Skip to main content

fidl_fuchsia_io/
fidl_fuchsia_io.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_io__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14/// The type to identify a connection to a node.
15/// It represents a capability: a reference to a node with associated rights.
16pub type Token = fidl::Event;
17
18#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct DirectoryCreateSymlinkRequest {
20    pub name: String,
21    pub target: Vec<u8>,
22    pub connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
23}
24
25impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
26    for DirectoryCreateSymlinkRequest
27{
28}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct DirectoryDeprecatedOpenRequest {
32    pub flags: OpenFlags,
33    pub mode: ModeType,
34    pub path: String,
35    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39    for DirectoryDeprecatedOpenRequest
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct DirectoryGetTokenResponse {
45    pub s: i32,
46    pub token: Option<fidl::NullableHandle>,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryGetTokenResponse {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct DirectoryLinkRequest {
53    pub src: String,
54    pub dst_parent_token: fidl::NullableHandle,
55    pub dst: String,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryLinkRequest {}
59
60#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct DirectoryRenameRequest {
62    pub src: String,
63    pub dst_parent_token: fidl::Event,
64    pub dst: String,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryRenameRequest {}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct DirectoryWatchRequest {
71    pub mask: WatchMask,
72    pub options: u32,
73    pub watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
74}
75
76impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryWatchRequest {}
77
78#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct FileAllocateRequest {
80    pub offset: u64,
81    pub length: u64,
82    /// If an empty bits is passed for mode, the default behavior is used. Otherwise the
83    /// behavior is modified as described for each mode bit. If the backing filesystem doesn't
84    /// support a particular provided mode bit, or combination of mode bits, an error is
85    /// returned.
86    pub mode: AllocateMode,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileAllocateRequest {}
90
91#[derive(Debug, PartialEq)]
92pub struct FileEnableVerityRequest {
93    pub options: VerificationOptions,
94}
95
96impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileEnableVerityRequest {}
97
98#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
99pub struct FileObject {
100    /// An optional event which transmits information about an object's readability
101    /// or writability. This event relays information about the underlying object, not
102    /// the capability granted to client: this event may be signalled "readable" on a
103    /// connection that does not have the capability to read.
104    ///
105    /// The "`FILE_SIGNAL_`" values may be observed on this event.
106    pub event: Option<fidl::Event>,
107    /// A placeholder for future stream support.
108    ///
109    /// Currently, servers are required not to send a handle in this field.
110    pub stream: Option<fidl::Stream>,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {}
114
115#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
116pub struct FileGetBackingMemoryResponse {
117    pub vmo: fidl::Vmo,
118}
119
120impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
121    for FileGetBackingMemoryResponse
122{
123}
124
125#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct LinkableLinkIntoRequest {
127    pub dst_parent_token: fidl::Event,
128    pub dst: String,
129}
130
131impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LinkableLinkIntoRequest {}
132
133#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
134pub struct NodeDeprecatedCloneRequest {
135    pub flags: OpenFlags,
136    pub object: fidl::endpoints::ServerEnd<NodeMarker>,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140    for NodeDeprecatedCloneRequest
141{
142}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct NodeListExtendedAttributesRequest {
146    pub iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
150    for NodeListExtendedAttributesRequest
151{
152}
153
154#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct NodeOnOpenRequest {
156    pub s: i32,
157    pub info: Option<Box<NodeInfoDeprecated>>,
158}
159
160impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeOnOpenRequest {}
161
162#[derive(Debug, PartialEq)]
163pub struct NodeSetExtendedAttributeRequest {
164    pub name: Vec<u8>,
165    pub value: ExtendedAttributeValue,
166    /// Specifies the behavior based on the current state of the attribute.
167    pub mode: SetExtendedAttributeMode,
168}
169
170impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
171    for NodeSetExtendedAttributeRequest
172{
173}
174
175#[derive(Debug, PartialEq)]
176pub struct OpenableOpenRequest {
177    pub path: String,
178    pub flags: Flags,
179    pub options: Options,
180    pub object: fidl::Channel,
181}
182
183impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for OpenableOpenRequest {}
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        Self { client: fidl::client::sync::Client::new(channel) }
428    }
429
430    pub fn into_channel(self) -> fidl::Channel {
431        self.client.into_channel()
432    }
433
434    /// Waits until an event arrives and returns it. It is safe for other
435    /// threads to make concurrent requests while waiting for an event.
436    pub fn wait_for_event(
437        &self,
438        deadline: zx::MonotonicInstant,
439    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
440        AdvisoryLockingEvent::decode(self.client.wait_for_event::<AdvisoryLockingMarker>(deadline)?)
441    }
442
443    /// Acquires an advisory lock on the underlying file.
444    ///
445    /// The lock lasts until either this connection is closed or
446    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
447    /// explicitly.
448    ///
449    /// Advisory locks are purely advisory. They do not prevent actual read or
450    /// write operations from occurring on the file, either through this
451    /// connection or through other connections.
452    ///
453    /// This method requires the following rights:
454    ///
455    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
456    /// * [`Rights.WRITE_BYTES`] if `request.type` is
457    ///   [`AdvisoryLockType.WRITE`].
458    ///
459    /// # Errors
460    ///
461    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
462    ///   example, another connection might hold a conflicting lock type.
463    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
464    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
465    ///   to acquire the given type of lock.
466    pub fn r#advisory_lock(
467        &self,
468        mut request: &AdvisoryLockRequest,
469        ___deadline: zx::MonotonicInstant,
470    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
471        let _response = self.client.send_query::<
472            AdvisoryLockingAdvisoryLockRequest,
473            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
474            AdvisoryLockingMarker,
475        >(
476            (request,),
477            0x6ee9c0ad53ec87aa,
478            fidl::encoding::DynamicFlags::empty(),
479            ___deadline,
480        )?;
481        Ok(_response.map(|x| x))
482    }
483}
484
485#[cfg(target_os = "fuchsia")]
486impl From<AdvisoryLockingSynchronousProxy> for zx::NullableHandle {
487    fn from(value: AdvisoryLockingSynchronousProxy) -> Self {
488        value.into_channel().into()
489    }
490}
491
492#[cfg(target_os = "fuchsia")]
493impl From<fidl::Channel> for AdvisoryLockingSynchronousProxy {
494    fn from(value: fidl::Channel) -> Self {
495        Self::new(value)
496    }
497}
498
499#[cfg(target_os = "fuchsia")]
500impl fidl::endpoints::FromClient for AdvisoryLockingSynchronousProxy {
501    type Protocol = AdvisoryLockingMarker;
502
503    fn from_client(value: fidl::endpoints::ClientEnd<AdvisoryLockingMarker>) -> Self {
504        Self::new(value.into_channel())
505    }
506}
507
508#[derive(Debug, Clone)]
509pub struct AdvisoryLockingProxy {
510    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
511}
512
513impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
514    type Protocol = AdvisoryLockingMarker;
515
516    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
517        Self::new(inner)
518    }
519
520    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
521        self.client.into_channel().map_err(|client| Self { client })
522    }
523
524    fn as_channel(&self) -> &::fidl::AsyncChannel {
525        self.client.as_channel()
526    }
527}
528
529impl AdvisoryLockingProxy {
530    /// Create a new Proxy for fuchsia.io/AdvisoryLocking.
531    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
532        let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
533        Self { client: fidl::client::Client::new(channel, protocol_name) }
534    }
535
536    /// Get a Stream of events from the remote end of the protocol.
537    ///
538    /// # Panics
539    ///
540    /// Panics if the event stream was already taken.
541    pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
542        AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
543    }
544
545    /// Acquires an advisory lock on the underlying file.
546    ///
547    /// The lock lasts until either this connection is closed or
548    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
549    /// explicitly.
550    ///
551    /// Advisory locks are purely advisory. They do not prevent actual read or
552    /// write operations from occurring on the file, either through this
553    /// connection or through other connections.
554    ///
555    /// This method requires the following rights:
556    ///
557    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
558    /// * [`Rights.WRITE_BYTES`] if `request.type` is
559    ///   [`AdvisoryLockType.WRITE`].
560    ///
561    /// # Errors
562    ///
563    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
564    ///   example, another connection might hold a conflicting lock type.
565    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
566    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
567    ///   to acquire the given type of lock.
568    pub fn r#advisory_lock(
569        &self,
570        mut request: &AdvisoryLockRequest,
571    ) -> fidl::client::QueryResponseFut<
572        AdvisoryLockingAdvisoryLockResult,
573        fidl::encoding::DefaultFuchsiaResourceDialect,
574    > {
575        AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
576    }
577}
578
579impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
580    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
581        AdvisoryLockingAdvisoryLockResult,
582        fidl::encoding::DefaultFuchsiaResourceDialect,
583    >;
584    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
585        fn _decode(
586            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
587        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
588            let _response = fidl::client::decode_transaction_body::<
589                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
590                fidl::encoding::DefaultFuchsiaResourceDialect,
591                0x6ee9c0ad53ec87aa,
592            >(_buf?)?;
593            Ok(_response.map(|x| x))
594        }
595        self.client.send_query_and_decode::<
596            AdvisoryLockingAdvisoryLockRequest,
597            AdvisoryLockingAdvisoryLockResult,
598        >(
599            (request,),
600            0x6ee9c0ad53ec87aa,
601            fidl::encoding::DynamicFlags::empty(),
602            _decode,
603        )
604    }
605}
606
607pub struct AdvisoryLockingEventStream {
608    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
609}
610
611impl std::marker::Unpin for AdvisoryLockingEventStream {}
612
613impl futures::stream::FusedStream for AdvisoryLockingEventStream {
614    fn is_terminated(&self) -> bool {
615        self.event_receiver.is_terminated()
616    }
617}
618
619impl futures::Stream for AdvisoryLockingEventStream {
620    type Item = Result<AdvisoryLockingEvent, fidl::Error>;
621
622    fn poll_next(
623        mut self: std::pin::Pin<&mut Self>,
624        cx: &mut std::task::Context<'_>,
625    ) -> std::task::Poll<Option<Self::Item>> {
626        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
627            &mut self.event_receiver,
628            cx
629        )?) {
630            Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
631            None => std::task::Poll::Ready(None),
632        }
633    }
634}
635
636#[derive(Debug)]
637pub enum AdvisoryLockingEvent {}
638
639impl AdvisoryLockingEvent {
640    /// Decodes a message buffer as a [`AdvisoryLockingEvent`].
641    fn decode(
642        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
643    ) -> Result<AdvisoryLockingEvent, fidl::Error> {
644        let (bytes, _handles) = buf.split_mut();
645        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
646        debug_assert_eq!(tx_header.tx_id, 0);
647        match tx_header.ordinal {
648            _ => Err(fidl::Error::UnknownOrdinal {
649                ordinal: tx_header.ordinal,
650                protocol_name:
651                    <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
652            }),
653        }
654    }
655}
656
657/// A Stream of incoming requests for fuchsia.io/AdvisoryLocking.
658pub struct AdvisoryLockingRequestStream {
659    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
660    is_terminated: bool,
661}
662
663impl std::marker::Unpin for AdvisoryLockingRequestStream {}
664
665impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
666    fn is_terminated(&self) -> bool {
667        self.is_terminated
668    }
669}
670
671impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
672    type Protocol = AdvisoryLockingMarker;
673    type ControlHandle = AdvisoryLockingControlHandle;
674
675    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
676        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
677    }
678
679    fn control_handle(&self) -> Self::ControlHandle {
680        AdvisoryLockingControlHandle { inner: self.inner.clone() }
681    }
682
683    fn into_inner(
684        self,
685    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
686    {
687        (self.inner, self.is_terminated)
688    }
689
690    fn from_inner(
691        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
692        is_terminated: bool,
693    ) -> Self {
694        Self { inner, is_terminated }
695    }
696}
697
698impl futures::Stream for AdvisoryLockingRequestStream {
699    type Item = Result<AdvisoryLockingRequest, fidl::Error>;
700
701    fn poll_next(
702        mut self: std::pin::Pin<&mut Self>,
703        cx: &mut std::task::Context<'_>,
704    ) -> std::task::Poll<Option<Self::Item>> {
705        let this = &mut *self;
706        if this.inner.check_shutdown(cx) {
707            this.is_terminated = true;
708            return std::task::Poll::Ready(None);
709        }
710        if this.is_terminated {
711            panic!("polled AdvisoryLockingRequestStream after completion");
712        }
713        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
714            |bytes, handles| {
715                match this.inner.channel().read_etc(cx, bytes, handles) {
716                    std::task::Poll::Ready(Ok(())) => {}
717                    std::task::Poll::Pending => return std::task::Poll::Pending,
718                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
719                        this.is_terminated = true;
720                        return std::task::Poll::Ready(None);
721                    }
722                    std::task::Poll::Ready(Err(e)) => {
723                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
724                            e.into(),
725                        ))));
726                    }
727                }
728
729                // A message has been received from the channel
730                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
731
732                std::task::Poll::Ready(Some(match header.ordinal {
733                    0x6ee9c0ad53ec87aa => {
734                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
735                        let mut req = fidl::new_empty!(
736                            AdvisoryLockingAdvisoryLockRequest,
737                            fidl::encoding::DefaultFuchsiaResourceDialect
738                        );
739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
740                        let control_handle =
741                            AdvisoryLockingControlHandle { inner: this.inner.clone() };
742                        Ok(AdvisoryLockingRequest::AdvisoryLock {
743                            request: req.request,
744
745                            responder: AdvisoryLockingAdvisoryLockResponder {
746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
747                                tx_id: header.tx_id,
748                            },
749                        })
750                    }
751                    _ => Err(fidl::Error::UnknownOrdinal {
752                        ordinal: header.ordinal,
753                        protocol_name:
754                            <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
755                    }),
756                }))
757            },
758        )
759    }
760}
761
762/// Advisory locking protocol.
763///
764/// This protocol is intended to be composed into the |File| protocol to
765/// provide support for advisory locking.
766///
767/// Advisory locks are purely advisory. They do not prevent actual read or
768/// write operations from occurring on the file, either through this
769/// connection or through other connections.
770///
771/// These primitives are designed to support the flock() and fcntl(),
772/// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
773/// running on Fuchsia expects from other operating systems.
774#[derive(Debug)]
775pub enum AdvisoryLockingRequest {
776    /// Acquires an advisory lock on the underlying file.
777    ///
778    /// The lock lasts until either this connection is closed or
779    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
780    /// explicitly.
781    ///
782    /// Advisory locks are purely advisory. They do not prevent actual read or
783    /// write operations from occurring on the file, either through this
784    /// connection or through other connections.
785    ///
786    /// This method requires the following rights:
787    ///
788    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
789    /// * [`Rights.WRITE_BYTES`] if `request.type` is
790    ///   [`AdvisoryLockType.WRITE`].
791    ///
792    /// # Errors
793    ///
794    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
795    ///   example, another connection might hold a conflicting lock type.
796    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
797    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
798    ///   to acquire the given type of lock.
799    AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
800}
801
802impl AdvisoryLockingRequest {
803    #[allow(irrefutable_let_patterns)]
804    pub fn into_advisory_lock(
805        self,
806    ) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
807        if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
808            Some((request, responder))
809        } else {
810            None
811        }
812    }
813
814    /// Name of the method defined in FIDL
815    pub fn method_name(&self) -> &'static str {
816        match *self {
817            AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
818        }
819    }
820}
821
822#[derive(Debug, Clone)]
823pub struct AdvisoryLockingControlHandle {
824    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
825}
826
827impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
828    fn shutdown(&self) {
829        self.inner.shutdown()
830    }
831
832    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
833        self.inner.shutdown_with_epitaph(status)
834    }
835
836    fn is_closed(&self) -> bool {
837        self.inner.channel().is_closed()
838    }
839    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
840        self.inner.channel().on_closed()
841    }
842
843    #[cfg(target_os = "fuchsia")]
844    fn signal_peer(
845        &self,
846        clear_mask: zx::Signals,
847        set_mask: zx::Signals,
848    ) -> Result<(), zx_status::Status> {
849        use fidl::Peered;
850        self.inner.channel().signal_peer(clear_mask, set_mask)
851    }
852}
853
854impl AdvisoryLockingControlHandle {}
855
856#[must_use = "FIDL methods require a response to be sent"]
857#[derive(Debug)]
858pub struct AdvisoryLockingAdvisoryLockResponder {
859    control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
860    tx_id: u32,
861}
862
863/// Set the the channel to be shutdown (see [`AdvisoryLockingControlHandle::shutdown`])
864/// if the responder is dropped without sending a response, so that the client
865/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
866impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
867    fn drop(&mut self) {
868        self.control_handle.shutdown();
869        // Safety: drops once, never accessed again
870        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
871    }
872}
873
874impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
875    type ControlHandle = AdvisoryLockingControlHandle;
876
877    fn control_handle(&self) -> &AdvisoryLockingControlHandle {
878        &self.control_handle
879    }
880
881    fn drop_without_shutdown(mut self) {
882        // Safety: drops once, never accessed again due to mem::forget
883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
884        // Prevent Drop from running (which would shut down the channel)
885        std::mem::forget(self);
886    }
887}
888
889impl AdvisoryLockingAdvisoryLockResponder {
890    /// Sends a response to the FIDL transaction.
891    ///
892    /// Sets the channel to shutdown if an error occurs.
893    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
894        let _result = self.send_raw(result);
895        if _result.is_err() {
896            self.control_handle.shutdown();
897        }
898        self.drop_without_shutdown();
899        _result
900    }
901
902    /// Similar to "send" but does not shutdown the channel if an error occurs.
903    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
904        let _result = self.send_raw(result);
905        self.drop_without_shutdown();
906        _result
907    }
908
909    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
910        self.control_handle
911            .inner
912            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
913                result,
914                self.tx_id,
915                0x6ee9c0ad53ec87aa,
916                fidl::encoding::DynamicFlags::empty(),
917            )
918    }
919}
920
921#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
922pub struct DirectoryMarker;
923
924impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
925    type Proxy = DirectoryProxy;
926    type RequestStream = DirectoryRequestStream;
927    #[cfg(target_os = "fuchsia")]
928    type SynchronousProxy = DirectorySynchronousProxy;
929
930    const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
931}
932impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
933pub type DirectoryUnlinkResult = Result<(), i32>;
934pub type DirectoryRenameResult = Result<(), i32>;
935pub type DirectoryCreateSymlinkResult = Result<(), i32>;
936
937pub trait DirectoryProxyInterface: Send + Sync {
938    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
939        + Send;
940    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
941    fn r#clone(
942        &self,
943        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
944    ) -> Result<(), fidl::Error>;
945    type CloseResponseFut: std::future::Future<
946            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
947        > + Send;
948    fn r#close(&self) -> Self::CloseResponseFut;
949    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
950    fn r#query(&self) -> Self::QueryResponseFut;
951    fn r#deprecated_clone(
952        &self,
953        flags: OpenFlags,
954        object: fidl::endpoints::ServerEnd<NodeMarker>,
955    ) -> Result<(), fidl::Error>;
956    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
957        + Send;
958    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
959    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
960    fn r#deprecated_set_attr(
961        &self,
962        flags: NodeAttributeFlags,
963        attributes: &NodeAttributes,
964    ) -> Self::DeprecatedSetAttrResponseFut;
965    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
966        + Send;
967    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
968    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
969        + Send;
970    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
971    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
972        + Send;
973    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
974    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
975        + Send;
976    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
977    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
978        + Send;
979    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
980    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
981        + Send;
982    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
983    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
984        + Send;
985    fn r#update_attributes(
986        &self,
987        payload: &MutableNodeAttributes,
988    ) -> Self::UpdateAttributesResponseFut;
989    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
990    fn r#sync(&self) -> Self::SyncResponseFut;
991    fn r#list_extended_attributes(
992        &self,
993        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
994    ) -> Result<(), fidl::Error>;
995    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
996        + Send;
997    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
998    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
999        + Send;
1000    fn r#set_extended_attribute(
1001        &self,
1002        name: &[u8],
1003        value: ExtendedAttributeValue,
1004        mode: SetExtendedAttributeMode,
1005    ) -> Self::SetExtendedAttributeResponseFut;
1006    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
1007        + Send;
1008    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
1009    fn r#open(
1010        &self,
1011        path: &str,
1012        flags: Flags,
1013        options: &Options,
1014        object: fidl::Channel,
1015    ) -> Result<(), fidl::Error>;
1016    fn r#deprecated_open(
1017        &self,
1018        flags: OpenFlags,
1019        mode: ModeType,
1020        path: &str,
1021        object: fidl::endpoints::ServerEnd<NodeMarker>,
1022    ) -> Result<(), fidl::Error>;
1023    type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
1024        + Send;
1025    fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
1026    type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1027    fn r#rewind(&self) -> Self::RewindResponseFut;
1028    type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::NullableHandle>), fidl::Error>>
1029        + Send;
1030    fn r#get_token(&self) -> Self::GetTokenResponseFut;
1031    type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1032    fn r#link(
1033        &self,
1034        src: &str,
1035        dst_parent_token: fidl::NullableHandle,
1036        dst: &str,
1037    ) -> Self::LinkResponseFut;
1038    type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
1039        + Send;
1040    fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
1041    type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
1042        + Send;
1043    fn r#rename(
1044        &self,
1045        src: &str,
1046        dst_parent_token: fidl::Event,
1047        dst: &str,
1048    ) -> Self::RenameResponseFut;
1049    type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
1050        + Send;
1051    fn r#create_symlink(
1052        &self,
1053        name: &str,
1054        target: &[u8],
1055        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1056    ) -> Self::CreateSymlinkResponseFut;
1057    type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1058    fn r#watch(
1059        &self,
1060        mask: WatchMask,
1061        options: u32,
1062        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1063    ) -> Self::WatchResponseFut;
1064}
1065#[derive(Debug)]
1066#[cfg(target_os = "fuchsia")]
1067pub struct DirectorySynchronousProxy {
1068    client: fidl::client::sync::Client,
1069}
1070
1071#[cfg(target_os = "fuchsia")]
1072impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
1073    type Proxy = DirectoryProxy;
1074    type Protocol = DirectoryMarker;
1075
1076    fn from_channel(inner: fidl::Channel) -> Self {
1077        Self::new(inner)
1078    }
1079
1080    fn into_channel(self) -> fidl::Channel {
1081        self.client.into_channel()
1082    }
1083
1084    fn as_channel(&self) -> &fidl::Channel {
1085        self.client.as_channel()
1086    }
1087}
1088
1089#[cfg(target_os = "fuchsia")]
1090impl DirectorySynchronousProxy {
1091    pub fn new(channel: fidl::Channel) -> Self {
1092        Self { client: fidl::client::sync::Client::new(channel) }
1093    }
1094
1095    pub fn into_channel(self) -> fidl::Channel {
1096        self.client.into_channel()
1097    }
1098
1099    /// Waits until an event arrives and returns it. It is safe for other
1100    /// threads to make concurrent requests while waiting for an event.
1101    pub fn wait_for_event(
1102        &self,
1103        deadline: zx::MonotonicInstant,
1104    ) -> Result<DirectoryEvent, fidl::Error> {
1105        DirectoryEvent::decode(self.client.wait_for_event::<DirectoryMarker>(deadline)?)
1106    }
1107
1108    /// Acquires an advisory lock on the underlying file.
1109    ///
1110    /// The lock lasts until either this connection is closed or
1111    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1112    /// explicitly.
1113    ///
1114    /// Advisory locks are purely advisory. They do not prevent actual read or
1115    /// write operations from occurring on the file, either through this
1116    /// connection or through other connections.
1117    ///
1118    /// This method requires the following rights:
1119    ///
1120    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1121    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1122    ///   [`AdvisoryLockType.WRITE`].
1123    ///
1124    /// # Errors
1125    ///
1126    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1127    ///   example, another connection might hold a conflicting lock type.
1128    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1129    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1130    ///   to acquire the given type of lock.
1131    pub fn r#advisory_lock(
1132        &self,
1133        mut request: &AdvisoryLockRequest,
1134        ___deadline: zx::MonotonicInstant,
1135    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
1136        let _response = self.client.send_query::<
1137            AdvisoryLockingAdvisoryLockRequest,
1138            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1139            DirectoryMarker,
1140        >(
1141            (request,),
1142            0x6ee9c0ad53ec87aa,
1143            fidl::encoding::DynamicFlags::empty(),
1144            ___deadline,
1145        )?;
1146        Ok(_response.map(|x| x))
1147    }
1148
1149    pub fn r#clone(
1150        &self,
1151        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1152    ) -> Result<(), fidl::Error> {
1153        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1154            (request,),
1155            0x20d8a7aba2168a79,
1156            fidl::encoding::DynamicFlags::empty(),
1157        )
1158    }
1159
1160    /// Terminates the connection.
1161    ///
1162    /// After calling `Close`, the client must not send any other requests.
1163    ///
1164    /// Servers, after sending the status response, should close the connection
1165    /// regardless of status and without sending an epitaph.
1166    ///
1167    /// Closing the client end of the channel should be semantically equivalent
1168    /// to calling `Close` without knowing when the close has completed or its
1169    /// status.
1170    pub fn r#close(
1171        &self,
1172        ___deadline: zx::MonotonicInstant,
1173    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1174        let _response = self.client.send_query::<
1175            fidl::encoding::EmptyPayload,
1176            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1177            DirectoryMarker,
1178        >(
1179            (),
1180            0x5ac5d459ad7f657e,
1181            fidl::encoding::DynamicFlags::empty(),
1182            ___deadline,
1183        )?;
1184        Ok(_response.map(|x| x))
1185    }
1186
1187    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
1188        let _response = self.client.send_query::<
1189            fidl::encoding::EmptyPayload,
1190            fidl_fuchsia_unknown::QueryableQueryResponse,
1191            DirectoryMarker,
1192        >(
1193            (),
1194            0x2658edee9decfc06,
1195            fidl::encoding::DynamicFlags::empty(),
1196            ___deadline,
1197        )?;
1198        Ok(_response.protocol)
1199    }
1200
1201    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1202    pub fn r#deprecated_clone(
1203        &self,
1204        mut flags: OpenFlags,
1205        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1206    ) -> Result<(), fidl::Error> {
1207        self.client.send::<NodeDeprecatedCloneRequest>(
1208            (flags, object),
1209            0x5a61678f293ce16f,
1210            fidl::encoding::DynamicFlags::FLEXIBLE,
1211        )
1212    }
1213
1214    /// DEPRECATED - Use `Node.GetAttributes` instead.
1215    pub fn r#deprecated_get_attr(
1216        &self,
1217        ___deadline: zx::MonotonicInstant,
1218    ) -> Result<(i32, NodeAttributes), fidl::Error> {
1219        let _response = self.client.send_query::<
1220            fidl::encoding::EmptyPayload,
1221            NodeDeprecatedGetAttrResponse,
1222            DirectoryMarker,
1223        >(
1224            (),
1225            0x78985e216314dafd,
1226            fidl::encoding::DynamicFlags::empty(),
1227            ___deadline,
1228        )?;
1229        Ok((_response.s, _response.attributes))
1230    }
1231
1232    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1233    pub fn r#deprecated_set_attr(
1234        &self,
1235        mut flags: NodeAttributeFlags,
1236        mut attributes: &NodeAttributes,
1237        ___deadline: zx::MonotonicInstant,
1238    ) -> Result<i32, fidl::Error> {
1239        let _response = self.client.send_query::<
1240            NodeDeprecatedSetAttrRequest,
1241            NodeDeprecatedSetAttrResponse,
1242            DirectoryMarker,
1243        >(
1244            (flags, attributes,),
1245            0x4186c0f40d938f46,
1246            fidl::encoding::DynamicFlags::empty(),
1247            ___deadline,
1248        )?;
1249        Ok(_response.s)
1250    }
1251
1252    /// [DEPRECATED - Use new GetFlags method instead.]
1253    pub fn r#deprecated_get_flags(
1254        &self,
1255        ___deadline: zx::MonotonicInstant,
1256    ) -> Result<(i32, OpenFlags), fidl::Error> {
1257        let _response = self.client.send_query::<
1258            fidl::encoding::EmptyPayload,
1259            NodeDeprecatedGetFlagsResponse,
1260            DirectoryMarker,
1261        >(
1262            (),
1263            0x5b88fffb8eda3aa1,
1264            fidl::encoding::DynamicFlags::empty(),
1265            ___deadline,
1266        )?;
1267        Ok((_response.s, _response.flags))
1268    }
1269
1270    /// [DEPRECATED - Use new SetFlags method instead.]
1271    pub fn r#deprecated_set_flags(
1272        &self,
1273        mut flags: OpenFlags,
1274        ___deadline: zx::MonotonicInstant,
1275    ) -> Result<i32, fidl::Error> {
1276        let _response = self.client.send_query::<
1277            NodeDeprecatedSetFlagsRequest,
1278            NodeDeprecatedSetFlagsResponse,
1279            DirectoryMarker,
1280        >(
1281            (flags,),
1282            0x5295b76c71fde733,
1283            fidl::encoding::DynamicFlags::empty(),
1284            ___deadline,
1285        )?;
1286        Ok(_response.s)
1287    }
1288
1289    /// Queries the flags that apply to this node after it has been opened/created. This method does
1290    /// not require any rights.
1291    ///
1292    /// Note that the final set of flags that apply to the connection may differ from those
1293    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
1294    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
1295    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
1296    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
1297    pub fn r#get_flags(
1298        &self,
1299        ___deadline: zx::MonotonicInstant,
1300    ) -> Result<NodeGetFlagsResult, fidl::Error> {
1301        let _response = self.client.send_query::<
1302            fidl::encoding::EmptyPayload,
1303            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
1304            DirectoryMarker,
1305        >(
1306            (),
1307            0x176eb318f64ec23,
1308            fidl::encoding::DynamicFlags::FLEXIBLE,
1309            ___deadline,
1310        )?
1311        .into_result::<DirectoryMarker>("get_flags")?;
1312        Ok(_response.map(|x| x.flags))
1313    }
1314
1315    /// Sets the flags that apply to this node after it has been opened. This method does not
1316    /// require any rights.
1317    ///
1318    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
1319    /// clear append mode.
1320    ///
1321    /// Errors:
1322    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
1323    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
1324    pub fn r#set_flags(
1325        &self,
1326        mut flags: Flags,
1327        ___deadline: zx::MonotonicInstant,
1328    ) -> Result<NodeSetFlagsResult, fidl::Error> {
1329        let _response = self.client.send_query::<
1330            NodeSetFlagsRequest,
1331            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1332            DirectoryMarker,
1333        >(
1334            (flags,),
1335            0x55a8028685791ea8,
1336            fidl::encoding::DynamicFlags::FLEXIBLE,
1337            ___deadline,
1338        )?
1339        .into_result::<DirectoryMarker>("set_flags")?;
1340        Ok(_response.map(|x| x))
1341    }
1342
1343    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
1344    /// volume has different settings or the storage is accounted seperately from the rest of the
1345    /// filesystem that may be reported instead of filesystem-wide details.
1346    pub fn r#query_filesystem(
1347        &self,
1348        ___deadline: zx::MonotonicInstant,
1349    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
1350        let _response = self.client.send_query::<
1351            fidl::encoding::EmptyPayload,
1352            NodeQueryFilesystemResponse,
1353            DirectoryMarker,
1354        >(
1355            (),
1356            0x6f344a1c6b0a0610,
1357            fidl::encoding::DynamicFlags::empty(),
1358            ___deadline,
1359        )?;
1360        Ok((_response.s, _response.info))
1361    }
1362
1363    /// Acquires information about the node.
1364    ///
1365    /// The attributes of a node should be stable, independent of the
1366    /// specific protocol used to access it.
1367    ///
1368    /// If a particular attribute is not applicable or not supported,
1369    /// filesystems should leave the corresponding field absent.
1370    ///
1371    /// + `query` a bit-mask specifying which attributes to fetch. The server
1372    ///   should not return more than necessary.
1373    /// - `attributes` the returned attributes.
1374    ///
1375    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1376    pub fn r#get_attributes(
1377        &self,
1378        mut query: NodeAttributesQuery,
1379        ___deadline: zx::MonotonicInstant,
1380    ) -> Result<NodeGetAttributesResult, fidl::Error> {
1381        let _response = self.client.send_query::<
1382            NodeGetAttributesRequest,
1383            fidl::encoding::ResultType<NodeAttributes2, i32>,
1384            DirectoryMarker,
1385        >(
1386            (query,),
1387            0x3d4396a638ea053b,
1388            fidl::encoding::DynamicFlags::empty(),
1389            ___deadline,
1390        )?;
1391        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
1392    }
1393
1394    /// Updates information about the node.
1395    ///
1396    /// + `attributes` the presence of a table field in `attributes` indicates
1397    /// the intent to update the corresponding attribute.
1398    ///
1399    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
1400    ///
1401    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1402    pub fn r#update_attributes(
1403        &self,
1404        mut payload: &MutableNodeAttributes,
1405        ___deadline: zx::MonotonicInstant,
1406    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
1407        let _response = self.client.send_query::<
1408            MutableNodeAttributes,
1409            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1410            DirectoryMarker,
1411        >(
1412            payload,
1413            0x3308c1da5a89bf08,
1414            fidl::encoding::DynamicFlags::empty(),
1415            ___deadline,
1416        )?;
1417        Ok(_response.map(|x| x))
1418    }
1419
1420    /// Synchronizes updates to the node to the underlying media, if it exists.
1421    ///
1422    /// This method will return when the filesystem server has flushed the
1423    /// relevant updates to the underlying media, but does not guarantee the
1424    /// underlying media has persisted the information, nor that any information
1425    /// is committed to hardware. Clients may use `Sync` to ensure ordering
1426    /// between operations.
1427    ///
1428    /// This method does not require any rights.
1429    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
1430        let _response = self.client.send_query::<
1431            fidl::encoding::EmptyPayload,
1432            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1433            DirectoryMarker,
1434        >(
1435            (),
1436            0x2c5c27ca0ab5dc49,
1437            fidl::encoding::DynamicFlags::empty(),
1438            ___deadline,
1439        )?;
1440        Ok(_response.map(|x| x))
1441    }
1442
1443    /// Creates an iterator over all the extended attribute names associated
1444    /// with this node. If an error occurs it is returned as an epitaph on the
1445    /// iterator request channel, and then the channel is closed.
1446    ///
1447    /// GetExtendedAttributes can be used with any of these names to retrieve
1448    /// the associated value.
1449    ///
1450    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1451    pub fn r#list_extended_attributes(
1452        &self,
1453        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
1454    ) -> Result<(), fidl::Error> {
1455        self.client.send::<NodeListExtendedAttributesRequest>(
1456            (iterator,),
1457            0x4b61033de007fcd0,
1458            fidl::encoding::DynamicFlags::empty(),
1459        )
1460    }
1461
1462    /// Get the value associated with the given attribute `name` for this node.
1463    ///
1464    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
1465    /// particular structure is imposed on them.
1466    ///
1467    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
1468    pub fn r#get_extended_attribute(
1469        &self,
1470        mut name: &[u8],
1471        ___deadline: zx::MonotonicInstant,
1472    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
1473        let _response = self.client.send_query::<
1474            NodeGetExtendedAttributeRequest,
1475            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
1476            DirectoryMarker,
1477        >(
1478            (name,),
1479            0x45ffa3ccfdeb76db,
1480            fidl::encoding::DynamicFlags::empty(),
1481            ___deadline,
1482        )?;
1483        Ok(_response.map(|x| x))
1484    }
1485
1486    /// Set the value for the given attribute `name` to `value` for this node.
1487    ///
1488    /// The attribute name may exist, in which case the attribute is updated.
1489    /// If the attribute doesn't exist, it is created. The name should have no
1490    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
1491    ///
1492    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1493    pub fn r#set_extended_attribute(
1494        &self,
1495        mut name: &[u8],
1496        mut value: ExtendedAttributeValue,
1497        mut mode: SetExtendedAttributeMode,
1498        ___deadline: zx::MonotonicInstant,
1499    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
1500        let _response = self.client.send_query::<
1501            NodeSetExtendedAttributeRequest,
1502            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1503            DirectoryMarker,
1504        >(
1505            (name, &mut value, mode,),
1506            0x4a951362f681f23c,
1507            fidl::encoding::DynamicFlags::empty(),
1508            ___deadline,
1509        )?;
1510        Ok(_response.map(|x| x))
1511    }
1512
1513    /// Remove the specified extended attribute.
1514    ///
1515    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
1516    ///
1517    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
1518    pub fn r#remove_extended_attribute(
1519        &self,
1520        mut name: &[u8],
1521        ___deadline: zx::MonotonicInstant,
1522    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
1523        let _response = self.client.send_query::<
1524            NodeRemoveExtendedAttributeRequest,
1525            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1526            DirectoryMarker,
1527        >(
1528            (name,),
1529            0x7a0b9f3a9bf9032d,
1530            fidl::encoding::DynamicFlags::empty(),
1531            ___deadline,
1532        )?;
1533        Ok(_response.map(|x| x))
1534    }
1535
1536    /// Open (or create) a node relative to this directory. Any errors are communicated via an
1537    /// epitaph sent on the `object` channel.
1538    ///
1539    /// Errors:
1540    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
1541    /// * See [`Flags`] for other errors which may be communicated based on `flags`
1542    pub fn r#open(
1543        &self,
1544        mut path: &str,
1545        mut flags: Flags,
1546        mut options: &Options,
1547        mut object: fidl::Channel,
1548    ) -> Result<(), fidl::Error> {
1549        self.client.send::<OpenableOpenRequest>(
1550            (path, flags, options, object),
1551            0x568ddcb9a9cbb6d9,
1552            fidl::encoding::DynamicFlags::FLEXIBLE,
1553        )
1554    }
1555
1556    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
1557    pub fn r#deprecated_open(
1558        &self,
1559        mut flags: OpenFlags,
1560        mut mode: ModeType,
1561        mut path: &str,
1562        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1563    ) -> Result<(), fidl::Error> {
1564        self.client.send::<DirectoryDeprecatedOpenRequest>(
1565            (flags, mode, path, object),
1566            0x2c5044561d685ec0,
1567            fidl::encoding::DynamicFlags::FLEXIBLE,
1568        )
1569    }
1570
1571    /// Reads a collection of variably sized dirents into a buffer.
1572    /// The number of dirents in a directory may be very large: akin to
1573    /// calling read multiple times on a file, directories have a seek
1574    /// offset which is updated on subsequent calls to ReadDirents.
1575    /// Each call to ReadDirents will only return whole dirent structures,
1576    /// they will not get split across ReadDirent calls. When the seek
1577    /// offset reaches the end, `dirents` will be empty.
1578    ///
1579    /// These dirents are of the form:
1580    /// ```
1581    /// struct dirent {
1582    ///   // Describes the inode of the entry.
1583    ///   uint64 ino;
1584    ///   // Describes the length of the dirent name in bytes.
1585    ///   uint8 size;
1586    ///   // Describes the type of the entry. Aligned with the
1587    ///   // POSIX d_type values. Use `DirentType` constants.
1588    ///   uint8 type;
1589    ///   // Unterminated name of entry.
1590    ///   char name[0];
1591    /// }
1592    /// ```
1593    ///
1594    /// This method does not require any rights, since one could always probe for
1595    /// directory contents by triggering name conflicts during file creation.
1596    pub fn r#read_dirents(
1597        &self,
1598        mut max_bytes: u64,
1599        ___deadline: zx::MonotonicInstant,
1600    ) -> Result<(i32, Vec<u8>), fidl::Error> {
1601        let _response = self.client.send_query::<
1602            DirectoryReadDirentsRequest,
1603            DirectoryReadDirentsResponse,
1604            DirectoryMarker,
1605        >(
1606            (max_bytes,),
1607            0x3582806bf27faa0a,
1608            fidl::encoding::DynamicFlags::empty(),
1609            ___deadline,
1610        )?;
1611        Ok((_response.s, _response.dirents))
1612    }
1613
1614    /// Resets the directory seek offset.
1615    ///
1616    /// This method does not require any rights, similar to ReadDirents.
1617    pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
1618        let _response = self
1619            .client
1620            .send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse, DirectoryMarker>(
1621                (),
1622                0x16b1202af0f34c71,
1623                fidl::encoding::DynamicFlags::empty(),
1624                ___deadline,
1625            )?;
1626        Ok(_response.s)
1627    }
1628
1629    /// Acquires a token to a Directory which can be used to identify access to it at a later point
1630    /// in time. The token will remain valid for as long as the connection requesting the token
1631    /// remains open.
1632    ///
1633    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
1634    /// `ZX_ERR_BAD_HANDLE`.
1635    pub fn r#get_token(
1636        &self,
1637        ___deadline: zx::MonotonicInstant,
1638    ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
1639        let _response = self
1640            .client
1641            .send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse, DirectoryMarker>(
1642                (),
1643                0x26ae9d18763c8655,
1644                fidl::encoding::DynamicFlags::empty(),
1645                ___deadline,
1646            )?;
1647        Ok((_response.s, _response.token))
1648    }
1649
1650    /// Creates a link to an object named src by the name dst, within a directory represented by
1651    /// token.
1652    ///
1653    /// `src` must be a resolved object name. Including "/" in the string will
1654    /// return `ZX_ERR_INVALID_ARGS`.
1655    ///
1656    /// `dst` must be a resolved object name. Including "/" in the string will
1657    /// return `ZX_ERR_INVALID_ARGS`.
1658    ///
1659    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
1660    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
1661    ///
1662    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
1663    /// there are two actors operating concurrently, and one actor performs a rename that affects
1664    /// the source within this directory, and the other does a link, each will appear to occur
1665    /// atomically in an unspecified order.
1666    pub fn r#link(
1667        &self,
1668        mut src: &str,
1669        mut dst_parent_token: fidl::NullableHandle,
1670        mut dst: &str,
1671        ___deadline: zx::MonotonicInstant,
1672    ) -> Result<i32, fidl::Error> {
1673        let _response = self
1674            .client
1675            .send_query::<DirectoryLinkRequest, DirectoryLinkResponse, DirectoryMarker>(
1676                (src, dst_parent_token, dst),
1677                0x740604c0c7c930e7,
1678                fidl::encoding::DynamicFlags::empty(),
1679                ___deadline,
1680            )?;
1681        Ok(_response.s)
1682    }
1683
1684    /// Removes a child node from the this directory's list of entries.
1685    ///
1686    /// Note: this does not guarantee that the underlying object is destroyed.
1687    /// Although the link will be removed from the containing directory,
1688    /// objects with multiple references (such as files which are still open)
1689    /// will not actually be destroyed until all references are closed.
1690    ///
1691    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
1692    ///   [`Rights.WRITE_BYTES`].
1693    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
1694    ///   support writing.
1695    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
1696    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
1697    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
1698    ///   containing a remote channel.
1699    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
1700    ///     something other than a directory was found.
1701    ///
1702    /// Other errors may be returned for filesystem-specific reasons.
1703    ///
1704    /// This method requires the following rights:
1705    ///
1706    /// * [`Rights.ENUMERATE`]
1707    /// * [`Rights.MODIFY_DIRECTORY`]
1708    pub fn r#unlink(
1709        &self,
1710        mut name: &str,
1711        mut options: &UnlinkOptions,
1712        ___deadline: zx::MonotonicInstant,
1713    ) -> Result<DirectoryUnlinkResult, fidl::Error> {
1714        let _response = self.client.send_query::<
1715            DirectoryUnlinkRequest,
1716            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1717            DirectoryMarker,
1718        >(
1719            (name, options,),
1720            0x750a0326a78d7bed,
1721            fidl::encoding::DynamicFlags::empty(),
1722            ___deadline,
1723        )?;
1724        Ok(_response.map(|x| x))
1725    }
1726
1727    /// Renames a node named `src` to the name `dst`, in a directory represented
1728    /// by `dst_parent_token`.
1729    ///
1730    /// `src` and `dst` must be valid node names.
1731    /// See [`Name`] for what constitutes a valid name.
1732    ///
1733    /// This method requires the following rights on both the current connection, and the connection
1734    /// identified by `dst_parent_token`:
1735    ///
1736    /// * [`Rights.ENUMERATE`]
1737    /// * [`Rights.MODIFY_DIRECTORY`]
1738    ///
1739    /// The following requirements are necessary to avoid rights escalations.
1740    ///
1741    /// If the source and destination directory differ, the source directory must also have the
1742    /// maximal set of abilities supported for files, which would typically be
1743    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
1744    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
1745    /// right.
1746    ///
1747    /// If `src` refers to a directory, and differs from the destination directory, then the source
1748    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
1749    ///
1750    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
1751    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
1752    pub fn r#rename(
1753        &self,
1754        mut src: &str,
1755        mut dst_parent_token: fidl::Event,
1756        mut dst: &str,
1757        ___deadline: zx::MonotonicInstant,
1758    ) -> Result<DirectoryRenameResult, fidl::Error> {
1759        let _response = self.client.send_query::<
1760            DirectoryRenameRequest,
1761            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1762            DirectoryMarker,
1763        >(
1764            (src, dst_parent_token, dst,),
1765            0x7060e7723b9928de,
1766            fidl::encoding::DynamicFlags::empty(),
1767            ___deadline,
1768        )?;
1769        Ok(_response.map(|x| x))
1770    }
1771
1772    /// Creates a symbolic link.
1773    ///
1774    /// `name` is the name to be given to the created symbolic link.
1775    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
1776    /// will perform no validation of `target` except for a server chosen maximum length.
1777    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
1778    /// on the successfully created node.
1779    ///
1780    /// * [`Rights.MODIFY_DIRECTORY`]
1781    ///
1782    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
1783    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
1784    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
1785    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
1786    pub fn r#create_symlink(
1787        &self,
1788        mut name: &str,
1789        mut target: &[u8],
1790        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
1791        ___deadline: zx::MonotonicInstant,
1792    ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
1793        let _response = self.client.send_query::<
1794            DirectoryCreateSymlinkRequest,
1795            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1796            DirectoryMarker,
1797        >(
1798            (name, target, connection,),
1799            0x21ce0f19ec043889,
1800            fidl::encoding::DynamicFlags::empty(),
1801            ___deadline,
1802        )?;
1803        Ok(_response.map(|x| x))
1804    }
1805
1806    /// Watches a directory, receiving events of added messages on the
1807    /// watcher request channel.
1808    ///
1809    /// Options must be zero; it is reserved.
1810    ///
1811    /// This method does not require any rights, similar to ReadDirents.
1812    pub fn r#watch(
1813        &self,
1814        mut mask: WatchMask,
1815        mut options: u32,
1816        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
1817        ___deadline: zx::MonotonicInstant,
1818    ) -> Result<i32, fidl::Error> {
1819        let _response = self
1820            .client
1821            .send_query::<DirectoryWatchRequest, DirectoryWatchResponse, DirectoryMarker>(
1822                (mask, options, watcher),
1823                0x5717193a59d66d91,
1824                fidl::encoding::DynamicFlags::empty(),
1825                ___deadline,
1826            )?;
1827        Ok(_response.s)
1828    }
1829}
1830
1831#[cfg(target_os = "fuchsia")]
1832impl From<DirectorySynchronousProxy> for zx::NullableHandle {
1833    fn from(value: DirectorySynchronousProxy) -> Self {
1834        value.into_channel().into()
1835    }
1836}
1837
1838#[cfg(target_os = "fuchsia")]
1839impl From<fidl::Channel> for DirectorySynchronousProxy {
1840    fn from(value: fidl::Channel) -> Self {
1841        Self::new(value)
1842    }
1843}
1844
1845#[cfg(target_os = "fuchsia")]
1846impl fidl::endpoints::FromClient for DirectorySynchronousProxy {
1847    type Protocol = DirectoryMarker;
1848
1849    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryMarker>) -> Self {
1850        Self::new(value.into_channel())
1851    }
1852}
1853
1854#[derive(Debug, Clone)]
1855pub struct DirectoryProxy {
1856    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1857}
1858
1859impl fidl::endpoints::Proxy for DirectoryProxy {
1860    type Protocol = DirectoryMarker;
1861
1862    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1863        Self::new(inner)
1864    }
1865
1866    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1867        self.client.into_channel().map_err(|client| Self { client })
1868    }
1869
1870    fn as_channel(&self) -> &::fidl::AsyncChannel {
1871        self.client.as_channel()
1872    }
1873}
1874
1875impl DirectoryProxy {
1876    /// Create a new Proxy for fuchsia.io/Directory.
1877    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1878        let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1879        Self { client: fidl::client::Client::new(channel, protocol_name) }
1880    }
1881
1882    /// Get a Stream of events from the remote end of the protocol.
1883    ///
1884    /// # Panics
1885    ///
1886    /// Panics if the event stream was already taken.
1887    pub fn take_event_stream(&self) -> DirectoryEventStream {
1888        DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
1889    }
1890
1891    /// Acquires an advisory lock on the underlying file.
1892    ///
1893    /// The lock lasts until either this connection is closed or
1894    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
1895    /// explicitly.
1896    ///
1897    /// Advisory locks are purely advisory. They do not prevent actual read or
1898    /// write operations from occurring on the file, either through this
1899    /// connection or through other connections.
1900    ///
1901    /// This method requires the following rights:
1902    ///
1903    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
1904    /// * [`Rights.WRITE_BYTES`] if `request.type` is
1905    ///   [`AdvisoryLockType.WRITE`].
1906    ///
1907    /// # Errors
1908    ///
1909    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
1910    ///   example, another connection might hold a conflicting lock type.
1911    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
1912    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
1913    ///   to acquire the given type of lock.
1914    pub fn r#advisory_lock(
1915        &self,
1916        mut request: &AdvisoryLockRequest,
1917    ) -> fidl::client::QueryResponseFut<
1918        AdvisoryLockingAdvisoryLockResult,
1919        fidl::encoding::DefaultFuchsiaResourceDialect,
1920    > {
1921        DirectoryProxyInterface::r#advisory_lock(self, request)
1922    }
1923
1924    pub fn r#clone(
1925        &self,
1926        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1927    ) -> Result<(), fidl::Error> {
1928        DirectoryProxyInterface::r#clone(self, request)
1929    }
1930
1931    /// Terminates the connection.
1932    ///
1933    /// After calling `Close`, the client must not send any other requests.
1934    ///
1935    /// Servers, after sending the status response, should close the connection
1936    /// regardless of status and without sending an epitaph.
1937    ///
1938    /// Closing the client end of the channel should be semantically equivalent
1939    /// to calling `Close` without knowing when the close has completed or its
1940    /// status.
1941    pub fn r#close(
1942        &self,
1943    ) -> fidl::client::QueryResponseFut<
1944        fidl_fuchsia_unknown::CloseableCloseResult,
1945        fidl::encoding::DefaultFuchsiaResourceDialect,
1946    > {
1947        DirectoryProxyInterface::r#close(self)
1948    }
1949
1950    pub fn r#query(
1951        &self,
1952    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1953    {
1954        DirectoryProxyInterface::r#query(self)
1955    }
1956
1957    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
1958    pub fn r#deprecated_clone(
1959        &self,
1960        mut flags: OpenFlags,
1961        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
1962    ) -> Result<(), fidl::Error> {
1963        DirectoryProxyInterface::r#deprecated_clone(self, flags, object)
1964    }
1965
1966    /// DEPRECATED - Use `Node.GetAttributes` instead.
1967    pub fn r#deprecated_get_attr(
1968        &self,
1969    ) -> fidl::client::QueryResponseFut<
1970        (i32, NodeAttributes),
1971        fidl::encoding::DefaultFuchsiaResourceDialect,
1972    > {
1973        DirectoryProxyInterface::r#deprecated_get_attr(self)
1974    }
1975
1976    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
1977    pub fn r#deprecated_set_attr(
1978        &self,
1979        mut flags: NodeAttributeFlags,
1980        mut attributes: &NodeAttributes,
1981    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1982        DirectoryProxyInterface::r#deprecated_set_attr(self, flags, attributes)
1983    }
1984
1985    /// [DEPRECATED - Use new GetFlags method instead.]
1986    pub fn r#deprecated_get_flags(
1987        &self,
1988    ) -> fidl::client::QueryResponseFut<
1989        (i32, OpenFlags),
1990        fidl::encoding::DefaultFuchsiaResourceDialect,
1991    > {
1992        DirectoryProxyInterface::r#deprecated_get_flags(self)
1993    }
1994
1995    /// [DEPRECATED - Use new SetFlags method instead.]
1996    pub fn r#deprecated_set_flags(
1997        &self,
1998        mut flags: OpenFlags,
1999    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2000        DirectoryProxyInterface::r#deprecated_set_flags(self, flags)
2001    }
2002
2003    /// Queries the flags that apply to this node after it has been opened/created. This method does
2004    /// not require any rights.
2005    ///
2006    /// Note that the final set of flags that apply to the connection may differ from those
2007    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
2008    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
2009    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
2010    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
2011    pub fn r#get_flags(
2012        &self,
2013    ) -> fidl::client::QueryResponseFut<
2014        NodeGetFlagsResult,
2015        fidl::encoding::DefaultFuchsiaResourceDialect,
2016    > {
2017        DirectoryProxyInterface::r#get_flags(self)
2018    }
2019
2020    /// Sets the flags that apply to this node after it has been opened. This method does not
2021    /// require any rights.
2022    ///
2023    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
2024    /// clear append mode.
2025    ///
2026    /// Errors:
2027    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
2028    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
2029    pub fn r#set_flags(
2030        &self,
2031        mut flags: Flags,
2032    ) -> fidl::client::QueryResponseFut<
2033        NodeSetFlagsResult,
2034        fidl::encoding::DefaultFuchsiaResourceDialect,
2035    > {
2036        DirectoryProxyInterface::r#set_flags(self, flags)
2037    }
2038
2039    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
2040    /// volume has different settings or the storage is accounted seperately from the rest of the
2041    /// filesystem that may be reported instead of filesystem-wide details.
2042    pub fn r#query_filesystem(
2043        &self,
2044    ) -> fidl::client::QueryResponseFut<
2045        (i32, Option<Box<FilesystemInfo>>),
2046        fidl::encoding::DefaultFuchsiaResourceDialect,
2047    > {
2048        DirectoryProxyInterface::r#query_filesystem(self)
2049    }
2050
2051    /// Acquires information about the node.
2052    ///
2053    /// The attributes of a node should be stable, independent of the
2054    /// specific protocol used to access it.
2055    ///
2056    /// If a particular attribute is not applicable or not supported,
2057    /// filesystems should leave the corresponding field absent.
2058    ///
2059    /// + `query` a bit-mask specifying which attributes to fetch. The server
2060    ///   should not return more than necessary.
2061    /// - `attributes` the returned attributes.
2062    ///
2063    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2064    pub fn r#get_attributes(
2065        &self,
2066        mut query: NodeAttributesQuery,
2067    ) -> fidl::client::QueryResponseFut<
2068        NodeGetAttributesResult,
2069        fidl::encoding::DefaultFuchsiaResourceDialect,
2070    > {
2071        DirectoryProxyInterface::r#get_attributes(self, query)
2072    }
2073
2074    /// Updates information about the node.
2075    ///
2076    /// + `attributes` the presence of a table field in `attributes` indicates
2077    /// the intent to update the corresponding attribute.
2078    ///
2079    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
2080    ///
2081    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2082    pub fn r#update_attributes(
2083        &self,
2084        mut payload: &MutableNodeAttributes,
2085    ) -> fidl::client::QueryResponseFut<
2086        NodeUpdateAttributesResult,
2087        fidl::encoding::DefaultFuchsiaResourceDialect,
2088    > {
2089        DirectoryProxyInterface::r#update_attributes(self, payload)
2090    }
2091
2092    /// Synchronizes updates to the node to the underlying media, if it exists.
2093    ///
2094    /// This method will return when the filesystem server has flushed the
2095    /// relevant updates to the underlying media, but does not guarantee the
2096    /// underlying media has persisted the information, nor that any information
2097    /// is committed to hardware. Clients may use `Sync` to ensure ordering
2098    /// between operations.
2099    ///
2100    /// This method does not require any rights.
2101    pub fn r#sync(
2102        &self,
2103    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
2104    {
2105        DirectoryProxyInterface::r#sync(self)
2106    }
2107
2108    /// Creates an iterator over all the extended attribute names associated
2109    /// with this node. If an error occurs it is returned as an epitaph on the
2110    /// iterator request channel, and then the channel is closed.
2111    ///
2112    /// GetExtendedAttributes can be used with any of these names to retrieve
2113    /// the associated value.
2114    ///
2115    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2116    pub fn r#list_extended_attributes(
2117        &self,
2118        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2119    ) -> Result<(), fidl::Error> {
2120        DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
2121    }
2122
2123    /// Get the value associated with the given attribute `name` for this node.
2124    ///
2125    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
2126    /// particular structure is imposed on them.
2127    ///
2128    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
2129    pub fn r#get_extended_attribute(
2130        &self,
2131        mut name: &[u8],
2132    ) -> fidl::client::QueryResponseFut<
2133        NodeGetExtendedAttributeResult,
2134        fidl::encoding::DefaultFuchsiaResourceDialect,
2135    > {
2136        DirectoryProxyInterface::r#get_extended_attribute(self, name)
2137    }
2138
2139    /// Set the value for the given attribute `name` to `value` for this node.
2140    ///
2141    /// The attribute name may exist, in which case the attribute is updated.
2142    /// If the attribute doesn't exist, it is created. The name should have no
2143    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
2144    ///
2145    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2146    pub fn r#set_extended_attribute(
2147        &self,
2148        mut name: &[u8],
2149        mut value: ExtendedAttributeValue,
2150        mut mode: SetExtendedAttributeMode,
2151    ) -> fidl::client::QueryResponseFut<
2152        NodeSetExtendedAttributeResult,
2153        fidl::encoding::DefaultFuchsiaResourceDialect,
2154    > {
2155        DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
2156    }
2157
2158    /// Remove the specified extended attribute.
2159    ///
2160    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
2161    ///
2162    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
2163    pub fn r#remove_extended_attribute(
2164        &self,
2165        mut name: &[u8],
2166    ) -> fidl::client::QueryResponseFut<
2167        NodeRemoveExtendedAttributeResult,
2168        fidl::encoding::DefaultFuchsiaResourceDialect,
2169    > {
2170        DirectoryProxyInterface::r#remove_extended_attribute(self, name)
2171    }
2172
2173    /// Open (or create) a node relative to this directory. Any errors are communicated via an
2174    /// epitaph sent on the `object` channel.
2175    ///
2176    /// Errors:
2177    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
2178    /// * See [`Flags`] for other errors which may be communicated based on `flags`
2179    pub fn r#open(
2180        &self,
2181        mut path: &str,
2182        mut flags: Flags,
2183        mut options: &Options,
2184        mut object: fidl::Channel,
2185    ) -> Result<(), fidl::Error> {
2186        DirectoryProxyInterface::r#open(self, path, flags, options, object)
2187    }
2188
2189    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
2190    pub fn r#deprecated_open(
2191        &self,
2192        mut flags: OpenFlags,
2193        mut mode: ModeType,
2194        mut path: &str,
2195        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2196    ) -> Result<(), fidl::Error> {
2197        DirectoryProxyInterface::r#deprecated_open(self, flags, mode, path, object)
2198    }
2199
2200    /// Reads a collection of variably sized dirents into a buffer.
2201    /// The number of dirents in a directory may be very large: akin to
2202    /// calling read multiple times on a file, directories have a seek
2203    /// offset which is updated on subsequent calls to ReadDirents.
2204    /// Each call to ReadDirents will only return whole dirent structures,
2205    /// they will not get split across ReadDirent calls. When the seek
2206    /// offset reaches the end, `dirents` will be empty.
2207    ///
2208    /// These dirents are of the form:
2209    /// ```
2210    /// struct dirent {
2211    ///   // Describes the inode of the entry.
2212    ///   uint64 ino;
2213    ///   // Describes the length of the dirent name in bytes.
2214    ///   uint8 size;
2215    ///   // Describes the type of the entry. Aligned with the
2216    ///   // POSIX d_type values. Use `DirentType` constants.
2217    ///   uint8 type;
2218    ///   // Unterminated name of entry.
2219    ///   char name[0];
2220    /// }
2221    /// ```
2222    ///
2223    /// This method does not require any rights, since one could always probe for
2224    /// directory contents by triggering name conflicts during file creation.
2225    pub fn r#read_dirents(
2226        &self,
2227        mut max_bytes: u64,
2228    ) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
2229    {
2230        DirectoryProxyInterface::r#read_dirents(self, max_bytes)
2231    }
2232
2233    /// Resets the directory seek offset.
2234    ///
2235    /// This method does not require any rights, similar to ReadDirents.
2236    pub fn r#rewind(
2237        &self,
2238    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2239        DirectoryProxyInterface::r#rewind(self)
2240    }
2241
2242    /// Acquires a token to a Directory which can be used to identify access to it at a later point
2243    /// in time. The token will remain valid for as long as the connection requesting the token
2244    /// remains open.
2245    ///
2246    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
2247    /// `ZX_ERR_BAD_HANDLE`.
2248    pub fn r#get_token(
2249        &self,
2250    ) -> fidl::client::QueryResponseFut<
2251        (i32, Option<fidl::NullableHandle>),
2252        fidl::encoding::DefaultFuchsiaResourceDialect,
2253    > {
2254        DirectoryProxyInterface::r#get_token(self)
2255    }
2256
2257    /// Creates a link to an object named src by the name dst, within a directory represented by
2258    /// token.
2259    ///
2260    /// `src` must be a resolved object name. Including "/" in the string will
2261    /// return `ZX_ERR_INVALID_ARGS`.
2262    ///
2263    /// `dst` must be a resolved object name. Including "/" in the string will
2264    /// return `ZX_ERR_INVALID_ARGS`.
2265    ///
2266    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
2267    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
2268    ///
2269    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
2270    /// there are two actors operating concurrently, and one actor performs a rename that affects
2271    /// the source within this directory, and the other does a link, each will appear to occur
2272    /// atomically in an unspecified order.
2273    pub fn r#link(
2274        &self,
2275        mut src: &str,
2276        mut dst_parent_token: fidl::NullableHandle,
2277        mut dst: &str,
2278    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2279        DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
2280    }
2281
2282    /// Removes a child node from the this directory's list of entries.
2283    ///
2284    /// Note: this does not guarantee that the underlying object is destroyed.
2285    /// Although the link will be removed from the containing directory,
2286    /// objects with multiple references (such as files which are still open)
2287    /// will not actually be destroyed until all references are closed.
2288    ///
2289    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
2290    ///   [`Rights.WRITE_BYTES`].
2291    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
2292    ///   support writing.
2293    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
2294    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
2295    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
2296    ///   containing a remote channel.
2297    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
2298    ///     something other than a directory was found.
2299    ///
2300    /// Other errors may be returned for filesystem-specific reasons.
2301    ///
2302    /// This method requires the following rights:
2303    ///
2304    /// * [`Rights.ENUMERATE`]
2305    /// * [`Rights.MODIFY_DIRECTORY`]
2306    pub fn r#unlink(
2307        &self,
2308        mut name: &str,
2309        mut options: &UnlinkOptions,
2310    ) -> fidl::client::QueryResponseFut<
2311        DirectoryUnlinkResult,
2312        fidl::encoding::DefaultFuchsiaResourceDialect,
2313    > {
2314        DirectoryProxyInterface::r#unlink(self, name, options)
2315    }
2316
2317    /// Renames a node named `src` to the name `dst`, in a directory represented
2318    /// by `dst_parent_token`.
2319    ///
2320    /// `src` and `dst` must be valid node names.
2321    /// See [`Name`] for what constitutes a valid name.
2322    ///
2323    /// This method requires the following rights on both the current connection, and the connection
2324    /// identified by `dst_parent_token`:
2325    ///
2326    /// * [`Rights.ENUMERATE`]
2327    /// * [`Rights.MODIFY_DIRECTORY`]
2328    ///
2329    /// The following requirements are necessary to avoid rights escalations.
2330    ///
2331    /// If the source and destination directory differ, the source directory must also have the
2332    /// maximal set of abilities supported for files, which would typically be
2333    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
2334    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
2335    /// right.
2336    ///
2337    /// If `src` refers to a directory, and differs from the destination directory, then the source
2338    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
2339    ///
2340    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
2341    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
2342    pub fn r#rename(
2343        &self,
2344        mut src: &str,
2345        mut dst_parent_token: fidl::Event,
2346        mut dst: &str,
2347    ) -> fidl::client::QueryResponseFut<
2348        DirectoryRenameResult,
2349        fidl::encoding::DefaultFuchsiaResourceDialect,
2350    > {
2351        DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
2352    }
2353
2354    /// Creates a symbolic link.
2355    ///
2356    /// `name` is the name to be given to the created symbolic link.
2357    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
2358    /// will perform no validation of `target` except for a server chosen maximum length.
2359    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
2360    /// on the successfully created node.
2361    ///
2362    /// * [`Rights.MODIFY_DIRECTORY`]
2363    ///
2364    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
2365    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
2366    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
2367    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
2368    pub fn r#create_symlink(
2369        &self,
2370        mut name: &str,
2371        mut target: &[u8],
2372        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
2373    ) -> fidl::client::QueryResponseFut<
2374        DirectoryCreateSymlinkResult,
2375        fidl::encoding::DefaultFuchsiaResourceDialect,
2376    > {
2377        DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
2378    }
2379
2380    /// Watches a directory, receiving events of added messages on the
2381    /// watcher request channel.
2382    ///
2383    /// Options must be zero; it is reserved.
2384    ///
2385    /// This method does not require any rights, similar to ReadDirents.
2386    pub fn r#watch(
2387        &self,
2388        mut mask: WatchMask,
2389        mut options: u32,
2390        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
2391    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2392        DirectoryProxyInterface::r#watch(self, mask, options, watcher)
2393    }
2394}
2395
2396impl DirectoryProxyInterface for DirectoryProxy {
2397    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
2398        AdvisoryLockingAdvisoryLockResult,
2399        fidl::encoding::DefaultFuchsiaResourceDialect,
2400    >;
2401    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
2402        fn _decode(
2403            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2404        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
2405            let _response = fidl::client::decode_transaction_body::<
2406                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2407                fidl::encoding::DefaultFuchsiaResourceDialect,
2408                0x6ee9c0ad53ec87aa,
2409            >(_buf?)?;
2410            Ok(_response.map(|x| x))
2411        }
2412        self.client.send_query_and_decode::<
2413            AdvisoryLockingAdvisoryLockRequest,
2414            AdvisoryLockingAdvisoryLockResult,
2415        >(
2416            (request,),
2417            0x6ee9c0ad53ec87aa,
2418            fidl::encoding::DynamicFlags::empty(),
2419            _decode,
2420        )
2421    }
2422
2423    fn r#clone(
2424        &self,
2425        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
2426    ) -> Result<(), fidl::Error> {
2427        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
2428            (request,),
2429            0x20d8a7aba2168a79,
2430            fidl::encoding::DynamicFlags::empty(),
2431        )
2432    }
2433
2434    type CloseResponseFut = fidl::client::QueryResponseFut<
2435        fidl_fuchsia_unknown::CloseableCloseResult,
2436        fidl::encoding::DefaultFuchsiaResourceDialect,
2437    >;
2438    fn r#close(&self) -> Self::CloseResponseFut {
2439        fn _decode(
2440            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2441        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2442            let _response = fidl::client::decode_transaction_body::<
2443                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2444                fidl::encoding::DefaultFuchsiaResourceDialect,
2445                0x5ac5d459ad7f657e,
2446            >(_buf?)?;
2447            Ok(_response.map(|x| x))
2448        }
2449        self.client.send_query_and_decode::<
2450            fidl::encoding::EmptyPayload,
2451            fidl_fuchsia_unknown::CloseableCloseResult,
2452        >(
2453            (),
2454            0x5ac5d459ad7f657e,
2455            fidl::encoding::DynamicFlags::empty(),
2456            _decode,
2457        )
2458    }
2459
2460    type QueryResponseFut =
2461        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2462    fn r#query(&self) -> Self::QueryResponseFut {
2463        fn _decode(
2464            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2465        ) -> Result<Vec<u8>, fidl::Error> {
2466            let _response = fidl::client::decode_transaction_body::<
2467                fidl_fuchsia_unknown::QueryableQueryResponse,
2468                fidl::encoding::DefaultFuchsiaResourceDialect,
2469                0x2658edee9decfc06,
2470            >(_buf?)?;
2471            Ok(_response.protocol)
2472        }
2473        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2474            (),
2475            0x2658edee9decfc06,
2476            fidl::encoding::DynamicFlags::empty(),
2477            _decode,
2478        )
2479    }
2480
2481    fn r#deprecated_clone(
2482        &self,
2483        mut flags: OpenFlags,
2484        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2485    ) -> Result<(), fidl::Error> {
2486        self.client.send::<NodeDeprecatedCloneRequest>(
2487            (flags, object),
2488            0x5a61678f293ce16f,
2489            fidl::encoding::DynamicFlags::FLEXIBLE,
2490        )
2491    }
2492
2493    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
2494        (i32, NodeAttributes),
2495        fidl::encoding::DefaultFuchsiaResourceDialect,
2496    >;
2497    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
2498        fn _decode(
2499            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2500        ) -> Result<(i32, NodeAttributes), fidl::Error> {
2501            let _response = fidl::client::decode_transaction_body::<
2502                NodeDeprecatedGetAttrResponse,
2503                fidl::encoding::DefaultFuchsiaResourceDialect,
2504                0x78985e216314dafd,
2505            >(_buf?)?;
2506            Ok((_response.s, _response.attributes))
2507        }
2508        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
2509            (),
2510            0x78985e216314dafd,
2511            fidl::encoding::DynamicFlags::empty(),
2512            _decode,
2513        )
2514    }
2515
2516    type DeprecatedSetAttrResponseFut =
2517        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2518    fn r#deprecated_set_attr(
2519        &self,
2520        mut flags: NodeAttributeFlags,
2521        mut attributes: &NodeAttributes,
2522    ) -> Self::DeprecatedSetAttrResponseFut {
2523        fn _decode(
2524            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2525        ) -> Result<i32, fidl::Error> {
2526            let _response = fidl::client::decode_transaction_body::<
2527                NodeDeprecatedSetAttrResponse,
2528                fidl::encoding::DefaultFuchsiaResourceDialect,
2529                0x4186c0f40d938f46,
2530            >(_buf?)?;
2531            Ok(_response.s)
2532        }
2533        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
2534            (flags, attributes),
2535            0x4186c0f40d938f46,
2536            fidl::encoding::DynamicFlags::empty(),
2537            _decode,
2538        )
2539    }
2540
2541    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
2542        (i32, OpenFlags),
2543        fidl::encoding::DefaultFuchsiaResourceDialect,
2544    >;
2545    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
2546        fn _decode(
2547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2548        ) -> Result<(i32, OpenFlags), fidl::Error> {
2549            let _response = fidl::client::decode_transaction_body::<
2550                NodeDeprecatedGetFlagsResponse,
2551                fidl::encoding::DefaultFuchsiaResourceDialect,
2552                0x5b88fffb8eda3aa1,
2553            >(_buf?)?;
2554            Ok((_response.s, _response.flags))
2555        }
2556        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
2557            (),
2558            0x5b88fffb8eda3aa1,
2559            fidl::encoding::DynamicFlags::empty(),
2560            _decode,
2561        )
2562    }
2563
2564    type DeprecatedSetFlagsResponseFut =
2565        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2566    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
2567        fn _decode(
2568            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2569        ) -> Result<i32, fidl::Error> {
2570            let _response = fidl::client::decode_transaction_body::<
2571                NodeDeprecatedSetFlagsResponse,
2572                fidl::encoding::DefaultFuchsiaResourceDialect,
2573                0x5295b76c71fde733,
2574            >(_buf?)?;
2575            Ok(_response.s)
2576        }
2577        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
2578            (flags,),
2579            0x5295b76c71fde733,
2580            fidl::encoding::DynamicFlags::empty(),
2581            _decode,
2582        )
2583    }
2584
2585    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
2586        NodeGetFlagsResult,
2587        fidl::encoding::DefaultFuchsiaResourceDialect,
2588    >;
2589    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
2590        fn _decode(
2591            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2592        ) -> Result<NodeGetFlagsResult, fidl::Error> {
2593            let _response = fidl::client::decode_transaction_body::<
2594                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
2595                fidl::encoding::DefaultFuchsiaResourceDialect,
2596                0x176eb318f64ec23,
2597            >(_buf?)?
2598            .into_result::<DirectoryMarker>("get_flags")?;
2599            Ok(_response.map(|x| x.flags))
2600        }
2601        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
2602            (),
2603            0x176eb318f64ec23,
2604            fidl::encoding::DynamicFlags::FLEXIBLE,
2605            _decode,
2606        )
2607    }
2608
2609    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
2610        NodeSetFlagsResult,
2611        fidl::encoding::DefaultFuchsiaResourceDialect,
2612    >;
2613    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
2614        fn _decode(
2615            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2616        ) -> Result<NodeSetFlagsResult, fidl::Error> {
2617            let _response = fidl::client::decode_transaction_body::<
2618                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2619                fidl::encoding::DefaultFuchsiaResourceDialect,
2620                0x55a8028685791ea8,
2621            >(_buf?)?
2622            .into_result::<DirectoryMarker>("set_flags")?;
2623            Ok(_response.map(|x| x))
2624        }
2625        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
2626            (flags,),
2627            0x55a8028685791ea8,
2628            fidl::encoding::DynamicFlags::FLEXIBLE,
2629            _decode,
2630        )
2631    }
2632
2633    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
2634        (i32, Option<Box<FilesystemInfo>>),
2635        fidl::encoding::DefaultFuchsiaResourceDialect,
2636    >;
2637    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
2638        fn _decode(
2639            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2640        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
2641            let _response = fidl::client::decode_transaction_body::<
2642                NodeQueryFilesystemResponse,
2643                fidl::encoding::DefaultFuchsiaResourceDialect,
2644                0x6f344a1c6b0a0610,
2645            >(_buf?)?;
2646            Ok((_response.s, _response.info))
2647        }
2648        self.client.send_query_and_decode::<
2649            fidl::encoding::EmptyPayload,
2650            (i32, Option<Box<FilesystemInfo>>),
2651        >(
2652            (),
2653            0x6f344a1c6b0a0610,
2654            fidl::encoding::DynamicFlags::empty(),
2655            _decode,
2656        )
2657    }
2658
2659    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
2660        NodeGetAttributesResult,
2661        fidl::encoding::DefaultFuchsiaResourceDialect,
2662    >;
2663    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
2664        fn _decode(
2665            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2666        ) -> Result<NodeGetAttributesResult, fidl::Error> {
2667            let _response = fidl::client::decode_transaction_body::<
2668                fidl::encoding::ResultType<NodeAttributes2, i32>,
2669                fidl::encoding::DefaultFuchsiaResourceDialect,
2670                0x3d4396a638ea053b,
2671            >(_buf?)?;
2672            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
2673        }
2674        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
2675            (query,),
2676            0x3d4396a638ea053b,
2677            fidl::encoding::DynamicFlags::empty(),
2678            _decode,
2679        )
2680    }
2681
2682    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
2683        NodeUpdateAttributesResult,
2684        fidl::encoding::DefaultFuchsiaResourceDialect,
2685    >;
2686    fn r#update_attributes(
2687        &self,
2688        mut payload: &MutableNodeAttributes,
2689    ) -> Self::UpdateAttributesResponseFut {
2690        fn _decode(
2691            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2692        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
2693            let _response = fidl::client::decode_transaction_body::<
2694                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2695                fidl::encoding::DefaultFuchsiaResourceDialect,
2696                0x3308c1da5a89bf08,
2697            >(_buf?)?;
2698            Ok(_response.map(|x| x))
2699        }
2700        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
2701            payload,
2702            0x3308c1da5a89bf08,
2703            fidl::encoding::DynamicFlags::empty(),
2704            _decode,
2705        )
2706    }
2707
2708    type SyncResponseFut = fidl::client::QueryResponseFut<
2709        NodeSyncResult,
2710        fidl::encoding::DefaultFuchsiaResourceDialect,
2711    >;
2712    fn r#sync(&self) -> Self::SyncResponseFut {
2713        fn _decode(
2714            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2715        ) -> Result<NodeSyncResult, fidl::Error> {
2716            let _response = fidl::client::decode_transaction_body::<
2717                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2718                fidl::encoding::DefaultFuchsiaResourceDialect,
2719                0x2c5c27ca0ab5dc49,
2720            >(_buf?)?;
2721            Ok(_response.map(|x| x))
2722        }
2723        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
2724            (),
2725            0x2c5c27ca0ab5dc49,
2726            fidl::encoding::DynamicFlags::empty(),
2727            _decode,
2728        )
2729    }
2730
2731    fn r#list_extended_attributes(
2732        &self,
2733        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
2734    ) -> Result<(), fidl::Error> {
2735        self.client.send::<NodeListExtendedAttributesRequest>(
2736            (iterator,),
2737            0x4b61033de007fcd0,
2738            fidl::encoding::DynamicFlags::empty(),
2739        )
2740    }
2741
2742    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2743        NodeGetExtendedAttributeResult,
2744        fidl::encoding::DefaultFuchsiaResourceDialect,
2745    >;
2746    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
2747        fn _decode(
2748            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2749        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
2750            let _response = fidl::client::decode_transaction_body::<
2751                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
2752                fidl::encoding::DefaultFuchsiaResourceDialect,
2753                0x45ffa3ccfdeb76db,
2754            >(_buf?)?;
2755            Ok(_response.map(|x| x))
2756        }
2757        self.client.send_query_and_decode::<
2758            NodeGetExtendedAttributeRequest,
2759            NodeGetExtendedAttributeResult,
2760        >(
2761            (name,),
2762            0x45ffa3ccfdeb76db,
2763            fidl::encoding::DynamicFlags::empty(),
2764            _decode,
2765        )
2766    }
2767
2768    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2769        NodeSetExtendedAttributeResult,
2770        fidl::encoding::DefaultFuchsiaResourceDialect,
2771    >;
2772    fn r#set_extended_attribute(
2773        &self,
2774        mut name: &[u8],
2775        mut value: ExtendedAttributeValue,
2776        mut mode: SetExtendedAttributeMode,
2777    ) -> Self::SetExtendedAttributeResponseFut {
2778        fn _decode(
2779            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2780        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
2781            let _response = fidl::client::decode_transaction_body::<
2782                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2783                fidl::encoding::DefaultFuchsiaResourceDialect,
2784                0x4a951362f681f23c,
2785            >(_buf?)?;
2786            Ok(_response.map(|x| x))
2787        }
2788        self.client.send_query_and_decode::<
2789            NodeSetExtendedAttributeRequest,
2790            NodeSetExtendedAttributeResult,
2791        >(
2792            (name, &mut value, mode,),
2793            0x4a951362f681f23c,
2794            fidl::encoding::DynamicFlags::empty(),
2795            _decode,
2796        )
2797    }
2798
2799    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
2800        NodeRemoveExtendedAttributeResult,
2801        fidl::encoding::DefaultFuchsiaResourceDialect,
2802    >;
2803    fn r#remove_extended_attribute(
2804        &self,
2805        mut name: &[u8],
2806    ) -> Self::RemoveExtendedAttributeResponseFut {
2807        fn _decode(
2808            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2809        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
2810            let _response = fidl::client::decode_transaction_body::<
2811                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2812                fidl::encoding::DefaultFuchsiaResourceDialect,
2813                0x7a0b9f3a9bf9032d,
2814            >(_buf?)?;
2815            Ok(_response.map(|x| x))
2816        }
2817        self.client.send_query_and_decode::<
2818            NodeRemoveExtendedAttributeRequest,
2819            NodeRemoveExtendedAttributeResult,
2820        >(
2821            (name,),
2822            0x7a0b9f3a9bf9032d,
2823            fidl::encoding::DynamicFlags::empty(),
2824            _decode,
2825        )
2826    }
2827
2828    fn r#open(
2829        &self,
2830        mut path: &str,
2831        mut flags: Flags,
2832        mut options: &Options,
2833        mut object: fidl::Channel,
2834    ) -> Result<(), fidl::Error> {
2835        self.client.send::<OpenableOpenRequest>(
2836            (path, flags, options, object),
2837            0x568ddcb9a9cbb6d9,
2838            fidl::encoding::DynamicFlags::FLEXIBLE,
2839        )
2840    }
2841
2842    fn r#deprecated_open(
2843        &self,
2844        mut flags: OpenFlags,
2845        mut mode: ModeType,
2846        mut path: &str,
2847        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
2848    ) -> Result<(), fidl::Error> {
2849        self.client.send::<DirectoryDeprecatedOpenRequest>(
2850            (flags, mode, path, object),
2851            0x2c5044561d685ec0,
2852            fidl::encoding::DynamicFlags::FLEXIBLE,
2853        )
2854    }
2855
2856    type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
2857        (i32, Vec<u8>),
2858        fidl::encoding::DefaultFuchsiaResourceDialect,
2859    >;
2860    fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
2861        fn _decode(
2862            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2863        ) -> Result<(i32, Vec<u8>), fidl::Error> {
2864            let _response = fidl::client::decode_transaction_body::<
2865                DirectoryReadDirentsResponse,
2866                fidl::encoding::DefaultFuchsiaResourceDialect,
2867                0x3582806bf27faa0a,
2868            >(_buf?)?;
2869            Ok((_response.s, _response.dirents))
2870        }
2871        self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
2872            (max_bytes,),
2873            0x3582806bf27faa0a,
2874            fidl::encoding::DynamicFlags::empty(),
2875            _decode,
2876        )
2877    }
2878
2879    type RewindResponseFut =
2880        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2881    fn r#rewind(&self) -> Self::RewindResponseFut {
2882        fn _decode(
2883            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2884        ) -> Result<i32, fidl::Error> {
2885            let _response = fidl::client::decode_transaction_body::<
2886                DirectoryRewindResponse,
2887                fidl::encoding::DefaultFuchsiaResourceDialect,
2888                0x16b1202af0f34c71,
2889            >(_buf?)?;
2890            Ok(_response.s)
2891        }
2892        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
2893            (),
2894            0x16b1202af0f34c71,
2895            fidl::encoding::DynamicFlags::empty(),
2896            _decode,
2897        )
2898    }
2899
2900    type GetTokenResponseFut = fidl::client::QueryResponseFut<
2901        (i32, Option<fidl::NullableHandle>),
2902        fidl::encoding::DefaultFuchsiaResourceDialect,
2903    >;
2904    fn r#get_token(&self) -> Self::GetTokenResponseFut {
2905        fn _decode(
2906            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2907        ) -> Result<(i32, Option<fidl::NullableHandle>), fidl::Error> {
2908            let _response = fidl::client::decode_transaction_body::<
2909                DirectoryGetTokenResponse,
2910                fidl::encoding::DefaultFuchsiaResourceDialect,
2911                0x26ae9d18763c8655,
2912            >(_buf?)?;
2913            Ok((_response.s, _response.token))
2914        }
2915        self.client.send_query_and_decode::<
2916            fidl::encoding::EmptyPayload,
2917            (i32, Option<fidl::NullableHandle>),
2918        >(
2919            (),
2920            0x26ae9d18763c8655,
2921            fidl::encoding::DynamicFlags::empty(),
2922            _decode,
2923        )
2924    }
2925
2926    type LinkResponseFut =
2927        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2928    fn r#link(
2929        &self,
2930        mut src: &str,
2931        mut dst_parent_token: fidl::NullableHandle,
2932        mut dst: &str,
2933    ) -> Self::LinkResponseFut {
2934        fn _decode(
2935            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2936        ) -> Result<i32, fidl::Error> {
2937            let _response = fidl::client::decode_transaction_body::<
2938                DirectoryLinkResponse,
2939                fidl::encoding::DefaultFuchsiaResourceDialect,
2940                0x740604c0c7c930e7,
2941            >(_buf?)?;
2942            Ok(_response.s)
2943        }
2944        self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
2945            (src, dst_parent_token, dst),
2946            0x740604c0c7c930e7,
2947            fidl::encoding::DynamicFlags::empty(),
2948            _decode,
2949        )
2950    }
2951
2952    type UnlinkResponseFut = fidl::client::QueryResponseFut<
2953        DirectoryUnlinkResult,
2954        fidl::encoding::DefaultFuchsiaResourceDialect,
2955    >;
2956    fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
2957        fn _decode(
2958            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2959        ) -> Result<DirectoryUnlinkResult, fidl::Error> {
2960            let _response = fidl::client::decode_transaction_body::<
2961                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2962                fidl::encoding::DefaultFuchsiaResourceDialect,
2963                0x750a0326a78d7bed,
2964            >(_buf?)?;
2965            Ok(_response.map(|x| x))
2966        }
2967        self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
2968            (name, options),
2969            0x750a0326a78d7bed,
2970            fidl::encoding::DynamicFlags::empty(),
2971            _decode,
2972        )
2973    }
2974
2975    type RenameResponseFut = fidl::client::QueryResponseFut<
2976        DirectoryRenameResult,
2977        fidl::encoding::DefaultFuchsiaResourceDialect,
2978    >;
2979    fn r#rename(
2980        &self,
2981        mut src: &str,
2982        mut dst_parent_token: fidl::Event,
2983        mut dst: &str,
2984    ) -> Self::RenameResponseFut {
2985        fn _decode(
2986            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2987        ) -> Result<DirectoryRenameResult, fidl::Error> {
2988            let _response = fidl::client::decode_transaction_body::<
2989                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2990                fidl::encoding::DefaultFuchsiaResourceDialect,
2991                0x7060e7723b9928de,
2992            >(_buf?)?;
2993            Ok(_response.map(|x| x))
2994        }
2995        self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
2996            (src, dst_parent_token, dst),
2997            0x7060e7723b9928de,
2998            fidl::encoding::DynamicFlags::empty(),
2999            _decode,
3000        )
3001    }
3002
3003    type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
3004        DirectoryCreateSymlinkResult,
3005        fidl::encoding::DefaultFuchsiaResourceDialect,
3006    >;
3007    fn r#create_symlink(
3008        &self,
3009        mut name: &str,
3010        mut target: &[u8],
3011        mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
3012    ) -> Self::CreateSymlinkResponseFut {
3013        fn _decode(
3014            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3015        ) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
3016            let _response = fidl::client::decode_transaction_body::<
3017                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3018                fidl::encoding::DefaultFuchsiaResourceDialect,
3019                0x21ce0f19ec043889,
3020            >(_buf?)?;
3021            Ok(_response.map(|x| x))
3022        }
3023        self.client
3024            .send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
3025                (name, target, connection),
3026                0x21ce0f19ec043889,
3027                fidl::encoding::DynamicFlags::empty(),
3028                _decode,
3029            )
3030    }
3031
3032    type WatchResponseFut =
3033        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3034    fn r#watch(
3035        &self,
3036        mut mask: WatchMask,
3037        mut options: u32,
3038        mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
3039    ) -> Self::WatchResponseFut {
3040        fn _decode(
3041            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3042        ) -> Result<i32, fidl::Error> {
3043            let _response = fidl::client::decode_transaction_body::<
3044                DirectoryWatchResponse,
3045                fidl::encoding::DefaultFuchsiaResourceDialect,
3046                0x5717193a59d66d91,
3047            >(_buf?)?;
3048            Ok(_response.s)
3049        }
3050        self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
3051            (mask, options, watcher),
3052            0x5717193a59d66d91,
3053            fidl::encoding::DynamicFlags::empty(),
3054            _decode,
3055        )
3056    }
3057}
3058
3059pub struct DirectoryEventStream {
3060    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3061}
3062
3063impl std::marker::Unpin for DirectoryEventStream {}
3064
3065impl futures::stream::FusedStream for DirectoryEventStream {
3066    fn is_terminated(&self) -> bool {
3067        self.event_receiver.is_terminated()
3068    }
3069}
3070
3071impl futures::Stream for DirectoryEventStream {
3072    type Item = Result<DirectoryEvent, fidl::Error>;
3073
3074    fn poll_next(
3075        mut self: std::pin::Pin<&mut Self>,
3076        cx: &mut std::task::Context<'_>,
3077    ) -> std::task::Poll<Option<Self::Item>> {
3078        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3079            &mut self.event_receiver,
3080            cx
3081        )?) {
3082            Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
3083            None => std::task::Poll::Ready(None),
3084        }
3085    }
3086}
3087
3088#[derive(Debug)]
3089pub enum DirectoryEvent {
3090    OnOpen_ {
3091        s: i32,
3092        info: Option<Box<NodeInfoDeprecated>>,
3093    },
3094    OnRepresentation {
3095        payload: Representation,
3096    },
3097    #[non_exhaustive]
3098    _UnknownEvent {
3099        /// Ordinal of the event that was sent.
3100        ordinal: u64,
3101    },
3102}
3103
3104impl DirectoryEvent {
3105    #[allow(irrefutable_let_patterns)]
3106    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
3107        if let DirectoryEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
3108    }
3109    #[allow(irrefutable_let_patterns)]
3110    pub fn into_on_representation(self) -> Option<Representation> {
3111        if let DirectoryEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
3112    }
3113
3114    /// Decodes a message buffer as a [`DirectoryEvent`].
3115    fn decode(
3116        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3117    ) -> Result<DirectoryEvent, fidl::Error> {
3118        let (bytes, _handles) = buf.split_mut();
3119        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3120        debug_assert_eq!(tx_header.tx_id, 0);
3121        match tx_header.ordinal {
3122            0x7fc7bbb1dbfd1972 => {
3123                let mut out = fidl::new_empty!(
3124                    NodeOnOpenRequest,
3125                    fidl::encoding::DefaultFuchsiaResourceDialect
3126                );
3127                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3128                Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
3129            }
3130            0x5cb40567d80a510c => {
3131                let mut out =
3132                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
3133                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
3134                Ok((DirectoryEvent::OnRepresentation { payload: out }))
3135            }
3136            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3137                Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3138            }
3139            _ => Err(fidl::Error::UnknownOrdinal {
3140                ordinal: tx_header.ordinal,
3141                protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3142            }),
3143        }
3144    }
3145}
3146
3147/// A Stream of incoming requests for fuchsia.io/Directory.
3148pub struct DirectoryRequestStream {
3149    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3150    is_terminated: bool,
3151}
3152
3153impl std::marker::Unpin for DirectoryRequestStream {}
3154
3155impl futures::stream::FusedStream for DirectoryRequestStream {
3156    fn is_terminated(&self) -> bool {
3157        self.is_terminated
3158    }
3159}
3160
3161impl fidl::endpoints::RequestStream for DirectoryRequestStream {
3162    type Protocol = DirectoryMarker;
3163    type ControlHandle = DirectoryControlHandle;
3164
3165    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3166        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3167    }
3168
3169    fn control_handle(&self) -> Self::ControlHandle {
3170        DirectoryControlHandle { inner: self.inner.clone() }
3171    }
3172
3173    fn into_inner(
3174        self,
3175    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3176    {
3177        (self.inner, self.is_terminated)
3178    }
3179
3180    fn from_inner(
3181        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3182        is_terminated: bool,
3183    ) -> Self {
3184        Self { inner, is_terminated }
3185    }
3186}
3187
3188impl futures::Stream for DirectoryRequestStream {
3189    type Item = Result<DirectoryRequest, fidl::Error>;
3190
3191    fn poll_next(
3192        mut self: std::pin::Pin<&mut Self>,
3193        cx: &mut std::task::Context<'_>,
3194    ) -> std::task::Poll<Option<Self::Item>> {
3195        let this = &mut *self;
3196        if this.inner.check_shutdown(cx) {
3197            this.is_terminated = true;
3198            return std::task::Poll::Ready(None);
3199        }
3200        if this.is_terminated {
3201            panic!("polled DirectoryRequestStream after completion");
3202        }
3203        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3204            |bytes, handles| {
3205                match this.inner.channel().read_etc(cx, bytes, handles) {
3206                    std::task::Poll::Ready(Ok(())) => {}
3207                    std::task::Poll::Pending => return std::task::Poll::Pending,
3208                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3209                        this.is_terminated = true;
3210                        return std::task::Poll::Ready(None);
3211                    }
3212                    std::task::Poll::Ready(Err(e)) => {
3213                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3214                            e.into(),
3215                        ))));
3216                    }
3217                }
3218
3219                // A message has been received from the channel
3220                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3221
3222                std::task::Poll::Ready(Some(match header.ordinal {
3223                    0x6ee9c0ad53ec87aa => {
3224                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3225                        let mut req = fidl::new_empty!(
3226                            AdvisoryLockingAdvisoryLockRequest,
3227                            fidl::encoding::DefaultFuchsiaResourceDialect
3228                        );
3229                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
3230                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3231                        Ok(DirectoryRequest::AdvisoryLock {
3232                            request: req.request,
3233
3234                            responder: DirectoryAdvisoryLockResponder {
3235                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3236                                tx_id: header.tx_id,
3237                            },
3238                        })
3239                    }
3240                    0x20d8a7aba2168a79 => {
3241                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3242                        let mut req = fidl::new_empty!(
3243                            fidl_fuchsia_unknown::CloneableCloneRequest,
3244                            fidl::encoding::DefaultFuchsiaResourceDialect
3245                        );
3246                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3247                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3248                        Ok(DirectoryRequest::Clone { request: req.request, control_handle })
3249                    }
3250                    0x5ac5d459ad7f657e => {
3251                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3252                        let mut req = fidl::new_empty!(
3253                            fidl::encoding::EmptyPayload,
3254                            fidl::encoding::DefaultFuchsiaResourceDialect
3255                        );
3256                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3257                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3258                        Ok(DirectoryRequest::Close {
3259                            responder: DirectoryCloseResponder {
3260                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3261                                tx_id: header.tx_id,
3262                            },
3263                        })
3264                    }
3265                    0x2658edee9decfc06 => {
3266                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3267                        let mut req = fidl::new_empty!(
3268                            fidl::encoding::EmptyPayload,
3269                            fidl::encoding::DefaultFuchsiaResourceDialect
3270                        );
3271                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3272                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3273                        Ok(DirectoryRequest::Query {
3274                            responder: DirectoryQueryResponder {
3275                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3276                                tx_id: header.tx_id,
3277                            },
3278                        })
3279                    }
3280                    0x5a61678f293ce16f => {
3281                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3282                        let mut req = fidl::new_empty!(
3283                            NodeDeprecatedCloneRequest,
3284                            fidl::encoding::DefaultFuchsiaResourceDialect
3285                        );
3286                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3287                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3288                        Ok(DirectoryRequest::DeprecatedClone {
3289                            flags: req.flags,
3290                            object: req.object,
3291
3292                            control_handle,
3293                        })
3294                    }
3295                    0x78985e216314dafd => {
3296                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3297                        let mut req = fidl::new_empty!(
3298                            fidl::encoding::EmptyPayload,
3299                            fidl::encoding::DefaultFuchsiaResourceDialect
3300                        );
3301                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3302                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3303                        Ok(DirectoryRequest::DeprecatedGetAttr {
3304                            responder: DirectoryDeprecatedGetAttrResponder {
3305                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3306                                tx_id: header.tx_id,
3307                            },
3308                        })
3309                    }
3310                    0x4186c0f40d938f46 => {
3311                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3312                        let mut req = fidl::new_empty!(
3313                            NodeDeprecatedSetAttrRequest,
3314                            fidl::encoding::DefaultFuchsiaResourceDialect
3315                        );
3316                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
3317                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3318                        Ok(DirectoryRequest::DeprecatedSetAttr {
3319                            flags: req.flags,
3320                            attributes: req.attributes,
3321
3322                            responder: DirectoryDeprecatedSetAttrResponder {
3323                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3324                                tx_id: header.tx_id,
3325                            },
3326                        })
3327                    }
3328                    0x5b88fffb8eda3aa1 => {
3329                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3330                        let mut req = fidl::new_empty!(
3331                            fidl::encoding::EmptyPayload,
3332                            fidl::encoding::DefaultFuchsiaResourceDialect
3333                        );
3334                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3335                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3336                        Ok(DirectoryRequest::DeprecatedGetFlags {
3337                            responder: DirectoryDeprecatedGetFlagsResponder {
3338                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3339                                tx_id: header.tx_id,
3340                            },
3341                        })
3342                    }
3343                    0x5295b76c71fde733 => {
3344                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3345                        let mut req = fidl::new_empty!(
3346                            NodeDeprecatedSetFlagsRequest,
3347                            fidl::encoding::DefaultFuchsiaResourceDialect
3348                        );
3349                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3350                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3351                        Ok(DirectoryRequest::DeprecatedSetFlags {
3352                            flags: req.flags,
3353
3354                            responder: DirectoryDeprecatedSetFlagsResponder {
3355                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3356                                tx_id: header.tx_id,
3357                            },
3358                        })
3359                    }
3360                    0x176eb318f64ec23 => {
3361                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3362                        let mut req = fidl::new_empty!(
3363                            fidl::encoding::EmptyPayload,
3364                            fidl::encoding::DefaultFuchsiaResourceDialect
3365                        );
3366                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3367                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3368                        Ok(DirectoryRequest::GetFlags {
3369                            responder: DirectoryGetFlagsResponder {
3370                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3371                                tx_id: header.tx_id,
3372                            },
3373                        })
3374                    }
3375                    0x55a8028685791ea8 => {
3376                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3377                        let mut req = fidl::new_empty!(
3378                            NodeSetFlagsRequest,
3379                            fidl::encoding::DefaultFuchsiaResourceDialect
3380                        );
3381                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
3382                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3383                        Ok(DirectoryRequest::SetFlags {
3384                            flags: req.flags,
3385
3386                            responder: DirectorySetFlagsResponder {
3387                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3388                                tx_id: header.tx_id,
3389                            },
3390                        })
3391                    }
3392                    0x6f344a1c6b0a0610 => {
3393                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3394                        let mut req = fidl::new_empty!(
3395                            fidl::encoding::EmptyPayload,
3396                            fidl::encoding::DefaultFuchsiaResourceDialect
3397                        );
3398                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3399                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3400                        Ok(DirectoryRequest::QueryFilesystem {
3401                            responder: DirectoryQueryFilesystemResponder {
3402                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3403                                tx_id: header.tx_id,
3404                            },
3405                        })
3406                    }
3407                    0x3d4396a638ea053b => {
3408                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3409                        let mut req = fidl::new_empty!(
3410                            NodeGetAttributesRequest,
3411                            fidl::encoding::DefaultFuchsiaResourceDialect
3412                        );
3413                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3414                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3415                        Ok(DirectoryRequest::GetAttributes {
3416                            query: req.query,
3417
3418                            responder: DirectoryGetAttributesResponder {
3419                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3420                                tx_id: header.tx_id,
3421                            },
3422                        })
3423                    }
3424                    0x3308c1da5a89bf08 => {
3425                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3426                        let mut req = fidl::new_empty!(
3427                            MutableNodeAttributes,
3428                            fidl::encoding::DefaultFuchsiaResourceDialect
3429                        );
3430                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
3431                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3432                        Ok(DirectoryRequest::UpdateAttributes {
3433                            payload: req,
3434                            responder: DirectoryUpdateAttributesResponder {
3435                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3436                                tx_id: header.tx_id,
3437                            },
3438                        })
3439                    }
3440                    0x2c5c27ca0ab5dc49 => {
3441                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3442                        let mut req = fidl::new_empty!(
3443                            fidl::encoding::EmptyPayload,
3444                            fidl::encoding::DefaultFuchsiaResourceDialect
3445                        );
3446                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3447                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3448                        Ok(DirectoryRequest::Sync {
3449                            responder: DirectorySyncResponder {
3450                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3451                                tx_id: header.tx_id,
3452                            },
3453                        })
3454                    }
3455                    0x4b61033de007fcd0 => {
3456                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3457                        let mut req = fidl::new_empty!(
3458                            NodeListExtendedAttributesRequest,
3459                            fidl::encoding::DefaultFuchsiaResourceDialect
3460                        );
3461                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
3462                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3463                        Ok(DirectoryRequest::ListExtendedAttributes {
3464                            iterator: req.iterator,
3465
3466                            control_handle,
3467                        })
3468                    }
3469                    0x45ffa3ccfdeb76db => {
3470                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3471                        let mut req = fidl::new_empty!(
3472                            NodeGetExtendedAttributeRequest,
3473                            fidl::encoding::DefaultFuchsiaResourceDialect
3474                        );
3475                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3476                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3477                        Ok(DirectoryRequest::GetExtendedAttribute {
3478                            name: req.name,
3479
3480                            responder: DirectoryGetExtendedAttributeResponder {
3481                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3482                                tx_id: header.tx_id,
3483                            },
3484                        })
3485                    }
3486                    0x4a951362f681f23c => {
3487                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3488                        let mut req = fidl::new_empty!(
3489                            NodeSetExtendedAttributeRequest,
3490                            fidl::encoding::DefaultFuchsiaResourceDialect
3491                        );
3492                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3493                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3494                        Ok(DirectoryRequest::SetExtendedAttribute {
3495                            name: req.name,
3496                            value: req.value,
3497                            mode: req.mode,
3498
3499                            responder: DirectorySetExtendedAttributeResponder {
3500                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3501                                tx_id: header.tx_id,
3502                            },
3503                        })
3504                    }
3505                    0x7a0b9f3a9bf9032d => {
3506                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3507                        let mut req = fidl::new_empty!(
3508                            NodeRemoveExtendedAttributeRequest,
3509                            fidl::encoding::DefaultFuchsiaResourceDialect
3510                        );
3511                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
3512                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3513                        Ok(DirectoryRequest::RemoveExtendedAttribute {
3514                            name: req.name,
3515
3516                            responder: DirectoryRemoveExtendedAttributeResponder {
3517                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3518                                tx_id: header.tx_id,
3519                            },
3520                        })
3521                    }
3522                    0x568ddcb9a9cbb6d9 => {
3523                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3524                        let mut req = fidl::new_empty!(
3525                            OpenableOpenRequest,
3526                            fidl::encoding::DefaultFuchsiaResourceDialect
3527                        );
3528                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3529                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3530                        Ok(DirectoryRequest::Open {
3531                            path: req.path,
3532                            flags: req.flags,
3533                            options: req.options,
3534                            object: req.object,
3535
3536                            control_handle,
3537                        })
3538                    }
3539                    0x2c5044561d685ec0 => {
3540                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3541                        let mut req = fidl::new_empty!(
3542                            DirectoryDeprecatedOpenRequest,
3543                            fidl::encoding::DefaultFuchsiaResourceDialect
3544                        );
3545                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
3546                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3547                        Ok(DirectoryRequest::DeprecatedOpen {
3548                            flags: req.flags,
3549                            mode: req.mode,
3550                            path: req.path,
3551                            object: req.object,
3552
3553                            control_handle,
3554                        })
3555                    }
3556                    0x3582806bf27faa0a => {
3557                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3558                        let mut req = fidl::new_empty!(
3559                            DirectoryReadDirentsRequest,
3560                            fidl::encoding::DefaultFuchsiaResourceDialect
3561                        );
3562                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
3563                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3564                        Ok(DirectoryRequest::ReadDirents {
3565                            max_bytes: req.max_bytes,
3566
3567                            responder: DirectoryReadDirentsResponder {
3568                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3569                                tx_id: header.tx_id,
3570                            },
3571                        })
3572                    }
3573                    0x16b1202af0f34c71 => {
3574                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3575                        let mut req = fidl::new_empty!(
3576                            fidl::encoding::EmptyPayload,
3577                            fidl::encoding::DefaultFuchsiaResourceDialect
3578                        );
3579                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3580                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3581                        Ok(DirectoryRequest::Rewind {
3582                            responder: DirectoryRewindResponder {
3583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3584                                tx_id: header.tx_id,
3585                            },
3586                        })
3587                    }
3588                    0x26ae9d18763c8655 => {
3589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3590                        let mut req = fidl::new_empty!(
3591                            fidl::encoding::EmptyPayload,
3592                            fidl::encoding::DefaultFuchsiaResourceDialect
3593                        );
3594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3595                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3596                        Ok(DirectoryRequest::GetToken {
3597                            responder: DirectoryGetTokenResponder {
3598                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3599                                tx_id: header.tx_id,
3600                            },
3601                        })
3602                    }
3603                    0x740604c0c7c930e7 => {
3604                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3605                        let mut req = fidl::new_empty!(
3606                            DirectoryLinkRequest,
3607                            fidl::encoding::DefaultFuchsiaResourceDialect
3608                        );
3609                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
3610                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3611                        Ok(DirectoryRequest::Link {
3612                            src: req.src,
3613                            dst_parent_token: req.dst_parent_token,
3614                            dst: req.dst,
3615
3616                            responder: DirectoryLinkResponder {
3617                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3618                                tx_id: header.tx_id,
3619                            },
3620                        })
3621                    }
3622                    0x750a0326a78d7bed => {
3623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3624                        let mut req = fidl::new_empty!(
3625                            DirectoryUnlinkRequest,
3626                            fidl::encoding::DefaultFuchsiaResourceDialect
3627                        );
3628                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3629                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3630                        Ok(DirectoryRequest::Unlink {
3631                            name: req.name,
3632                            options: req.options,
3633
3634                            responder: DirectoryUnlinkResponder {
3635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3636                                tx_id: header.tx_id,
3637                            },
3638                        })
3639                    }
3640                    0x7060e7723b9928de => {
3641                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3642                        let mut req = fidl::new_empty!(
3643                            DirectoryRenameRequest,
3644                            fidl::encoding::DefaultFuchsiaResourceDialect
3645                        );
3646                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
3647                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3648                        Ok(DirectoryRequest::Rename {
3649                            src: req.src,
3650                            dst_parent_token: req.dst_parent_token,
3651                            dst: req.dst,
3652
3653                            responder: DirectoryRenameResponder {
3654                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3655                                tx_id: header.tx_id,
3656                            },
3657                        })
3658                    }
3659                    0x21ce0f19ec043889 => {
3660                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3661                        let mut req = fidl::new_empty!(
3662                            DirectoryCreateSymlinkRequest,
3663                            fidl::encoding::DefaultFuchsiaResourceDialect
3664                        );
3665                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
3666                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3667                        Ok(DirectoryRequest::CreateSymlink {
3668                            name: req.name,
3669                            target: req.target,
3670                            connection: req.connection,
3671
3672                            responder: DirectoryCreateSymlinkResponder {
3673                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3674                                tx_id: header.tx_id,
3675                            },
3676                        })
3677                    }
3678                    0x5717193a59d66d91 => {
3679                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3680                        let mut req = fidl::new_empty!(
3681                            DirectoryWatchRequest,
3682                            fidl::encoding::DefaultFuchsiaResourceDialect
3683                        );
3684                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
3685                        let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
3686                        Ok(DirectoryRequest::Watch {
3687                            mask: req.mask,
3688                            options: req.options,
3689                            watcher: req.watcher,
3690
3691                            responder: DirectoryWatchResponder {
3692                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3693                                tx_id: header.tx_id,
3694                            },
3695                        })
3696                    }
3697                    _ if header.tx_id == 0
3698                        && header
3699                            .dynamic_flags()
3700                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3701                    {
3702                        Ok(DirectoryRequest::_UnknownMethod {
3703                            ordinal: header.ordinal,
3704                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3705                            method_type: fidl::MethodType::OneWay,
3706                        })
3707                    }
3708                    _ if header
3709                        .dynamic_flags()
3710                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3711                    {
3712                        this.inner.send_framework_err(
3713                            fidl::encoding::FrameworkErr::UnknownMethod,
3714                            header.tx_id,
3715                            header.ordinal,
3716                            header.dynamic_flags(),
3717                            (bytes, handles),
3718                        )?;
3719                        Ok(DirectoryRequest::_UnknownMethod {
3720                            ordinal: header.ordinal,
3721                            control_handle: DirectoryControlHandle { inner: this.inner.clone() },
3722                            method_type: fidl::MethodType::TwoWay,
3723                        })
3724                    }
3725                    _ => Err(fidl::Error::UnknownOrdinal {
3726                        ordinal: header.ordinal,
3727                        protocol_name:
3728                            <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3729                    }),
3730                }))
3731            },
3732        )
3733    }
3734}
3735
3736/// Directory defines a node which is capable of containing other Objects.
3737#[derive(Debug)]
3738pub enum DirectoryRequest {
3739    /// Acquires an advisory lock on the underlying file.
3740    ///
3741    /// The lock lasts until either this connection is closed or
3742    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
3743    /// explicitly.
3744    ///
3745    /// Advisory locks are purely advisory. They do not prevent actual read or
3746    /// write operations from occurring on the file, either through this
3747    /// connection or through other connections.
3748    ///
3749    /// This method requires the following rights:
3750    ///
3751    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
3752    /// * [`Rights.WRITE_BYTES`] if `request.type` is
3753    ///   [`AdvisoryLockType.WRITE`].
3754    ///
3755    /// # Errors
3756    ///
3757    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
3758    ///   example, another connection might hold a conflicting lock type.
3759    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
3760    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
3761    ///   to acquire the given type of lock.
3762    AdvisoryLock {
3763        request: AdvisoryLockRequest,
3764        responder: DirectoryAdvisoryLockResponder,
3765    },
3766    Clone {
3767        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3768        control_handle: DirectoryControlHandle,
3769    },
3770    /// Terminates the connection.
3771    ///
3772    /// After calling `Close`, the client must not send any other requests.
3773    ///
3774    /// Servers, after sending the status response, should close the connection
3775    /// regardless of status and without sending an epitaph.
3776    ///
3777    /// Closing the client end of the channel should be semantically equivalent
3778    /// to calling `Close` without knowing when the close has completed or its
3779    /// status.
3780    Close {
3781        responder: DirectoryCloseResponder,
3782    },
3783    Query {
3784        responder: DirectoryQueryResponder,
3785    },
3786    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
3787    DeprecatedClone {
3788        flags: OpenFlags,
3789        object: fidl::endpoints::ServerEnd<NodeMarker>,
3790        control_handle: DirectoryControlHandle,
3791    },
3792    /// DEPRECATED - Use `Node.GetAttributes` instead.
3793    DeprecatedGetAttr {
3794        responder: DirectoryDeprecatedGetAttrResponder,
3795    },
3796    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
3797    DeprecatedSetAttr {
3798        flags: NodeAttributeFlags,
3799        attributes: NodeAttributes,
3800        responder: DirectoryDeprecatedSetAttrResponder,
3801    },
3802    /// [DEPRECATED - Use new GetFlags method instead.]
3803    DeprecatedGetFlags {
3804        responder: DirectoryDeprecatedGetFlagsResponder,
3805    },
3806    /// [DEPRECATED - Use new SetFlags method instead.]
3807    DeprecatedSetFlags {
3808        flags: OpenFlags,
3809        responder: DirectoryDeprecatedSetFlagsResponder,
3810    },
3811    /// Queries the flags that apply to this node after it has been opened/created. This method does
3812    /// not require any rights.
3813    ///
3814    /// Note that the final set of flags that apply to the connection may differ from those
3815    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
3816    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
3817    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
3818    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
3819    GetFlags {
3820        responder: DirectoryGetFlagsResponder,
3821    },
3822    /// Sets the flags that apply to this node after it has been opened. This method does not
3823    /// require any rights.
3824    ///
3825    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
3826    /// clear append mode.
3827    ///
3828    /// Errors:
3829    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
3830    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
3831    SetFlags {
3832        flags: Flags,
3833        responder: DirectorySetFlagsResponder,
3834    },
3835    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
3836    /// volume has different settings or the storage is accounted seperately from the rest of the
3837    /// filesystem that may be reported instead of filesystem-wide details.
3838    QueryFilesystem {
3839        responder: DirectoryQueryFilesystemResponder,
3840    },
3841    /// Acquires information about the node.
3842    ///
3843    /// The attributes of a node should be stable, independent of the
3844    /// specific protocol used to access it.
3845    ///
3846    /// If a particular attribute is not applicable or not supported,
3847    /// filesystems should leave the corresponding field absent.
3848    ///
3849    /// + `query` a bit-mask specifying which attributes to fetch. The server
3850    ///   should not return more than necessary.
3851    /// - `attributes` the returned attributes.
3852    ///
3853    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3854    GetAttributes {
3855        query: NodeAttributesQuery,
3856        responder: DirectoryGetAttributesResponder,
3857    },
3858    /// Updates information about the node.
3859    ///
3860    /// + `attributes` the presence of a table field in `attributes` indicates
3861    /// the intent to update the corresponding attribute.
3862    ///
3863    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
3864    ///
3865    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3866    UpdateAttributes {
3867        payload: MutableNodeAttributes,
3868        responder: DirectoryUpdateAttributesResponder,
3869    },
3870    /// Synchronizes updates to the node to the underlying media, if it exists.
3871    ///
3872    /// This method will return when the filesystem server has flushed the
3873    /// relevant updates to the underlying media, but does not guarantee the
3874    /// underlying media has persisted the information, nor that any information
3875    /// is committed to hardware. Clients may use `Sync` to ensure ordering
3876    /// between operations.
3877    ///
3878    /// This method does not require any rights.
3879    Sync {
3880        responder: DirectorySyncResponder,
3881    },
3882    /// Creates an iterator over all the extended attribute names associated
3883    /// with this node. If an error occurs it is returned as an epitaph on the
3884    /// iterator request channel, and then the channel is closed.
3885    ///
3886    /// GetExtendedAttributes can be used with any of these names to retrieve
3887    /// the associated value.
3888    ///
3889    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3890    ListExtendedAttributes {
3891        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
3892        control_handle: DirectoryControlHandle,
3893    },
3894    /// Get the value associated with the given attribute `name` for this node.
3895    ///
3896    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
3897    /// particular structure is imposed on them.
3898    ///
3899    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
3900    GetExtendedAttribute {
3901        name: Vec<u8>,
3902        responder: DirectoryGetExtendedAttributeResponder,
3903    },
3904    /// Set the value for the given attribute `name` to `value` for this node.
3905    ///
3906    /// The attribute name may exist, in which case the attribute is updated.
3907    /// If the attribute doesn't exist, it is created. The name should have no
3908    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
3909    ///
3910    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3911    SetExtendedAttribute {
3912        name: Vec<u8>,
3913        value: ExtendedAttributeValue,
3914        mode: SetExtendedAttributeMode,
3915        responder: DirectorySetExtendedAttributeResponder,
3916    },
3917    /// Remove the specified extended attribute.
3918    ///
3919    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
3920    ///
3921    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
3922    RemoveExtendedAttribute {
3923        name: Vec<u8>,
3924        responder: DirectoryRemoveExtendedAttributeResponder,
3925    },
3926    /// Open (or create) a node relative to this directory. Any errors are communicated via an
3927    /// epitaph sent on the `object` channel.
3928    ///
3929    /// Errors:
3930    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
3931    /// * See [`Flags`] for other errors which may be communicated based on `flags`
3932    Open {
3933        path: String,
3934        flags: Flags,
3935        options: Options,
3936        object: fidl::Channel,
3937        control_handle: DirectoryControlHandle,
3938    },
3939    /// DEPRECATED - Use `fuchsia.io/Directory.Open` instead.
3940    DeprecatedOpen {
3941        flags: OpenFlags,
3942        mode: ModeType,
3943        path: String,
3944        object: fidl::endpoints::ServerEnd<NodeMarker>,
3945        control_handle: DirectoryControlHandle,
3946    },
3947    /// Reads a collection of variably sized dirents into a buffer.
3948    /// The number of dirents in a directory may be very large: akin to
3949    /// calling read multiple times on a file, directories have a seek
3950    /// offset which is updated on subsequent calls to ReadDirents.
3951    /// Each call to ReadDirents will only return whole dirent structures,
3952    /// they will not get split across ReadDirent calls. When the seek
3953    /// offset reaches the end, `dirents` will be empty.
3954    ///
3955    /// These dirents are of the form:
3956    /// ```
3957    /// struct dirent {
3958    ///   // Describes the inode of the entry.
3959    ///   uint64 ino;
3960    ///   // Describes the length of the dirent name in bytes.
3961    ///   uint8 size;
3962    ///   // Describes the type of the entry. Aligned with the
3963    ///   // POSIX d_type values. Use `DirentType` constants.
3964    ///   uint8 type;
3965    ///   // Unterminated name of entry.
3966    ///   char name[0];
3967    /// }
3968    /// ```
3969    ///
3970    /// This method does not require any rights, since one could always probe for
3971    /// directory contents by triggering name conflicts during file creation.
3972    ReadDirents {
3973        max_bytes: u64,
3974        responder: DirectoryReadDirentsResponder,
3975    },
3976    /// Resets the directory seek offset.
3977    ///
3978    /// This method does not require any rights, similar to ReadDirents.
3979    Rewind {
3980        responder: DirectoryRewindResponder,
3981    },
3982    /// Acquires a token to a Directory which can be used to identify access to it at a later point
3983    /// in time. The token will remain valid for as long as the connection requesting the token
3984    /// remains open.
3985    ///
3986    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
3987    /// `ZX_ERR_BAD_HANDLE`.
3988    GetToken {
3989        responder: DirectoryGetTokenResponder,
3990    },
3991    /// Creates a link to an object named src by the name dst, within a directory represented by
3992    /// token.
3993    ///
3994    /// `src` must be a resolved object name. Including "/" in the string will
3995    /// return `ZX_ERR_INVALID_ARGS`.
3996    ///
3997    /// `dst` must be a resolved object name. Including "/" in the string will
3998    /// return `ZX_ERR_INVALID_ARGS`.
3999    ///
4000    /// This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and
4001    /// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
4002    ///
4003    /// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
4004    /// there are two actors operating concurrently, and one actor performs a rename that affects
4005    /// the source within this directory, and the other does a link, each will appear to occur
4006    /// atomically in an unspecified order.
4007    Link {
4008        src: String,
4009        dst_parent_token: fidl::NullableHandle,
4010        dst: String,
4011        responder: DirectoryLinkResponder,
4012    },
4013    /// Removes a child node from the this directory's list of entries.
4014    ///
4015    /// Note: this does not guarantee that the underlying object is destroyed.
4016    /// Although the link will be removed from the containing directory,
4017    /// objects with multiple references (such as files which are still open)
4018    /// will not actually be destroyed until all references are closed.
4019    ///
4020    /// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
4021    ///   [`Rights.WRITE_BYTES`].
4022    /// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
4023    ///   support writing.
4024    /// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
4025    /// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
4026    /// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
4027    ///   containing a remote channel.
4028    /// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
4029    ///     something other than a directory was found.
4030    ///
4031    /// Other errors may be returned for filesystem-specific reasons.
4032    ///
4033    /// This method requires the following rights:
4034    ///
4035    /// * [`Rights.ENUMERATE`]
4036    /// * [`Rights.MODIFY_DIRECTORY`]
4037    Unlink {
4038        name: String,
4039        options: UnlinkOptions,
4040        responder: DirectoryUnlinkResponder,
4041    },
4042    /// Renames a node named `src` to the name `dst`, in a directory represented
4043    /// by `dst_parent_token`.
4044    ///
4045    /// `src` and `dst` must be valid node names.
4046    /// See [`Name`] for what constitutes a valid name.
4047    ///
4048    /// This method requires the following rights on both the current connection, and the connection
4049    /// identified by `dst_parent_token`:
4050    ///
4051    /// * [`Rights.ENUMERATE`]
4052    /// * [`Rights.MODIFY_DIRECTORY`]
4053    ///
4054    /// The following requirements are necessary to avoid rights escalations.
4055    ///
4056    /// If the source and destination directory differ, the source directory must also have the
4057    /// maximal set of abilities supported for files, which would typically be
4058    /// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
4059    /// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
4060    /// right.
4061    ///
4062    /// If `src` refers to a directory, and differs from the destination directory, then the source
4063    /// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
4064    ///
4065    /// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
4066    /// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
4067    Rename {
4068        src: String,
4069        dst_parent_token: fidl::Event,
4070        dst: String,
4071        responder: DirectoryRenameResponder,
4072    },
4073    /// Creates a symbolic link.
4074    ///
4075    /// `name` is the name to be given to the created symbolic link.
4076    /// `target` is the target of the symbolic link, which has no meaning on the server. The server
4077    /// will perform no validation of `target` except for a server chosen maximum length.
4078    /// `connection` is an optional server end of a channel that will speak the Symlink protocol
4079    /// on the successfully created node.
4080    ///
4081    /// * [`Rights.MODIFY_DIRECTORY`]
4082    ///
4083    /// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
4084    /// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
4085    /// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
4086    /// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
4087    CreateSymlink {
4088        name: String,
4089        target: Vec<u8>,
4090        connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4091        responder: DirectoryCreateSymlinkResponder,
4092    },
4093    /// Watches a directory, receiving events of added messages on the
4094    /// watcher request channel.
4095    ///
4096    /// Options must be zero; it is reserved.
4097    ///
4098    /// This method does not require any rights, similar to ReadDirents.
4099    Watch {
4100        mask: WatchMask,
4101        options: u32,
4102        watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4103        responder: DirectoryWatchResponder,
4104    },
4105    /// An interaction was received which does not match any known method.
4106    #[non_exhaustive]
4107    _UnknownMethod {
4108        /// Ordinal of the method that was called.
4109        ordinal: u64,
4110        control_handle: DirectoryControlHandle,
4111        method_type: fidl::MethodType,
4112    },
4113}
4114
4115impl DirectoryRequest {
4116    #[allow(irrefutable_let_patterns)]
4117    pub fn into_advisory_lock(
4118        self,
4119    ) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
4120        if let DirectoryRequest::AdvisoryLock { request, responder } = self {
4121            Some((request, responder))
4122        } else {
4123            None
4124        }
4125    }
4126
4127    #[allow(irrefutable_let_patterns)]
4128    pub fn into_clone(
4129        self,
4130    ) -> Option<(
4131        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4132        DirectoryControlHandle,
4133    )> {
4134        if let DirectoryRequest::Clone { request, control_handle } = self {
4135            Some((request, control_handle))
4136        } else {
4137            None
4138        }
4139    }
4140
4141    #[allow(irrefutable_let_patterns)]
4142    pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
4143        if let DirectoryRequest::Close { responder } = self { Some((responder)) } else { None }
4144    }
4145
4146    #[allow(irrefutable_let_patterns)]
4147    pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
4148        if let DirectoryRequest::Query { responder } = self { Some((responder)) } else { None }
4149    }
4150
4151    #[allow(irrefutable_let_patterns)]
4152    pub fn into_deprecated_clone(
4153        self,
4154    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
4155        if let DirectoryRequest::DeprecatedClone { flags, object, control_handle } = self {
4156            Some((flags, object, control_handle))
4157        } else {
4158            None
4159        }
4160    }
4161
4162    #[allow(irrefutable_let_patterns)]
4163    pub fn into_deprecated_get_attr(self) -> Option<(DirectoryDeprecatedGetAttrResponder)> {
4164        if let DirectoryRequest::DeprecatedGetAttr { responder } = self {
4165            Some((responder))
4166        } else {
4167            None
4168        }
4169    }
4170
4171    #[allow(irrefutable_let_patterns)]
4172    pub fn into_deprecated_set_attr(
4173        self,
4174    ) -> Option<(NodeAttributeFlags, NodeAttributes, DirectoryDeprecatedSetAttrResponder)> {
4175        if let DirectoryRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
4176            Some((flags, attributes, responder))
4177        } else {
4178            None
4179        }
4180    }
4181
4182    #[allow(irrefutable_let_patterns)]
4183    pub fn into_deprecated_get_flags(self) -> Option<(DirectoryDeprecatedGetFlagsResponder)> {
4184        if let DirectoryRequest::DeprecatedGetFlags { responder } = self {
4185            Some((responder))
4186        } else {
4187            None
4188        }
4189    }
4190
4191    #[allow(irrefutable_let_patterns)]
4192    pub fn into_deprecated_set_flags(
4193        self,
4194    ) -> Option<(OpenFlags, DirectoryDeprecatedSetFlagsResponder)> {
4195        if let DirectoryRequest::DeprecatedSetFlags { flags, responder } = self {
4196            Some((flags, responder))
4197        } else {
4198            None
4199        }
4200    }
4201
4202    #[allow(irrefutable_let_patterns)]
4203    pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
4204        if let DirectoryRequest::GetFlags { responder } = self { Some((responder)) } else { None }
4205    }
4206
4207    #[allow(irrefutable_let_patterns)]
4208    pub fn into_set_flags(self) -> Option<(Flags, DirectorySetFlagsResponder)> {
4209        if let DirectoryRequest::SetFlags { flags, responder } = self {
4210            Some((flags, responder))
4211        } else {
4212            None
4213        }
4214    }
4215
4216    #[allow(irrefutable_let_patterns)]
4217    pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
4218        if let DirectoryRequest::QueryFilesystem { responder } = self {
4219            Some((responder))
4220        } else {
4221            None
4222        }
4223    }
4224
4225    #[allow(irrefutable_let_patterns)]
4226    pub fn into_get_attributes(
4227        self,
4228    ) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
4229        if let DirectoryRequest::GetAttributes { query, responder } = self {
4230            Some((query, responder))
4231        } else {
4232            None
4233        }
4234    }
4235
4236    #[allow(irrefutable_let_patterns)]
4237    pub fn into_update_attributes(
4238        self,
4239    ) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
4240        if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
4241            Some((payload, responder))
4242        } else {
4243            None
4244        }
4245    }
4246
4247    #[allow(irrefutable_let_patterns)]
4248    pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
4249        if let DirectoryRequest::Sync { responder } = self { Some((responder)) } else { None }
4250    }
4251
4252    #[allow(irrefutable_let_patterns)]
4253    pub fn into_list_extended_attributes(
4254        self,
4255    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
4256    {
4257        if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
4258            Some((iterator, control_handle))
4259        } else {
4260            None
4261        }
4262    }
4263
4264    #[allow(irrefutable_let_patterns)]
4265    pub fn into_get_extended_attribute(
4266        self,
4267    ) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
4268        if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
4269            Some((name, responder))
4270        } else {
4271            None
4272        }
4273    }
4274
4275    #[allow(irrefutable_let_patterns)]
4276    pub fn into_set_extended_attribute(
4277        self,
4278    ) -> Option<(
4279        Vec<u8>,
4280        ExtendedAttributeValue,
4281        SetExtendedAttributeMode,
4282        DirectorySetExtendedAttributeResponder,
4283    )> {
4284        if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
4285            Some((name, value, mode, responder))
4286        } else {
4287            None
4288        }
4289    }
4290
4291    #[allow(irrefutable_let_patterns)]
4292    pub fn into_remove_extended_attribute(
4293        self,
4294    ) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
4295        if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
4296            Some((name, responder))
4297        } else {
4298            None
4299        }
4300    }
4301
4302    #[allow(irrefutable_let_patterns)]
4303    pub fn into_open(
4304        self,
4305    ) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
4306        if let DirectoryRequest::Open { path, flags, options, object, control_handle } = self {
4307            Some((path, flags, options, object, control_handle))
4308        } else {
4309            None
4310        }
4311    }
4312
4313    #[allow(irrefutable_let_patterns)]
4314    pub fn into_deprecated_open(
4315        self,
4316    ) -> Option<(
4317        OpenFlags,
4318        ModeType,
4319        String,
4320        fidl::endpoints::ServerEnd<NodeMarker>,
4321        DirectoryControlHandle,
4322    )> {
4323        if let DirectoryRequest::DeprecatedOpen { flags, mode, path, object, control_handle } = self
4324        {
4325            Some((flags, mode, path, object, control_handle))
4326        } else {
4327            None
4328        }
4329    }
4330
4331    #[allow(irrefutable_let_patterns)]
4332    pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
4333        if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
4334            Some((max_bytes, responder))
4335        } else {
4336            None
4337        }
4338    }
4339
4340    #[allow(irrefutable_let_patterns)]
4341    pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
4342        if let DirectoryRequest::Rewind { responder } = self { Some((responder)) } else { None }
4343    }
4344
4345    #[allow(irrefutable_let_patterns)]
4346    pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
4347        if let DirectoryRequest::GetToken { responder } = self { Some((responder)) } else { None }
4348    }
4349
4350    #[allow(irrefutable_let_patterns)]
4351    pub fn into_link(
4352        self,
4353    ) -> Option<(String, fidl::NullableHandle, String, DirectoryLinkResponder)> {
4354        if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
4355            Some((src, dst_parent_token, dst, responder))
4356        } else {
4357            None
4358        }
4359    }
4360
4361    #[allow(irrefutable_let_patterns)]
4362    pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
4363        if let DirectoryRequest::Unlink { name, options, responder } = self {
4364            Some((name, options, responder))
4365        } else {
4366            None
4367        }
4368    }
4369
4370    #[allow(irrefutable_let_patterns)]
4371    pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
4372        if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
4373            Some((src, dst_parent_token, dst, responder))
4374        } else {
4375            None
4376        }
4377    }
4378
4379    #[allow(irrefutable_let_patterns)]
4380    pub fn into_create_symlink(
4381        self,
4382    ) -> Option<(
4383        String,
4384        Vec<u8>,
4385        Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
4386        DirectoryCreateSymlinkResponder,
4387    )> {
4388        if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
4389            Some((name, target, connection, responder))
4390        } else {
4391            None
4392        }
4393    }
4394
4395    #[allow(irrefutable_let_patterns)]
4396    pub fn into_watch(
4397        self,
4398    ) -> Option<(
4399        WatchMask,
4400        u32,
4401        fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
4402        DirectoryWatchResponder,
4403    )> {
4404        if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
4405            Some((mask, options, watcher, responder))
4406        } else {
4407            None
4408        }
4409    }
4410
4411    /// Name of the method defined in FIDL
4412    pub fn method_name(&self) -> &'static str {
4413        match *self {
4414            DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
4415            DirectoryRequest::Clone { .. } => "clone",
4416            DirectoryRequest::Close { .. } => "close",
4417            DirectoryRequest::Query { .. } => "query",
4418            DirectoryRequest::DeprecatedClone { .. } => "deprecated_clone",
4419            DirectoryRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
4420            DirectoryRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
4421            DirectoryRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
4422            DirectoryRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
4423            DirectoryRequest::GetFlags { .. } => "get_flags",
4424            DirectoryRequest::SetFlags { .. } => "set_flags",
4425            DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
4426            DirectoryRequest::GetAttributes { .. } => "get_attributes",
4427            DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
4428            DirectoryRequest::Sync { .. } => "sync",
4429            DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
4430            DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
4431            DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
4432            DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
4433            DirectoryRequest::Open { .. } => "open",
4434            DirectoryRequest::DeprecatedOpen { .. } => "deprecated_open",
4435            DirectoryRequest::ReadDirents { .. } => "read_dirents",
4436            DirectoryRequest::Rewind { .. } => "rewind",
4437            DirectoryRequest::GetToken { .. } => "get_token",
4438            DirectoryRequest::Link { .. } => "link",
4439            DirectoryRequest::Unlink { .. } => "unlink",
4440            DirectoryRequest::Rename { .. } => "rename",
4441            DirectoryRequest::CreateSymlink { .. } => "create_symlink",
4442            DirectoryRequest::Watch { .. } => "watch",
4443            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4444                "unknown one-way method"
4445            }
4446            DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4447                "unknown two-way method"
4448            }
4449        }
4450    }
4451}
4452
4453#[derive(Debug, Clone)]
4454pub struct DirectoryControlHandle {
4455    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4456}
4457
4458impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
4459    fn shutdown(&self) {
4460        self.inner.shutdown()
4461    }
4462
4463    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4464        self.inner.shutdown_with_epitaph(status)
4465    }
4466
4467    fn is_closed(&self) -> bool {
4468        self.inner.channel().is_closed()
4469    }
4470    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4471        self.inner.channel().on_closed()
4472    }
4473
4474    #[cfg(target_os = "fuchsia")]
4475    fn signal_peer(
4476        &self,
4477        clear_mask: zx::Signals,
4478        set_mask: zx::Signals,
4479    ) -> Result<(), zx_status::Status> {
4480        use fidl::Peered;
4481        self.inner.channel().signal_peer(clear_mask, set_mask)
4482    }
4483}
4484
4485impl DirectoryControlHandle {
4486    pub fn send_on_open_(
4487        &self,
4488        mut s: i32,
4489        mut info: Option<NodeInfoDeprecated>,
4490    ) -> Result<(), fidl::Error> {
4491        self.inner.send::<NodeOnOpenRequest>(
4492            (s, info.as_mut()),
4493            0,
4494            0x7fc7bbb1dbfd1972,
4495            fidl::encoding::DynamicFlags::FLEXIBLE,
4496        )
4497    }
4498
4499    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
4500        self.inner.send::<Representation>(
4501            &mut payload,
4502            0,
4503            0x5cb40567d80a510c,
4504            fidl::encoding::DynamicFlags::empty(),
4505        )
4506    }
4507}
4508
4509#[must_use = "FIDL methods require a response to be sent"]
4510#[derive(Debug)]
4511pub struct DirectoryAdvisoryLockResponder {
4512    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4513    tx_id: u32,
4514}
4515
4516/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4517/// if the responder is dropped without sending a response, so that the client
4518/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4519impl std::ops::Drop for DirectoryAdvisoryLockResponder {
4520    fn drop(&mut self) {
4521        self.control_handle.shutdown();
4522        // Safety: drops once, never accessed again
4523        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4524    }
4525}
4526
4527impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
4528    type ControlHandle = DirectoryControlHandle;
4529
4530    fn control_handle(&self) -> &DirectoryControlHandle {
4531        &self.control_handle
4532    }
4533
4534    fn drop_without_shutdown(mut self) {
4535        // Safety: drops once, never accessed again due to mem::forget
4536        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4537        // Prevent Drop from running (which would shut down the channel)
4538        std::mem::forget(self);
4539    }
4540}
4541
4542impl DirectoryAdvisoryLockResponder {
4543    /// Sends a response to the FIDL transaction.
4544    ///
4545    /// Sets the channel to shutdown if an error occurs.
4546    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4547        let _result = self.send_raw(result);
4548        if _result.is_err() {
4549            self.control_handle.shutdown();
4550        }
4551        self.drop_without_shutdown();
4552        _result
4553    }
4554
4555    /// Similar to "send" but does not shutdown the channel if an error occurs.
4556    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4557        let _result = self.send_raw(result);
4558        self.drop_without_shutdown();
4559        _result
4560    }
4561
4562    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4563        self.control_handle
4564            .inner
4565            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4566                result,
4567                self.tx_id,
4568                0x6ee9c0ad53ec87aa,
4569                fidl::encoding::DynamicFlags::empty(),
4570            )
4571    }
4572}
4573
4574#[must_use = "FIDL methods require a response to be sent"]
4575#[derive(Debug)]
4576pub struct DirectoryCloseResponder {
4577    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4578    tx_id: u32,
4579}
4580
4581/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4582/// if the responder is dropped without sending a response, so that the client
4583/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4584impl std::ops::Drop for DirectoryCloseResponder {
4585    fn drop(&mut self) {
4586        self.control_handle.shutdown();
4587        // Safety: drops once, never accessed again
4588        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4589    }
4590}
4591
4592impl fidl::endpoints::Responder for DirectoryCloseResponder {
4593    type ControlHandle = DirectoryControlHandle;
4594
4595    fn control_handle(&self) -> &DirectoryControlHandle {
4596        &self.control_handle
4597    }
4598
4599    fn drop_without_shutdown(mut self) {
4600        // Safety: drops once, never accessed again due to mem::forget
4601        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4602        // Prevent Drop from running (which would shut down the channel)
4603        std::mem::forget(self);
4604    }
4605}
4606
4607impl DirectoryCloseResponder {
4608    /// Sends a response to the FIDL transaction.
4609    ///
4610    /// Sets the channel to shutdown if an error occurs.
4611    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4612        let _result = self.send_raw(result);
4613        if _result.is_err() {
4614            self.control_handle.shutdown();
4615        }
4616        self.drop_without_shutdown();
4617        _result
4618    }
4619
4620    /// Similar to "send" but does not shutdown the channel if an error occurs.
4621    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4622        let _result = self.send_raw(result);
4623        self.drop_without_shutdown();
4624        _result
4625    }
4626
4627    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4628        self.control_handle
4629            .inner
4630            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4631                result,
4632                self.tx_id,
4633                0x5ac5d459ad7f657e,
4634                fidl::encoding::DynamicFlags::empty(),
4635            )
4636    }
4637}
4638
4639#[must_use = "FIDL methods require a response to be sent"]
4640#[derive(Debug)]
4641pub struct DirectoryQueryResponder {
4642    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4643    tx_id: u32,
4644}
4645
4646/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4647/// if the responder is dropped without sending a response, so that the client
4648/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4649impl std::ops::Drop for DirectoryQueryResponder {
4650    fn drop(&mut self) {
4651        self.control_handle.shutdown();
4652        // Safety: drops once, never accessed again
4653        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4654    }
4655}
4656
4657impl fidl::endpoints::Responder for DirectoryQueryResponder {
4658    type ControlHandle = DirectoryControlHandle;
4659
4660    fn control_handle(&self) -> &DirectoryControlHandle {
4661        &self.control_handle
4662    }
4663
4664    fn drop_without_shutdown(mut self) {
4665        // Safety: drops once, never accessed again due to mem::forget
4666        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4667        // Prevent Drop from running (which would shut down the channel)
4668        std::mem::forget(self);
4669    }
4670}
4671
4672impl DirectoryQueryResponder {
4673    /// Sends a response to the FIDL transaction.
4674    ///
4675    /// Sets the channel to shutdown if an error occurs.
4676    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4677        let _result = self.send_raw(protocol);
4678        if _result.is_err() {
4679            self.control_handle.shutdown();
4680        }
4681        self.drop_without_shutdown();
4682        _result
4683    }
4684
4685    /// Similar to "send" but does not shutdown the channel if an error occurs.
4686    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4687        let _result = self.send_raw(protocol);
4688        self.drop_without_shutdown();
4689        _result
4690    }
4691
4692    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4693        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4694            (protocol,),
4695            self.tx_id,
4696            0x2658edee9decfc06,
4697            fidl::encoding::DynamicFlags::empty(),
4698        )
4699    }
4700}
4701
4702#[must_use = "FIDL methods require a response to be sent"]
4703#[derive(Debug)]
4704pub struct DirectoryDeprecatedGetAttrResponder {
4705    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4706    tx_id: u32,
4707}
4708
4709/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4710/// if the responder is dropped without sending a response, so that the client
4711/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4712impl std::ops::Drop for DirectoryDeprecatedGetAttrResponder {
4713    fn drop(&mut self) {
4714        self.control_handle.shutdown();
4715        // Safety: drops once, never accessed again
4716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4717    }
4718}
4719
4720impl fidl::endpoints::Responder for DirectoryDeprecatedGetAttrResponder {
4721    type ControlHandle = DirectoryControlHandle;
4722
4723    fn control_handle(&self) -> &DirectoryControlHandle {
4724        &self.control_handle
4725    }
4726
4727    fn drop_without_shutdown(mut self) {
4728        // Safety: drops once, never accessed again due to mem::forget
4729        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4730        // Prevent Drop from running (which would shut down the channel)
4731        std::mem::forget(self);
4732    }
4733}
4734
4735impl DirectoryDeprecatedGetAttrResponder {
4736    /// Sends a response to the FIDL transaction.
4737    ///
4738    /// Sets the channel to shutdown if an error occurs.
4739    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4740        let _result = self.send_raw(s, attributes);
4741        if _result.is_err() {
4742            self.control_handle.shutdown();
4743        }
4744        self.drop_without_shutdown();
4745        _result
4746    }
4747
4748    /// Similar to "send" but does not shutdown the channel if an error occurs.
4749    pub fn send_no_shutdown_on_err(
4750        self,
4751        mut s: i32,
4752        mut attributes: &NodeAttributes,
4753    ) -> Result<(), fidl::Error> {
4754        let _result = self.send_raw(s, attributes);
4755        self.drop_without_shutdown();
4756        _result
4757    }
4758
4759    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
4760        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
4761            (s, attributes),
4762            self.tx_id,
4763            0x78985e216314dafd,
4764            fidl::encoding::DynamicFlags::empty(),
4765        )
4766    }
4767}
4768
4769#[must_use = "FIDL methods require a response to be sent"]
4770#[derive(Debug)]
4771pub struct DirectoryDeprecatedSetAttrResponder {
4772    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4773    tx_id: u32,
4774}
4775
4776/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4777/// if the responder is dropped without sending a response, so that the client
4778/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4779impl std::ops::Drop for DirectoryDeprecatedSetAttrResponder {
4780    fn drop(&mut self) {
4781        self.control_handle.shutdown();
4782        // Safety: drops once, never accessed again
4783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4784    }
4785}
4786
4787impl fidl::endpoints::Responder for DirectoryDeprecatedSetAttrResponder {
4788    type ControlHandle = DirectoryControlHandle;
4789
4790    fn control_handle(&self) -> &DirectoryControlHandle {
4791        &self.control_handle
4792    }
4793
4794    fn drop_without_shutdown(mut self) {
4795        // Safety: drops once, never accessed again due to mem::forget
4796        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4797        // Prevent Drop from running (which would shut down the channel)
4798        std::mem::forget(self);
4799    }
4800}
4801
4802impl DirectoryDeprecatedSetAttrResponder {
4803    /// Sends a response to the FIDL transaction.
4804    ///
4805    /// Sets the channel to shutdown if an error occurs.
4806    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4807        let _result = self.send_raw(s);
4808        if _result.is_err() {
4809            self.control_handle.shutdown();
4810        }
4811        self.drop_without_shutdown();
4812        _result
4813    }
4814
4815    /// Similar to "send" but does not shutdown the channel if an error occurs.
4816    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4817        let _result = self.send_raw(s);
4818        self.drop_without_shutdown();
4819        _result
4820    }
4821
4822    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4823        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
4824            (s,),
4825            self.tx_id,
4826            0x4186c0f40d938f46,
4827            fidl::encoding::DynamicFlags::empty(),
4828        )
4829    }
4830}
4831
4832#[must_use = "FIDL methods require a response to be sent"]
4833#[derive(Debug)]
4834pub struct DirectoryDeprecatedGetFlagsResponder {
4835    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4836    tx_id: u32,
4837}
4838
4839/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4840/// if the responder is dropped without sending a response, so that the client
4841/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4842impl std::ops::Drop for DirectoryDeprecatedGetFlagsResponder {
4843    fn drop(&mut self) {
4844        self.control_handle.shutdown();
4845        // Safety: drops once, never accessed again
4846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4847    }
4848}
4849
4850impl fidl::endpoints::Responder for DirectoryDeprecatedGetFlagsResponder {
4851    type ControlHandle = DirectoryControlHandle;
4852
4853    fn control_handle(&self) -> &DirectoryControlHandle {
4854        &self.control_handle
4855    }
4856
4857    fn drop_without_shutdown(mut self) {
4858        // Safety: drops once, never accessed again due to mem::forget
4859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4860        // Prevent Drop from running (which would shut down the channel)
4861        std::mem::forget(self);
4862    }
4863}
4864
4865impl DirectoryDeprecatedGetFlagsResponder {
4866    /// Sends a response to the FIDL transaction.
4867    ///
4868    /// Sets the channel to shutdown if an error occurs.
4869    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4870        let _result = self.send_raw(s, flags);
4871        if _result.is_err() {
4872            self.control_handle.shutdown();
4873        }
4874        self.drop_without_shutdown();
4875        _result
4876    }
4877
4878    /// Similar to "send" but does not shutdown the channel if an error occurs.
4879    pub fn send_no_shutdown_on_err(
4880        self,
4881        mut s: i32,
4882        mut flags: OpenFlags,
4883    ) -> Result<(), fidl::Error> {
4884        let _result = self.send_raw(s, flags);
4885        self.drop_without_shutdown();
4886        _result
4887    }
4888
4889    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
4890        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
4891            (s, flags),
4892            self.tx_id,
4893            0x5b88fffb8eda3aa1,
4894            fidl::encoding::DynamicFlags::empty(),
4895        )
4896    }
4897}
4898
4899#[must_use = "FIDL methods require a response to be sent"]
4900#[derive(Debug)]
4901pub struct DirectoryDeprecatedSetFlagsResponder {
4902    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4903    tx_id: u32,
4904}
4905
4906/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4907/// if the responder is dropped without sending a response, so that the client
4908/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4909impl std::ops::Drop for DirectoryDeprecatedSetFlagsResponder {
4910    fn drop(&mut self) {
4911        self.control_handle.shutdown();
4912        // Safety: drops once, never accessed again
4913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4914    }
4915}
4916
4917impl fidl::endpoints::Responder for DirectoryDeprecatedSetFlagsResponder {
4918    type ControlHandle = DirectoryControlHandle;
4919
4920    fn control_handle(&self) -> &DirectoryControlHandle {
4921        &self.control_handle
4922    }
4923
4924    fn drop_without_shutdown(mut self) {
4925        // Safety: drops once, never accessed again due to mem::forget
4926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4927        // Prevent Drop from running (which would shut down the channel)
4928        std::mem::forget(self);
4929    }
4930}
4931
4932impl DirectoryDeprecatedSetFlagsResponder {
4933    /// Sends a response to the FIDL transaction.
4934    ///
4935    /// Sets the channel to shutdown if an error occurs.
4936    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
4937        let _result = self.send_raw(s);
4938        if _result.is_err() {
4939            self.control_handle.shutdown();
4940        }
4941        self.drop_without_shutdown();
4942        _result
4943    }
4944
4945    /// Similar to "send" but does not shutdown the channel if an error occurs.
4946    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
4947        let _result = self.send_raw(s);
4948        self.drop_without_shutdown();
4949        _result
4950    }
4951
4952    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
4953        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
4954            (s,),
4955            self.tx_id,
4956            0x5295b76c71fde733,
4957            fidl::encoding::DynamicFlags::empty(),
4958        )
4959    }
4960}
4961
4962#[must_use = "FIDL methods require a response to be sent"]
4963#[derive(Debug)]
4964pub struct DirectoryGetFlagsResponder {
4965    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
4966    tx_id: u32,
4967}
4968
4969/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
4970/// if the responder is dropped without sending a response, so that the client
4971/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4972impl std::ops::Drop for DirectoryGetFlagsResponder {
4973    fn drop(&mut self) {
4974        self.control_handle.shutdown();
4975        // Safety: drops once, never accessed again
4976        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4977    }
4978}
4979
4980impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
4981    type ControlHandle = DirectoryControlHandle;
4982
4983    fn control_handle(&self) -> &DirectoryControlHandle {
4984        &self.control_handle
4985    }
4986
4987    fn drop_without_shutdown(mut self) {
4988        // Safety: drops once, never accessed again due to mem::forget
4989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4990        // Prevent Drop from running (which would shut down the channel)
4991        std::mem::forget(self);
4992    }
4993}
4994
4995impl DirectoryGetFlagsResponder {
4996    /// Sends a response to the FIDL transaction.
4997    ///
4998    /// Sets the channel to shutdown if an error occurs.
4999    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5000        let _result = self.send_raw(result);
5001        if _result.is_err() {
5002            self.control_handle.shutdown();
5003        }
5004        self.drop_without_shutdown();
5005        _result
5006    }
5007
5008    /// Similar to "send" but does not shutdown the channel if an error occurs.
5009    pub fn send_no_shutdown_on_err(
5010        self,
5011        mut result: Result<Flags, i32>,
5012    ) -> Result<(), fidl::Error> {
5013        let _result = self.send_raw(result);
5014        self.drop_without_shutdown();
5015        _result
5016    }
5017
5018    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
5019        self.control_handle
5020            .inner
5021            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
5022                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
5023                self.tx_id,
5024                0x176eb318f64ec23,
5025                fidl::encoding::DynamicFlags::FLEXIBLE,
5026            )
5027    }
5028}
5029
5030#[must_use = "FIDL methods require a response to be sent"]
5031#[derive(Debug)]
5032pub struct DirectorySetFlagsResponder {
5033    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5034    tx_id: u32,
5035}
5036
5037/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5038/// if the responder is dropped without sending a response, so that the client
5039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5040impl std::ops::Drop for DirectorySetFlagsResponder {
5041    fn drop(&mut self) {
5042        self.control_handle.shutdown();
5043        // Safety: drops once, never accessed again
5044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5045    }
5046}
5047
5048impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
5049    type ControlHandle = DirectoryControlHandle;
5050
5051    fn control_handle(&self) -> &DirectoryControlHandle {
5052        &self.control_handle
5053    }
5054
5055    fn drop_without_shutdown(mut self) {
5056        // Safety: drops once, never accessed again due to mem::forget
5057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5058        // Prevent Drop from running (which would shut down the channel)
5059        std::mem::forget(self);
5060    }
5061}
5062
5063impl DirectorySetFlagsResponder {
5064    /// Sends a response to the FIDL transaction.
5065    ///
5066    /// Sets the channel to shutdown if an error occurs.
5067    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5068        let _result = self.send_raw(result);
5069        if _result.is_err() {
5070            self.control_handle.shutdown();
5071        }
5072        self.drop_without_shutdown();
5073        _result
5074    }
5075
5076    /// Similar to "send" but does not shutdown the channel if an error occurs.
5077    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5078        let _result = self.send_raw(result);
5079        self.drop_without_shutdown();
5080        _result
5081    }
5082
5083    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5084        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5085            fidl::encoding::EmptyStruct,
5086            i32,
5087        >>(
5088            fidl::encoding::FlexibleResult::new(result),
5089            self.tx_id,
5090            0x55a8028685791ea8,
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 DirectoryQueryFilesystemResponder {
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 DirectoryQueryFilesystemResponder {
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 DirectoryQueryFilesystemResponder {
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 DirectoryQueryFilesystemResponder {
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 s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5134        let _result = self.send_raw(s, info);
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(
5144        self,
5145        mut s: i32,
5146        mut info: Option<&FilesystemInfo>,
5147    ) -> Result<(), fidl::Error> {
5148        let _result = self.send_raw(s, info);
5149        self.drop_without_shutdown();
5150        _result
5151    }
5152
5153    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
5154        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
5155            (s, info),
5156            self.tx_id,
5157            0x6f344a1c6b0a0610,
5158            fidl::encoding::DynamicFlags::empty(),
5159        )
5160    }
5161}
5162
5163#[must_use = "FIDL methods require a response to be sent"]
5164#[derive(Debug)]
5165pub struct DirectoryGetAttributesResponder {
5166    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5167    tx_id: u32,
5168}
5169
5170/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5171/// if the responder is dropped without sending a response, so that the client
5172/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5173impl std::ops::Drop for DirectoryGetAttributesResponder {
5174    fn drop(&mut self) {
5175        self.control_handle.shutdown();
5176        // Safety: drops once, never accessed again
5177        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5178    }
5179}
5180
5181impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
5182    type ControlHandle = DirectoryControlHandle;
5183
5184    fn control_handle(&self) -> &DirectoryControlHandle {
5185        &self.control_handle
5186    }
5187
5188    fn drop_without_shutdown(mut self) {
5189        // Safety: drops once, never accessed again due to mem::forget
5190        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5191        // Prevent Drop from running (which would shut down the channel)
5192        std::mem::forget(self);
5193    }
5194}
5195
5196impl DirectoryGetAttributesResponder {
5197    /// Sends a response to the FIDL transaction.
5198    ///
5199    /// Sets the channel to shutdown if an error occurs.
5200    pub fn send(
5201        self,
5202        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5203    ) -> Result<(), fidl::Error> {
5204        let _result = self.send_raw(result);
5205        if _result.is_err() {
5206            self.control_handle.shutdown();
5207        }
5208        self.drop_without_shutdown();
5209        _result
5210    }
5211
5212    /// Similar to "send" but does not shutdown the channel if an error occurs.
5213    pub fn send_no_shutdown_on_err(
5214        self,
5215        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5216    ) -> Result<(), fidl::Error> {
5217        let _result = self.send_raw(result);
5218        self.drop_without_shutdown();
5219        _result
5220    }
5221
5222    fn send_raw(
5223        &self,
5224        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
5225    ) -> Result<(), fidl::Error> {
5226        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
5227            result,
5228            self.tx_id,
5229            0x3d4396a638ea053b,
5230            fidl::encoding::DynamicFlags::empty(),
5231        )
5232    }
5233}
5234
5235#[must_use = "FIDL methods require a response to be sent"]
5236#[derive(Debug)]
5237pub struct DirectoryUpdateAttributesResponder {
5238    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5239    tx_id: u32,
5240}
5241
5242/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5243/// if the responder is dropped without sending a response, so that the client
5244/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5245impl std::ops::Drop for DirectoryUpdateAttributesResponder {
5246    fn drop(&mut self) {
5247        self.control_handle.shutdown();
5248        // Safety: drops once, never accessed again
5249        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5250    }
5251}
5252
5253impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
5254    type ControlHandle = DirectoryControlHandle;
5255
5256    fn control_handle(&self) -> &DirectoryControlHandle {
5257        &self.control_handle
5258    }
5259
5260    fn drop_without_shutdown(mut self) {
5261        // Safety: drops once, never accessed again due to mem::forget
5262        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5263        // Prevent Drop from running (which would shut down the channel)
5264        std::mem::forget(self);
5265    }
5266}
5267
5268impl DirectoryUpdateAttributesResponder {
5269    /// Sends a response to the FIDL transaction.
5270    ///
5271    /// Sets the channel to shutdown if an error occurs.
5272    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5273        let _result = self.send_raw(result);
5274        if _result.is_err() {
5275            self.control_handle.shutdown();
5276        }
5277        self.drop_without_shutdown();
5278        _result
5279    }
5280
5281    /// Similar to "send" but does not shutdown the channel if an error occurs.
5282    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5283        let _result = self.send_raw(result);
5284        self.drop_without_shutdown();
5285        _result
5286    }
5287
5288    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5289        self.control_handle
5290            .inner
5291            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5292                result,
5293                self.tx_id,
5294                0x3308c1da5a89bf08,
5295                fidl::encoding::DynamicFlags::empty(),
5296            )
5297    }
5298}
5299
5300#[must_use = "FIDL methods require a response to be sent"]
5301#[derive(Debug)]
5302pub struct DirectorySyncResponder {
5303    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5304    tx_id: u32,
5305}
5306
5307/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5308/// if the responder is dropped without sending a response, so that the client
5309/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5310impl std::ops::Drop for DirectorySyncResponder {
5311    fn drop(&mut self) {
5312        self.control_handle.shutdown();
5313        // Safety: drops once, never accessed again
5314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5315    }
5316}
5317
5318impl fidl::endpoints::Responder for DirectorySyncResponder {
5319    type ControlHandle = DirectoryControlHandle;
5320
5321    fn control_handle(&self) -> &DirectoryControlHandle {
5322        &self.control_handle
5323    }
5324
5325    fn drop_without_shutdown(mut self) {
5326        // Safety: drops once, never accessed again due to mem::forget
5327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5328        // Prevent Drop from running (which would shut down the channel)
5329        std::mem::forget(self);
5330    }
5331}
5332
5333impl DirectorySyncResponder {
5334    /// Sends a response to the FIDL transaction.
5335    ///
5336    /// Sets the channel to shutdown if an error occurs.
5337    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5338        let _result = self.send_raw(result);
5339        if _result.is_err() {
5340            self.control_handle.shutdown();
5341        }
5342        self.drop_without_shutdown();
5343        _result
5344    }
5345
5346    /// Similar to "send" but does not shutdown the channel if an error occurs.
5347    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5348        let _result = self.send_raw(result);
5349        self.drop_without_shutdown();
5350        _result
5351    }
5352
5353    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5354        self.control_handle
5355            .inner
5356            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5357                result,
5358                self.tx_id,
5359                0x2c5c27ca0ab5dc49,
5360                fidl::encoding::DynamicFlags::empty(),
5361            )
5362    }
5363}
5364
5365#[must_use = "FIDL methods require a response to be sent"]
5366#[derive(Debug)]
5367pub struct DirectoryGetExtendedAttributeResponder {
5368    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5369    tx_id: u32,
5370}
5371
5372/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5373/// if the responder is dropped without sending a response, so that the client
5374/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5375impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
5376    fn drop(&mut self) {
5377        self.control_handle.shutdown();
5378        // Safety: drops once, never accessed again
5379        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5380    }
5381}
5382
5383impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
5384    type ControlHandle = DirectoryControlHandle;
5385
5386    fn control_handle(&self) -> &DirectoryControlHandle {
5387        &self.control_handle
5388    }
5389
5390    fn drop_without_shutdown(mut self) {
5391        // Safety: drops once, never accessed again due to mem::forget
5392        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5393        // Prevent Drop from running (which would shut down the channel)
5394        std::mem::forget(self);
5395    }
5396}
5397
5398impl DirectoryGetExtendedAttributeResponder {
5399    /// Sends a response to the FIDL transaction.
5400    ///
5401    /// Sets the channel to shutdown if an error occurs.
5402    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5403        let _result = self.send_raw(result);
5404        if _result.is_err() {
5405            self.control_handle.shutdown();
5406        }
5407        self.drop_without_shutdown();
5408        _result
5409    }
5410
5411    /// Similar to "send" but does not shutdown the channel if an error occurs.
5412    pub fn send_no_shutdown_on_err(
5413        self,
5414        mut result: Result<ExtendedAttributeValue, i32>,
5415    ) -> Result<(), fidl::Error> {
5416        let _result = self.send_raw(result);
5417        self.drop_without_shutdown();
5418        _result
5419    }
5420
5421    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
5422        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
5423            result.as_mut().map_err(|e| *e),
5424            self.tx_id,
5425            0x45ffa3ccfdeb76db,
5426            fidl::encoding::DynamicFlags::empty(),
5427        )
5428    }
5429}
5430
5431#[must_use = "FIDL methods require a response to be sent"]
5432#[derive(Debug)]
5433pub struct DirectorySetExtendedAttributeResponder {
5434    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5435    tx_id: u32,
5436}
5437
5438/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5439/// if the responder is dropped without sending a response, so that the client
5440/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5441impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
5442    fn drop(&mut self) {
5443        self.control_handle.shutdown();
5444        // Safety: drops once, never accessed again
5445        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5446    }
5447}
5448
5449impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
5450    type ControlHandle = DirectoryControlHandle;
5451
5452    fn control_handle(&self) -> &DirectoryControlHandle {
5453        &self.control_handle
5454    }
5455
5456    fn drop_without_shutdown(mut self) {
5457        // Safety: drops once, never accessed again due to mem::forget
5458        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5459        // Prevent Drop from running (which would shut down the channel)
5460        std::mem::forget(self);
5461    }
5462}
5463
5464impl DirectorySetExtendedAttributeResponder {
5465    /// Sends a response to the FIDL transaction.
5466    ///
5467    /// Sets the channel to shutdown if an error occurs.
5468    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5469        let _result = self.send_raw(result);
5470        if _result.is_err() {
5471            self.control_handle.shutdown();
5472        }
5473        self.drop_without_shutdown();
5474        _result
5475    }
5476
5477    /// Similar to "send" but does not shutdown the channel if an error occurs.
5478    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5479        let _result = self.send_raw(result);
5480        self.drop_without_shutdown();
5481        _result
5482    }
5483
5484    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5485        self.control_handle
5486            .inner
5487            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5488                result,
5489                self.tx_id,
5490                0x4a951362f681f23c,
5491                fidl::encoding::DynamicFlags::empty(),
5492            )
5493    }
5494}
5495
5496#[must_use = "FIDL methods require a response to be sent"]
5497#[derive(Debug)]
5498pub struct DirectoryRemoveExtendedAttributeResponder {
5499    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5500    tx_id: u32,
5501}
5502
5503/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5504/// if the responder is dropped without sending a response, so that the client
5505/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5506impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
5507    fn drop(&mut self) {
5508        self.control_handle.shutdown();
5509        // Safety: drops once, never accessed again
5510        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5511    }
5512}
5513
5514impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
5515    type ControlHandle = DirectoryControlHandle;
5516
5517    fn control_handle(&self) -> &DirectoryControlHandle {
5518        &self.control_handle
5519    }
5520
5521    fn drop_without_shutdown(mut self) {
5522        // Safety: drops once, never accessed again due to mem::forget
5523        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5524        // Prevent Drop from running (which would shut down the channel)
5525        std::mem::forget(self);
5526    }
5527}
5528
5529impl DirectoryRemoveExtendedAttributeResponder {
5530    /// Sends a response to the FIDL transaction.
5531    ///
5532    /// Sets the channel to shutdown if an error occurs.
5533    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5534        let _result = self.send_raw(result);
5535        if _result.is_err() {
5536            self.control_handle.shutdown();
5537        }
5538        self.drop_without_shutdown();
5539        _result
5540    }
5541
5542    /// Similar to "send" but does not shutdown the channel if an error occurs.
5543    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5544        let _result = self.send_raw(result);
5545        self.drop_without_shutdown();
5546        _result
5547    }
5548
5549    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5550        self.control_handle
5551            .inner
5552            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5553                result,
5554                self.tx_id,
5555                0x7a0b9f3a9bf9032d,
5556                fidl::encoding::DynamicFlags::empty(),
5557            )
5558    }
5559}
5560
5561#[must_use = "FIDL methods require a response to be sent"]
5562#[derive(Debug)]
5563pub struct DirectoryReadDirentsResponder {
5564    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5565    tx_id: u32,
5566}
5567
5568/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5569/// if the responder is dropped without sending a response, so that the client
5570/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5571impl std::ops::Drop for DirectoryReadDirentsResponder {
5572    fn drop(&mut self) {
5573        self.control_handle.shutdown();
5574        // Safety: drops once, never accessed again
5575        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5576    }
5577}
5578
5579impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
5580    type ControlHandle = DirectoryControlHandle;
5581
5582    fn control_handle(&self) -> &DirectoryControlHandle {
5583        &self.control_handle
5584    }
5585
5586    fn drop_without_shutdown(mut self) {
5587        // Safety: drops once, never accessed again due to mem::forget
5588        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5589        // Prevent Drop from running (which would shut down the channel)
5590        std::mem::forget(self);
5591    }
5592}
5593
5594impl DirectoryReadDirentsResponder {
5595    /// Sends a response to the FIDL transaction.
5596    ///
5597    /// Sets the channel to shutdown if an error occurs.
5598    pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5599        let _result = self.send_raw(s, dirents);
5600        if _result.is_err() {
5601            self.control_handle.shutdown();
5602        }
5603        self.drop_without_shutdown();
5604        _result
5605    }
5606
5607    /// Similar to "send" but does not shutdown the channel if an error occurs.
5608    pub fn send_no_shutdown_on_err(
5609        self,
5610        mut s: i32,
5611        mut dirents: &[u8],
5612    ) -> Result<(), fidl::Error> {
5613        let _result = self.send_raw(s, dirents);
5614        self.drop_without_shutdown();
5615        _result
5616    }
5617
5618    fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
5619        self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
5620            (s, dirents),
5621            self.tx_id,
5622            0x3582806bf27faa0a,
5623            fidl::encoding::DynamicFlags::empty(),
5624        )
5625    }
5626}
5627
5628#[must_use = "FIDL methods require a response to be sent"]
5629#[derive(Debug)]
5630pub struct DirectoryRewindResponder {
5631    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5632    tx_id: u32,
5633}
5634
5635/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5636/// if the responder is dropped without sending a response, so that the client
5637/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5638impl std::ops::Drop for DirectoryRewindResponder {
5639    fn drop(&mut self) {
5640        self.control_handle.shutdown();
5641        // Safety: drops once, never accessed again
5642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5643    }
5644}
5645
5646impl fidl::endpoints::Responder for DirectoryRewindResponder {
5647    type ControlHandle = DirectoryControlHandle;
5648
5649    fn control_handle(&self) -> &DirectoryControlHandle {
5650        &self.control_handle
5651    }
5652
5653    fn drop_without_shutdown(mut self) {
5654        // Safety: drops once, never accessed again due to mem::forget
5655        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5656        // Prevent Drop from running (which would shut down the channel)
5657        std::mem::forget(self);
5658    }
5659}
5660
5661impl DirectoryRewindResponder {
5662    /// Sends a response to the FIDL transaction.
5663    ///
5664    /// Sets the channel to shutdown if an error occurs.
5665    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5666        let _result = self.send_raw(s);
5667        if _result.is_err() {
5668            self.control_handle.shutdown();
5669        }
5670        self.drop_without_shutdown();
5671        _result
5672    }
5673
5674    /// Similar to "send" but does not shutdown the channel if an error occurs.
5675    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5676        let _result = self.send_raw(s);
5677        self.drop_without_shutdown();
5678        _result
5679    }
5680
5681    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5682        self.control_handle.inner.send::<DirectoryRewindResponse>(
5683            (s,),
5684            self.tx_id,
5685            0x16b1202af0f34c71,
5686            fidl::encoding::DynamicFlags::empty(),
5687        )
5688    }
5689}
5690
5691#[must_use = "FIDL methods require a response to be sent"]
5692#[derive(Debug)]
5693pub struct DirectoryGetTokenResponder {
5694    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5695    tx_id: u32,
5696}
5697
5698/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5699/// if the responder is dropped without sending a response, so that the client
5700/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5701impl std::ops::Drop for DirectoryGetTokenResponder {
5702    fn drop(&mut self) {
5703        self.control_handle.shutdown();
5704        // Safety: drops once, never accessed again
5705        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5706    }
5707}
5708
5709impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
5710    type ControlHandle = DirectoryControlHandle;
5711
5712    fn control_handle(&self) -> &DirectoryControlHandle {
5713        &self.control_handle
5714    }
5715
5716    fn drop_without_shutdown(mut self) {
5717        // Safety: drops once, never accessed again due to mem::forget
5718        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5719        // Prevent Drop from running (which would shut down the channel)
5720        std::mem::forget(self);
5721    }
5722}
5723
5724impl DirectoryGetTokenResponder {
5725    /// Sends a response to the FIDL transaction.
5726    ///
5727    /// Sets the channel to shutdown if an error occurs.
5728    pub fn send(
5729        self,
5730        mut s: i32,
5731        mut token: Option<fidl::NullableHandle>,
5732    ) -> Result<(), fidl::Error> {
5733        let _result = self.send_raw(s, token);
5734        if _result.is_err() {
5735            self.control_handle.shutdown();
5736        }
5737        self.drop_without_shutdown();
5738        _result
5739    }
5740
5741    /// Similar to "send" but does not shutdown the channel if an error occurs.
5742    pub fn send_no_shutdown_on_err(
5743        self,
5744        mut s: i32,
5745        mut token: Option<fidl::NullableHandle>,
5746    ) -> Result<(), fidl::Error> {
5747        let _result = self.send_raw(s, token);
5748        self.drop_without_shutdown();
5749        _result
5750    }
5751
5752    fn send_raw(
5753        &self,
5754        mut s: i32,
5755        mut token: Option<fidl::NullableHandle>,
5756    ) -> Result<(), fidl::Error> {
5757        self.control_handle.inner.send::<DirectoryGetTokenResponse>(
5758            (s, token),
5759            self.tx_id,
5760            0x26ae9d18763c8655,
5761            fidl::encoding::DynamicFlags::empty(),
5762        )
5763    }
5764}
5765
5766#[must_use = "FIDL methods require a response to be sent"]
5767#[derive(Debug)]
5768pub struct DirectoryLinkResponder {
5769    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5770    tx_id: u32,
5771}
5772
5773/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5774/// if the responder is dropped without sending a response, so that the client
5775/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5776impl std::ops::Drop for DirectoryLinkResponder {
5777    fn drop(&mut self) {
5778        self.control_handle.shutdown();
5779        // Safety: drops once, never accessed again
5780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5781    }
5782}
5783
5784impl fidl::endpoints::Responder for DirectoryLinkResponder {
5785    type ControlHandle = DirectoryControlHandle;
5786
5787    fn control_handle(&self) -> &DirectoryControlHandle {
5788        &self.control_handle
5789    }
5790
5791    fn drop_without_shutdown(mut self) {
5792        // Safety: drops once, never accessed again due to mem::forget
5793        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5794        // Prevent Drop from running (which would shut down the channel)
5795        std::mem::forget(self);
5796    }
5797}
5798
5799impl DirectoryLinkResponder {
5800    /// Sends a response to the FIDL transaction.
5801    ///
5802    /// Sets the channel to shutdown if an error occurs.
5803    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
5804        let _result = self.send_raw(s);
5805        if _result.is_err() {
5806            self.control_handle.shutdown();
5807        }
5808        self.drop_without_shutdown();
5809        _result
5810    }
5811
5812    /// Similar to "send" but does not shutdown the channel if an error occurs.
5813    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
5814        let _result = self.send_raw(s);
5815        self.drop_without_shutdown();
5816        _result
5817    }
5818
5819    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
5820        self.control_handle.inner.send::<DirectoryLinkResponse>(
5821            (s,),
5822            self.tx_id,
5823            0x740604c0c7c930e7,
5824            fidl::encoding::DynamicFlags::empty(),
5825        )
5826    }
5827}
5828
5829#[must_use = "FIDL methods require a response to be sent"]
5830#[derive(Debug)]
5831pub struct DirectoryUnlinkResponder {
5832    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5833    tx_id: u32,
5834}
5835
5836/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5837/// if the responder is dropped without sending a response, so that the client
5838/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5839impl std::ops::Drop for DirectoryUnlinkResponder {
5840    fn drop(&mut self) {
5841        self.control_handle.shutdown();
5842        // Safety: drops once, never accessed again
5843        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5844    }
5845}
5846
5847impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
5848    type ControlHandle = DirectoryControlHandle;
5849
5850    fn control_handle(&self) -> &DirectoryControlHandle {
5851        &self.control_handle
5852    }
5853
5854    fn drop_without_shutdown(mut self) {
5855        // Safety: drops once, never accessed again due to mem::forget
5856        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5857        // Prevent Drop from running (which would shut down the channel)
5858        std::mem::forget(self);
5859    }
5860}
5861
5862impl DirectoryUnlinkResponder {
5863    /// Sends a response to the FIDL transaction.
5864    ///
5865    /// Sets the channel to shutdown if an error occurs.
5866    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5867        let _result = self.send_raw(result);
5868        if _result.is_err() {
5869            self.control_handle.shutdown();
5870        }
5871        self.drop_without_shutdown();
5872        _result
5873    }
5874
5875    /// Similar to "send" but does not shutdown the channel if an error occurs.
5876    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5877        let _result = self.send_raw(result);
5878        self.drop_without_shutdown();
5879        _result
5880    }
5881
5882    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5883        self.control_handle
5884            .inner
5885            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5886                result,
5887                self.tx_id,
5888                0x750a0326a78d7bed,
5889                fidl::encoding::DynamicFlags::empty(),
5890            )
5891    }
5892}
5893
5894#[must_use = "FIDL methods require a response to be sent"]
5895#[derive(Debug)]
5896pub struct DirectoryRenameResponder {
5897    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5898    tx_id: u32,
5899}
5900
5901/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5902/// if the responder is dropped without sending a response, so that the client
5903/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5904impl std::ops::Drop for DirectoryRenameResponder {
5905    fn drop(&mut self) {
5906        self.control_handle.shutdown();
5907        // Safety: drops once, never accessed again
5908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5909    }
5910}
5911
5912impl fidl::endpoints::Responder for DirectoryRenameResponder {
5913    type ControlHandle = DirectoryControlHandle;
5914
5915    fn control_handle(&self) -> &DirectoryControlHandle {
5916        &self.control_handle
5917    }
5918
5919    fn drop_without_shutdown(mut self) {
5920        // Safety: drops once, never accessed again due to mem::forget
5921        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5922        // Prevent Drop from running (which would shut down the channel)
5923        std::mem::forget(self);
5924    }
5925}
5926
5927impl DirectoryRenameResponder {
5928    /// Sends a response to the FIDL transaction.
5929    ///
5930    /// Sets the channel to shutdown if an error occurs.
5931    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5932        let _result = self.send_raw(result);
5933        if _result.is_err() {
5934            self.control_handle.shutdown();
5935        }
5936        self.drop_without_shutdown();
5937        _result
5938    }
5939
5940    /// Similar to "send" but does not shutdown the channel if an error occurs.
5941    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5942        let _result = self.send_raw(result);
5943        self.drop_without_shutdown();
5944        _result
5945    }
5946
5947    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5948        self.control_handle
5949            .inner
5950            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5951                result,
5952                self.tx_id,
5953                0x7060e7723b9928de,
5954                fidl::encoding::DynamicFlags::empty(),
5955            )
5956    }
5957}
5958
5959#[must_use = "FIDL methods require a response to be sent"]
5960#[derive(Debug)]
5961pub struct DirectoryCreateSymlinkResponder {
5962    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
5963    tx_id: u32,
5964}
5965
5966/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
5967/// if the responder is dropped without sending a response, so that the client
5968/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5969impl std::ops::Drop for DirectoryCreateSymlinkResponder {
5970    fn drop(&mut self) {
5971        self.control_handle.shutdown();
5972        // Safety: drops once, never accessed again
5973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5974    }
5975}
5976
5977impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
5978    type ControlHandle = DirectoryControlHandle;
5979
5980    fn control_handle(&self) -> &DirectoryControlHandle {
5981        &self.control_handle
5982    }
5983
5984    fn drop_without_shutdown(mut self) {
5985        // Safety: drops once, never accessed again due to mem::forget
5986        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5987        // Prevent Drop from running (which would shut down the channel)
5988        std::mem::forget(self);
5989    }
5990}
5991
5992impl DirectoryCreateSymlinkResponder {
5993    /// Sends a response to the FIDL transaction.
5994    ///
5995    /// Sets the channel to shutdown if an error occurs.
5996    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5997        let _result = self.send_raw(result);
5998        if _result.is_err() {
5999            self.control_handle.shutdown();
6000        }
6001        self.drop_without_shutdown();
6002        _result
6003    }
6004
6005    /// Similar to "send" but does not shutdown the channel if an error occurs.
6006    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6007        let _result = self.send_raw(result);
6008        self.drop_without_shutdown();
6009        _result
6010    }
6011
6012    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6013        self.control_handle
6014            .inner
6015            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6016                result,
6017                self.tx_id,
6018                0x21ce0f19ec043889,
6019                fidl::encoding::DynamicFlags::empty(),
6020            )
6021    }
6022}
6023
6024#[must_use = "FIDL methods require a response to be sent"]
6025#[derive(Debug)]
6026pub struct DirectoryWatchResponder {
6027    control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
6028    tx_id: u32,
6029}
6030
6031/// Set the the channel to be shutdown (see [`DirectoryControlHandle::shutdown`])
6032/// if the responder is dropped without sending a response, so that the client
6033/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6034impl std::ops::Drop for DirectoryWatchResponder {
6035    fn drop(&mut self) {
6036        self.control_handle.shutdown();
6037        // Safety: drops once, never accessed again
6038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6039    }
6040}
6041
6042impl fidl::endpoints::Responder for DirectoryWatchResponder {
6043    type ControlHandle = DirectoryControlHandle;
6044
6045    fn control_handle(&self) -> &DirectoryControlHandle {
6046        &self.control_handle
6047    }
6048
6049    fn drop_without_shutdown(mut self) {
6050        // Safety: drops once, never accessed again due to mem::forget
6051        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6052        // Prevent Drop from running (which would shut down the channel)
6053        std::mem::forget(self);
6054    }
6055}
6056
6057impl DirectoryWatchResponder {
6058    /// Sends a response to the FIDL transaction.
6059    ///
6060    /// Sets the channel to shutdown if an error occurs.
6061    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
6062        let _result = self.send_raw(s);
6063        if _result.is_err() {
6064            self.control_handle.shutdown();
6065        }
6066        self.drop_without_shutdown();
6067        _result
6068    }
6069
6070    /// Similar to "send" but does not shutdown the channel if an error occurs.
6071    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
6072        let _result = self.send_raw(s);
6073        self.drop_without_shutdown();
6074        _result
6075    }
6076
6077    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
6078        self.control_handle.inner.send::<DirectoryWatchResponse>(
6079            (s,),
6080            self.tx_id,
6081            0x5717193a59d66d91,
6082            fidl::encoding::DynamicFlags::empty(),
6083        )
6084    }
6085}
6086
6087#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6088pub struct DirectoryWatcherMarker;
6089
6090impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
6091    type Proxy = DirectoryWatcherProxy;
6092    type RequestStream = DirectoryWatcherRequestStream;
6093    #[cfg(target_os = "fuchsia")]
6094    type SynchronousProxy = DirectoryWatcherSynchronousProxy;
6095
6096    const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
6097}
6098
6099pub trait DirectoryWatcherProxyInterface: Send + Sync {}
6100#[derive(Debug)]
6101#[cfg(target_os = "fuchsia")]
6102pub struct DirectoryWatcherSynchronousProxy {
6103    client: fidl::client::sync::Client,
6104}
6105
6106#[cfg(target_os = "fuchsia")]
6107impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
6108    type Proxy = DirectoryWatcherProxy;
6109    type Protocol = DirectoryWatcherMarker;
6110
6111    fn from_channel(inner: fidl::Channel) -> Self {
6112        Self::new(inner)
6113    }
6114
6115    fn into_channel(self) -> fidl::Channel {
6116        self.client.into_channel()
6117    }
6118
6119    fn as_channel(&self) -> &fidl::Channel {
6120        self.client.as_channel()
6121    }
6122}
6123
6124#[cfg(target_os = "fuchsia")]
6125impl DirectoryWatcherSynchronousProxy {
6126    pub fn new(channel: fidl::Channel) -> Self {
6127        Self { client: fidl::client::sync::Client::new(channel) }
6128    }
6129
6130    pub fn into_channel(self) -> fidl::Channel {
6131        self.client.into_channel()
6132    }
6133
6134    /// Waits until an event arrives and returns it. It is safe for other
6135    /// threads to make concurrent requests while waiting for an event.
6136    pub fn wait_for_event(
6137        &self,
6138        deadline: zx::MonotonicInstant,
6139    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6140        DirectoryWatcherEvent::decode(
6141            self.client.wait_for_event::<DirectoryWatcherMarker>(deadline)?,
6142        )
6143    }
6144}
6145
6146#[cfg(target_os = "fuchsia")]
6147impl From<DirectoryWatcherSynchronousProxy> for zx::NullableHandle {
6148    fn from(value: DirectoryWatcherSynchronousProxy) -> Self {
6149        value.into_channel().into()
6150    }
6151}
6152
6153#[cfg(target_os = "fuchsia")]
6154impl From<fidl::Channel> for DirectoryWatcherSynchronousProxy {
6155    fn from(value: fidl::Channel) -> Self {
6156        Self::new(value)
6157    }
6158}
6159
6160#[cfg(target_os = "fuchsia")]
6161impl fidl::endpoints::FromClient for DirectoryWatcherSynchronousProxy {
6162    type Protocol = DirectoryWatcherMarker;
6163
6164    fn from_client(value: fidl::endpoints::ClientEnd<DirectoryWatcherMarker>) -> Self {
6165        Self::new(value.into_channel())
6166    }
6167}
6168
6169#[derive(Debug, Clone)]
6170pub struct DirectoryWatcherProxy {
6171    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6172}
6173
6174impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
6175    type Protocol = DirectoryWatcherMarker;
6176
6177    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6178        Self::new(inner)
6179    }
6180
6181    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6182        self.client.into_channel().map_err(|client| Self { client })
6183    }
6184
6185    fn as_channel(&self) -> &::fidl::AsyncChannel {
6186        self.client.as_channel()
6187    }
6188}
6189
6190impl DirectoryWatcherProxy {
6191    /// Create a new Proxy for fuchsia.io/DirectoryWatcher.
6192    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6193        let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6194        Self { client: fidl::client::Client::new(channel, protocol_name) }
6195    }
6196
6197    /// Get a Stream of events from the remote end of the protocol.
6198    ///
6199    /// # Panics
6200    ///
6201    /// Panics if the event stream was already taken.
6202    pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
6203        DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6204    }
6205}
6206
6207impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
6208
6209pub struct DirectoryWatcherEventStream {
6210    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6211}
6212
6213impl std::marker::Unpin for DirectoryWatcherEventStream {}
6214
6215impl futures::stream::FusedStream for DirectoryWatcherEventStream {
6216    fn is_terminated(&self) -> bool {
6217        self.event_receiver.is_terminated()
6218    }
6219}
6220
6221impl futures::Stream for DirectoryWatcherEventStream {
6222    type Item = Result<DirectoryWatcherEvent, fidl::Error>;
6223
6224    fn poll_next(
6225        mut self: std::pin::Pin<&mut Self>,
6226        cx: &mut std::task::Context<'_>,
6227    ) -> std::task::Poll<Option<Self::Item>> {
6228        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6229            &mut self.event_receiver,
6230            cx
6231        )?) {
6232            Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
6233            None => std::task::Poll::Ready(None),
6234        }
6235    }
6236}
6237
6238#[derive(Debug)]
6239pub enum DirectoryWatcherEvent {}
6240
6241impl DirectoryWatcherEvent {
6242    /// Decodes a message buffer as a [`DirectoryWatcherEvent`].
6243    fn decode(
6244        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6245    ) -> Result<DirectoryWatcherEvent, fidl::Error> {
6246        let (bytes, _handles) = buf.split_mut();
6247        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6248        debug_assert_eq!(tx_header.tx_id, 0);
6249        match tx_header.ordinal {
6250            _ => Err(fidl::Error::UnknownOrdinal {
6251                ordinal: tx_header.ordinal,
6252                protocol_name:
6253                    <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6254            }),
6255        }
6256    }
6257}
6258
6259/// A Stream of incoming requests for fuchsia.io/DirectoryWatcher.
6260pub struct DirectoryWatcherRequestStream {
6261    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6262    is_terminated: bool,
6263}
6264
6265impl std::marker::Unpin for DirectoryWatcherRequestStream {}
6266
6267impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
6268    fn is_terminated(&self) -> bool {
6269        self.is_terminated
6270    }
6271}
6272
6273impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
6274    type Protocol = DirectoryWatcherMarker;
6275    type ControlHandle = DirectoryWatcherControlHandle;
6276
6277    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6278        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6279    }
6280
6281    fn control_handle(&self) -> Self::ControlHandle {
6282        DirectoryWatcherControlHandle { inner: self.inner.clone() }
6283    }
6284
6285    fn into_inner(
6286        self,
6287    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6288    {
6289        (self.inner, self.is_terminated)
6290    }
6291
6292    fn from_inner(
6293        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6294        is_terminated: bool,
6295    ) -> Self {
6296        Self { inner, is_terminated }
6297    }
6298}
6299
6300impl futures::Stream for DirectoryWatcherRequestStream {
6301    type Item = Result<DirectoryWatcherRequest, fidl::Error>;
6302
6303    fn poll_next(
6304        mut self: std::pin::Pin<&mut Self>,
6305        cx: &mut std::task::Context<'_>,
6306    ) -> std::task::Poll<Option<Self::Item>> {
6307        let this = &mut *self;
6308        if this.inner.check_shutdown(cx) {
6309            this.is_terminated = true;
6310            return std::task::Poll::Ready(None);
6311        }
6312        if this.is_terminated {
6313            panic!("polled DirectoryWatcherRequestStream after completion");
6314        }
6315        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6316            |bytes, handles| {
6317                match this.inner.channel().read_etc(cx, bytes, handles) {
6318                    std::task::Poll::Ready(Ok(())) => {}
6319                    std::task::Poll::Pending => return std::task::Poll::Pending,
6320                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6321                        this.is_terminated = true;
6322                        return std::task::Poll::Ready(None);
6323                    }
6324                    std::task::Poll::Ready(Err(e)) => {
6325                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6326                            e.into(),
6327                        ))));
6328                    }
6329                }
6330
6331                // A message has been received from the channel
6332                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6333
6334                std::task::Poll::Ready(Some(match header.ordinal {
6335                    _ => Err(fidl::Error::UnknownOrdinal {
6336                        ordinal: header.ordinal,
6337                        protocol_name:
6338                            <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6339                    }),
6340                }))
6341            },
6342        )
6343    }
6344}
6345
6346/// DirectoryWatcher transmits messages from a filesystem server
6347/// about events happening in the filesystem. Clients can register
6348/// new watchers using the `Directory.Watch` method, where they can
6349/// filter which events they want to receive notifications for.
6350///
6351/// The DirectoryWatcher will send messages of the form:
6352/// ```
6353/// struct {
6354///   uint8 event;
6355///   uint8 len;
6356///   char name[];
6357/// };
6358/// ```
6359/// Where names are NOT null-terminated. The name is the relative
6360/// path to the entry the event is refering to. It will be empty if
6361/// the event isn't referencing a particular entry (e.g. for the
6362/// `IDLE` event).
6363#[derive(Debug)]
6364pub enum DirectoryWatcherRequest {}
6365
6366impl DirectoryWatcherRequest {
6367    /// Name of the method defined in FIDL
6368    pub fn method_name(&self) -> &'static str {
6369        match *self {}
6370    }
6371}
6372
6373#[derive(Debug, Clone)]
6374pub struct DirectoryWatcherControlHandle {
6375    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6376}
6377
6378impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
6379    fn shutdown(&self) {
6380        self.inner.shutdown()
6381    }
6382
6383    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6384        self.inner.shutdown_with_epitaph(status)
6385    }
6386
6387    fn is_closed(&self) -> bool {
6388        self.inner.channel().is_closed()
6389    }
6390    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6391        self.inner.channel().on_closed()
6392    }
6393
6394    #[cfg(target_os = "fuchsia")]
6395    fn signal_peer(
6396        &self,
6397        clear_mask: zx::Signals,
6398        set_mask: zx::Signals,
6399    ) -> Result<(), zx_status::Status> {
6400        use fidl::Peered;
6401        self.inner.channel().signal_peer(clear_mask, set_mask)
6402    }
6403}
6404
6405impl DirectoryWatcherControlHandle {}
6406
6407#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6408pub struct ExtendedAttributeIteratorMarker;
6409
6410impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
6411    type Proxy = ExtendedAttributeIteratorProxy;
6412    type RequestStream = ExtendedAttributeIteratorRequestStream;
6413    #[cfg(target_os = "fuchsia")]
6414    type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
6415
6416    const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
6417}
6418pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
6419
6420pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
6421    type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
6422        + Send;
6423    fn r#get_next(&self) -> Self::GetNextResponseFut;
6424}
6425#[derive(Debug)]
6426#[cfg(target_os = "fuchsia")]
6427pub struct ExtendedAttributeIteratorSynchronousProxy {
6428    client: fidl::client::sync::Client,
6429}
6430
6431#[cfg(target_os = "fuchsia")]
6432impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
6433    type Proxy = ExtendedAttributeIteratorProxy;
6434    type Protocol = ExtendedAttributeIteratorMarker;
6435
6436    fn from_channel(inner: fidl::Channel) -> Self {
6437        Self::new(inner)
6438    }
6439
6440    fn into_channel(self) -> fidl::Channel {
6441        self.client.into_channel()
6442    }
6443
6444    fn as_channel(&self) -> &fidl::Channel {
6445        self.client.as_channel()
6446    }
6447}
6448
6449#[cfg(target_os = "fuchsia")]
6450impl ExtendedAttributeIteratorSynchronousProxy {
6451    pub fn new(channel: fidl::Channel) -> Self {
6452        Self { client: fidl::client::sync::Client::new(channel) }
6453    }
6454
6455    pub fn into_channel(self) -> fidl::Channel {
6456        self.client.into_channel()
6457    }
6458
6459    /// Waits until an event arrives and returns it. It is safe for other
6460    /// threads to make concurrent requests while waiting for an event.
6461    pub fn wait_for_event(
6462        &self,
6463        deadline: zx::MonotonicInstant,
6464    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6465        ExtendedAttributeIteratorEvent::decode(
6466            self.client.wait_for_event::<ExtendedAttributeIteratorMarker>(deadline)?,
6467        )
6468    }
6469
6470    /// Get the next chunk of extended attribute names. If this is the last
6471    /// chunk, last will be true, and the channel will be closed after the
6472    /// call.
6473    pub fn r#get_next(
6474        &self,
6475        ___deadline: zx::MonotonicInstant,
6476    ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6477        let _response = self.client.send_query::<
6478            fidl::encoding::EmptyPayload,
6479            fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6480            ExtendedAttributeIteratorMarker,
6481        >(
6482            (),
6483            0x3ba664a1c2e45a7,
6484            fidl::encoding::DynamicFlags::empty(),
6485            ___deadline,
6486        )?;
6487        Ok(_response.map(|x| (x.attributes, x.last)))
6488    }
6489}
6490
6491#[cfg(target_os = "fuchsia")]
6492impl From<ExtendedAttributeIteratorSynchronousProxy> for zx::NullableHandle {
6493    fn from(value: ExtendedAttributeIteratorSynchronousProxy) -> Self {
6494        value.into_channel().into()
6495    }
6496}
6497
6498#[cfg(target_os = "fuchsia")]
6499impl From<fidl::Channel> for ExtendedAttributeIteratorSynchronousProxy {
6500    fn from(value: fidl::Channel) -> Self {
6501        Self::new(value)
6502    }
6503}
6504
6505#[cfg(target_os = "fuchsia")]
6506impl fidl::endpoints::FromClient for ExtendedAttributeIteratorSynchronousProxy {
6507    type Protocol = ExtendedAttributeIteratorMarker;
6508
6509    fn from_client(value: fidl::endpoints::ClientEnd<ExtendedAttributeIteratorMarker>) -> Self {
6510        Self::new(value.into_channel())
6511    }
6512}
6513
6514#[derive(Debug, Clone)]
6515pub struct ExtendedAttributeIteratorProxy {
6516    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6517}
6518
6519impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
6520    type Protocol = ExtendedAttributeIteratorMarker;
6521
6522    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6523        Self::new(inner)
6524    }
6525
6526    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6527        self.client.into_channel().map_err(|client| Self { client })
6528    }
6529
6530    fn as_channel(&self) -> &::fidl::AsyncChannel {
6531        self.client.as_channel()
6532    }
6533}
6534
6535impl ExtendedAttributeIteratorProxy {
6536    /// Create a new Proxy for fuchsia.io/ExtendedAttributeIterator.
6537    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6538        let protocol_name =
6539            <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6540        Self { client: fidl::client::Client::new(channel, protocol_name) }
6541    }
6542
6543    /// Get a Stream of events from the remote end of the protocol.
6544    ///
6545    /// # Panics
6546    ///
6547    /// Panics if the event stream was already taken.
6548    pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
6549        ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6550    }
6551
6552    /// Get the next chunk of extended attribute names. If this is the last
6553    /// chunk, last will be true, and the channel will be closed after the
6554    /// call.
6555    pub fn r#get_next(
6556        &self,
6557    ) -> fidl::client::QueryResponseFut<
6558        ExtendedAttributeIteratorGetNextResult,
6559        fidl::encoding::DefaultFuchsiaResourceDialect,
6560    > {
6561        ExtendedAttributeIteratorProxyInterface::r#get_next(self)
6562    }
6563}
6564
6565impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
6566    type GetNextResponseFut = fidl::client::QueryResponseFut<
6567        ExtendedAttributeIteratorGetNextResult,
6568        fidl::encoding::DefaultFuchsiaResourceDialect,
6569    >;
6570    fn r#get_next(&self) -> Self::GetNextResponseFut {
6571        fn _decode(
6572            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6573        ) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
6574            let _response = fidl::client::decode_transaction_body::<
6575                fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
6576                fidl::encoding::DefaultFuchsiaResourceDialect,
6577                0x3ba664a1c2e45a7,
6578            >(_buf?)?;
6579            Ok(_response.map(|x| (x.attributes, x.last)))
6580        }
6581        self.client.send_query_and_decode::<
6582            fidl::encoding::EmptyPayload,
6583            ExtendedAttributeIteratorGetNextResult,
6584        >(
6585            (),
6586            0x3ba664a1c2e45a7,
6587            fidl::encoding::DynamicFlags::empty(),
6588            _decode,
6589        )
6590    }
6591}
6592
6593pub struct ExtendedAttributeIteratorEventStream {
6594    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6595}
6596
6597impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
6598
6599impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
6600    fn is_terminated(&self) -> bool {
6601        self.event_receiver.is_terminated()
6602    }
6603}
6604
6605impl futures::Stream for ExtendedAttributeIteratorEventStream {
6606    type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
6607
6608    fn poll_next(
6609        mut self: std::pin::Pin<&mut Self>,
6610        cx: &mut std::task::Context<'_>,
6611    ) -> std::task::Poll<Option<Self::Item>> {
6612        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6613            &mut self.event_receiver,
6614            cx
6615        )?) {
6616            Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
6617            None => std::task::Poll::Ready(None),
6618        }
6619    }
6620}
6621
6622#[derive(Debug)]
6623pub enum ExtendedAttributeIteratorEvent {}
6624
6625impl ExtendedAttributeIteratorEvent {
6626    /// Decodes a message buffer as a [`ExtendedAttributeIteratorEvent`].
6627    fn decode(
6628        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6629    ) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
6630        let (bytes, _handles) = buf.split_mut();
6631        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6632        debug_assert_eq!(tx_header.tx_id, 0);
6633        match tx_header.ordinal {
6634            _ => Err(fidl::Error::UnknownOrdinal {
6635                ordinal: tx_header.ordinal,
6636                protocol_name:
6637                    <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6638            }),
6639        }
6640    }
6641}
6642
6643/// A Stream of incoming requests for fuchsia.io/ExtendedAttributeIterator.
6644pub struct ExtendedAttributeIteratorRequestStream {
6645    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6646    is_terminated: bool,
6647}
6648
6649impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
6650
6651impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
6652    fn is_terminated(&self) -> bool {
6653        self.is_terminated
6654    }
6655}
6656
6657impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
6658    type Protocol = ExtendedAttributeIteratorMarker;
6659    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6660
6661    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6662        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6663    }
6664
6665    fn control_handle(&self) -> Self::ControlHandle {
6666        ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
6667    }
6668
6669    fn into_inner(
6670        self,
6671    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6672    {
6673        (self.inner, self.is_terminated)
6674    }
6675
6676    fn from_inner(
6677        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6678        is_terminated: bool,
6679    ) -> Self {
6680        Self { inner, is_terminated }
6681    }
6682}
6683
6684impl futures::Stream for ExtendedAttributeIteratorRequestStream {
6685    type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
6686
6687    fn poll_next(
6688        mut self: std::pin::Pin<&mut Self>,
6689        cx: &mut std::task::Context<'_>,
6690    ) -> std::task::Poll<Option<Self::Item>> {
6691        let this = &mut *self;
6692        if this.inner.check_shutdown(cx) {
6693            this.is_terminated = true;
6694            return std::task::Poll::Ready(None);
6695        }
6696        if this.is_terminated {
6697            panic!("polled ExtendedAttributeIteratorRequestStream after completion");
6698        }
6699        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6700            |bytes, handles| {
6701                match this.inner.channel().read_etc(cx, bytes, handles) {
6702                    std::task::Poll::Ready(Ok(())) => {}
6703                    std::task::Poll::Pending => return std::task::Poll::Pending,
6704                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6705                        this.is_terminated = true;
6706                        return std::task::Poll::Ready(None);
6707                    }
6708                    std::task::Poll::Ready(Err(e)) => {
6709                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6710                            e.into(),
6711                        ))));
6712                    }
6713                }
6714
6715                // A message has been received from the channel
6716                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6717
6718                std::task::Poll::Ready(Some(match header.ordinal {
6719                0x3ba664a1c2e45a7 => {
6720                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6721                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6722                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6723                    let control_handle = ExtendedAttributeIteratorControlHandle {
6724                        inner: this.inner.clone(),
6725                    };
6726                    Ok(ExtendedAttributeIteratorRequest::GetNext {
6727                        responder: ExtendedAttributeIteratorGetNextResponder {
6728                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6729                            tx_id: header.tx_id,
6730                        },
6731                    })
6732                }
6733                _ => Err(fidl::Error::UnknownOrdinal {
6734                    ordinal: header.ordinal,
6735                    protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6736                }),
6737            }))
6738            },
6739        )
6740    }
6741}
6742
6743#[derive(Debug)]
6744pub enum ExtendedAttributeIteratorRequest {
6745    /// Get the next chunk of extended attribute names. If this is the last
6746    /// chunk, last will be true, and the channel will be closed after the
6747    /// call.
6748    GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
6749}
6750
6751impl ExtendedAttributeIteratorRequest {
6752    #[allow(irrefutable_let_patterns)]
6753    pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
6754        if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
6755            Some((responder))
6756        } else {
6757            None
6758        }
6759    }
6760
6761    /// Name of the method defined in FIDL
6762    pub fn method_name(&self) -> &'static str {
6763        match *self {
6764            ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
6765        }
6766    }
6767}
6768
6769#[derive(Debug, Clone)]
6770pub struct ExtendedAttributeIteratorControlHandle {
6771    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6772}
6773
6774impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
6775    fn shutdown(&self) {
6776        self.inner.shutdown()
6777    }
6778
6779    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6780        self.inner.shutdown_with_epitaph(status)
6781    }
6782
6783    fn is_closed(&self) -> bool {
6784        self.inner.channel().is_closed()
6785    }
6786    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6787        self.inner.channel().on_closed()
6788    }
6789
6790    #[cfg(target_os = "fuchsia")]
6791    fn signal_peer(
6792        &self,
6793        clear_mask: zx::Signals,
6794        set_mask: zx::Signals,
6795    ) -> Result<(), zx_status::Status> {
6796        use fidl::Peered;
6797        self.inner.channel().signal_peer(clear_mask, set_mask)
6798    }
6799}
6800
6801impl ExtendedAttributeIteratorControlHandle {}
6802
6803#[must_use = "FIDL methods require a response to be sent"]
6804#[derive(Debug)]
6805pub struct ExtendedAttributeIteratorGetNextResponder {
6806    control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
6807    tx_id: u32,
6808}
6809
6810/// Set the the channel to be shutdown (see [`ExtendedAttributeIteratorControlHandle::shutdown`])
6811/// if the responder is dropped without sending a response, so that the client
6812/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6813impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
6814    fn drop(&mut self) {
6815        self.control_handle.shutdown();
6816        // Safety: drops once, never accessed again
6817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6818    }
6819}
6820
6821impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
6822    type ControlHandle = ExtendedAttributeIteratorControlHandle;
6823
6824    fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
6825        &self.control_handle
6826    }
6827
6828    fn drop_without_shutdown(mut self) {
6829        // Safety: drops once, never accessed again due to mem::forget
6830        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6831        // Prevent Drop from running (which would shut down the channel)
6832        std::mem::forget(self);
6833    }
6834}
6835
6836impl ExtendedAttributeIteratorGetNextResponder {
6837    /// Sends a response to the FIDL transaction.
6838    ///
6839    /// Sets the channel to shutdown if an error occurs.
6840    pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6841        let _result = self.send_raw(result);
6842        if _result.is_err() {
6843            self.control_handle.shutdown();
6844        }
6845        self.drop_without_shutdown();
6846        _result
6847    }
6848
6849    /// Similar to "send" but does not shutdown the channel if an error occurs.
6850    pub fn send_no_shutdown_on_err(
6851        self,
6852        mut result: Result<(&[Vec<u8>], bool), i32>,
6853    ) -> Result<(), fidl::Error> {
6854        let _result = self.send_raw(result);
6855        self.drop_without_shutdown();
6856        _result
6857    }
6858
6859    fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
6860        self.control_handle.inner.send::<fidl::encoding::ResultType<
6861            ExtendedAttributeIteratorGetNextResponse,
6862            i32,
6863        >>(
6864            result,
6865            self.tx_id,
6866            0x3ba664a1c2e45a7,
6867            fidl::encoding::DynamicFlags::empty(),
6868        )
6869    }
6870}
6871
6872#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6873pub struct FileMarker;
6874
6875impl fidl::endpoints::ProtocolMarker for FileMarker {
6876    type Proxy = FileProxy;
6877    type RequestStream = FileRequestStream;
6878    #[cfg(target_os = "fuchsia")]
6879    type SynchronousProxy = FileSynchronousProxy;
6880
6881    const DEBUG_NAME: &'static str = "fuchsia.io.File";
6882}
6883impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
6884pub type FileSeekResult = Result<u64, i32>;
6885pub type FileReadAtResult = Result<Vec<u8>, i32>;
6886pub type FileWriteAtResult = Result<u64, i32>;
6887pub type FileResizeResult = Result<(), i32>;
6888pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
6889pub type FileAllocateResult = Result<(), i32>;
6890pub type FileEnableVerityResult = Result<(), i32>;
6891
6892pub trait FileProxyInterface: Send + Sync {
6893    type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
6894        + Send;
6895    fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
6896    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
6897        + Send;
6898    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
6899    fn r#clone(
6900        &self,
6901        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6902    ) -> Result<(), fidl::Error>;
6903    type CloseResponseFut: std::future::Future<
6904            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
6905        > + Send;
6906    fn r#close(&self) -> Self::CloseResponseFut;
6907    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
6908    fn r#query(&self) -> Self::QueryResponseFut;
6909    fn r#deprecated_clone(
6910        &self,
6911        flags: OpenFlags,
6912        object: fidl::endpoints::ServerEnd<NodeMarker>,
6913    ) -> Result<(), fidl::Error>;
6914    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
6915        + Send;
6916    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
6917    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6918    fn r#deprecated_set_attr(
6919        &self,
6920        flags: NodeAttributeFlags,
6921        attributes: &NodeAttributes,
6922    ) -> Self::DeprecatedSetAttrResponseFut;
6923    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
6924        + Send;
6925    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
6926    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
6927        + Send;
6928    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
6929    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
6930        + Send;
6931    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
6932    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
6933        + Send;
6934    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
6935    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
6936        + Send;
6937    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
6938    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
6939        + Send;
6940    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
6941    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
6942        + Send;
6943    fn r#update_attributes(
6944        &self,
6945        payload: &MutableNodeAttributes,
6946    ) -> Self::UpdateAttributesResponseFut;
6947    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
6948    fn r#sync(&self) -> Self::SyncResponseFut;
6949    fn r#list_extended_attributes(
6950        &self,
6951        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
6952    ) -> Result<(), fidl::Error>;
6953    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
6954        + Send;
6955    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
6956    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
6957        + Send;
6958    fn r#set_extended_attribute(
6959        &self,
6960        name: &[u8],
6961        value: ExtendedAttributeValue,
6962        mode: SetExtendedAttributeMode,
6963    ) -> Self::SetExtendedAttributeResponseFut;
6964    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
6965        + Send;
6966    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
6967    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
6968        + Send;
6969    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
6970    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
6971        + Send;
6972    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
6973    type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
6974    fn r#describe(&self) -> Self::DescribeResponseFut;
6975    type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
6976    fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
6977    type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
6978        + Send;
6979    fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
6980    type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
6981        + Send;
6982    fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
6983    type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
6984        + Send;
6985    fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
6986    type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
6987        + Send;
6988    fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
6989    type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
6990        + Send;
6991    fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
6992    -> Self::AllocateResponseFut;
6993    type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
6994        + Send;
6995    fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
6996}
6997#[derive(Debug)]
6998#[cfg(target_os = "fuchsia")]
6999pub struct FileSynchronousProxy {
7000    client: fidl::client::sync::Client,
7001}
7002
7003#[cfg(target_os = "fuchsia")]
7004impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
7005    type Proxy = FileProxy;
7006    type Protocol = FileMarker;
7007
7008    fn from_channel(inner: fidl::Channel) -> Self {
7009        Self::new(inner)
7010    }
7011
7012    fn into_channel(self) -> fidl::Channel {
7013        self.client.into_channel()
7014    }
7015
7016    fn as_channel(&self) -> &fidl::Channel {
7017        self.client.as_channel()
7018    }
7019}
7020
7021#[cfg(target_os = "fuchsia")]
7022impl FileSynchronousProxy {
7023    pub fn new(channel: fidl::Channel) -> Self {
7024        Self { client: fidl::client::sync::Client::new(channel) }
7025    }
7026
7027    pub fn into_channel(self) -> fidl::Channel {
7028        self.client.into_channel()
7029    }
7030
7031    /// Waits until an event arrives and returns it. It is safe for other
7032    /// threads to make concurrent requests while waiting for an event.
7033    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
7034        FileEvent::decode(self.client.wait_for_event::<FileMarker>(deadline)?)
7035    }
7036
7037    /// Acquires an advisory lock on the underlying file.
7038    ///
7039    /// The lock lasts until either this connection is closed or
7040    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7041    /// explicitly.
7042    ///
7043    /// Advisory locks are purely advisory. They do not prevent actual read or
7044    /// write operations from occurring on the file, either through this
7045    /// connection or through other connections.
7046    ///
7047    /// This method requires the following rights:
7048    ///
7049    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7050    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7051    ///   [`AdvisoryLockType.WRITE`].
7052    ///
7053    /// # Errors
7054    ///
7055    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7056    ///   example, another connection might hold a conflicting lock type.
7057    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7058    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7059    ///   to acquire the given type of lock.
7060    pub fn r#advisory_lock(
7061        &self,
7062        mut request: &AdvisoryLockRequest,
7063        ___deadline: zx::MonotonicInstant,
7064    ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
7065        let _response = self.client.send_query::<
7066            AdvisoryLockingAdvisoryLockRequest,
7067            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7068            FileMarker,
7069        >(
7070            (request,),
7071            0x6ee9c0ad53ec87aa,
7072            fidl::encoding::DynamicFlags::empty(),
7073            ___deadline,
7074        )?;
7075        Ok(_response.map(|x| x))
7076    }
7077
7078    /// Creates a link to this this object with name `dst` in the directory represented by
7079    /// `dst_parent_token`.
7080    ///
7081    /// `dst` must be a resolved object name. Including "/" in the string will return
7082    /// `ZX_ERR_INVALID_ARGS`.
7083    ///
7084    /// This method requires the maximal set of rights supported by the filesystem for this object.
7085    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7086    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7087    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7088    /// `ZX_ERR_ACCESS_DENIED`.
7089    ///
7090    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7091    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7092    ///
7093    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7094    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7095    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7096    ///
7097    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7098    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7099    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7100    pub fn r#link_into(
7101        &self,
7102        mut dst_parent_token: fidl::Event,
7103        mut dst: &str,
7104        ___deadline: zx::MonotonicInstant,
7105    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
7106        let _response = self.client.send_query::<
7107            LinkableLinkIntoRequest,
7108            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7109            FileMarker,
7110        >(
7111            (dst_parent_token, dst,),
7112            0x54f3949246a03e74,
7113            fidl::encoding::DynamicFlags::empty(),
7114            ___deadline,
7115        )?;
7116        Ok(_response.map(|x| x))
7117    }
7118
7119    pub fn r#clone(
7120        &self,
7121        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7122    ) -> Result<(), fidl::Error> {
7123        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7124            (request,),
7125            0x20d8a7aba2168a79,
7126            fidl::encoding::DynamicFlags::empty(),
7127        )
7128    }
7129
7130    /// Terminates the connection.
7131    ///
7132    /// After calling `Close`, the client must not send any other requests.
7133    ///
7134    /// Servers, after sending the status response, should close the connection
7135    /// regardless of status and without sending an epitaph.
7136    ///
7137    /// Closing the client end of the channel should be semantically equivalent
7138    /// to calling `Close` without knowing when the close has completed or its
7139    /// status.
7140    pub fn r#close(
7141        &self,
7142        ___deadline: zx::MonotonicInstant,
7143    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
7144        let _response = self.client.send_query::<
7145            fidl::encoding::EmptyPayload,
7146            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7147            FileMarker,
7148        >(
7149            (),
7150            0x5ac5d459ad7f657e,
7151            fidl::encoding::DynamicFlags::empty(),
7152            ___deadline,
7153        )?;
7154        Ok(_response.map(|x| x))
7155    }
7156
7157    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
7158        let _response = self.client.send_query::<
7159            fidl::encoding::EmptyPayload,
7160            fidl_fuchsia_unknown::QueryableQueryResponse,
7161            FileMarker,
7162        >(
7163            (),
7164            0x2658edee9decfc06,
7165            fidl::encoding::DynamicFlags::empty(),
7166            ___deadline,
7167        )?;
7168        Ok(_response.protocol)
7169    }
7170
7171    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7172    pub fn r#deprecated_clone(
7173        &self,
7174        mut flags: OpenFlags,
7175        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7176    ) -> Result<(), fidl::Error> {
7177        self.client.send::<NodeDeprecatedCloneRequest>(
7178            (flags, object),
7179            0x5a61678f293ce16f,
7180            fidl::encoding::DynamicFlags::FLEXIBLE,
7181        )
7182    }
7183
7184    /// DEPRECATED - Use `Node.GetAttributes` instead.
7185    pub fn r#deprecated_get_attr(
7186        &self,
7187        ___deadline: zx::MonotonicInstant,
7188    ) -> Result<(i32, NodeAttributes), fidl::Error> {
7189        let _response = self
7190            .client
7191            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, FileMarker>(
7192                (),
7193                0x78985e216314dafd,
7194                fidl::encoding::DynamicFlags::empty(),
7195                ___deadline,
7196            )?;
7197        Ok((_response.s, _response.attributes))
7198    }
7199
7200    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7201    pub fn r#deprecated_set_attr(
7202        &self,
7203        mut flags: NodeAttributeFlags,
7204        mut attributes: &NodeAttributes,
7205        ___deadline: zx::MonotonicInstant,
7206    ) -> Result<i32, fidl::Error> {
7207        let _response = self
7208            .client
7209            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, FileMarker>(
7210                (flags, attributes),
7211                0x4186c0f40d938f46,
7212                fidl::encoding::DynamicFlags::empty(),
7213                ___deadline,
7214            )?;
7215        Ok(_response.s)
7216    }
7217
7218    /// [DEPRECATED - Use new GetFlags method instead.]
7219    pub fn r#deprecated_get_flags(
7220        &self,
7221        ___deadline: zx::MonotonicInstant,
7222    ) -> Result<(i32, OpenFlags), fidl::Error> {
7223        let _response = self
7224            .client
7225            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, FileMarker>(
7226                (),
7227                0x5b88fffb8eda3aa1,
7228                fidl::encoding::DynamicFlags::empty(),
7229                ___deadline,
7230            )?;
7231        Ok((_response.s, _response.flags))
7232    }
7233
7234    /// [DEPRECATED - Use new SetFlags method instead.]
7235    pub fn r#deprecated_set_flags(
7236        &self,
7237        mut flags: OpenFlags,
7238        ___deadline: zx::MonotonicInstant,
7239    ) -> Result<i32, fidl::Error> {
7240        let _response = self.client.send_query::<
7241            NodeDeprecatedSetFlagsRequest,
7242            NodeDeprecatedSetFlagsResponse,
7243            FileMarker,
7244        >(
7245            (flags,),
7246            0x5295b76c71fde733,
7247            fidl::encoding::DynamicFlags::empty(),
7248            ___deadline,
7249        )?;
7250        Ok(_response.s)
7251    }
7252
7253    /// Queries the flags that apply to this node after it has been opened/created. This method does
7254    /// not require any rights.
7255    ///
7256    /// Note that the final set of flags that apply to the connection may differ from those
7257    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
7258    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
7259    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
7260    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
7261    pub fn r#get_flags(
7262        &self,
7263        ___deadline: zx::MonotonicInstant,
7264    ) -> Result<NodeGetFlagsResult, fidl::Error> {
7265        let _response = self.client.send_query::<
7266            fidl::encoding::EmptyPayload,
7267            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
7268            FileMarker,
7269        >(
7270            (),
7271            0x176eb318f64ec23,
7272            fidl::encoding::DynamicFlags::FLEXIBLE,
7273            ___deadline,
7274        )?
7275        .into_result::<FileMarker>("get_flags")?;
7276        Ok(_response.map(|x| x.flags))
7277    }
7278
7279    /// Sets the flags that apply to this node after it has been opened. This method does not
7280    /// require any rights.
7281    ///
7282    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
7283    /// clear append mode.
7284    ///
7285    /// Errors:
7286    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
7287    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
7288    pub fn r#set_flags(
7289        &self,
7290        mut flags: Flags,
7291        ___deadline: zx::MonotonicInstant,
7292    ) -> Result<NodeSetFlagsResult, fidl::Error> {
7293        let _response = self.client.send_query::<
7294            NodeSetFlagsRequest,
7295            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7296            FileMarker,
7297        >(
7298            (flags,),
7299            0x55a8028685791ea8,
7300            fidl::encoding::DynamicFlags::FLEXIBLE,
7301            ___deadline,
7302        )?
7303        .into_result::<FileMarker>("set_flags")?;
7304        Ok(_response.map(|x| x))
7305    }
7306
7307    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
7308    /// volume has different settings or the storage is accounted seperately from the rest of the
7309    /// filesystem that may be reported instead of filesystem-wide details.
7310    pub fn r#query_filesystem(
7311        &self,
7312        ___deadline: zx::MonotonicInstant,
7313    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
7314        let _response = self
7315            .client
7316            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, FileMarker>(
7317                (),
7318                0x6f344a1c6b0a0610,
7319                fidl::encoding::DynamicFlags::empty(),
7320                ___deadline,
7321            )?;
7322        Ok((_response.s, _response.info))
7323    }
7324
7325    /// Acquires information about the node.
7326    ///
7327    /// The attributes of a node should be stable, independent of the
7328    /// specific protocol used to access it.
7329    ///
7330    /// If a particular attribute is not applicable or not supported,
7331    /// filesystems should leave the corresponding field absent.
7332    ///
7333    /// + `query` a bit-mask specifying which attributes to fetch. The server
7334    ///   should not return more than necessary.
7335    /// - `attributes` the returned attributes.
7336    ///
7337    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7338    pub fn r#get_attributes(
7339        &self,
7340        mut query: NodeAttributesQuery,
7341        ___deadline: zx::MonotonicInstant,
7342    ) -> Result<NodeGetAttributesResult, fidl::Error> {
7343        let _response = self.client.send_query::<
7344            NodeGetAttributesRequest,
7345            fidl::encoding::ResultType<NodeAttributes2, i32>,
7346            FileMarker,
7347        >(
7348            (query,),
7349            0x3d4396a638ea053b,
7350            fidl::encoding::DynamicFlags::empty(),
7351            ___deadline,
7352        )?;
7353        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
7354    }
7355
7356    /// Updates information about the node.
7357    ///
7358    /// + `attributes` the presence of a table field in `attributes` indicates
7359    /// the intent to update the corresponding attribute.
7360    ///
7361    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
7362    ///
7363    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7364    pub fn r#update_attributes(
7365        &self,
7366        mut payload: &MutableNodeAttributes,
7367        ___deadline: zx::MonotonicInstant,
7368    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
7369        let _response = self.client.send_query::<
7370            MutableNodeAttributes,
7371            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7372            FileMarker,
7373        >(
7374            payload,
7375            0x3308c1da5a89bf08,
7376            fidl::encoding::DynamicFlags::empty(),
7377            ___deadline,
7378        )?;
7379        Ok(_response.map(|x| x))
7380    }
7381
7382    /// Synchronizes updates to the node to the underlying media, if it exists.
7383    ///
7384    /// This method will return when the filesystem server has flushed the
7385    /// relevant updates to the underlying media, but does not guarantee the
7386    /// underlying media has persisted the information, nor that any information
7387    /// is committed to hardware. Clients may use `Sync` to ensure ordering
7388    /// between operations.
7389    ///
7390    /// This method does not require any rights.
7391    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
7392        let _response = self.client.send_query::<
7393            fidl::encoding::EmptyPayload,
7394            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7395            FileMarker,
7396        >(
7397            (),
7398            0x2c5c27ca0ab5dc49,
7399            fidl::encoding::DynamicFlags::empty(),
7400            ___deadline,
7401        )?;
7402        Ok(_response.map(|x| x))
7403    }
7404
7405    /// Creates an iterator over all the extended attribute names associated
7406    /// with this node. If an error occurs it is returned as an epitaph on the
7407    /// iterator request channel, and then the channel is closed.
7408    ///
7409    /// GetExtendedAttributes can be used with any of these names to retrieve
7410    /// the associated value.
7411    ///
7412    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7413    pub fn r#list_extended_attributes(
7414        &self,
7415        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
7416    ) -> Result<(), fidl::Error> {
7417        self.client.send::<NodeListExtendedAttributesRequest>(
7418            (iterator,),
7419            0x4b61033de007fcd0,
7420            fidl::encoding::DynamicFlags::empty(),
7421        )
7422    }
7423
7424    /// Get the value associated with the given attribute `name` for this node.
7425    ///
7426    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
7427    /// particular structure is imposed on them.
7428    ///
7429    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
7430    pub fn r#get_extended_attribute(
7431        &self,
7432        mut name: &[u8],
7433        ___deadline: zx::MonotonicInstant,
7434    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
7435        let _response = self.client.send_query::<
7436            NodeGetExtendedAttributeRequest,
7437            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
7438            FileMarker,
7439        >(
7440            (name,),
7441            0x45ffa3ccfdeb76db,
7442            fidl::encoding::DynamicFlags::empty(),
7443            ___deadline,
7444        )?;
7445        Ok(_response.map(|x| x))
7446    }
7447
7448    /// Set the value for the given attribute `name` to `value` for this node.
7449    ///
7450    /// The attribute name may exist, in which case the attribute is updated.
7451    /// If the attribute doesn't exist, it is created. The name should have no
7452    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
7453    ///
7454    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7455    pub fn r#set_extended_attribute(
7456        &self,
7457        mut name: &[u8],
7458        mut value: ExtendedAttributeValue,
7459        mut mode: SetExtendedAttributeMode,
7460        ___deadline: zx::MonotonicInstant,
7461    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
7462        let _response = self.client.send_query::<
7463            NodeSetExtendedAttributeRequest,
7464            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7465            FileMarker,
7466        >(
7467            (name, &mut value, mode,),
7468            0x4a951362f681f23c,
7469            fidl::encoding::DynamicFlags::empty(),
7470            ___deadline,
7471        )?;
7472        Ok(_response.map(|x| x))
7473    }
7474
7475    /// Remove the specified extended attribute.
7476    ///
7477    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
7478    ///
7479    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7480    pub fn r#remove_extended_attribute(
7481        &self,
7482        mut name: &[u8],
7483        ___deadline: zx::MonotonicInstant,
7484    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
7485        let _response = self.client.send_query::<
7486            NodeRemoveExtendedAttributeRequest,
7487            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7488            FileMarker,
7489        >(
7490            (name,),
7491            0x7a0b9f3a9bf9032d,
7492            fidl::encoding::DynamicFlags::empty(),
7493            ___deadline,
7494        )?;
7495        Ok(_response.map(|x| x))
7496    }
7497
7498    /// Reads up to 'count' bytes at the seek offset.
7499    /// The seek offset is moved forward by the number of bytes read.
7500    ///
7501    /// ## Invariants
7502    ///
7503    /// * The returned `data.length` will never be greater than `count`.
7504    /// * If `data.length` is less than `count`, it means that the seek offset
7505    ///   has reached the end of file as part of this operation.
7506    /// * If `data.length` is zero while `count` is not, it means that the
7507    ///   seek offset is already at or beyond the end of file, and no data could
7508    ///   be read.
7509    /// * If `count` is zero, the server should perform all the checks ensuring
7510    ///   read access without actually read anything, and return an empty
7511    ///   `data` vector.
7512    ///
7513    /// This method requires the [`Rights.READ_BYTES`] right.
7514    ///
7515    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7516    pub fn r#read(
7517        &self,
7518        mut count: u64,
7519        ___deadline: zx::MonotonicInstant,
7520    ) -> Result<ReadableReadResult, fidl::Error> {
7521        let _response = self.client.send_query::<
7522            ReadableReadRequest,
7523            fidl::encoding::ResultType<ReadableReadResponse, i32>,
7524            FileMarker,
7525        >(
7526            (count,),
7527            0x57e419a298c8ede,
7528            fidl::encoding::DynamicFlags::empty(),
7529            ___deadline,
7530        )?;
7531        Ok(_response.map(|x| x.data))
7532    }
7533
7534    /// Writes data at the seek offset.
7535    /// The seek offset is moved forward by the number of bytes written.
7536    /// If the file is in append mode, the seek offset is first set to the end
7537    /// of the file, followed by the write, in one atomic step.
7538    ///
7539    /// The file size may grow if the seek offset plus `data.length` is beyond
7540    /// the current end of file.
7541    ///
7542    /// + request `data` the byte buffer to write to the file.
7543    /// - response `actual_count` the number of bytes written.
7544    ///
7545    /// ## Invariants
7546    ///
7547    /// * The returned `actual_count` will never be greater than `data.length`.
7548    /// * If the server is unable to write all the data due to e.g. not enough
7549    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7550    ///   could be written, an error is returned.
7551    /// * If `data.length` is zero, the server should perform all the checks
7552    ///   ensuring write access without mutating the file and return a
7553    ///   successful write of zero bytes.  The seek offset is still updated if
7554    ///   in append mode.
7555    ///
7556    /// This method requires the [`Rights.WRITE_BYTES`] right.
7557    pub fn r#write(
7558        &self,
7559        mut data: &[u8],
7560        ___deadline: zx::MonotonicInstant,
7561    ) -> Result<WritableWriteResult, fidl::Error> {
7562        let _response = self.client.send_query::<
7563            WritableWriteRequest,
7564            fidl::encoding::ResultType<WritableWriteResponse, i32>,
7565            FileMarker,
7566        >(
7567            (data,),
7568            0x6a31437832469f82,
7569            fidl::encoding::DynamicFlags::empty(),
7570            ___deadline,
7571        )?;
7572        Ok(_response.map(|x| x.actual_count))
7573    }
7574
7575    pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
7576        let _response =
7577            self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo, FileMarker>(
7578                (),
7579                0x68b5ac00c62906bc,
7580                fidl::encoding::DynamicFlags::empty(),
7581                ___deadline,
7582            )?;
7583        Ok(_response)
7584    }
7585
7586    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
7587    /// will occur. The seek offset is specific to each file connection.
7588    ///
7589    /// + request `origin` the reference point where `offset` will be based on.
7590    /// + request `offset` the number of bytes to seek.
7591    /// - response `offset_from_start` the adjusted seek offset, from the start
7592    ///   of the file.
7593    ///
7594    /// This method does not require any rights.
7595    pub fn r#seek(
7596        &self,
7597        mut origin: SeekOrigin,
7598        mut offset: i64,
7599        ___deadline: zx::MonotonicInstant,
7600    ) -> Result<FileSeekResult, fidl::Error> {
7601        let _response = self.client.send_query::<
7602            FileSeekRequest,
7603            fidl::encoding::ResultType<FileSeekResponse, i32>,
7604            FileMarker,
7605        >(
7606            (origin, offset,),
7607            0x78079168162c5207,
7608            fidl::encoding::DynamicFlags::empty(),
7609            ___deadline,
7610        )?;
7611        Ok(_response.map(|x| x.offset_from_start))
7612    }
7613
7614    /// Reads up to 'count' bytes at the provided offset.
7615    /// Does not affect the seek offset.
7616    ///
7617    /// ## Invariants
7618    ///
7619    /// * The returned `data.length` will never be greater than `count`.
7620    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
7621    ///   the end of file as part of this operation.
7622    /// * If `data.length` is zero while `count` is not, it means that `offset`
7623    ///   is at or past the end of file, and no data can be read.
7624    /// * If `count` is zero, the server should perform all the checks ensuring
7625    ///   read access without actually reading anything, and return an empty
7626    ///   `data` vector.
7627    ///
7628    /// This method requires the [`Rights.READ_BYTES`] right.
7629    ///
7630    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
7631    pub fn r#read_at(
7632        &self,
7633        mut count: u64,
7634        mut offset: u64,
7635        ___deadline: zx::MonotonicInstant,
7636    ) -> Result<FileReadAtResult, fidl::Error> {
7637        let _response = self.client.send_query::<
7638            FileReadAtRequest,
7639            fidl::encoding::ResultType<FileReadAtResponse, i32>,
7640            FileMarker,
7641        >(
7642            (count, offset,),
7643            0x1607a293a60d723e,
7644            fidl::encoding::DynamicFlags::empty(),
7645            ___deadline,
7646        )?;
7647        Ok(_response.map(|x| x.data))
7648    }
7649
7650    /// Writes data at the provided offset.
7651    /// Does not affect the seek offset.
7652    ///
7653    /// The file size may grow if `offset` plus `data.length` is past the
7654    /// current end of file.
7655    ///
7656    /// + request `data` the byte buffer to write to the file.
7657    /// + request `offset` the offset from start of the file to begin writing.
7658    /// - response `actual_count` the number of bytes written.
7659    ///
7660    /// ## Invariants
7661    ///
7662    /// * The returned `actual_count` will never be greater than `data.length`.
7663    /// * If the server is unable to write all the data due to e.g. not enough
7664    ///   space, `actual_count` may be less than `data.length`.  If no bytes
7665    ///   could be written, an error is returned.
7666    /// * If `data.length` is zero, the server should perform all the checks
7667    ///   ensuring write access without mutating the file, and will return a
7668    ///   successful write of zero bytes.
7669    ///
7670    /// This method requires the [`Rights.WRITE_BYTES`] right.
7671    pub fn r#write_at(
7672        &self,
7673        mut data: &[u8],
7674        mut offset: u64,
7675        ___deadline: zx::MonotonicInstant,
7676    ) -> Result<FileWriteAtResult, fidl::Error> {
7677        let _response = self.client.send_query::<
7678            FileWriteAtRequest,
7679            fidl::encoding::ResultType<FileWriteAtResponse, i32>,
7680            FileMarker,
7681        >(
7682            (data, offset,),
7683            0x793eefc0045e792b,
7684            fidl::encoding::DynamicFlags::empty(),
7685            ___deadline,
7686        )?;
7687        Ok(_response.map(|x| x.actual_count))
7688    }
7689
7690    /// Shrinks or grows the file size to 'length' bytes.
7691    ///
7692    /// If file size is reduced by this operation, the extra trailing data'
7693    /// is discarded.
7694    /// If file size is increased by this operation, the extended area appears
7695    /// as if it was zeroed.
7696    ///
7697    /// This method requires the [`Rights.WRITE_BYTES`] right.
7698    pub fn r#resize(
7699        &self,
7700        mut length: u64,
7701        ___deadline: zx::MonotonicInstant,
7702    ) -> Result<FileResizeResult, fidl::Error> {
7703        let _response = self.client.send_query::<
7704            FileResizeRequest,
7705            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
7706            FileMarker,
7707        >(
7708            (length,),
7709            0x2b80825f0535743a,
7710            fidl::encoding::DynamicFlags::empty(),
7711            ___deadline,
7712        )?;
7713        Ok(_response.map(|x| x))
7714    }
7715
7716    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
7717    /// with the requested access rights.
7718    ///
7719    /// Implementations are not required to implement files backed by VMOs so
7720    /// this request may fail. Additionally, implementations may only support
7721    /// a certain subset of the flags. Clients should be prepared with fallback
7722    /// behavior if this request fails.
7723    ///
7724    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
7725    /// implementation is free to choose the semantics of the returned VMO.
7726    ///
7727    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
7728    /// - response `vmo` the requested [`zx.Handle:VMO`].
7729    /// * error a [`zx.Status`] value indicating the failure.
7730    ///
7731    /// This method requires the following rights:
7732    ///
7733    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
7734    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
7735    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
7736    pub fn r#get_backing_memory(
7737        &self,
7738        mut flags: VmoFlags,
7739        ___deadline: zx::MonotonicInstant,
7740    ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
7741        let _response = self.client.send_query::<
7742            FileGetBackingMemoryRequest,
7743            fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
7744            FileMarker,
7745        >(
7746            (flags,),
7747            0xa6a9e654cbf62b,
7748            fidl::encoding::DynamicFlags::empty(),
7749            ___deadline,
7750        )?;
7751        Ok(_response.map(|x| x.vmo))
7752    }
7753
7754    /// Pre-allocate on-disk space for this file.
7755    pub fn r#allocate(
7756        &self,
7757        mut offset: u64,
7758        mut length: u64,
7759        mut mode: AllocateMode,
7760        ___deadline: zx::MonotonicInstant,
7761    ) -> Result<FileAllocateResult, fidl::Error> {
7762        let _response = self.client.send_query::<
7763            FileAllocateRequest,
7764            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7765            FileMarker,
7766        >(
7767            (offset, length, mode,),
7768            0x77fa0c330b57fd2e,
7769            fidl::encoding::DynamicFlags::FLEXIBLE,
7770            ___deadline,
7771        )?
7772        .into_result::<FileMarker>("allocate")?;
7773        Ok(_response.map(|x| x))
7774    }
7775
7776    /// Enables verification for the file (permanently) which involves computing a merkle tree for
7777    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
7778    /// captured. Future reads will be verified against the computed merkle tree and writes will be
7779    /// rejected. This method can take some time to complete as it depends on the size of the file.
7780    /// This method can be aborted by closing the connection that this method was issued on.
7781    ///
7782    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
7783    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
7784    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
7785    /// Also returns any error that might arise from reading the file, or from flushing the file,
7786    /// such as `ZX_ERR_IO`.
7787    pub fn r#enable_verity(
7788        &self,
7789        mut options: &VerificationOptions,
7790        ___deadline: zx::MonotonicInstant,
7791    ) -> Result<FileEnableVerityResult, fidl::Error> {
7792        let _response = self.client.send_query::<
7793            FileEnableVerityRequest,
7794            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7795            FileMarker,
7796        >(
7797            (options,),
7798            0x2c421ec3faaeb8bb,
7799            fidl::encoding::DynamicFlags::FLEXIBLE,
7800            ___deadline,
7801        )?
7802        .into_result::<FileMarker>("enable_verity")?;
7803        Ok(_response.map(|x| x))
7804    }
7805}
7806
7807#[cfg(target_os = "fuchsia")]
7808impl From<FileSynchronousProxy> for zx::NullableHandle {
7809    fn from(value: FileSynchronousProxy) -> Self {
7810        value.into_channel().into()
7811    }
7812}
7813
7814#[cfg(target_os = "fuchsia")]
7815impl From<fidl::Channel> for FileSynchronousProxy {
7816    fn from(value: fidl::Channel) -> Self {
7817        Self::new(value)
7818    }
7819}
7820
7821#[cfg(target_os = "fuchsia")]
7822impl fidl::endpoints::FromClient for FileSynchronousProxy {
7823    type Protocol = FileMarker;
7824
7825    fn from_client(value: fidl::endpoints::ClientEnd<FileMarker>) -> Self {
7826        Self::new(value.into_channel())
7827    }
7828}
7829
7830#[derive(Debug, Clone)]
7831pub struct FileProxy {
7832    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7833}
7834
7835impl fidl::endpoints::Proxy for FileProxy {
7836    type Protocol = FileMarker;
7837
7838    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7839        Self::new(inner)
7840    }
7841
7842    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7843        self.client.into_channel().map_err(|client| Self { client })
7844    }
7845
7846    fn as_channel(&self) -> &::fidl::AsyncChannel {
7847        self.client.as_channel()
7848    }
7849}
7850
7851impl FileProxy {
7852    /// Create a new Proxy for fuchsia.io/File.
7853    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7854        let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7855        Self { client: fidl::client::Client::new(channel, protocol_name) }
7856    }
7857
7858    /// Get a Stream of events from the remote end of the protocol.
7859    ///
7860    /// # Panics
7861    ///
7862    /// Panics if the event stream was already taken.
7863    pub fn take_event_stream(&self) -> FileEventStream {
7864        FileEventStream { event_receiver: self.client.take_event_receiver() }
7865    }
7866
7867    /// Acquires an advisory lock on the underlying file.
7868    ///
7869    /// The lock lasts until either this connection is closed or
7870    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
7871    /// explicitly.
7872    ///
7873    /// Advisory locks are purely advisory. They do not prevent actual read or
7874    /// write operations from occurring on the file, either through this
7875    /// connection or through other connections.
7876    ///
7877    /// This method requires the following rights:
7878    ///
7879    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
7880    /// * [`Rights.WRITE_BYTES`] if `request.type` is
7881    ///   [`AdvisoryLockType.WRITE`].
7882    ///
7883    /// # Errors
7884    ///
7885    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
7886    ///   example, another connection might hold a conflicting lock type.
7887    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
7888    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
7889    ///   to acquire the given type of lock.
7890    pub fn r#advisory_lock(
7891        &self,
7892        mut request: &AdvisoryLockRequest,
7893    ) -> fidl::client::QueryResponseFut<
7894        AdvisoryLockingAdvisoryLockResult,
7895        fidl::encoding::DefaultFuchsiaResourceDialect,
7896    > {
7897        FileProxyInterface::r#advisory_lock(self, request)
7898    }
7899
7900    /// Creates a link to this this object with name `dst` in the directory represented by
7901    /// `dst_parent_token`.
7902    ///
7903    /// `dst` must be a resolved object name. Including "/" in the string will return
7904    /// `ZX_ERR_INVALID_ARGS`.
7905    ///
7906    /// This method requires the maximal set of rights supported by the filesystem for this object.
7907    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
7908    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
7909    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
7910    /// `ZX_ERR_ACCESS_DENIED`.
7911    ///
7912    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
7913    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
7914    ///
7915    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
7916    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
7917    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
7918    ///
7919    /// This method does not have the same atomicity properties has the `Directory::Link` method,
7920    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
7921    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
7922    pub fn r#link_into(
7923        &self,
7924        mut dst_parent_token: fidl::Event,
7925        mut dst: &str,
7926    ) -> fidl::client::QueryResponseFut<
7927        LinkableLinkIntoResult,
7928        fidl::encoding::DefaultFuchsiaResourceDialect,
7929    > {
7930        FileProxyInterface::r#link_into(self, dst_parent_token, dst)
7931    }
7932
7933    pub fn r#clone(
7934        &self,
7935        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7936    ) -> Result<(), fidl::Error> {
7937        FileProxyInterface::r#clone(self, request)
7938    }
7939
7940    /// Terminates the connection.
7941    ///
7942    /// After calling `Close`, the client must not send any other requests.
7943    ///
7944    /// Servers, after sending the status response, should close the connection
7945    /// regardless of status and without sending an epitaph.
7946    ///
7947    /// Closing the client end of the channel should be semantically equivalent
7948    /// to calling `Close` without knowing when the close has completed or its
7949    /// status.
7950    pub fn r#close(
7951        &self,
7952    ) -> fidl::client::QueryResponseFut<
7953        fidl_fuchsia_unknown::CloseableCloseResult,
7954        fidl::encoding::DefaultFuchsiaResourceDialect,
7955    > {
7956        FileProxyInterface::r#close(self)
7957    }
7958
7959    pub fn r#query(
7960        &self,
7961    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
7962    {
7963        FileProxyInterface::r#query(self)
7964    }
7965
7966    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
7967    pub fn r#deprecated_clone(
7968        &self,
7969        mut flags: OpenFlags,
7970        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
7971    ) -> Result<(), fidl::Error> {
7972        FileProxyInterface::r#deprecated_clone(self, flags, object)
7973    }
7974
7975    /// DEPRECATED - Use `Node.GetAttributes` instead.
7976    pub fn r#deprecated_get_attr(
7977        &self,
7978    ) -> fidl::client::QueryResponseFut<
7979        (i32, NodeAttributes),
7980        fidl::encoding::DefaultFuchsiaResourceDialect,
7981    > {
7982        FileProxyInterface::r#deprecated_get_attr(self)
7983    }
7984
7985    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
7986    pub fn r#deprecated_set_attr(
7987        &self,
7988        mut flags: NodeAttributeFlags,
7989        mut attributes: &NodeAttributes,
7990    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
7991        FileProxyInterface::r#deprecated_set_attr(self, flags, attributes)
7992    }
7993
7994    /// [DEPRECATED - Use new GetFlags method instead.]
7995    pub fn r#deprecated_get_flags(
7996        &self,
7997    ) -> fidl::client::QueryResponseFut<
7998        (i32, OpenFlags),
7999        fidl::encoding::DefaultFuchsiaResourceDialect,
8000    > {
8001        FileProxyInterface::r#deprecated_get_flags(self)
8002    }
8003
8004    /// [DEPRECATED - Use new SetFlags method instead.]
8005    pub fn r#deprecated_set_flags(
8006        &self,
8007        mut flags: OpenFlags,
8008    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
8009        FileProxyInterface::r#deprecated_set_flags(self, flags)
8010    }
8011
8012    /// Queries the flags that apply to this node after it has been opened/created. This method does
8013    /// not require any rights.
8014    ///
8015    /// Note that the final set of flags that apply to the connection may differ from those
8016    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
8017    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
8018    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
8019    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
8020    pub fn r#get_flags(
8021        &self,
8022    ) -> fidl::client::QueryResponseFut<
8023        NodeGetFlagsResult,
8024        fidl::encoding::DefaultFuchsiaResourceDialect,
8025    > {
8026        FileProxyInterface::r#get_flags(self)
8027    }
8028
8029    /// Sets the flags that apply to this node after it has been opened. This method does not
8030    /// require any rights.
8031    ///
8032    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
8033    /// clear append mode.
8034    ///
8035    /// Errors:
8036    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
8037    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
8038    pub fn r#set_flags(
8039        &self,
8040        mut flags: Flags,
8041    ) -> fidl::client::QueryResponseFut<
8042        NodeSetFlagsResult,
8043        fidl::encoding::DefaultFuchsiaResourceDialect,
8044    > {
8045        FileProxyInterface::r#set_flags(self, flags)
8046    }
8047
8048    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
8049    /// volume has different settings or the storage is accounted seperately from the rest of the
8050    /// filesystem that may be reported instead of filesystem-wide details.
8051    pub fn r#query_filesystem(
8052        &self,
8053    ) -> fidl::client::QueryResponseFut<
8054        (i32, Option<Box<FilesystemInfo>>),
8055        fidl::encoding::DefaultFuchsiaResourceDialect,
8056    > {
8057        FileProxyInterface::r#query_filesystem(self)
8058    }
8059
8060    /// Acquires information about the node.
8061    ///
8062    /// The attributes of a node should be stable, independent of the
8063    /// specific protocol used to access it.
8064    ///
8065    /// If a particular attribute is not applicable or not supported,
8066    /// filesystems should leave the corresponding field absent.
8067    ///
8068    /// + `query` a bit-mask specifying which attributes to fetch. The server
8069    ///   should not return more than necessary.
8070    /// - `attributes` the returned attributes.
8071    ///
8072    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8073    pub fn r#get_attributes(
8074        &self,
8075        mut query: NodeAttributesQuery,
8076    ) -> fidl::client::QueryResponseFut<
8077        NodeGetAttributesResult,
8078        fidl::encoding::DefaultFuchsiaResourceDialect,
8079    > {
8080        FileProxyInterface::r#get_attributes(self, query)
8081    }
8082
8083    /// Updates information about the node.
8084    ///
8085    /// + `attributes` the presence of a table field in `attributes` indicates
8086    /// the intent to update the corresponding attribute.
8087    ///
8088    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
8089    ///
8090    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8091    pub fn r#update_attributes(
8092        &self,
8093        mut payload: &MutableNodeAttributes,
8094    ) -> fidl::client::QueryResponseFut<
8095        NodeUpdateAttributesResult,
8096        fidl::encoding::DefaultFuchsiaResourceDialect,
8097    > {
8098        FileProxyInterface::r#update_attributes(self, payload)
8099    }
8100
8101    /// Synchronizes updates to the node to the underlying media, if it exists.
8102    ///
8103    /// This method will return when the filesystem server has flushed the
8104    /// relevant updates to the underlying media, but does not guarantee the
8105    /// underlying media has persisted the information, nor that any information
8106    /// is committed to hardware. Clients may use `Sync` to ensure ordering
8107    /// between operations.
8108    ///
8109    /// This method does not require any rights.
8110    pub fn r#sync(
8111        &self,
8112    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8113    {
8114        FileProxyInterface::r#sync(self)
8115    }
8116
8117    /// Creates an iterator over all the extended attribute names associated
8118    /// with this node. If an error occurs it is returned as an epitaph on the
8119    /// iterator request channel, and then the channel is closed.
8120    ///
8121    /// GetExtendedAttributes can be used with any of these names to retrieve
8122    /// the associated value.
8123    ///
8124    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8125    pub fn r#list_extended_attributes(
8126        &self,
8127        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8128    ) -> Result<(), fidl::Error> {
8129        FileProxyInterface::r#list_extended_attributes(self, iterator)
8130    }
8131
8132    /// Get the value associated with the given attribute `name` for this node.
8133    ///
8134    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
8135    /// particular structure is imposed on them.
8136    ///
8137    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
8138    pub fn r#get_extended_attribute(
8139        &self,
8140        mut name: &[u8],
8141    ) -> fidl::client::QueryResponseFut<
8142        NodeGetExtendedAttributeResult,
8143        fidl::encoding::DefaultFuchsiaResourceDialect,
8144    > {
8145        FileProxyInterface::r#get_extended_attribute(self, name)
8146    }
8147
8148    /// Set the value for the given attribute `name` to `value` for this node.
8149    ///
8150    /// The attribute name may exist, in which case the attribute is updated.
8151    /// If the attribute doesn't exist, it is created. The name should have no
8152    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
8153    ///
8154    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8155    pub fn r#set_extended_attribute(
8156        &self,
8157        mut name: &[u8],
8158        mut value: ExtendedAttributeValue,
8159        mut mode: SetExtendedAttributeMode,
8160    ) -> fidl::client::QueryResponseFut<
8161        NodeSetExtendedAttributeResult,
8162        fidl::encoding::DefaultFuchsiaResourceDialect,
8163    > {
8164        FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
8165    }
8166
8167    /// Remove the specified extended attribute.
8168    ///
8169    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
8170    ///
8171    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8172    pub fn r#remove_extended_attribute(
8173        &self,
8174        mut name: &[u8],
8175    ) -> fidl::client::QueryResponseFut<
8176        NodeRemoveExtendedAttributeResult,
8177        fidl::encoding::DefaultFuchsiaResourceDialect,
8178    > {
8179        FileProxyInterface::r#remove_extended_attribute(self, name)
8180    }
8181
8182    /// Reads up to 'count' bytes at the seek offset.
8183    /// The seek offset is moved forward by the number of bytes read.
8184    ///
8185    /// ## Invariants
8186    ///
8187    /// * The returned `data.length` will never be greater than `count`.
8188    /// * If `data.length` is less than `count`, it means that the seek offset
8189    ///   has reached the end of file as part of this operation.
8190    /// * If `data.length` is zero while `count` is not, it means that the
8191    ///   seek offset is already at or beyond the end of file, and no data could
8192    ///   be read.
8193    /// * If `count` is zero, the server should perform all the checks ensuring
8194    ///   read access without actually read anything, and return an empty
8195    ///   `data` vector.
8196    ///
8197    /// This method requires the [`Rights.READ_BYTES`] right.
8198    ///
8199    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8200    pub fn r#read(
8201        &self,
8202        mut count: u64,
8203    ) -> fidl::client::QueryResponseFut<
8204        ReadableReadResult,
8205        fidl::encoding::DefaultFuchsiaResourceDialect,
8206    > {
8207        FileProxyInterface::r#read(self, count)
8208    }
8209
8210    /// Writes data at the seek offset.
8211    /// The seek offset is moved forward by the number of bytes written.
8212    /// If the file is in append mode, the seek offset is first set to the end
8213    /// of the file, followed by the write, in one atomic step.
8214    ///
8215    /// The file size may grow if the seek offset plus `data.length` is beyond
8216    /// the current end of file.
8217    ///
8218    /// + request `data` the byte buffer to write to the file.
8219    /// - response `actual_count` the number of bytes written.
8220    ///
8221    /// ## Invariants
8222    ///
8223    /// * The returned `actual_count` will never be greater than `data.length`.
8224    /// * If the server is unable to write all the data due to e.g. not enough
8225    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8226    ///   could be written, an error is returned.
8227    /// * If `data.length` is zero, the server should perform all the checks
8228    ///   ensuring write access without mutating the file and return a
8229    ///   successful write of zero bytes.  The seek offset is still updated if
8230    ///   in append mode.
8231    ///
8232    /// This method requires the [`Rights.WRITE_BYTES`] right.
8233    pub fn r#write(
8234        &self,
8235        mut data: &[u8],
8236    ) -> fidl::client::QueryResponseFut<
8237        WritableWriteResult,
8238        fidl::encoding::DefaultFuchsiaResourceDialect,
8239    > {
8240        FileProxyInterface::r#write(self, data)
8241    }
8242
8243    pub fn r#describe(
8244        &self,
8245    ) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8246    {
8247        FileProxyInterface::r#describe(self)
8248    }
8249
8250    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
8251    /// will occur. The seek offset is specific to each file connection.
8252    ///
8253    /// + request `origin` the reference point where `offset` will be based on.
8254    /// + request `offset` the number of bytes to seek.
8255    /// - response `offset_from_start` the adjusted seek offset, from the start
8256    ///   of the file.
8257    ///
8258    /// This method does not require any rights.
8259    pub fn r#seek(
8260        &self,
8261        mut origin: SeekOrigin,
8262        mut offset: i64,
8263    ) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
8264    {
8265        FileProxyInterface::r#seek(self, origin, offset)
8266    }
8267
8268    /// Reads up to 'count' bytes at the provided offset.
8269    /// Does not affect the seek offset.
8270    ///
8271    /// ## Invariants
8272    ///
8273    /// * The returned `data.length` will never be greater than `count`.
8274    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
8275    ///   the end of file as part of this operation.
8276    /// * If `data.length` is zero while `count` is not, it means that `offset`
8277    ///   is at or past the end of file, and no data can be read.
8278    /// * If `count` is zero, the server should perform all the checks ensuring
8279    ///   read access without actually reading anything, and return an empty
8280    ///   `data` vector.
8281    ///
8282    /// This method requires the [`Rights.READ_BYTES`] right.
8283    ///
8284    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
8285    pub fn r#read_at(
8286        &self,
8287        mut count: u64,
8288        mut offset: u64,
8289    ) -> fidl::client::QueryResponseFut<
8290        FileReadAtResult,
8291        fidl::encoding::DefaultFuchsiaResourceDialect,
8292    > {
8293        FileProxyInterface::r#read_at(self, count, offset)
8294    }
8295
8296    /// Writes data at the provided offset.
8297    /// Does not affect the seek offset.
8298    ///
8299    /// The file size may grow if `offset` plus `data.length` is past the
8300    /// current end of file.
8301    ///
8302    /// + request `data` the byte buffer to write to the file.
8303    /// + request `offset` the offset from start of the file to begin writing.
8304    /// - response `actual_count` the number of bytes written.
8305    ///
8306    /// ## Invariants
8307    ///
8308    /// * The returned `actual_count` will never be greater than `data.length`.
8309    /// * If the server is unable to write all the data due to e.g. not enough
8310    ///   space, `actual_count` may be less than `data.length`.  If no bytes
8311    ///   could be written, an error is returned.
8312    /// * If `data.length` is zero, the server should perform all the checks
8313    ///   ensuring write access without mutating the file, and will return a
8314    ///   successful write of zero bytes.
8315    ///
8316    /// This method requires the [`Rights.WRITE_BYTES`] right.
8317    pub fn r#write_at(
8318        &self,
8319        mut data: &[u8],
8320        mut offset: u64,
8321    ) -> fidl::client::QueryResponseFut<
8322        FileWriteAtResult,
8323        fidl::encoding::DefaultFuchsiaResourceDialect,
8324    > {
8325        FileProxyInterface::r#write_at(self, data, offset)
8326    }
8327
8328    /// Shrinks or grows the file size to 'length' bytes.
8329    ///
8330    /// If file size is reduced by this operation, the extra trailing data'
8331    /// is discarded.
8332    /// If file size is increased by this operation, the extended area appears
8333    /// as if it was zeroed.
8334    ///
8335    /// This method requires the [`Rights.WRITE_BYTES`] right.
8336    pub fn r#resize(
8337        &self,
8338        mut length: u64,
8339    ) -> fidl::client::QueryResponseFut<
8340        FileResizeResult,
8341        fidl::encoding::DefaultFuchsiaResourceDialect,
8342    > {
8343        FileProxyInterface::r#resize(self, length)
8344    }
8345
8346    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
8347    /// with the requested access rights.
8348    ///
8349    /// Implementations are not required to implement files backed by VMOs so
8350    /// this request may fail. Additionally, implementations may only support
8351    /// a certain subset of the flags. Clients should be prepared with fallback
8352    /// behavior if this request fails.
8353    ///
8354    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
8355    /// implementation is free to choose the semantics of the returned VMO.
8356    ///
8357    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
8358    /// - response `vmo` the requested [`zx.Handle:VMO`].
8359    /// * error a [`zx.Status`] value indicating the failure.
8360    ///
8361    /// This method requires the following rights:
8362    ///
8363    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
8364    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
8365    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
8366    pub fn r#get_backing_memory(
8367        &self,
8368        mut flags: VmoFlags,
8369    ) -> fidl::client::QueryResponseFut<
8370        FileGetBackingMemoryResult,
8371        fidl::encoding::DefaultFuchsiaResourceDialect,
8372    > {
8373        FileProxyInterface::r#get_backing_memory(self, flags)
8374    }
8375
8376    /// Pre-allocate on-disk space for this file.
8377    pub fn r#allocate(
8378        &self,
8379        mut offset: u64,
8380        mut length: u64,
8381        mut mode: AllocateMode,
8382    ) -> fidl::client::QueryResponseFut<
8383        FileAllocateResult,
8384        fidl::encoding::DefaultFuchsiaResourceDialect,
8385    > {
8386        FileProxyInterface::r#allocate(self, offset, length, mode)
8387    }
8388
8389    /// Enables verification for the file (permanently) which involves computing a merkle tree for
8390    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
8391    /// captured. Future reads will be verified against the computed merkle tree and writes will be
8392    /// rejected. This method can take some time to complete as it depends on the size of the file.
8393    /// This method can be aborted by closing the connection that this method was issued on.
8394    ///
8395    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
8396    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
8397    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
8398    /// Also returns any error that might arise from reading the file, or from flushing the file,
8399    /// such as `ZX_ERR_IO`.
8400    pub fn r#enable_verity(
8401        &self,
8402        mut options: &VerificationOptions,
8403    ) -> fidl::client::QueryResponseFut<
8404        FileEnableVerityResult,
8405        fidl::encoding::DefaultFuchsiaResourceDialect,
8406    > {
8407        FileProxyInterface::r#enable_verity(self, options)
8408    }
8409}
8410
8411impl FileProxyInterface for FileProxy {
8412    type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
8413        AdvisoryLockingAdvisoryLockResult,
8414        fidl::encoding::DefaultFuchsiaResourceDialect,
8415    >;
8416    fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
8417        fn _decode(
8418            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8419        ) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
8420            let _response = fidl::client::decode_transaction_body::<
8421                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8422                fidl::encoding::DefaultFuchsiaResourceDialect,
8423                0x6ee9c0ad53ec87aa,
8424            >(_buf?)?;
8425            Ok(_response.map(|x| x))
8426        }
8427        self.client.send_query_and_decode::<
8428            AdvisoryLockingAdvisoryLockRequest,
8429            AdvisoryLockingAdvisoryLockResult,
8430        >(
8431            (request,),
8432            0x6ee9c0ad53ec87aa,
8433            fidl::encoding::DynamicFlags::empty(),
8434            _decode,
8435        )
8436    }
8437
8438    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
8439        LinkableLinkIntoResult,
8440        fidl::encoding::DefaultFuchsiaResourceDialect,
8441    >;
8442    fn r#link_into(
8443        &self,
8444        mut dst_parent_token: fidl::Event,
8445        mut dst: &str,
8446    ) -> Self::LinkIntoResponseFut {
8447        fn _decode(
8448            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8449        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
8450            let _response = fidl::client::decode_transaction_body::<
8451                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8452                fidl::encoding::DefaultFuchsiaResourceDialect,
8453                0x54f3949246a03e74,
8454            >(_buf?)?;
8455            Ok(_response.map(|x| x))
8456        }
8457        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
8458            (dst_parent_token, dst),
8459            0x54f3949246a03e74,
8460            fidl::encoding::DynamicFlags::empty(),
8461            _decode,
8462        )
8463    }
8464
8465    fn r#clone(
8466        &self,
8467        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8468    ) -> Result<(), fidl::Error> {
8469        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8470            (request,),
8471            0x20d8a7aba2168a79,
8472            fidl::encoding::DynamicFlags::empty(),
8473        )
8474    }
8475
8476    type CloseResponseFut = fidl::client::QueryResponseFut<
8477        fidl_fuchsia_unknown::CloseableCloseResult,
8478        fidl::encoding::DefaultFuchsiaResourceDialect,
8479    >;
8480    fn r#close(&self) -> Self::CloseResponseFut {
8481        fn _decode(
8482            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8483        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
8484            let _response = fidl::client::decode_transaction_body::<
8485                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8486                fidl::encoding::DefaultFuchsiaResourceDialect,
8487                0x5ac5d459ad7f657e,
8488            >(_buf?)?;
8489            Ok(_response.map(|x| x))
8490        }
8491        self.client.send_query_and_decode::<
8492            fidl::encoding::EmptyPayload,
8493            fidl_fuchsia_unknown::CloseableCloseResult,
8494        >(
8495            (),
8496            0x5ac5d459ad7f657e,
8497            fidl::encoding::DynamicFlags::empty(),
8498            _decode,
8499        )
8500    }
8501
8502    type QueryResponseFut =
8503        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8504    fn r#query(&self) -> Self::QueryResponseFut {
8505        fn _decode(
8506            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8507        ) -> Result<Vec<u8>, fidl::Error> {
8508            let _response = fidl::client::decode_transaction_body::<
8509                fidl_fuchsia_unknown::QueryableQueryResponse,
8510                fidl::encoding::DefaultFuchsiaResourceDialect,
8511                0x2658edee9decfc06,
8512            >(_buf?)?;
8513            Ok(_response.protocol)
8514        }
8515        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
8516            (),
8517            0x2658edee9decfc06,
8518            fidl::encoding::DynamicFlags::empty(),
8519            _decode,
8520        )
8521    }
8522
8523    fn r#deprecated_clone(
8524        &self,
8525        mut flags: OpenFlags,
8526        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
8527    ) -> Result<(), fidl::Error> {
8528        self.client.send::<NodeDeprecatedCloneRequest>(
8529            (flags, object),
8530            0x5a61678f293ce16f,
8531            fidl::encoding::DynamicFlags::FLEXIBLE,
8532        )
8533    }
8534
8535    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
8536        (i32, NodeAttributes),
8537        fidl::encoding::DefaultFuchsiaResourceDialect,
8538    >;
8539    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
8540        fn _decode(
8541            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8542        ) -> Result<(i32, NodeAttributes), fidl::Error> {
8543            let _response = fidl::client::decode_transaction_body::<
8544                NodeDeprecatedGetAttrResponse,
8545                fidl::encoding::DefaultFuchsiaResourceDialect,
8546                0x78985e216314dafd,
8547            >(_buf?)?;
8548            Ok((_response.s, _response.attributes))
8549        }
8550        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
8551            (),
8552            0x78985e216314dafd,
8553            fidl::encoding::DynamicFlags::empty(),
8554            _decode,
8555        )
8556    }
8557
8558    type DeprecatedSetAttrResponseFut =
8559        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8560    fn r#deprecated_set_attr(
8561        &self,
8562        mut flags: NodeAttributeFlags,
8563        mut attributes: &NodeAttributes,
8564    ) -> Self::DeprecatedSetAttrResponseFut {
8565        fn _decode(
8566            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8567        ) -> Result<i32, fidl::Error> {
8568            let _response = fidl::client::decode_transaction_body::<
8569                NodeDeprecatedSetAttrResponse,
8570                fidl::encoding::DefaultFuchsiaResourceDialect,
8571                0x4186c0f40d938f46,
8572            >(_buf?)?;
8573            Ok(_response.s)
8574        }
8575        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
8576            (flags, attributes),
8577            0x4186c0f40d938f46,
8578            fidl::encoding::DynamicFlags::empty(),
8579            _decode,
8580        )
8581    }
8582
8583    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
8584        (i32, OpenFlags),
8585        fidl::encoding::DefaultFuchsiaResourceDialect,
8586    >;
8587    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
8588        fn _decode(
8589            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8590        ) -> Result<(i32, OpenFlags), fidl::Error> {
8591            let _response = fidl::client::decode_transaction_body::<
8592                NodeDeprecatedGetFlagsResponse,
8593                fidl::encoding::DefaultFuchsiaResourceDialect,
8594                0x5b88fffb8eda3aa1,
8595            >(_buf?)?;
8596            Ok((_response.s, _response.flags))
8597        }
8598        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
8599            (),
8600            0x5b88fffb8eda3aa1,
8601            fidl::encoding::DynamicFlags::empty(),
8602            _decode,
8603        )
8604    }
8605
8606    type DeprecatedSetFlagsResponseFut =
8607        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
8608    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
8609        fn _decode(
8610            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8611        ) -> Result<i32, fidl::Error> {
8612            let _response = fidl::client::decode_transaction_body::<
8613                NodeDeprecatedSetFlagsResponse,
8614                fidl::encoding::DefaultFuchsiaResourceDialect,
8615                0x5295b76c71fde733,
8616            >(_buf?)?;
8617            Ok(_response.s)
8618        }
8619        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
8620            (flags,),
8621            0x5295b76c71fde733,
8622            fidl::encoding::DynamicFlags::empty(),
8623            _decode,
8624        )
8625    }
8626
8627    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
8628        NodeGetFlagsResult,
8629        fidl::encoding::DefaultFuchsiaResourceDialect,
8630    >;
8631    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
8632        fn _decode(
8633            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8634        ) -> Result<NodeGetFlagsResult, fidl::Error> {
8635            let _response = fidl::client::decode_transaction_body::<
8636                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
8637                fidl::encoding::DefaultFuchsiaResourceDialect,
8638                0x176eb318f64ec23,
8639            >(_buf?)?
8640            .into_result::<FileMarker>("get_flags")?;
8641            Ok(_response.map(|x| x.flags))
8642        }
8643        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
8644            (),
8645            0x176eb318f64ec23,
8646            fidl::encoding::DynamicFlags::FLEXIBLE,
8647            _decode,
8648        )
8649    }
8650
8651    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
8652        NodeSetFlagsResult,
8653        fidl::encoding::DefaultFuchsiaResourceDialect,
8654    >;
8655    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
8656        fn _decode(
8657            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8658        ) -> Result<NodeSetFlagsResult, fidl::Error> {
8659            let _response = fidl::client::decode_transaction_body::<
8660                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
8661                fidl::encoding::DefaultFuchsiaResourceDialect,
8662                0x55a8028685791ea8,
8663            >(_buf?)?
8664            .into_result::<FileMarker>("set_flags")?;
8665            Ok(_response.map(|x| x))
8666        }
8667        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
8668            (flags,),
8669            0x55a8028685791ea8,
8670            fidl::encoding::DynamicFlags::FLEXIBLE,
8671            _decode,
8672        )
8673    }
8674
8675    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
8676        (i32, Option<Box<FilesystemInfo>>),
8677        fidl::encoding::DefaultFuchsiaResourceDialect,
8678    >;
8679    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
8680        fn _decode(
8681            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8682        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
8683            let _response = fidl::client::decode_transaction_body::<
8684                NodeQueryFilesystemResponse,
8685                fidl::encoding::DefaultFuchsiaResourceDialect,
8686                0x6f344a1c6b0a0610,
8687            >(_buf?)?;
8688            Ok((_response.s, _response.info))
8689        }
8690        self.client.send_query_and_decode::<
8691            fidl::encoding::EmptyPayload,
8692            (i32, Option<Box<FilesystemInfo>>),
8693        >(
8694            (),
8695            0x6f344a1c6b0a0610,
8696            fidl::encoding::DynamicFlags::empty(),
8697            _decode,
8698        )
8699    }
8700
8701    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
8702        NodeGetAttributesResult,
8703        fidl::encoding::DefaultFuchsiaResourceDialect,
8704    >;
8705    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
8706        fn _decode(
8707            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8708        ) -> Result<NodeGetAttributesResult, fidl::Error> {
8709            let _response = fidl::client::decode_transaction_body::<
8710                fidl::encoding::ResultType<NodeAttributes2, i32>,
8711                fidl::encoding::DefaultFuchsiaResourceDialect,
8712                0x3d4396a638ea053b,
8713            >(_buf?)?;
8714            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
8715        }
8716        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
8717            (query,),
8718            0x3d4396a638ea053b,
8719            fidl::encoding::DynamicFlags::empty(),
8720            _decode,
8721        )
8722    }
8723
8724    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
8725        NodeUpdateAttributesResult,
8726        fidl::encoding::DefaultFuchsiaResourceDialect,
8727    >;
8728    fn r#update_attributes(
8729        &self,
8730        mut payload: &MutableNodeAttributes,
8731    ) -> Self::UpdateAttributesResponseFut {
8732        fn _decode(
8733            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8734        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
8735            let _response = fidl::client::decode_transaction_body::<
8736                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8737                fidl::encoding::DefaultFuchsiaResourceDialect,
8738                0x3308c1da5a89bf08,
8739            >(_buf?)?;
8740            Ok(_response.map(|x| x))
8741        }
8742        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
8743            payload,
8744            0x3308c1da5a89bf08,
8745            fidl::encoding::DynamicFlags::empty(),
8746            _decode,
8747        )
8748    }
8749
8750    type SyncResponseFut = fidl::client::QueryResponseFut<
8751        NodeSyncResult,
8752        fidl::encoding::DefaultFuchsiaResourceDialect,
8753    >;
8754    fn r#sync(&self) -> Self::SyncResponseFut {
8755        fn _decode(
8756            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8757        ) -> Result<NodeSyncResult, fidl::Error> {
8758            let _response = fidl::client::decode_transaction_body::<
8759                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8760                fidl::encoding::DefaultFuchsiaResourceDialect,
8761                0x2c5c27ca0ab5dc49,
8762            >(_buf?)?;
8763            Ok(_response.map(|x| x))
8764        }
8765        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
8766            (),
8767            0x2c5c27ca0ab5dc49,
8768            fidl::encoding::DynamicFlags::empty(),
8769            _decode,
8770        )
8771    }
8772
8773    fn r#list_extended_attributes(
8774        &self,
8775        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
8776    ) -> Result<(), fidl::Error> {
8777        self.client.send::<NodeListExtendedAttributesRequest>(
8778            (iterator,),
8779            0x4b61033de007fcd0,
8780            fidl::encoding::DynamicFlags::empty(),
8781        )
8782    }
8783
8784    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8785        NodeGetExtendedAttributeResult,
8786        fidl::encoding::DefaultFuchsiaResourceDialect,
8787    >;
8788    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
8789        fn _decode(
8790            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8791        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
8792            let _response = fidl::client::decode_transaction_body::<
8793                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
8794                fidl::encoding::DefaultFuchsiaResourceDialect,
8795                0x45ffa3ccfdeb76db,
8796            >(_buf?)?;
8797            Ok(_response.map(|x| x))
8798        }
8799        self.client.send_query_and_decode::<
8800            NodeGetExtendedAttributeRequest,
8801            NodeGetExtendedAttributeResult,
8802        >(
8803            (name,),
8804            0x45ffa3ccfdeb76db,
8805            fidl::encoding::DynamicFlags::empty(),
8806            _decode,
8807        )
8808    }
8809
8810    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8811        NodeSetExtendedAttributeResult,
8812        fidl::encoding::DefaultFuchsiaResourceDialect,
8813    >;
8814    fn r#set_extended_attribute(
8815        &self,
8816        mut name: &[u8],
8817        mut value: ExtendedAttributeValue,
8818        mut mode: SetExtendedAttributeMode,
8819    ) -> Self::SetExtendedAttributeResponseFut {
8820        fn _decode(
8821            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8822        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
8823            let _response = fidl::client::decode_transaction_body::<
8824                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8825                fidl::encoding::DefaultFuchsiaResourceDialect,
8826                0x4a951362f681f23c,
8827            >(_buf?)?;
8828            Ok(_response.map(|x| x))
8829        }
8830        self.client.send_query_and_decode::<
8831            NodeSetExtendedAttributeRequest,
8832            NodeSetExtendedAttributeResult,
8833        >(
8834            (name, &mut value, mode,),
8835            0x4a951362f681f23c,
8836            fidl::encoding::DynamicFlags::empty(),
8837            _decode,
8838        )
8839    }
8840
8841    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
8842        NodeRemoveExtendedAttributeResult,
8843        fidl::encoding::DefaultFuchsiaResourceDialect,
8844    >;
8845    fn r#remove_extended_attribute(
8846        &self,
8847        mut name: &[u8],
8848    ) -> Self::RemoveExtendedAttributeResponseFut {
8849        fn _decode(
8850            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8851        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
8852            let _response = fidl::client::decode_transaction_body::<
8853                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
8854                fidl::encoding::DefaultFuchsiaResourceDialect,
8855                0x7a0b9f3a9bf9032d,
8856            >(_buf?)?;
8857            Ok(_response.map(|x| x))
8858        }
8859        self.client.send_query_and_decode::<
8860            NodeRemoveExtendedAttributeRequest,
8861            NodeRemoveExtendedAttributeResult,
8862        >(
8863            (name,),
8864            0x7a0b9f3a9bf9032d,
8865            fidl::encoding::DynamicFlags::empty(),
8866            _decode,
8867        )
8868    }
8869
8870    type ReadResponseFut = fidl::client::QueryResponseFut<
8871        ReadableReadResult,
8872        fidl::encoding::DefaultFuchsiaResourceDialect,
8873    >;
8874    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
8875        fn _decode(
8876            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8877        ) -> Result<ReadableReadResult, fidl::Error> {
8878            let _response = fidl::client::decode_transaction_body::<
8879                fidl::encoding::ResultType<ReadableReadResponse, i32>,
8880                fidl::encoding::DefaultFuchsiaResourceDialect,
8881                0x57e419a298c8ede,
8882            >(_buf?)?;
8883            Ok(_response.map(|x| x.data))
8884        }
8885        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
8886            (count,),
8887            0x57e419a298c8ede,
8888            fidl::encoding::DynamicFlags::empty(),
8889            _decode,
8890        )
8891    }
8892
8893    type WriteResponseFut = fidl::client::QueryResponseFut<
8894        WritableWriteResult,
8895        fidl::encoding::DefaultFuchsiaResourceDialect,
8896    >;
8897    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
8898        fn _decode(
8899            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8900        ) -> Result<WritableWriteResult, fidl::Error> {
8901            let _response = fidl::client::decode_transaction_body::<
8902                fidl::encoding::ResultType<WritableWriteResponse, i32>,
8903                fidl::encoding::DefaultFuchsiaResourceDialect,
8904                0x6a31437832469f82,
8905            >(_buf?)?;
8906            Ok(_response.map(|x| x.actual_count))
8907        }
8908        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
8909            (data,),
8910            0x6a31437832469f82,
8911            fidl::encoding::DynamicFlags::empty(),
8912            _decode,
8913        )
8914    }
8915
8916    type DescribeResponseFut =
8917        fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8918    fn r#describe(&self) -> Self::DescribeResponseFut {
8919        fn _decode(
8920            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8921        ) -> Result<FileInfo, fidl::Error> {
8922            let _response = fidl::client::decode_transaction_body::<
8923                FileInfo,
8924                fidl::encoding::DefaultFuchsiaResourceDialect,
8925                0x68b5ac00c62906bc,
8926            >(_buf?)?;
8927            Ok(_response)
8928        }
8929        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
8930            (),
8931            0x68b5ac00c62906bc,
8932            fidl::encoding::DynamicFlags::empty(),
8933            _decode,
8934        )
8935    }
8936
8937    type SeekResponseFut = fidl::client::QueryResponseFut<
8938        FileSeekResult,
8939        fidl::encoding::DefaultFuchsiaResourceDialect,
8940    >;
8941    fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
8942        fn _decode(
8943            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8944        ) -> Result<FileSeekResult, fidl::Error> {
8945            let _response = fidl::client::decode_transaction_body::<
8946                fidl::encoding::ResultType<FileSeekResponse, i32>,
8947                fidl::encoding::DefaultFuchsiaResourceDialect,
8948                0x78079168162c5207,
8949            >(_buf?)?;
8950            Ok(_response.map(|x| x.offset_from_start))
8951        }
8952        self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
8953            (origin, offset),
8954            0x78079168162c5207,
8955            fidl::encoding::DynamicFlags::empty(),
8956            _decode,
8957        )
8958    }
8959
8960    type ReadAtResponseFut = fidl::client::QueryResponseFut<
8961        FileReadAtResult,
8962        fidl::encoding::DefaultFuchsiaResourceDialect,
8963    >;
8964    fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
8965        fn _decode(
8966            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8967        ) -> Result<FileReadAtResult, fidl::Error> {
8968            let _response = fidl::client::decode_transaction_body::<
8969                fidl::encoding::ResultType<FileReadAtResponse, i32>,
8970                fidl::encoding::DefaultFuchsiaResourceDialect,
8971                0x1607a293a60d723e,
8972            >(_buf?)?;
8973            Ok(_response.map(|x| x.data))
8974        }
8975        self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
8976            (count, offset),
8977            0x1607a293a60d723e,
8978            fidl::encoding::DynamicFlags::empty(),
8979            _decode,
8980        )
8981    }
8982
8983    type WriteAtResponseFut = fidl::client::QueryResponseFut<
8984        FileWriteAtResult,
8985        fidl::encoding::DefaultFuchsiaResourceDialect,
8986    >;
8987    fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
8988        fn _decode(
8989            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8990        ) -> Result<FileWriteAtResult, fidl::Error> {
8991            let _response = fidl::client::decode_transaction_body::<
8992                fidl::encoding::ResultType<FileWriteAtResponse, i32>,
8993                fidl::encoding::DefaultFuchsiaResourceDialect,
8994                0x793eefc0045e792b,
8995            >(_buf?)?;
8996            Ok(_response.map(|x| x.actual_count))
8997        }
8998        self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
8999            (data, offset),
9000            0x793eefc0045e792b,
9001            fidl::encoding::DynamicFlags::empty(),
9002            _decode,
9003        )
9004    }
9005
9006    type ResizeResponseFut = fidl::client::QueryResponseFut<
9007        FileResizeResult,
9008        fidl::encoding::DefaultFuchsiaResourceDialect,
9009    >;
9010    fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
9011        fn _decode(
9012            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9013        ) -> Result<FileResizeResult, fidl::Error> {
9014            let _response = fidl::client::decode_transaction_body::<
9015                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9016                fidl::encoding::DefaultFuchsiaResourceDialect,
9017                0x2b80825f0535743a,
9018            >(_buf?)?;
9019            Ok(_response.map(|x| x))
9020        }
9021        self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
9022            (length,),
9023            0x2b80825f0535743a,
9024            fidl::encoding::DynamicFlags::empty(),
9025            _decode,
9026        )
9027    }
9028
9029    type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
9030        FileGetBackingMemoryResult,
9031        fidl::encoding::DefaultFuchsiaResourceDialect,
9032    >;
9033    fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
9034        fn _decode(
9035            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9036        ) -> Result<FileGetBackingMemoryResult, fidl::Error> {
9037            let _response = fidl::client::decode_transaction_body::<
9038                fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
9039                fidl::encoding::DefaultFuchsiaResourceDialect,
9040                0xa6a9e654cbf62b,
9041            >(_buf?)?;
9042            Ok(_response.map(|x| x.vmo))
9043        }
9044        self.client
9045            .send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
9046                (flags,),
9047                0xa6a9e654cbf62b,
9048                fidl::encoding::DynamicFlags::empty(),
9049                _decode,
9050            )
9051    }
9052
9053    type AllocateResponseFut = fidl::client::QueryResponseFut<
9054        FileAllocateResult,
9055        fidl::encoding::DefaultFuchsiaResourceDialect,
9056    >;
9057    fn r#allocate(
9058        &self,
9059        mut offset: u64,
9060        mut length: u64,
9061        mut mode: AllocateMode,
9062    ) -> Self::AllocateResponseFut {
9063        fn _decode(
9064            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9065        ) -> Result<FileAllocateResult, fidl::Error> {
9066            let _response = fidl::client::decode_transaction_body::<
9067                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9068                fidl::encoding::DefaultFuchsiaResourceDialect,
9069                0x77fa0c330b57fd2e,
9070            >(_buf?)?
9071            .into_result::<FileMarker>("allocate")?;
9072            Ok(_response.map(|x| x))
9073        }
9074        self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
9075            (offset, length, mode),
9076            0x77fa0c330b57fd2e,
9077            fidl::encoding::DynamicFlags::FLEXIBLE,
9078            _decode,
9079        )
9080    }
9081
9082    type EnableVerityResponseFut = fidl::client::QueryResponseFut<
9083        FileEnableVerityResult,
9084        fidl::encoding::DefaultFuchsiaResourceDialect,
9085    >;
9086    fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
9087        fn _decode(
9088            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9089        ) -> Result<FileEnableVerityResult, fidl::Error> {
9090            let _response = fidl::client::decode_transaction_body::<
9091                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9092                fidl::encoding::DefaultFuchsiaResourceDialect,
9093                0x2c421ec3faaeb8bb,
9094            >(_buf?)?
9095            .into_result::<FileMarker>("enable_verity")?;
9096            Ok(_response.map(|x| x))
9097        }
9098        self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
9099            (options,),
9100            0x2c421ec3faaeb8bb,
9101            fidl::encoding::DynamicFlags::FLEXIBLE,
9102            _decode,
9103        )
9104    }
9105}
9106
9107pub struct FileEventStream {
9108    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9109}
9110
9111impl std::marker::Unpin for FileEventStream {}
9112
9113impl futures::stream::FusedStream for FileEventStream {
9114    fn is_terminated(&self) -> bool {
9115        self.event_receiver.is_terminated()
9116    }
9117}
9118
9119impl futures::Stream for FileEventStream {
9120    type Item = Result<FileEvent, fidl::Error>;
9121
9122    fn poll_next(
9123        mut self: std::pin::Pin<&mut Self>,
9124        cx: &mut std::task::Context<'_>,
9125    ) -> std::task::Poll<Option<Self::Item>> {
9126        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9127            &mut self.event_receiver,
9128            cx
9129        )?) {
9130            Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
9131            None => std::task::Poll::Ready(None),
9132        }
9133    }
9134}
9135
9136#[derive(Debug)]
9137pub enum FileEvent {
9138    OnOpen_ {
9139        s: i32,
9140        info: Option<Box<NodeInfoDeprecated>>,
9141    },
9142    OnRepresentation {
9143        payload: Representation,
9144    },
9145    #[non_exhaustive]
9146    _UnknownEvent {
9147        /// Ordinal of the event that was sent.
9148        ordinal: u64,
9149    },
9150}
9151
9152impl FileEvent {
9153    #[allow(irrefutable_let_patterns)]
9154    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
9155        if let FileEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
9156    }
9157    #[allow(irrefutable_let_patterns)]
9158    pub fn into_on_representation(self) -> Option<Representation> {
9159        if let FileEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
9160    }
9161
9162    /// Decodes a message buffer as a [`FileEvent`].
9163    fn decode(
9164        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9165    ) -> Result<FileEvent, fidl::Error> {
9166        let (bytes, _handles) = buf.split_mut();
9167        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9168        debug_assert_eq!(tx_header.tx_id, 0);
9169        match tx_header.ordinal {
9170            0x7fc7bbb1dbfd1972 => {
9171                let mut out = fidl::new_empty!(
9172                    NodeOnOpenRequest,
9173                    fidl::encoding::DefaultFuchsiaResourceDialect
9174                );
9175                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
9176                Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
9177            }
9178            0x5cb40567d80a510c => {
9179                let mut out =
9180                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
9181                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
9182                Ok((FileEvent::OnRepresentation { payload: out }))
9183            }
9184            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9185                Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9186            }
9187            _ => Err(fidl::Error::UnknownOrdinal {
9188                ordinal: tx_header.ordinal,
9189                protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9190            }),
9191        }
9192    }
9193}
9194
9195/// A Stream of incoming requests for fuchsia.io/File.
9196pub struct FileRequestStream {
9197    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9198    is_terminated: bool,
9199}
9200
9201impl std::marker::Unpin for FileRequestStream {}
9202
9203impl futures::stream::FusedStream for FileRequestStream {
9204    fn is_terminated(&self) -> bool {
9205        self.is_terminated
9206    }
9207}
9208
9209impl fidl::endpoints::RequestStream for FileRequestStream {
9210    type Protocol = FileMarker;
9211    type ControlHandle = FileControlHandle;
9212
9213    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9214        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9215    }
9216
9217    fn control_handle(&self) -> Self::ControlHandle {
9218        FileControlHandle { inner: self.inner.clone() }
9219    }
9220
9221    fn into_inner(
9222        self,
9223    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9224    {
9225        (self.inner, self.is_terminated)
9226    }
9227
9228    fn from_inner(
9229        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9230        is_terminated: bool,
9231    ) -> Self {
9232        Self { inner, is_terminated }
9233    }
9234}
9235
9236impl futures::Stream for FileRequestStream {
9237    type Item = Result<FileRequest, fidl::Error>;
9238
9239    fn poll_next(
9240        mut self: std::pin::Pin<&mut Self>,
9241        cx: &mut std::task::Context<'_>,
9242    ) -> std::task::Poll<Option<Self::Item>> {
9243        let this = &mut *self;
9244        if this.inner.check_shutdown(cx) {
9245            this.is_terminated = true;
9246            return std::task::Poll::Ready(None);
9247        }
9248        if this.is_terminated {
9249            panic!("polled FileRequestStream after completion");
9250        }
9251        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9252            |bytes, handles| {
9253                match this.inner.channel().read_etc(cx, bytes, handles) {
9254                    std::task::Poll::Ready(Ok(())) => {}
9255                    std::task::Poll::Pending => return std::task::Poll::Pending,
9256                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9257                        this.is_terminated = true;
9258                        return std::task::Poll::Ready(None);
9259                    }
9260                    std::task::Poll::Ready(Err(e)) => {
9261                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9262                            e.into(),
9263                        ))));
9264                    }
9265                }
9266
9267                // A message has been received from the channel
9268                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9269
9270                std::task::Poll::Ready(Some(match header.ordinal {
9271                    0x6ee9c0ad53ec87aa => {
9272                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9273                        let mut req = fidl::new_empty!(
9274                            AdvisoryLockingAdvisoryLockRequest,
9275                            fidl::encoding::DefaultFuchsiaResourceDialect
9276                        );
9277                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
9278                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9279                        Ok(FileRequest::AdvisoryLock {
9280                            request: req.request,
9281
9282                            responder: FileAdvisoryLockResponder {
9283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9284                                tx_id: header.tx_id,
9285                            },
9286                        })
9287                    }
9288                    0x54f3949246a03e74 => {
9289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9290                        let mut req = fidl::new_empty!(
9291                            LinkableLinkIntoRequest,
9292                            fidl::encoding::DefaultFuchsiaResourceDialect
9293                        );
9294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
9295                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9296                        Ok(FileRequest::LinkInto {
9297                            dst_parent_token: req.dst_parent_token,
9298                            dst: req.dst,
9299
9300                            responder: FileLinkIntoResponder {
9301                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9302                                tx_id: header.tx_id,
9303                            },
9304                        })
9305                    }
9306                    0x20d8a7aba2168a79 => {
9307                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9308                        let mut req = fidl::new_empty!(
9309                            fidl_fuchsia_unknown::CloneableCloneRequest,
9310                            fidl::encoding::DefaultFuchsiaResourceDialect
9311                        );
9312                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9313                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9314                        Ok(FileRequest::Clone { request: req.request, control_handle })
9315                    }
9316                    0x5ac5d459ad7f657e => {
9317                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9318                        let mut req = fidl::new_empty!(
9319                            fidl::encoding::EmptyPayload,
9320                            fidl::encoding::DefaultFuchsiaResourceDialect
9321                        );
9322                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9323                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9324                        Ok(FileRequest::Close {
9325                            responder: FileCloseResponder {
9326                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9327                                tx_id: header.tx_id,
9328                            },
9329                        })
9330                    }
9331                    0x2658edee9decfc06 => {
9332                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9333                        let mut req = fidl::new_empty!(
9334                            fidl::encoding::EmptyPayload,
9335                            fidl::encoding::DefaultFuchsiaResourceDialect
9336                        );
9337                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9338                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9339                        Ok(FileRequest::Query {
9340                            responder: FileQueryResponder {
9341                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9342                                tx_id: header.tx_id,
9343                            },
9344                        })
9345                    }
9346                    0x5a61678f293ce16f => {
9347                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9348                        let mut req = fidl::new_empty!(
9349                            NodeDeprecatedCloneRequest,
9350                            fidl::encoding::DefaultFuchsiaResourceDialect
9351                        );
9352                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9353                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9354                        Ok(FileRequest::DeprecatedClone {
9355                            flags: req.flags,
9356                            object: req.object,
9357
9358                            control_handle,
9359                        })
9360                    }
9361                    0x78985e216314dafd => {
9362                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9363                        let mut req = fidl::new_empty!(
9364                            fidl::encoding::EmptyPayload,
9365                            fidl::encoding::DefaultFuchsiaResourceDialect
9366                        );
9367                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9368                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9369                        Ok(FileRequest::DeprecatedGetAttr {
9370                            responder: FileDeprecatedGetAttrResponder {
9371                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9372                                tx_id: header.tx_id,
9373                            },
9374                        })
9375                    }
9376                    0x4186c0f40d938f46 => {
9377                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9378                        let mut req = fidl::new_empty!(
9379                            NodeDeprecatedSetAttrRequest,
9380                            fidl::encoding::DefaultFuchsiaResourceDialect
9381                        );
9382                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
9383                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9384                        Ok(FileRequest::DeprecatedSetAttr {
9385                            flags: req.flags,
9386                            attributes: req.attributes,
9387
9388                            responder: FileDeprecatedSetAttrResponder {
9389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9390                                tx_id: header.tx_id,
9391                            },
9392                        })
9393                    }
9394                    0x5b88fffb8eda3aa1 => {
9395                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9396                        let mut req = fidl::new_empty!(
9397                            fidl::encoding::EmptyPayload,
9398                            fidl::encoding::DefaultFuchsiaResourceDialect
9399                        );
9400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9401                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9402                        Ok(FileRequest::DeprecatedGetFlags {
9403                            responder: FileDeprecatedGetFlagsResponder {
9404                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9405                                tx_id: header.tx_id,
9406                            },
9407                        })
9408                    }
9409                    0x5295b76c71fde733 => {
9410                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9411                        let mut req = fidl::new_empty!(
9412                            NodeDeprecatedSetFlagsRequest,
9413                            fidl::encoding::DefaultFuchsiaResourceDialect
9414                        );
9415                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9416                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9417                        Ok(FileRequest::DeprecatedSetFlags {
9418                            flags: req.flags,
9419
9420                            responder: FileDeprecatedSetFlagsResponder {
9421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9422                                tx_id: header.tx_id,
9423                            },
9424                        })
9425                    }
9426                    0x176eb318f64ec23 => {
9427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9428                        let mut req = fidl::new_empty!(
9429                            fidl::encoding::EmptyPayload,
9430                            fidl::encoding::DefaultFuchsiaResourceDialect
9431                        );
9432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9433                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9434                        Ok(FileRequest::GetFlags {
9435                            responder: FileGetFlagsResponder {
9436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9437                                tx_id: header.tx_id,
9438                            },
9439                        })
9440                    }
9441                    0x55a8028685791ea8 => {
9442                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9443                        let mut req = fidl::new_empty!(
9444                            NodeSetFlagsRequest,
9445                            fidl::encoding::DefaultFuchsiaResourceDialect
9446                        );
9447                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
9448                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9449                        Ok(FileRequest::SetFlags {
9450                            flags: req.flags,
9451
9452                            responder: FileSetFlagsResponder {
9453                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9454                                tx_id: header.tx_id,
9455                            },
9456                        })
9457                    }
9458                    0x6f344a1c6b0a0610 => {
9459                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9460                        let mut req = fidl::new_empty!(
9461                            fidl::encoding::EmptyPayload,
9462                            fidl::encoding::DefaultFuchsiaResourceDialect
9463                        );
9464                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9465                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9466                        Ok(FileRequest::QueryFilesystem {
9467                            responder: FileQueryFilesystemResponder {
9468                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9469                                tx_id: header.tx_id,
9470                            },
9471                        })
9472                    }
9473                    0x3d4396a638ea053b => {
9474                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9475                        let mut req = fidl::new_empty!(
9476                            NodeGetAttributesRequest,
9477                            fidl::encoding::DefaultFuchsiaResourceDialect
9478                        );
9479                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9480                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9481                        Ok(FileRequest::GetAttributes {
9482                            query: req.query,
9483
9484                            responder: FileGetAttributesResponder {
9485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9486                                tx_id: header.tx_id,
9487                            },
9488                        })
9489                    }
9490                    0x3308c1da5a89bf08 => {
9491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9492                        let mut req = fidl::new_empty!(
9493                            MutableNodeAttributes,
9494                            fidl::encoding::DefaultFuchsiaResourceDialect
9495                        );
9496                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
9497                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9498                        Ok(FileRequest::UpdateAttributes {
9499                            payload: req,
9500                            responder: FileUpdateAttributesResponder {
9501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9502                                tx_id: header.tx_id,
9503                            },
9504                        })
9505                    }
9506                    0x2c5c27ca0ab5dc49 => {
9507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9508                        let mut req = fidl::new_empty!(
9509                            fidl::encoding::EmptyPayload,
9510                            fidl::encoding::DefaultFuchsiaResourceDialect
9511                        );
9512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9513                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9514                        Ok(FileRequest::Sync {
9515                            responder: FileSyncResponder {
9516                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9517                                tx_id: header.tx_id,
9518                            },
9519                        })
9520                    }
9521                    0x4b61033de007fcd0 => {
9522                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9523                        let mut req = fidl::new_empty!(
9524                            NodeListExtendedAttributesRequest,
9525                            fidl::encoding::DefaultFuchsiaResourceDialect
9526                        );
9527                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
9528                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9529                        Ok(FileRequest::ListExtendedAttributes {
9530                            iterator: req.iterator,
9531
9532                            control_handle,
9533                        })
9534                    }
9535                    0x45ffa3ccfdeb76db => {
9536                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9537                        let mut req = fidl::new_empty!(
9538                            NodeGetExtendedAttributeRequest,
9539                            fidl::encoding::DefaultFuchsiaResourceDialect
9540                        );
9541                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9542                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9543                        Ok(FileRequest::GetExtendedAttribute {
9544                            name: req.name,
9545
9546                            responder: FileGetExtendedAttributeResponder {
9547                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9548                                tx_id: header.tx_id,
9549                            },
9550                        })
9551                    }
9552                    0x4a951362f681f23c => {
9553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9554                        let mut req = fidl::new_empty!(
9555                            NodeSetExtendedAttributeRequest,
9556                            fidl::encoding::DefaultFuchsiaResourceDialect
9557                        );
9558                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9559                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9560                        Ok(FileRequest::SetExtendedAttribute {
9561                            name: req.name,
9562                            value: req.value,
9563                            mode: req.mode,
9564
9565                            responder: FileSetExtendedAttributeResponder {
9566                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9567                                tx_id: header.tx_id,
9568                            },
9569                        })
9570                    }
9571                    0x7a0b9f3a9bf9032d => {
9572                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9573                        let mut req = fidl::new_empty!(
9574                            NodeRemoveExtendedAttributeRequest,
9575                            fidl::encoding::DefaultFuchsiaResourceDialect
9576                        );
9577                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
9578                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9579                        Ok(FileRequest::RemoveExtendedAttribute {
9580                            name: req.name,
9581
9582                            responder: FileRemoveExtendedAttributeResponder {
9583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9584                                tx_id: header.tx_id,
9585                            },
9586                        })
9587                    }
9588                    0x57e419a298c8ede => {
9589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9590                        let mut req = fidl::new_empty!(
9591                            ReadableReadRequest,
9592                            fidl::encoding::DefaultFuchsiaResourceDialect
9593                        );
9594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
9595                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9596                        Ok(FileRequest::Read {
9597                            count: req.count,
9598
9599                            responder: FileReadResponder {
9600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9601                                tx_id: header.tx_id,
9602                            },
9603                        })
9604                    }
9605                    0x6a31437832469f82 => {
9606                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9607                        let mut req = fidl::new_empty!(
9608                            WritableWriteRequest,
9609                            fidl::encoding::DefaultFuchsiaResourceDialect
9610                        );
9611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
9612                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9613                        Ok(FileRequest::Write {
9614                            data: req.data,
9615
9616                            responder: FileWriteResponder {
9617                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9618                                tx_id: header.tx_id,
9619                            },
9620                        })
9621                    }
9622                    0x68b5ac00c62906bc => {
9623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9624                        let mut req = fidl::new_empty!(
9625                            fidl::encoding::EmptyPayload,
9626                            fidl::encoding::DefaultFuchsiaResourceDialect
9627                        );
9628                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9629                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9630                        Ok(FileRequest::Describe {
9631                            responder: FileDescribeResponder {
9632                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9633                                tx_id: header.tx_id,
9634                            },
9635                        })
9636                    }
9637                    0x78079168162c5207 => {
9638                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9639                        let mut req = fidl::new_empty!(
9640                            FileSeekRequest,
9641                            fidl::encoding::DefaultFuchsiaResourceDialect
9642                        );
9643                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
9644                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9645                        Ok(FileRequest::Seek {
9646                            origin: req.origin,
9647                            offset: req.offset,
9648
9649                            responder: FileSeekResponder {
9650                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9651                                tx_id: header.tx_id,
9652                            },
9653                        })
9654                    }
9655                    0x1607a293a60d723e => {
9656                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9657                        let mut req = fidl::new_empty!(
9658                            FileReadAtRequest,
9659                            fidl::encoding::DefaultFuchsiaResourceDialect
9660                        );
9661                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
9662                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9663                        Ok(FileRequest::ReadAt {
9664                            count: req.count,
9665                            offset: req.offset,
9666
9667                            responder: FileReadAtResponder {
9668                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9669                                tx_id: header.tx_id,
9670                            },
9671                        })
9672                    }
9673                    0x793eefc0045e792b => {
9674                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9675                        let mut req = fidl::new_empty!(
9676                            FileWriteAtRequest,
9677                            fidl::encoding::DefaultFuchsiaResourceDialect
9678                        );
9679                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
9680                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9681                        Ok(FileRequest::WriteAt {
9682                            data: req.data,
9683                            offset: req.offset,
9684
9685                            responder: FileWriteAtResponder {
9686                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9687                                tx_id: header.tx_id,
9688                            },
9689                        })
9690                    }
9691                    0x2b80825f0535743a => {
9692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9693                        let mut req = fidl::new_empty!(
9694                            FileResizeRequest,
9695                            fidl::encoding::DefaultFuchsiaResourceDialect
9696                        );
9697                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
9698                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9699                        Ok(FileRequest::Resize {
9700                            length: req.length,
9701
9702                            responder: FileResizeResponder {
9703                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9704                                tx_id: header.tx_id,
9705                            },
9706                        })
9707                    }
9708                    0xa6a9e654cbf62b => {
9709                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9710                        let mut req = fidl::new_empty!(
9711                            FileGetBackingMemoryRequest,
9712                            fidl::encoding::DefaultFuchsiaResourceDialect
9713                        );
9714                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
9715                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9716                        Ok(FileRequest::GetBackingMemory {
9717                            flags: req.flags,
9718
9719                            responder: FileGetBackingMemoryResponder {
9720                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9721                                tx_id: header.tx_id,
9722                            },
9723                        })
9724                    }
9725                    0x77fa0c330b57fd2e => {
9726                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9727                        let mut req = fidl::new_empty!(
9728                            FileAllocateRequest,
9729                            fidl::encoding::DefaultFuchsiaResourceDialect
9730                        );
9731                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
9732                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9733                        Ok(FileRequest::Allocate {
9734                            offset: req.offset,
9735                            length: req.length,
9736                            mode: req.mode,
9737
9738                            responder: FileAllocateResponder {
9739                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9740                                tx_id: header.tx_id,
9741                            },
9742                        })
9743                    }
9744                    0x2c421ec3faaeb8bb => {
9745                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9746                        let mut req = fidl::new_empty!(
9747                            FileEnableVerityRequest,
9748                            fidl::encoding::DefaultFuchsiaResourceDialect
9749                        );
9750                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
9751                        let control_handle = FileControlHandle { inner: this.inner.clone() };
9752                        Ok(FileRequest::EnableVerity {
9753                            options: req.options,
9754
9755                            responder: FileEnableVerityResponder {
9756                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9757                                tx_id: header.tx_id,
9758                            },
9759                        })
9760                    }
9761                    _ if header.tx_id == 0
9762                        && header
9763                            .dynamic_flags()
9764                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9765                    {
9766                        Ok(FileRequest::_UnknownMethod {
9767                            ordinal: header.ordinal,
9768                            control_handle: FileControlHandle { inner: this.inner.clone() },
9769                            method_type: fidl::MethodType::OneWay,
9770                        })
9771                    }
9772                    _ if header
9773                        .dynamic_flags()
9774                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9775                    {
9776                        this.inner.send_framework_err(
9777                            fidl::encoding::FrameworkErr::UnknownMethod,
9778                            header.tx_id,
9779                            header.ordinal,
9780                            header.dynamic_flags(),
9781                            (bytes, handles),
9782                        )?;
9783                        Ok(FileRequest::_UnknownMethod {
9784                            ordinal: header.ordinal,
9785                            control_handle: FileControlHandle { inner: this.inner.clone() },
9786                            method_type: fidl::MethodType::TwoWay,
9787                        })
9788                    }
9789                    _ => Err(fidl::Error::UnknownOrdinal {
9790                        ordinal: header.ordinal,
9791                        protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9792                    }),
9793                }))
9794            },
9795        )
9796    }
9797}
9798
9799/// A [`Node`] which contains a sequence of bytes of definite length.
9800///
9801/// NOTE: cloned connections do not share their seek offset with their source
9802/// connection.
9803#[derive(Debug)]
9804pub enum FileRequest {
9805    /// Acquires an advisory lock on the underlying file.
9806    ///
9807    /// The lock lasts until either this connection is closed or
9808    /// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
9809    /// explicitly.
9810    ///
9811    /// Advisory locks are purely advisory. They do not prevent actual read or
9812    /// write operations from occurring on the file, either through this
9813    /// connection or through other connections.
9814    ///
9815    /// This method requires the following rights:
9816    ///
9817    /// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
9818    /// * [`Rights.WRITE_BYTES`] if `request.type` is
9819    ///   [`AdvisoryLockType.WRITE`].
9820    ///
9821    /// # Errors
9822    ///
9823    /// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
9824    ///   example, another connection might hold a conflicting lock type.
9825    /// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
9826    /// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
9827    ///   to acquire the given type of lock.
9828    AdvisoryLock {
9829        request: AdvisoryLockRequest,
9830        responder: FileAdvisoryLockResponder,
9831    },
9832    /// Creates a link to this this object with name `dst` in the directory represented by
9833    /// `dst_parent_token`.
9834    ///
9835    /// `dst` must be a resolved object name. Including "/" in the string will return
9836    /// `ZX_ERR_INVALID_ARGS`.
9837    ///
9838    /// This method requires the maximal set of rights supported by the filesystem for this object.
9839    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
9840    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
9841    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
9842    /// `ZX_ERR_ACCESS_DENIED`.
9843    ///
9844    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
9845    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
9846    ///
9847    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
9848    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
9849    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
9850    ///
9851    /// This method does not have the same atomicity properties has the `Directory::Link` method,
9852    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
9853    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
9854    LinkInto {
9855        dst_parent_token: fidl::Event,
9856        dst: String,
9857        responder: FileLinkIntoResponder,
9858    },
9859    Clone {
9860        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9861        control_handle: FileControlHandle,
9862    },
9863    /// Terminates the connection.
9864    ///
9865    /// After calling `Close`, the client must not send any other requests.
9866    ///
9867    /// Servers, after sending the status response, should close the connection
9868    /// regardless of status and without sending an epitaph.
9869    ///
9870    /// Closing the client end of the channel should be semantically equivalent
9871    /// to calling `Close` without knowing when the close has completed or its
9872    /// status.
9873    Close {
9874        responder: FileCloseResponder,
9875    },
9876    Query {
9877        responder: FileQueryResponder,
9878    },
9879    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
9880    DeprecatedClone {
9881        flags: OpenFlags,
9882        object: fidl::endpoints::ServerEnd<NodeMarker>,
9883        control_handle: FileControlHandle,
9884    },
9885    /// DEPRECATED - Use `Node.GetAttributes` instead.
9886    DeprecatedGetAttr {
9887        responder: FileDeprecatedGetAttrResponder,
9888    },
9889    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
9890    DeprecatedSetAttr {
9891        flags: NodeAttributeFlags,
9892        attributes: NodeAttributes,
9893        responder: FileDeprecatedSetAttrResponder,
9894    },
9895    /// [DEPRECATED - Use new GetFlags method instead.]
9896    DeprecatedGetFlags {
9897        responder: FileDeprecatedGetFlagsResponder,
9898    },
9899    /// [DEPRECATED - Use new SetFlags method instead.]
9900    DeprecatedSetFlags {
9901        flags: OpenFlags,
9902        responder: FileDeprecatedSetFlagsResponder,
9903    },
9904    /// Queries the flags that apply to this node after it has been opened/created. This method does
9905    /// not require any rights.
9906    ///
9907    /// Note that the final set of flags that apply to the connection may differ from those
9908    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
9909    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
9910    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
9911    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
9912    GetFlags {
9913        responder: FileGetFlagsResponder,
9914    },
9915    /// Sets the flags that apply to this node after it has been opened. This method does not
9916    /// require any rights.
9917    ///
9918    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
9919    /// clear append mode.
9920    ///
9921    /// Errors:
9922    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
9923    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
9924    SetFlags {
9925        flags: Flags,
9926        responder: FileSetFlagsResponder,
9927    },
9928    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
9929    /// volume has different settings or the storage is accounted seperately from the rest of the
9930    /// filesystem that may be reported instead of filesystem-wide details.
9931    QueryFilesystem {
9932        responder: FileQueryFilesystemResponder,
9933    },
9934    /// Acquires information about the node.
9935    ///
9936    /// The attributes of a node should be stable, independent of the
9937    /// specific protocol used to access it.
9938    ///
9939    /// If a particular attribute is not applicable or not supported,
9940    /// filesystems should leave the corresponding field absent.
9941    ///
9942    /// + `query` a bit-mask specifying which attributes to fetch. The server
9943    ///   should not return more than necessary.
9944    /// - `attributes` the returned attributes.
9945    ///
9946    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9947    GetAttributes {
9948        query: NodeAttributesQuery,
9949        responder: FileGetAttributesResponder,
9950    },
9951    /// Updates information about the node.
9952    ///
9953    /// + `attributes` the presence of a table field in `attributes` indicates
9954    /// the intent to update the corresponding attribute.
9955    ///
9956    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
9957    ///
9958    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
9959    UpdateAttributes {
9960        payload: MutableNodeAttributes,
9961        responder: FileUpdateAttributesResponder,
9962    },
9963    /// Synchronizes updates to the node to the underlying media, if it exists.
9964    ///
9965    /// This method will return when the filesystem server has flushed the
9966    /// relevant updates to the underlying media, but does not guarantee the
9967    /// underlying media has persisted the information, nor that any information
9968    /// is committed to hardware. Clients may use `Sync` to ensure ordering
9969    /// between operations.
9970    ///
9971    /// This method does not require any rights.
9972    Sync {
9973        responder: FileSyncResponder,
9974    },
9975    /// Creates an iterator over all the extended attribute names associated
9976    /// with this node. If an error occurs it is returned as an epitaph on the
9977    /// iterator request channel, and then the channel is closed.
9978    ///
9979    /// GetExtendedAttributes can be used with any of these names to retrieve
9980    /// the associated value.
9981    ///
9982    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9983    ListExtendedAttributes {
9984        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
9985        control_handle: FileControlHandle,
9986    },
9987    /// Get the value associated with the given attribute `name` for this node.
9988    ///
9989    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
9990    /// particular structure is imposed on them.
9991    ///
9992    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
9993    GetExtendedAttribute {
9994        name: Vec<u8>,
9995        responder: FileGetExtendedAttributeResponder,
9996    },
9997    /// Set the value for the given attribute `name` to `value` for this node.
9998    ///
9999    /// The attribute name may exist, in which case the attribute is updated.
10000    /// If the attribute doesn't exist, it is created. The name should have no
10001    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
10002    ///
10003    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10004    SetExtendedAttribute {
10005        name: Vec<u8>,
10006        value: ExtendedAttributeValue,
10007        mode: SetExtendedAttributeMode,
10008        responder: FileSetExtendedAttributeResponder,
10009    },
10010    /// Remove the specified extended attribute.
10011    ///
10012    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
10013    ///
10014    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10015    RemoveExtendedAttribute {
10016        name: Vec<u8>,
10017        responder: FileRemoveExtendedAttributeResponder,
10018    },
10019    /// Reads up to 'count' bytes at the seek offset.
10020    /// The seek offset is moved forward by the number of bytes read.
10021    ///
10022    /// ## Invariants
10023    ///
10024    /// * The returned `data.length` will never be greater than `count`.
10025    /// * If `data.length` is less than `count`, it means that the seek offset
10026    ///   has reached the end of file as part of this operation.
10027    /// * If `data.length` is zero while `count` is not, it means that the
10028    ///   seek offset is already at or beyond the end of file, and no data could
10029    ///   be read.
10030    /// * If `count` is zero, the server should perform all the checks ensuring
10031    ///   read access without actually read anything, and return an empty
10032    ///   `data` vector.
10033    ///
10034    /// This method requires the [`Rights.READ_BYTES`] right.
10035    ///
10036    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10037    Read {
10038        count: u64,
10039        responder: FileReadResponder,
10040    },
10041    /// Writes data at the seek offset.
10042    /// The seek offset is moved forward by the number of bytes written.
10043    /// If the file is in append mode, the seek offset is first set to the end
10044    /// of the file, followed by the write, in one atomic step.
10045    ///
10046    /// The file size may grow if the seek offset plus `data.length` is beyond
10047    /// the current end of file.
10048    ///
10049    /// + request `data` the byte buffer to write to the file.
10050    /// - response `actual_count` the number of bytes written.
10051    ///
10052    /// ## Invariants
10053    ///
10054    /// * The returned `actual_count` will never be greater than `data.length`.
10055    /// * If the server is unable to write all the data due to e.g. not enough
10056    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10057    ///   could be written, an error is returned.
10058    /// * If `data.length` is zero, the server should perform all the checks
10059    ///   ensuring write access without mutating the file and return a
10060    ///   successful write of zero bytes.  The seek offset is still updated if
10061    ///   in append mode.
10062    ///
10063    /// This method requires the [`Rights.WRITE_BYTES`] right.
10064    Write {
10065        data: Vec<u8>,
10066        responder: FileWriteResponder,
10067    },
10068    Describe {
10069        responder: FileDescribeResponder,
10070    },
10071    /// Moves the offset at which the next invocation of [`Read`] or [`Write`]
10072    /// will occur. The seek offset is specific to each file connection.
10073    ///
10074    /// + request `origin` the reference point where `offset` will be based on.
10075    /// + request `offset` the number of bytes to seek.
10076    /// - response `offset_from_start` the adjusted seek offset, from the start
10077    ///   of the file.
10078    ///
10079    /// This method does not require any rights.
10080    Seek {
10081        origin: SeekOrigin,
10082        offset: i64,
10083        responder: FileSeekResponder,
10084    },
10085    /// Reads up to 'count' bytes at the provided offset.
10086    /// Does not affect the seek offset.
10087    ///
10088    /// ## Invariants
10089    ///
10090    /// * The returned `data.length` will never be greater than `count`.
10091    /// * If `data.length` is less than `count`, it means that `ReadAt` has hit
10092    ///   the end of file as part of this operation.
10093    /// * If `data.length` is zero while `count` is not, it means that `offset`
10094    ///   is at or past the end of file, and no data can be read.
10095    /// * If `count` is zero, the server should perform all the checks ensuring
10096    ///   read access without actually reading anything, and return an empty
10097    ///   `data` vector.
10098    ///
10099    /// This method requires the [`Rights.READ_BYTES`] right.
10100    ///
10101    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
10102    ReadAt {
10103        count: u64,
10104        offset: u64,
10105        responder: FileReadAtResponder,
10106    },
10107    /// Writes data at the provided offset.
10108    /// Does not affect the seek offset.
10109    ///
10110    /// The file size may grow if `offset` plus `data.length` is past the
10111    /// current end of file.
10112    ///
10113    /// + request `data` the byte buffer to write to the file.
10114    /// + request `offset` the offset from start of the file to begin writing.
10115    /// - response `actual_count` the number of bytes written.
10116    ///
10117    /// ## Invariants
10118    ///
10119    /// * The returned `actual_count` will never be greater than `data.length`.
10120    /// * If the server is unable to write all the data due to e.g. not enough
10121    ///   space, `actual_count` may be less than `data.length`.  If no bytes
10122    ///   could be written, an error is returned.
10123    /// * If `data.length` is zero, the server should perform all the checks
10124    ///   ensuring write access without mutating the file, and will return a
10125    ///   successful write of zero bytes.
10126    ///
10127    /// This method requires the [`Rights.WRITE_BYTES`] right.
10128    WriteAt {
10129        data: Vec<u8>,
10130        offset: u64,
10131        responder: FileWriteAtResponder,
10132    },
10133    /// Shrinks or grows the file size to 'length' bytes.
10134    ///
10135    /// If file size is reduced by this operation, the extra trailing data'
10136    /// is discarded.
10137    /// If file size is increased by this operation, the extended area appears
10138    /// as if it was zeroed.
10139    ///
10140    /// This method requires the [`Rights.WRITE_BYTES`] right.
10141    Resize {
10142        length: u64,
10143        responder: FileResizeResponder,
10144    },
10145    /// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
10146    /// with the requested access rights.
10147    ///
10148    /// Implementations are not required to implement files backed by VMOs so
10149    /// this request may fail. Additionally, implementations may only support
10150    /// a certain subset of the flags. Clients should be prepared with fallback
10151    /// behavior if this request fails.
10152    ///
10153    /// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
10154    /// implementation is free to choose the semantics of the returned VMO.
10155    ///
10156    /// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
10157    /// - response `vmo` the requested [`zx.Handle:VMO`].
10158    /// * error a [`zx.Status`] value indicating the failure.
10159    ///
10160    /// This method requires the following rights:
10161    ///
10162    /// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
10163    /// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
10164    /// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
10165    GetBackingMemory {
10166        flags: VmoFlags,
10167        responder: FileGetBackingMemoryResponder,
10168    },
10169    /// Pre-allocate on-disk space for this file.
10170    Allocate {
10171        offset: u64,
10172        length: u64,
10173        mode: AllocateMode,
10174        responder: FileAllocateResponder,
10175    },
10176    /// Enables verification for the file (permanently) which involves computing a merkle tree for
10177    /// the file. Forces a flush prior to building the merkle tree to ensure cached data is
10178    /// captured. Future reads will be verified against the computed merkle tree and writes will be
10179    /// rejected. This method can take some time to complete as it depends on the size of the file.
10180    /// This method can be aborted by closing the connection that this method was issued on.
10181    ///
10182    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
10183    /// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
10184    /// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
10185    /// Also returns any error that might arise from reading the file, or from flushing the file,
10186    /// such as `ZX_ERR_IO`.
10187    EnableVerity {
10188        options: VerificationOptions,
10189        responder: FileEnableVerityResponder,
10190    },
10191    /// An interaction was received which does not match any known method.
10192    #[non_exhaustive]
10193    _UnknownMethod {
10194        /// Ordinal of the method that was called.
10195        ordinal: u64,
10196        control_handle: FileControlHandle,
10197        method_type: fidl::MethodType,
10198    },
10199}
10200
10201impl FileRequest {
10202    #[allow(irrefutable_let_patterns)]
10203    pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
10204        if let FileRequest::AdvisoryLock { request, responder } = self {
10205            Some((request, responder))
10206        } else {
10207            None
10208        }
10209    }
10210
10211    #[allow(irrefutable_let_patterns)]
10212    pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
10213        if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
10214            Some((dst_parent_token, dst, responder))
10215        } else {
10216            None
10217        }
10218    }
10219
10220    #[allow(irrefutable_let_patterns)]
10221    pub fn into_clone(
10222        self,
10223    ) -> Option<(
10224        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10225        FileControlHandle,
10226    )> {
10227        if let FileRequest::Clone { request, control_handle } = self {
10228            Some((request, control_handle))
10229        } else {
10230            None
10231        }
10232    }
10233
10234    #[allow(irrefutable_let_patterns)]
10235    pub fn into_close(self) -> Option<(FileCloseResponder)> {
10236        if let FileRequest::Close { responder } = self { Some((responder)) } else { None }
10237    }
10238
10239    #[allow(irrefutable_let_patterns)]
10240    pub fn into_query(self) -> Option<(FileQueryResponder)> {
10241        if let FileRequest::Query { responder } = self { Some((responder)) } else { None }
10242    }
10243
10244    #[allow(irrefutable_let_patterns)]
10245    pub fn into_deprecated_clone(
10246        self,
10247    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
10248        if let FileRequest::DeprecatedClone { flags, object, control_handle } = self {
10249            Some((flags, object, control_handle))
10250        } else {
10251            None
10252        }
10253    }
10254
10255    #[allow(irrefutable_let_patterns)]
10256    pub fn into_deprecated_get_attr(self) -> Option<(FileDeprecatedGetAttrResponder)> {
10257        if let FileRequest::DeprecatedGetAttr { responder } = self {
10258            Some((responder))
10259        } else {
10260            None
10261        }
10262    }
10263
10264    #[allow(irrefutable_let_patterns)]
10265    pub fn into_deprecated_set_attr(
10266        self,
10267    ) -> Option<(NodeAttributeFlags, NodeAttributes, FileDeprecatedSetAttrResponder)> {
10268        if let FileRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
10269            Some((flags, attributes, responder))
10270        } else {
10271            None
10272        }
10273    }
10274
10275    #[allow(irrefutable_let_patterns)]
10276    pub fn into_deprecated_get_flags(self) -> Option<(FileDeprecatedGetFlagsResponder)> {
10277        if let FileRequest::DeprecatedGetFlags { responder } = self {
10278            Some((responder))
10279        } else {
10280            None
10281        }
10282    }
10283
10284    #[allow(irrefutable_let_patterns)]
10285    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, FileDeprecatedSetFlagsResponder)> {
10286        if let FileRequest::DeprecatedSetFlags { flags, responder } = self {
10287            Some((flags, responder))
10288        } else {
10289            None
10290        }
10291    }
10292
10293    #[allow(irrefutable_let_patterns)]
10294    pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
10295        if let FileRequest::GetFlags { responder } = self { Some((responder)) } else { None }
10296    }
10297
10298    #[allow(irrefutable_let_patterns)]
10299    pub fn into_set_flags(self) -> Option<(Flags, FileSetFlagsResponder)> {
10300        if let FileRequest::SetFlags { flags, responder } = self {
10301            Some((flags, responder))
10302        } else {
10303            None
10304        }
10305    }
10306
10307    #[allow(irrefutable_let_patterns)]
10308    pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
10309        if let FileRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
10310    }
10311
10312    #[allow(irrefutable_let_patterns)]
10313    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
10314        if let FileRequest::GetAttributes { query, responder } = self {
10315            Some((query, responder))
10316        } else {
10317            None
10318        }
10319    }
10320
10321    #[allow(irrefutable_let_patterns)]
10322    pub fn into_update_attributes(
10323        self,
10324    ) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
10325        if let FileRequest::UpdateAttributes { payload, responder } = self {
10326            Some((payload, responder))
10327        } else {
10328            None
10329        }
10330    }
10331
10332    #[allow(irrefutable_let_patterns)]
10333    pub fn into_sync(self) -> Option<(FileSyncResponder)> {
10334        if let FileRequest::Sync { responder } = self { Some((responder)) } else { None }
10335    }
10336
10337    #[allow(irrefutable_let_patterns)]
10338    pub fn into_list_extended_attributes(
10339        self,
10340    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
10341    {
10342        if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
10343            Some((iterator, control_handle))
10344        } else {
10345            None
10346        }
10347    }
10348
10349    #[allow(irrefutable_let_patterns)]
10350    pub fn into_get_extended_attribute(
10351        self,
10352    ) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
10353        if let FileRequest::GetExtendedAttribute { name, responder } = self {
10354            Some((name, responder))
10355        } else {
10356            None
10357        }
10358    }
10359
10360    #[allow(irrefutable_let_patterns)]
10361    pub fn into_set_extended_attribute(
10362        self,
10363    ) -> Option<(
10364        Vec<u8>,
10365        ExtendedAttributeValue,
10366        SetExtendedAttributeMode,
10367        FileSetExtendedAttributeResponder,
10368    )> {
10369        if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
10370            Some((name, value, mode, responder))
10371        } else {
10372            None
10373        }
10374    }
10375
10376    #[allow(irrefutable_let_patterns)]
10377    pub fn into_remove_extended_attribute(
10378        self,
10379    ) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
10380        if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
10381            Some((name, responder))
10382        } else {
10383            None
10384        }
10385    }
10386
10387    #[allow(irrefutable_let_patterns)]
10388    pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
10389        if let FileRequest::Read { count, responder } = self {
10390            Some((count, responder))
10391        } else {
10392            None
10393        }
10394    }
10395
10396    #[allow(irrefutable_let_patterns)]
10397    pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
10398        if let FileRequest::Write { data, responder } = self {
10399            Some((data, responder))
10400        } else {
10401            None
10402        }
10403    }
10404
10405    #[allow(irrefutable_let_patterns)]
10406    pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
10407        if let FileRequest::Describe { responder } = self { Some((responder)) } else { None }
10408    }
10409
10410    #[allow(irrefutable_let_patterns)]
10411    pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
10412        if let FileRequest::Seek { origin, offset, responder } = self {
10413            Some((origin, offset, responder))
10414        } else {
10415            None
10416        }
10417    }
10418
10419    #[allow(irrefutable_let_patterns)]
10420    pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
10421        if let FileRequest::ReadAt { count, offset, responder } = self {
10422            Some((count, offset, responder))
10423        } else {
10424            None
10425        }
10426    }
10427
10428    #[allow(irrefutable_let_patterns)]
10429    pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
10430        if let FileRequest::WriteAt { data, offset, responder } = self {
10431            Some((data, offset, responder))
10432        } else {
10433            None
10434        }
10435    }
10436
10437    #[allow(irrefutable_let_patterns)]
10438    pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
10439        if let FileRequest::Resize { length, responder } = self {
10440            Some((length, responder))
10441        } else {
10442            None
10443        }
10444    }
10445
10446    #[allow(irrefutable_let_patterns)]
10447    pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
10448        if let FileRequest::GetBackingMemory { flags, responder } = self {
10449            Some((flags, responder))
10450        } else {
10451            None
10452        }
10453    }
10454
10455    #[allow(irrefutable_let_patterns)]
10456    pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
10457        if let FileRequest::Allocate { offset, length, mode, responder } = self {
10458            Some((offset, length, mode, responder))
10459        } else {
10460            None
10461        }
10462    }
10463
10464    #[allow(irrefutable_let_patterns)]
10465    pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
10466        if let FileRequest::EnableVerity { options, responder } = self {
10467            Some((options, responder))
10468        } else {
10469            None
10470        }
10471    }
10472
10473    /// Name of the method defined in FIDL
10474    pub fn method_name(&self) -> &'static str {
10475        match *self {
10476            FileRequest::AdvisoryLock { .. } => "advisory_lock",
10477            FileRequest::LinkInto { .. } => "link_into",
10478            FileRequest::Clone { .. } => "clone",
10479            FileRequest::Close { .. } => "close",
10480            FileRequest::Query { .. } => "query",
10481            FileRequest::DeprecatedClone { .. } => "deprecated_clone",
10482            FileRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
10483            FileRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
10484            FileRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
10485            FileRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
10486            FileRequest::GetFlags { .. } => "get_flags",
10487            FileRequest::SetFlags { .. } => "set_flags",
10488            FileRequest::QueryFilesystem { .. } => "query_filesystem",
10489            FileRequest::GetAttributes { .. } => "get_attributes",
10490            FileRequest::UpdateAttributes { .. } => "update_attributes",
10491            FileRequest::Sync { .. } => "sync",
10492            FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
10493            FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
10494            FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
10495            FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
10496            FileRequest::Read { .. } => "read",
10497            FileRequest::Write { .. } => "write",
10498            FileRequest::Describe { .. } => "describe",
10499            FileRequest::Seek { .. } => "seek",
10500            FileRequest::ReadAt { .. } => "read_at",
10501            FileRequest::WriteAt { .. } => "write_at",
10502            FileRequest::Resize { .. } => "resize",
10503            FileRequest::GetBackingMemory { .. } => "get_backing_memory",
10504            FileRequest::Allocate { .. } => "allocate",
10505            FileRequest::EnableVerity { .. } => "enable_verity",
10506            FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10507                "unknown one-way method"
10508            }
10509            FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10510                "unknown two-way method"
10511            }
10512        }
10513    }
10514}
10515
10516#[derive(Debug, Clone)]
10517pub struct FileControlHandle {
10518    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10519}
10520
10521impl fidl::endpoints::ControlHandle for FileControlHandle {
10522    fn shutdown(&self) {
10523        self.inner.shutdown()
10524    }
10525
10526    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10527        self.inner.shutdown_with_epitaph(status)
10528    }
10529
10530    fn is_closed(&self) -> bool {
10531        self.inner.channel().is_closed()
10532    }
10533    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10534        self.inner.channel().on_closed()
10535    }
10536
10537    #[cfg(target_os = "fuchsia")]
10538    fn signal_peer(
10539        &self,
10540        clear_mask: zx::Signals,
10541        set_mask: zx::Signals,
10542    ) -> Result<(), zx_status::Status> {
10543        use fidl::Peered;
10544        self.inner.channel().signal_peer(clear_mask, set_mask)
10545    }
10546}
10547
10548impl FileControlHandle {
10549    pub fn send_on_open_(
10550        &self,
10551        mut s: i32,
10552        mut info: Option<NodeInfoDeprecated>,
10553    ) -> Result<(), fidl::Error> {
10554        self.inner.send::<NodeOnOpenRequest>(
10555            (s, info.as_mut()),
10556            0,
10557            0x7fc7bbb1dbfd1972,
10558            fidl::encoding::DynamicFlags::FLEXIBLE,
10559        )
10560    }
10561
10562    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
10563        self.inner.send::<Representation>(
10564            &mut payload,
10565            0,
10566            0x5cb40567d80a510c,
10567            fidl::encoding::DynamicFlags::empty(),
10568        )
10569    }
10570}
10571
10572#[must_use = "FIDL methods require a response to be sent"]
10573#[derive(Debug)]
10574pub struct FileAdvisoryLockResponder {
10575    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10576    tx_id: u32,
10577}
10578
10579/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10580/// if the responder is dropped without sending a response, so that the client
10581/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10582impl std::ops::Drop for FileAdvisoryLockResponder {
10583    fn drop(&mut self) {
10584        self.control_handle.shutdown();
10585        // Safety: drops once, never accessed again
10586        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10587    }
10588}
10589
10590impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
10591    type ControlHandle = FileControlHandle;
10592
10593    fn control_handle(&self) -> &FileControlHandle {
10594        &self.control_handle
10595    }
10596
10597    fn drop_without_shutdown(mut self) {
10598        // Safety: drops once, never accessed again due to mem::forget
10599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10600        // Prevent Drop from running (which would shut down the channel)
10601        std::mem::forget(self);
10602    }
10603}
10604
10605impl FileAdvisoryLockResponder {
10606    /// Sends a response to the FIDL transaction.
10607    ///
10608    /// Sets the channel to shutdown if an error occurs.
10609    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10610        let _result = self.send_raw(result);
10611        if _result.is_err() {
10612            self.control_handle.shutdown();
10613        }
10614        self.drop_without_shutdown();
10615        _result
10616    }
10617
10618    /// Similar to "send" but does not shutdown the channel if an error occurs.
10619    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10620        let _result = self.send_raw(result);
10621        self.drop_without_shutdown();
10622        _result
10623    }
10624
10625    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10626        self.control_handle
10627            .inner
10628            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10629                result,
10630                self.tx_id,
10631                0x6ee9c0ad53ec87aa,
10632                fidl::encoding::DynamicFlags::empty(),
10633            )
10634    }
10635}
10636
10637#[must_use = "FIDL methods require a response to be sent"]
10638#[derive(Debug)]
10639pub struct FileLinkIntoResponder {
10640    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10641    tx_id: u32,
10642}
10643
10644/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10645/// if the responder is dropped without sending a response, so that the client
10646/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10647impl std::ops::Drop for FileLinkIntoResponder {
10648    fn drop(&mut self) {
10649        self.control_handle.shutdown();
10650        // Safety: drops once, never accessed again
10651        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10652    }
10653}
10654
10655impl fidl::endpoints::Responder for FileLinkIntoResponder {
10656    type ControlHandle = FileControlHandle;
10657
10658    fn control_handle(&self) -> &FileControlHandle {
10659        &self.control_handle
10660    }
10661
10662    fn drop_without_shutdown(mut self) {
10663        // Safety: drops once, never accessed again due to mem::forget
10664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10665        // Prevent Drop from running (which would shut down the channel)
10666        std::mem::forget(self);
10667    }
10668}
10669
10670impl FileLinkIntoResponder {
10671    /// Sends a response to the FIDL transaction.
10672    ///
10673    /// Sets the channel to shutdown if an error occurs.
10674    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10675        let _result = self.send_raw(result);
10676        if _result.is_err() {
10677            self.control_handle.shutdown();
10678        }
10679        self.drop_without_shutdown();
10680        _result
10681    }
10682
10683    /// Similar to "send" but does not shutdown the channel if an error occurs.
10684    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10685        let _result = self.send_raw(result);
10686        self.drop_without_shutdown();
10687        _result
10688    }
10689
10690    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10691        self.control_handle
10692            .inner
10693            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10694                result,
10695                self.tx_id,
10696                0x54f3949246a03e74,
10697                fidl::encoding::DynamicFlags::empty(),
10698            )
10699    }
10700}
10701
10702#[must_use = "FIDL methods require a response to be sent"]
10703#[derive(Debug)]
10704pub struct FileCloseResponder {
10705    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10706    tx_id: u32,
10707}
10708
10709/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10710/// if the responder is dropped without sending a response, so that the client
10711/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10712impl std::ops::Drop for FileCloseResponder {
10713    fn drop(&mut self) {
10714        self.control_handle.shutdown();
10715        // Safety: drops once, never accessed again
10716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10717    }
10718}
10719
10720impl fidl::endpoints::Responder for FileCloseResponder {
10721    type ControlHandle = FileControlHandle;
10722
10723    fn control_handle(&self) -> &FileControlHandle {
10724        &self.control_handle
10725    }
10726
10727    fn drop_without_shutdown(mut self) {
10728        // Safety: drops once, never accessed again due to mem::forget
10729        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10730        // Prevent Drop from running (which would shut down the channel)
10731        std::mem::forget(self);
10732    }
10733}
10734
10735impl FileCloseResponder {
10736    /// Sends a response to the FIDL transaction.
10737    ///
10738    /// Sets the channel to shutdown if an error occurs.
10739    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10740        let _result = self.send_raw(result);
10741        if _result.is_err() {
10742            self.control_handle.shutdown();
10743        }
10744        self.drop_without_shutdown();
10745        _result
10746    }
10747
10748    /// Similar to "send" but does not shutdown the channel if an error occurs.
10749    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10750        let _result = self.send_raw(result);
10751        self.drop_without_shutdown();
10752        _result
10753    }
10754
10755    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10756        self.control_handle
10757            .inner
10758            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10759                result,
10760                self.tx_id,
10761                0x5ac5d459ad7f657e,
10762                fidl::encoding::DynamicFlags::empty(),
10763            )
10764    }
10765}
10766
10767#[must_use = "FIDL methods require a response to be sent"]
10768#[derive(Debug)]
10769pub struct FileQueryResponder {
10770    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10771    tx_id: u32,
10772}
10773
10774/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10775/// if the responder is dropped without sending a response, so that the client
10776/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10777impl std::ops::Drop for FileQueryResponder {
10778    fn drop(&mut self) {
10779        self.control_handle.shutdown();
10780        // Safety: drops once, never accessed again
10781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10782    }
10783}
10784
10785impl fidl::endpoints::Responder for FileQueryResponder {
10786    type ControlHandle = FileControlHandle;
10787
10788    fn control_handle(&self) -> &FileControlHandle {
10789        &self.control_handle
10790    }
10791
10792    fn drop_without_shutdown(mut self) {
10793        // Safety: drops once, never accessed again due to mem::forget
10794        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10795        // Prevent Drop from running (which would shut down the channel)
10796        std::mem::forget(self);
10797    }
10798}
10799
10800impl FileQueryResponder {
10801    /// Sends a response to the FIDL transaction.
10802    ///
10803    /// Sets the channel to shutdown if an error occurs.
10804    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10805        let _result = self.send_raw(protocol);
10806        if _result.is_err() {
10807            self.control_handle.shutdown();
10808        }
10809        self.drop_without_shutdown();
10810        _result
10811    }
10812
10813    /// Similar to "send" but does not shutdown the channel if an error occurs.
10814    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10815        let _result = self.send_raw(protocol);
10816        self.drop_without_shutdown();
10817        _result
10818    }
10819
10820    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
10821        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
10822            (protocol,),
10823            self.tx_id,
10824            0x2658edee9decfc06,
10825            fidl::encoding::DynamicFlags::empty(),
10826        )
10827    }
10828}
10829
10830#[must_use = "FIDL methods require a response to be sent"]
10831#[derive(Debug)]
10832pub struct FileDeprecatedGetAttrResponder {
10833    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10834    tx_id: u32,
10835}
10836
10837/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10838/// if the responder is dropped without sending a response, so that the client
10839/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10840impl std::ops::Drop for FileDeprecatedGetAttrResponder {
10841    fn drop(&mut self) {
10842        self.control_handle.shutdown();
10843        // Safety: drops once, never accessed again
10844        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10845    }
10846}
10847
10848impl fidl::endpoints::Responder for FileDeprecatedGetAttrResponder {
10849    type ControlHandle = FileControlHandle;
10850
10851    fn control_handle(&self) -> &FileControlHandle {
10852        &self.control_handle
10853    }
10854
10855    fn drop_without_shutdown(mut self) {
10856        // Safety: drops once, never accessed again due to mem::forget
10857        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10858        // Prevent Drop from running (which would shut down the channel)
10859        std::mem::forget(self);
10860    }
10861}
10862
10863impl FileDeprecatedGetAttrResponder {
10864    /// Sends a response to the FIDL transaction.
10865    ///
10866    /// Sets the channel to shutdown if an error occurs.
10867    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10868        let _result = self.send_raw(s, attributes);
10869        if _result.is_err() {
10870            self.control_handle.shutdown();
10871        }
10872        self.drop_without_shutdown();
10873        _result
10874    }
10875
10876    /// Similar to "send" but does not shutdown the channel if an error occurs.
10877    pub fn send_no_shutdown_on_err(
10878        self,
10879        mut s: i32,
10880        mut attributes: &NodeAttributes,
10881    ) -> Result<(), fidl::Error> {
10882        let _result = self.send_raw(s, attributes);
10883        self.drop_without_shutdown();
10884        _result
10885    }
10886
10887    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
10888        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
10889            (s, attributes),
10890            self.tx_id,
10891            0x78985e216314dafd,
10892            fidl::encoding::DynamicFlags::empty(),
10893        )
10894    }
10895}
10896
10897#[must_use = "FIDL methods require a response to be sent"]
10898#[derive(Debug)]
10899pub struct FileDeprecatedSetAttrResponder {
10900    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10901    tx_id: u32,
10902}
10903
10904/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10905/// if the responder is dropped without sending a response, so that the client
10906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10907impl std::ops::Drop for FileDeprecatedSetAttrResponder {
10908    fn drop(&mut self) {
10909        self.control_handle.shutdown();
10910        // Safety: drops once, never accessed again
10911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10912    }
10913}
10914
10915impl fidl::endpoints::Responder for FileDeprecatedSetAttrResponder {
10916    type ControlHandle = FileControlHandle;
10917
10918    fn control_handle(&self) -> &FileControlHandle {
10919        &self.control_handle
10920    }
10921
10922    fn drop_without_shutdown(mut self) {
10923        // Safety: drops once, never accessed again due to mem::forget
10924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10925        // Prevent Drop from running (which would shut down the channel)
10926        std::mem::forget(self);
10927    }
10928}
10929
10930impl FileDeprecatedSetAttrResponder {
10931    /// Sends a response to the FIDL transaction.
10932    ///
10933    /// Sets the channel to shutdown if an error occurs.
10934    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
10935        let _result = self.send_raw(s);
10936        if _result.is_err() {
10937            self.control_handle.shutdown();
10938        }
10939        self.drop_without_shutdown();
10940        _result
10941    }
10942
10943    /// Similar to "send" but does not shutdown the channel if an error occurs.
10944    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
10945        let _result = self.send_raw(s);
10946        self.drop_without_shutdown();
10947        _result
10948    }
10949
10950    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
10951        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
10952            (s,),
10953            self.tx_id,
10954            0x4186c0f40d938f46,
10955            fidl::encoding::DynamicFlags::empty(),
10956        )
10957    }
10958}
10959
10960#[must_use = "FIDL methods require a response to be sent"]
10961#[derive(Debug)]
10962pub struct FileDeprecatedGetFlagsResponder {
10963    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
10964    tx_id: u32,
10965}
10966
10967/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
10968/// if the responder is dropped without sending a response, so that the client
10969/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10970impl std::ops::Drop for FileDeprecatedGetFlagsResponder {
10971    fn drop(&mut self) {
10972        self.control_handle.shutdown();
10973        // Safety: drops once, never accessed again
10974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10975    }
10976}
10977
10978impl fidl::endpoints::Responder for FileDeprecatedGetFlagsResponder {
10979    type ControlHandle = FileControlHandle;
10980
10981    fn control_handle(&self) -> &FileControlHandle {
10982        &self.control_handle
10983    }
10984
10985    fn drop_without_shutdown(mut self) {
10986        // Safety: drops once, never accessed again due to mem::forget
10987        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10988        // Prevent Drop from running (which would shut down the channel)
10989        std::mem::forget(self);
10990    }
10991}
10992
10993impl FileDeprecatedGetFlagsResponder {
10994    /// Sends a response to the FIDL transaction.
10995    ///
10996    /// Sets the channel to shutdown if an error occurs.
10997    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
10998        let _result = self.send_raw(s, flags);
10999        if _result.is_err() {
11000            self.control_handle.shutdown();
11001        }
11002        self.drop_without_shutdown();
11003        _result
11004    }
11005
11006    /// Similar to "send" but does not shutdown the channel if an error occurs.
11007    pub fn send_no_shutdown_on_err(
11008        self,
11009        mut s: i32,
11010        mut flags: OpenFlags,
11011    ) -> Result<(), fidl::Error> {
11012        let _result = self.send_raw(s, flags);
11013        self.drop_without_shutdown();
11014        _result
11015    }
11016
11017    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
11018        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
11019            (s, flags),
11020            self.tx_id,
11021            0x5b88fffb8eda3aa1,
11022            fidl::encoding::DynamicFlags::empty(),
11023        )
11024    }
11025}
11026
11027#[must_use = "FIDL methods require a response to be sent"]
11028#[derive(Debug)]
11029pub struct FileDeprecatedSetFlagsResponder {
11030    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11031    tx_id: u32,
11032}
11033
11034/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11035/// if the responder is dropped without sending a response, so that the client
11036/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11037impl std::ops::Drop for FileDeprecatedSetFlagsResponder {
11038    fn drop(&mut self) {
11039        self.control_handle.shutdown();
11040        // Safety: drops once, never accessed again
11041        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11042    }
11043}
11044
11045impl fidl::endpoints::Responder for FileDeprecatedSetFlagsResponder {
11046    type ControlHandle = FileControlHandle;
11047
11048    fn control_handle(&self) -> &FileControlHandle {
11049        &self.control_handle
11050    }
11051
11052    fn drop_without_shutdown(mut self) {
11053        // Safety: drops once, never accessed again due to mem::forget
11054        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11055        // Prevent Drop from running (which would shut down the channel)
11056        std::mem::forget(self);
11057    }
11058}
11059
11060impl FileDeprecatedSetFlagsResponder {
11061    /// Sends a response to the FIDL transaction.
11062    ///
11063    /// Sets the channel to shutdown if an error occurs.
11064    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
11065        let _result = self.send_raw(s);
11066        if _result.is_err() {
11067            self.control_handle.shutdown();
11068        }
11069        self.drop_without_shutdown();
11070        _result
11071    }
11072
11073    /// Similar to "send" but does not shutdown the channel if an error occurs.
11074    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
11075        let _result = self.send_raw(s);
11076        self.drop_without_shutdown();
11077        _result
11078    }
11079
11080    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
11081        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
11082            (s,),
11083            self.tx_id,
11084            0x5295b76c71fde733,
11085            fidl::encoding::DynamicFlags::empty(),
11086        )
11087    }
11088}
11089
11090#[must_use = "FIDL methods require a response to be sent"]
11091#[derive(Debug)]
11092pub struct FileGetFlagsResponder {
11093    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11094    tx_id: u32,
11095}
11096
11097/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11098/// if the responder is dropped without sending a response, so that the client
11099/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11100impl std::ops::Drop for FileGetFlagsResponder {
11101    fn drop(&mut self) {
11102        self.control_handle.shutdown();
11103        // Safety: drops once, never accessed again
11104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11105    }
11106}
11107
11108impl fidl::endpoints::Responder for FileGetFlagsResponder {
11109    type ControlHandle = FileControlHandle;
11110
11111    fn control_handle(&self) -> &FileControlHandle {
11112        &self.control_handle
11113    }
11114
11115    fn drop_without_shutdown(mut self) {
11116        // Safety: drops once, never accessed again due to mem::forget
11117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11118        // Prevent Drop from running (which would shut down the channel)
11119        std::mem::forget(self);
11120    }
11121}
11122
11123impl FileGetFlagsResponder {
11124    /// Sends a response to the FIDL transaction.
11125    ///
11126    /// Sets the channel to shutdown if an error occurs.
11127    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11128        let _result = self.send_raw(result);
11129        if _result.is_err() {
11130            self.control_handle.shutdown();
11131        }
11132        self.drop_without_shutdown();
11133        _result
11134    }
11135
11136    /// Similar to "send" but does not shutdown the channel if an error occurs.
11137    pub fn send_no_shutdown_on_err(
11138        self,
11139        mut result: Result<Flags, i32>,
11140    ) -> Result<(), fidl::Error> {
11141        let _result = self.send_raw(result);
11142        self.drop_without_shutdown();
11143        _result
11144    }
11145
11146    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
11147        self.control_handle
11148            .inner
11149            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
11150                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
11151                self.tx_id,
11152                0x176eb318f64ec23,
11153                fidl::encoding::DynamicFlags::FLEXIBLE,
11154            )
11155    }
11156}
11157
11158#[must_use = "FIDL methods require a response to be sent"]
11159#[derive(Debug)]
11160pub struct FileSetFlagsResponder {
11161    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11162    tx_id: u32,
11163}
11164
11165/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11166/// if the responder is dropped without sending a response, so that the client
11167/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11168impl std::ops::Drop for FileSetFlagsResponder {
11169    fn drop(&mut self) {
11170        self.control_handle.shutdown();
11171        // Safety: drops once, never accessed again
11172        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11173    }
11174}
11175
11176impl fidl::endpoints::Responder for FileSetFlagsResponder {
11177    type ControlHandle = FileControlHandle;
11178
11179    fn control_handle(&self) -> &FileControlHandle {
11180        &self.control_handle
11181    }
11182
11183    fn drop_without_shutdown(mut self) {
11184        // Safety: drops once, never accessed again due to mem::forget
11185        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11186        // Prevent Drop from running (which would shut down the channel)
11187        std::mem::forget(self);
11188    }
11189}
11190
11191impl FileSetFlagsResponder {
11192    /// Sends a response to the FIDL transaction.
11193    ///
11194    /// Sets the channel to shutdown if an error occurs.
11195    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11196        let _result = self.send_raw(result);
11197        if _result.is_err() {
11198            self.control_handle.shutdown();
11199        }
11200        self.drop_without_shutdown();
11201        _result
11202    }
11203
11204    /// Similar to "send" but does not shutdown the channel if an error occurs.
11205    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11206        let _result = self.send_raw(result);
11207        self.drop_without_shutdown();
11208        _result
11209    }
11210
11211    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11212        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11213            fidl::encoding::EmptyStruct,
11214            i32,
11215        >>(
11216            fidl::encoding::FlexibleResult::new(result),
11217            self.tx_id,
11218            0x55a8028685791ea8,
11219            fidl::encoding::DynamicFlags::FLEXIBLE,
11220        )
11221    }
11222}
11223
11224#[must_use = "FIDL methods require a response to be sent"]
11225#[derive(Debug)]
11226pub struct FileQueryFilesystemResponder {
11227    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11228    tx_id: u32,
11229}
11230
11231/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11232/// if the responder is dropped without sending a response, so that the client
11233/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11234impl std::ops::Drop for FileQueryFilesystemResponder {
11235    fn drop(&mut self) {
11236        self.control_handle.shutdown();
11237        // Safety: drops once, never accessed again
11238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11239    }
11240}
11241
11242impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
11243    type ControlHandle = FileControlHandle;
11244
11245    fn control_handle(&self) -> &FileControlHandle {
11246        &self.control_handle
11247    }
11248
11249    fn drop_without_shutdown(mut self) {
11250        // Safety: drops once, never accessed again due to mem::forget
11251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11252        // Prevent Drop from running (which would shut down the channel)
11253        std::mem::forget(self);
11254    }
11255}
11256
11257impl FileQueryFilesystemResponder {
11258    /// Sends a response to the FIDL transaction.
11259    ///
11260    /// Sets the channel to shutdown if an error occurs.
11261    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11262        let _result = self.send_raw(s, info);
11263        if _result.is_err() {
11264            self.control_handle.shutdown();
11265        }
11266        self.drop_without_shutdown();
11267        _result
11268    }
11269
11270    /// Similar to "send" but does not shutdown the channel if an error occurs.
11271    pub fn send_no_shutdown_on_err(
11272        self,
11273        mut s: i32,
11274        mut info: Option<&FilesystemInfo>,
11275    ) -> Result<(), fidl::Error> {
11276        let _result = self.send_raw(s, info);
11277        self.drop_without_shutdown();
11278        _result
11279    }
11280
11281    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
11282        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
11283            (s, info),
11284            self.tx_id,
11285            0x6f344a1c6b0a0610,
11286            fidl::encoding::DynamicFlags::empty(),
11287        )
11288    }
11289}
11290
11291#[must_use = "FIDL methods require a response to be sent"]
11292#[derive(Debug)]
11293pub struct FileGetAttributesResponder {
11294    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11295    tx_id: u32,
11296}
11297
11298/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11299/// if the responder is dropped without sending a response, so that the client
11300/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11301impl std::ops::Drop for FileGetAttributesResponder {
11302    fn drop(&mut self) {
11303        self.control_handle.shutdown();
11304        // Safety: drops once, never accessed again
11305        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11306    }
11307}
11308
11309impl fidl::endpoints::Responder for FileGetAttributesResponder {
11310    type ControlHandle = FileControlHandle;
11311
11312    fn control_handle(&self) -> &FileControlHandle {
11313        &self.control_handle
11314    }
11315
11316    fn drop_without_shutdown(mut self) {
11317        // Safety: drops once, never accessed again due to mem::forget
11318        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11319        // Prevent Drop from running (which would shut down the channel)
11320        std::mem::forget(self);
11321    }
11322}
11323
11324impl FileGetAttributesResponder {
11325    /// Sends a response to the FIDL transaction.
11326    ///
11327    /// Sets the channel to shutdown if an error occurs.
11328    pub fn send(
11329        self,
11330        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11331    ) -> Result<(), fidl::Error> {
11332        let _result = self.send_raw(result);
11333        if _result.is_err() {
11334            self.control_handle.shutdown();
11335        }
11336        self.drop_without_shutdown();
11337        _result
11338    }
11339
11340    /// Similar to "send" but does not shutdown the channel if an error occurs.
11341    pub fn send_no_shutdown_on_err(
11342        self,
11343        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11344    ) -> Result<(), fidl::Error> {
11345        let _result = self.send_raw(result);
11346        self.drop_without_shutdown();
11347        _result
11348    }
11349
11350    fn send_raw(
11351        &self,
11352        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
11353    ) -> Result<(), fidl::Error> {
11354        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
11355            result,
11356            self.tx_id,
11357            0x3d4396a638ea053b,
11358            fidl::encoding::DynamicFlags::empty(),
11359        )
11360    }
11361}
11362
11363#[must_use = "FIDL methods require a response to be sent"]
11364#[derive(Debug)]
11365pub struct FileUpdateAttributesResponder {
11366    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11367    tx_id: u32,
11368}
11369
11370/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11371/// if the responder is dropped without sending a response, so that the client
11372/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11373impl std::ops::Drop for FileUpdateAttributesResponder {
11374    fn drop(&mut self) {
11375        self.control_handle.shutdown();
11376        // Safety: drops once, never accessed again
11377        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11378    }
11379}
11380
11381impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
11382    type ControlHandle = FileControlHandle;
11383
11384    fn control_handle(&self) -> &FileControlHandle {
11385        &self.control_handle
11386    }
11387
11388    fn drop_without_shutdown(mut self) {
11389        // Safety: drops once, never accessed again due to mem::forget
11390        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11391        // Prevent Drop from running (which would shut down the channel)
11392        std::mem::forget(self);
11393    }
11394}
11395
11396impl FileUpdateAttributesResponder {
11397    /// Sends a response to the FIDL transaction.
11398    ///
11399    /// Sets the channel to shutdown if an error occurs.
11400    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11401        let _result = self.send_raw(result);
11402        if _result.is_err() {
11403            self.control_handle.shutdown();
11404        }
11405        self.drop_without_shutdown();
11406        _result
11407    }
11408
11409    /// Similar to "send" but does not shutdown the channel if an error occurs.
11410    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11411        let _result = self.send_raw(result);
11412        self.drop_without_shutdown();
11413        _result
11414    }
11415
11416    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11417        self.control_handle
11418            .inner
11419            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11420                result,
11421                self.tx_id,
11422                0x3308c1da5a89bf08,
11423                fidl::encoding::DynamicFlags::empty(),
11424            )
11425    }
11426}
11427
11428#[must_use = "FIDL methods require a response to be sent"]
11429#[derive(Debug)]
11430pub struct FileSyncResponder {
11431    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11432    tx_id: u32,
11433}
11434
11435/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11436/// if the responder is dropped without sending a response, so that the client
11437/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11438impl std::ops::Drop for FileSyncResponder {
11439    fn drop(&mut self) {
11440        self.control_handle.shutdown();
11441        // Safety: drops once, never accessed again
11442        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11443    }
11444}
11445
11446impl fidl::endpoints::Responder for FileSyncResponder {
11447    type ControlHandle = FileControlHandle;
11448
11449    fn control_handle(&self) -> &FileControlHandle {
11450        &self.control_handle
11451    }
11452
11453    fn drop_without_shutdown(mut self) {
11454        // Safety: drops once, never accessed again due to mem::forget
11455        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11456        // Prevent Drop from running (which would shut down the channel)
11457        std::mem::forget(self);
11458    }
11459}
11460
11461impl FileSyncResponder {
11462    /// Sends a response to the FIDL transaction.
11463    ///
11464    /// Sets the channel to shutdown if an error occurs.
11465    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11466        let _result = self.send_raw(result);
11467        if _result.is_err() {
11468            self.control_handle.shutdown();
11469        }
11470        self.drop_without_shutdown();
11471        _result
11472    }
11473
11474    /// Similar to "send" but does not shutdown the channel if an error occurs.
11475    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11476        let _result = self.send_raw(result);
11477        self.drop_without_shutdown();
11478        _result
11479    }
11480
11481    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11482        self.control_handle
11483            .inner
11484            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11485                result,
11486                self.tx_id,
11487                0x2c5c27ca0ab5dc49,
11488                fidl::encoding::DynamicFlags::empty(),
11489            )
11490    }
11491}
11492
11493#[must_use = "FIDL methods require a response to be sent"]
11494#[derive(Debug)]
11495pub struct FileGetExtendedAttributeResponder {
11496    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11497    tx_id: u32,
11498}
11499
11500/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11501/// if the responder is dropped without sending a response, so that the client
11502/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11503impl std::ops::Drop for FileGetExtendedAttributeResponder {
11504    fn drop(&mut self) {
11505        self.control_handle.shutdown();
11506        // Safety: drops once, never accessed again
11507        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11508    }
11509}
11510
11511impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
11512    type ControlHandle = FileControlHandle;
11513
11514    fn control_handle(&self) -> &FileControlHandle {
11515        &self.control_handle
11516    }
11517
11518    fn drop_without_shutdown(mut self) {
11519        // Safety: drops once, never accessed again due to mem::forget
11520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11521        // Prevent Drop from running (which would shut down the channel)
11522        std::mem::forget(self);
11523    }
11524}
11525
11526impl FileGetExtendedAttributeResponder {
11527    /// Sends a response to the FIDL transaction.
11528    ///
11529    /// Sets the channel to shutdown if an error occurs.
11530    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11531        let _result = self.send_raw(result);
11532        if _result.is_err() {
11533            self.control_handle.shutdown();
11534        }
11535        self.drop_without_shutdown();
11536        _result
11537    }
11538
11539    /// Similar to "send" but does not shutdown the channel if an error occurs.
11540    pub fn send_no_shutdown_on_err(
11541        self,
11542        mut result: Result<ExtendedAttributeValue, i32>,
11543    ) -> Result<(), fidl::Error> {
11544        let _result = self.send_raw(result);
11545        self.drop_without_shutdown();
11546        _result
11547    }
11548
11549    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
11550        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
11551            result.as_mut().map_err(|e| *e),
11552            self.tx_id,
11553            0x45ffa3ccfdeb76db,
11554            fidl::encoding::DynamicFlags::empty(),
11555        )
11556    }
11557}
11558
11559#[must_use = "FIDL methods require a response to be sent"]
11560#[derive(Debug)]
11561pub struct FileSetExtendedAttributeResponder {
11562    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11563    tx_id: u32,
11564}
11565
11566/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11567/// if the responder is dropped without sending a response, so that the client
11568/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11569impl std::ops::Drop for FileSetExtendedAttributeResponder {
11570    fn drop(&mut self) {
11571        self.control_handle.shutdown();
11572        // Safety: drops once, never accessed again
11573        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11574    }
11575}
11576
11577impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
11578    type ControlHandle = FileControlHandle;
11579
11580    fn control_handle(&self) -> &FileControlHandle {
11581        &self.control_handle
11582    }
11583
11584    fn drop_without_shutdown(mut self) {
11585        // Safety: drops once, never accessed again due to mem::forget
11586        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11587        // Prevent Drop from running (which would shut down the channel)
11588        std::mem::forget(self);
11589    }
11590}
11591
11592impl FileSetExtendedAttributeResponder {
11593    /// Sends a response to the FIDL transaction.
11594    ///
11595    /// Sets the channel to shutdown if an error occurs.
11596    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11597        let _result = self.send_raw(result);
11598        if _result.is_err() {
11599            self.control_handle.shutdown();
11600        }
11601        self.drop_without_shutdown();
11602        _result
11603    }
11604
11605    /// Similar to "send" but does not shutdown the channel if an error occurs.
11606    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11607        let _result = self.send_raw(result);
11608        self.drop_without_shutdown();
11609        _result
11610    }
11611
11612    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11613        self.control_handle
11614            .inner
11615            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11616                result,
11617                self.tx_id,
11618                0x4a951362f681f23c,
11619                fidl::encoding::DynamicFlags::empty(),
11620            )
11621    }
11622}
11623
11624#[must_use = "FIDL methods require a response to be sent"]
11625#[derive(Debug)]
11626pub struct FileRemoveExtendedAttributeResponder {
11627    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11628    tx_id: u32,
11629}
11630
11631/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11632/// if the responder is dropped without sending a response, so that the client
11633/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11634impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
11635    fn drop(&mut self) {
11636        self.control_handle.shutdown();
11637        // Safety: drops once, never accessed again
11638        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11639    }
11640}
11641
11642impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
11643    type ControlHandle = FileControlHandle;
11644
11645    fn control_handle(&self) -> &FileControlHandle {
11646        &self.control_handle
11647    }
11648
11649    fn drop_without_shutdown(mut self) {
11650        // Safety: drops once, never accessed again due to mem::forget
11651        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11652        // Prevent Drop from running (which would shut down the channel)
11653        std::mem::forget(self);
11654    }
11655}
11656
11657impl FileRemoveExtendedAttributeResponder {
11658    /// Sends a response to the FIDL transaction.
11659    ///
11660    /// Sets the channel to shutdown if an error occurs.
11661    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11662        let _result = self.send_raw(result);
11663        if _result.is_err() {
11664            self.control_handle.shutdown();
11665        }
11666        self.drop_without_shutdown();
11667        _result
11668    }
11669
11670    /// Similar to "send" but does not shutdown the channel if an error occurs.
11671    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11672        let _result = self.send_raw(result);
11673        self.drop_without_shutdown();
11674        _result
11675    }
11676
11677    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11678        self.control_handle
11679            .inner
11680            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
11681                result,
11682                self.tx_id,
11683                0x7a0b9f3a9bf9032d,
11684                fidl::encoding::DynamicFlags::empty(),
11685            )
11686    }
11687}
11688
11689#[must_use = "FIDL methods require a response to be sent"]
11690#[derive(Debug)]
11691pub struct FileReadResponder {
11692    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11693    tx_id: u32,
11694}
11695
11696/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11697/// if the responder is dropped without sending a response, so that the client
11698/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11699impl std::ops::Drop for FileReadResponder {
11700    fn drop(&mut self) {
11701        self.control_handle.shutdown();
11702        // Safety: drops once, never accessed again
11703        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11704    }
11705}
11706
11707impl fidl::endpoints::Responder for FileReadResponder {
11708    type ControlHandle = FileControlHandle;
11709
11710    fn control_handle(&self) -> &FileControlHandle {
11711        &self.control_handle
11712    }
11713
11714    fn drop_without_shutdown(mut self) {
11715        // Safety: drops once, never accessed again due to mem::forget
11716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11717        // Prevent Drop from running (which would shut down the channel)
11718        std::mem::forget(self);
11719    }
11720}
11721
11722impl FileReadResponder {
11723    /// Sends a response to the FIDL transaction.
11724    ///
11725    /// Sets the channel to shutdown if an error occurs.
11726    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11727        let _result = self.send_raw(result);
11728        if _result.is_err() {
11729            self.control_handle.shutdown();
11730        }
11731        self.drop_without_shutdown();
11732        _result
11733    }
11734
11735    /// Similar to "send" but does not shutdown the channel if an error occurs.
11736    pub fn send_no_shutdown_on_err(
11737        self,
11738        mut result: Result<&[u8], i32>,
11739    ) -> Result<(), fidl::Error> {
11740        let _result = self.send_raw(result);
11741        self.drop_without_shutdown();
11742        _result
11743    }
11744
11745    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11746        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
11747            result.map(|data| (data,)),
11748            self.tx_id,
11749            0x57e419a298c8ede,
11750            fidl::encoding::DynamicFlags::empty(),
11751        )
11752    }
11753}
11754
11755#[must_use = "FIDL methods require a response to be sent"]
11756#[derive(Debug)]
11757pub struct FileWriteResponder {
11758    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11759    tx_id: u32,
11760}
11761
11762/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11763/// if the responder is dropped without sending a response, so that the client
11764/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11765impl std::ops::Drop for FileWriteResponder {
11766    fn drop(&mut self) {
11767        self.control_handle.shutdown();
11768        // Safety: drops once, never accessed again
11769        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11770    }
11771}
11772
11773impl fidl::endpoints::Responder for FileWriteResponder {
11774    type ControlHandle = FileControlHandle;
11775
11776    fn control_handle(&self) -> &FileControlHandle {
11777        &self.control_handle
11778    }
11779
11780    fn drop_without_shutdown(mut self) {
11781        // Safety: drops once, never accessed again due to mem::forget
11782        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11783        // Prevent Drop from running (which would shut down the channel)
11784        std::mem::forget(self);
11785    }
11786}
11787
11788impl FileWriteResponder {
11789    /// Sends a response to the FIDL transaction.
11790    ///
11791    /// Sets the channel to shutdown if an error occurs.
11792    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11793        let _result = self.send_raw(result);
11794        if _result.is_err() {
11795            self.control_handle.shutdown();
11796        }
11797        self.drop_without_shutdown();
11798        _result
11799    }
11800
11801    /// Similar to "send" but does not shutdown the channel if an error occurs.
11802    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11803        let _result = self.send_raw(result);
11804        self.drop_without_shutdown();
11805        _result
11806    }
11807
11808    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11809        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
11810            result.map(|actual_count| (actual_count,)),
11811            self.tx_id,
11812            0x6a31437832469f82,
11813            fidl::encoding::DynamicFlags::empty(),
11814        )
11815    }
11816}
11817
11818#[must_use = "FIDL methods require a response to be sent"]
11819#[derive(Debug)]
11820pub struct FileDescribeResponder {
11821    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11822    tx_id: u32,
11823}
11824
11825/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11826/// if the responder is dropped without sending a response, so that the client
11827/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11828impl std::ops::Drop for FileDescribeResponder {
11829    fn drop(&mut self) {
11830        self.control_handle.shutdown();
11831        // Safety: drops once, never accessed again
11832        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11833    }
11834}
11835
11836impl fidl::endpoints::Responder for FileDescribeResponder {
11837    type ControlHandle = FileControlHandle;
11838
11839    fn control_handle(&self) -> &FileControlHandle {
11840        &self.control_handle
11841    }
11842
11843    fn drop_without_shutdown(mut self) {
11844        // Safety: drops once, never accessed again due to mem::forget
11845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11846        // Prevent Drop from running (which would shut down the channel)
11847        std::mem::forget(self);
11848    }
11849}
11850
11851impl FileDescribeResponder {
11852    /// Sends a response to the FIDL transaction.
11853    ///
11854    /// Sets the channel to shutdown if an error occurs.
11855    pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11856        let _result = self.send_raw(payload);
11857        if _result.is_err() {
11858            self.control_handle.shutdown();
11859        }
11860        self.drop_without_shutdown();
11861        _result
11862    }
11863
11864    /// Similar to "send" but does not shutdown the channel if an error occurs.
11865    pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11866        let _result = self.send_raw(payload);
11867        self.drop_without_shutdown();
11868        _result
11869    }
11870
11871    fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
11872        self.control_handle.inner.send::<FileInfo>(
11873            &mut payload,
11874            self.tx_id,
11875            0x68b5ac00c62906bc,
11876            fidl::encoding::DynamicFlags::empty(),
11877        )
11878    }
11879}
11880
11881#[must_use = "FIDL methods require a response to be sent"]
11882#[derive(Debug)]
11883pub struct FileSeekResponder {
11884    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11885    tx_id: u32,
11886}
11887
11888/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11889/// if the responder is dropped without sending a response, so that the client
11890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11891impl std::ops::Drop for FileSeekResponder {
11892    fn drop(&mut self) {
11893        self.control_handle.shutdown();
11894        // Safety: drops once, never accessed again
11895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11896    }
11897}
11898
11899impl fidl::endpoints::Responder for FileSeekResponder {
11900    type ControlHandle = FileControlHandle;
11901
11902    fn control_handle(&self) -> &FileControlHandle {
11903        &self.control_handle
11904    }
11905
11906    fn drop_without_shutdown(mut self) {
11907        // Safety: drops once, never accessed again due to mem::forget
11908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11909        // Prevent Drop from running (which would shut down the channel)
11910        std::mem::forget(self);
11911    }
11912}
11913
11914impl FileSeekResponder {
11915    /// Sends a response to the FIDL transaction.
11916    ///
11917    /// Sets the channel to shutdown if an error occurs.
11918    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11919        let _result = self.send_raw(result);
11920        if _result.is_err() {
11921            self.control_handle.shutdown();
11922        }
11923        self.drop_without_shutdown();
11924        _result
11925    }
11926
11927    /// Similar to "send" but does not shutdown the channel if an error occurs.
11928    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11929        let _result = self.send_raw(result);
11930        self.drop_without_shutdown();
11931        _result
11932    }
11933
11934    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
11935        self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
11936            result.map(|offset_from_start| (offset_from_start,)),
11937            self.tx_id,
11938            0x78079168162c5207,
11939            fidl::encoding::DynamicFlags::empty(),
11940        )
11941    }
11942}
11943
11944#[must_use = "FIDL methods require a response to be sent"]
11945#[derive(Debug)]
11946pub struct FileReadAtResponder {
11947    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
11948    tx_id: u32,
11949}
11950
11951/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
11952/// if the responder is dropped without sending a response, so that the client
11953/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11954impl std::ops::Drop for FileReadAtResponder {
11955    fn drop(&mut self) {
11956        self.control_handle.shutdown();
11957        // Safety: drops once, never accessed again
11958        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11959    }
11960}
11961
11962impl fidl::endpoints::Responder for FileReadAtResponder {
11963    type ControlHandle = FileControlHandle;
11964
11965    fn control_handle(&self) -> &FileControlHandle {
11966        &self.control_handle
11967    }
11968
11969    fn drop_without_shutdown(mut self) {
11970        // Safety: drops once, never accessed again due to mem::forget
11971        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11972        // Prevent Drop from running (which would shut down the channel)
11973        std::mem::forget(self);
11974    }
11975}
11976
11977impl FileReadAtResponder {
11978    /// Sends a response to the FIDL transaction.
11979    ///
11980    /// Sets the channel to shutdown if an error occurs.
11981    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
11982        let _result = self.send_raw(result);
11983        if _result.is_err() {
11984            self.control_handle.shutdown();
11985        }
11986        self.drop_without_shutdown();
11987        _result
11988    }
11989
11990    /// Similar to "send" but does not shutdown the channel if an error occurs.
11991    pub fn send_no_shutdown_on_err(
11992        self,
11993        mut result: Result<&[u8], i32>,
11994    ) -> Result<(), fidl::Error> {
11995        let _result = self.send_raw(result);
11996        self.drop_without_shutdown();
11997        _result
11998    }
11999
12000    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
12001        self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
12002            result.map(|data| (data,)),
12003            self.tx_id,
12004            0x1607a293a60d723e,
12005            fidl::encoding::DynamicFlags::empty(),
12006        )
12007    }
12008}
12009
12010#[must_use = "FIDL methods require a response to be sent"]
12011#[derive(Debug)]
12012pub struct FileWriteAtResponder {
12013    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12014    tx_id: u32,
12015}
12016
12017/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12018/// if the responder is dropped without sending a response, so that the client
12019/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12020impl std::ops::Drop for FileWriteAtResponder {
12021    fn drop(&mut self) {
12022        self.control_handle.shutdown();
12023        // Safety: drops once, never accessed again
12024        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12025    }
12026}
12027
12028impl fidl::endpoints::Responder for FileWriteAtResponder {
12029    type ControlHandle = FileControlHandle;
12030
12031    fn control_handle(&self) -> &FileControlHandle {
12032        &self.control_handle
12033    }
12034
12035    fn drop_without_shutdown(mut self) {
12036        // Safety: drops once, never accessed again due to mem::forget
12037        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12038        // Prevent Drop from running (which would shut down the channel)
12039        std::mem::forget(self);
12040    }
12041}
12042
12043impl FileWriteAtResponder {
12044    /// Sends a response to the FIDL transaction.
12045    ///
12046    /// Sets the channel to shutdown if an error occurs.
12047    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12048        let _result = self.send_raw(result);
12049        if _result.is_err() {
12050            self.control_handle.shutdown();
12051        }
12052        self.drop_without_shutdown();
12053        _result
12054    }
12055
12056    /// Similar to "send" but does not shutdown the channel if an error occurs.
12057    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12058        let _result = self.send_raw(result);
12059        self.drop_without_shutdown();
12060        _result
12061    }
12062
12063    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
12064        self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
12065            result.map(|actual_count| (actual_count,)),
12066            self.tx_id,
12067            0x793eefc0045e792b,
12068            fidl::encoding::DynamicFlags::empty(),
12069        )
12070    }
12071}
12072
12073#[must_use = "FIDL methods require a response to be sent"]
12074#[derive(Debug)]
12075pub struct FileResizeResponder {
12076    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12077    tx_id: u32,
12078}
12079
12080/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12081/// if the responder is dropped without sending a response, so that the client
12082/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12083impl std::ops::Drop for FileResizeResponder {
12084    fn drop(&mut self) {
12085        self.control_handle.shutdown();
12086        // Safety: drops once, never accessed again
12087        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12088    }
12089}
12090
12091impl fidl::endpoints::Responder for FileResizeResponder {
12092    type ControlHandle = FileControlHandle;
12093
12094    fn control_handle(&self) -> &FileControlHandle {
12095        &self.control_handle
12096    }
12097
12098    fn drop_without_shutdown(mut self) {
12099        // Safety: drops once, never accessed again due to mem::forget
12100        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12101        // Prevent Drop from running (which would shut down the channel)
12102        std::mem::forget(self);
12103    }
12104}
12105
12106impl FileResizeResponder {
12107    /// Sends a response to the FIDL transaction.
12108    ///
12109    /// Sets the channel to shutdown if an error occurs.
12110    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12111        let _result = self.send_raw(result);
12112        if _result.is_err() {
12113            self.control_handle.shutdown();
12114        }
12115        self.drop_without_shutdown();
12116        _result
12117    }
12118
12119    /// Similar to "send" but does not shutdown the channel if an error occurs.
12120    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12121        let _result = self.send_raw(result);
12122        self.drop_without_shutdown();
12123        _result
12124    }
12125
12126    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12127        self.control_handle
12128            .inner
12129            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12130                result,
12131                self.tx_id,
12132                0x2b80825f0535743a,
12133                fidl::encoding::DynamicFlags::empty(),
12134            )
12135    }
12136}
12137
12138#[must_use = "FIDL methods require a response to be sent"]
12139#[derive(Debug)]
12140pub struct FileGetBackingMemoryResponder {
12141    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12142    tx_id: u32,
12143}
12144
12145/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12146/// if the responder is dropped without sending a response, so that the client
12147/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12148impl std::ops::Drop for FileGetBackingMemoryResponder {
12149    fn drop(&mut self) {
12150        self.control_handle.shutdown();
12151        // Safety: drops once, never accessed again
12152        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12153    }
12154}
12155
12156impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
12157    type ControlHandle = FileControlHandle;
12158
12159    fn control_handle(&self) -> &FileControlHandle {
12160        &self.control_handle
12161    }
12162
12163    fn drop_without_shutdown(mut self) {
12164        // Safety: drops once, never accessed again due to mem::forget
12165        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12166        // Prevent Drop from running (which would shut down the channel)
12167        std::mem::forget(self);
12168    }
12169}
12170
12171impl FileGetBackingMemoryResponder {
12172    /// Sends a response to the FIDL transaction.
12173    ///
12174    /// Sets the channel to shutdown if an error occurs.
12175    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12176        let _result = self.send_raw(result);
12177        if _result.is_err() {
12178            self.control_handle.shutdown();
12179        }
12180        self.drop_without_shutdown();
12181        _result
12182    }
12183
12184    /// Similar to "send" but does not shutdown the channel if an error occurs.
12185    pub fn send_no_shutdown_on_err(
12186        self,
12187        mut result: Result<fidl::Vmo, i32>,
12188    ) -> Result<(), fidl::Error> {
12189        let _result = self.send_raw(result);
12190        self.drop_without_shutdown();
12191        _result
12192    }
12193
12194    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
12195        self.control_handle
12196            .inner
12197            .send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
12198                result.map(|vmo| (vmo,)),
12199                self.tx_id,
12200                0xa6a9e654cbf62b,
12201                fidl::encoding::DynamicFlags::empty(),
12202            )
12203    }
12204}
12205
12206#[must_use = "FIDL methods require a response to be sent"]
12207#[derive(Debug)]
12208pub struct FileAllocateResponder {
12209    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12210    tx_id: u32,
12211}
12212
12213/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12214/// if the responder is dropped without sending a response, so that the client
12215/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12216impl std::ops::Drop for FileAllocateResponder {
12217    fn drop(&mut self) {
12218        self.control_handle.shutdown();
12219        // Safety: drops once, never accessed again
12220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12221    }
12222}
12223
12224impl fidl::endpoints::Responder for FileAllocateResponder {
12225    type ControlHandle = FileControlHandle;
12226
12227    fn control_handle(&self) -> &FileControlHandle {
12228        &self.control_handle
12229    }
12230
12231    fn drop_without_shutdown(mut self) {
12232        // Safety: drops once, never accessed again due to mem::forget
12233        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12234        // Prevent Drop from running (which would shut down the channel)
12235        std::mem::forget(self);
12236    }
12237}
12238
12239impl FileAllocateResponder {
12240    /// Sends a response to the FIDL transaction.
12241    ///
12242    /// Sets the channel to shutdown if an error occurs.
12243    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12244        let _result = self.send_raw(result);
12245        if _result.is_err() {
12246            self.control_handle.shutdown();
12247        }
12248        self.drop_without_shutdown();
12249        _result
12250    }
12251
12252    /// Similar to "send" but does not shutdown the channel if an error occurs.
12253    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12254        let _result = self.send_raw(result);
12255        self.drop_without_shutdown();
12256        _result
12257    }
12258
12259    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12260        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12261            fidl::encoding::EmptyStruct,
12262            i32,
12263        >>(
12264            fidl::encoding::FlexibleResult::new(result),
12265            self.tx_id,
12266            0x77fa0c330b57fd2e,
12267            fidl::encoding::DynamicFlags::FLEXIBLE,
12268        )
12269    }
12270}
12271
12272#[must_use = "FIDL methods require a response to be sent"]
12273#[derive(Debug)]
12274pub struct FileEnableVerityResponder {
12275    control_handle: std::mem::ManuallyDrop<FileControlHandle>,
12276    tx_id: u32,
12277}
12278
12279/// Set the the channel to be shutdown (see [`FileControlHandle::shutdown`])
12280/// if the responder is dropped without sending a response, so that the client
12281/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12282impl std::ops::Drop for FileEnableVerityResponder {
12283    fn drop(&mut self) {
12284        self.control_handle.shutdown();
12285        // Safety: drops once, never accessed again
12286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12287    }
12288}
12289
12290impl fidl::endpoints::Responder for FileEnableVerityResponder {
12291    type ControlHandle = FileControlHandle;
12292
12293    fn control_handle(&self) -> &FileControlHandle {
12294        &self.control_handle
12295    }
12296
12297    fn drop_without_shutdown(mut self) {
12298        // Safety: drops once, never accessed again due to mem::forget
12299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12300        // Prevent Drop from running (which would shut down the channel)
12301        std::mem::forget(self);
12302    }
12303}
12304
12305impl FileEnableVerityResponder {
12306    /// Sends a response to the FIDL transaction.
12307    ///
12308    /// Sets the channel to shutdown if an error occurs.
12309    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12310        let _result = self.send_raw(result);
12311        if _result.is_err() {
12312            self.control_handle.shutdown();
12313        }
12314        self.drop_without_shutdown();
12315        _result
12316    }
12317
12318    /// Similar to "send" but does not shutdown the channel if an error occurs.
12319    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12320        let _result = self.send_raw(result);
12321        self.drop_without_shutdown();
12322        _result
12323    }
12324
12325    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12326        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12327            fidl::encoding::EmptyStruct,
12328            i32,
12329        >>(
12330            fidl::encoding::FlexibleResult::new(result),
12331            self.tx_id,
12332            0x2c421ec3faaeb8bb,
12333            fidl::encoding::DynamicFlags::FLEXIBLE,
12334        )
12335    }
12336}
12337
12338#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12339pub struct LinkableMarker;
12340
12341impl fidl::endpoints::ProtocolMarker for LinkableMarker {
12342    type Proxy = LinkableProxy;
12343    type RequestStream = LinkableRequestStream;
12344    #[cfg(target_os = "fuchsia")]
12345    type SynchronousProxy = LinkableSynchronousProxy;
12346
12347    const DEBUG_NAME: &'static str = "(anonymous) Linkable";
12348}
12349pub type LinkableLinkIntoResult = Result<(), i32>;
12350
12351pub trait LinkableProxyInterface: Send + Sync {
12352    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
12353        + Send;
12354    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
12355}
12356#[derive(Debug)]
12357#[cfg(target_os = "fuchsia")]
12358pub struct LinkableSynchronousProxy {
12359    client: fidl::client::sync::Client,
12360}
12361
12362#[cfg(target_os = "fuchsia")]
12363impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
12364    type Proxy = LinkableProxy;
12365    type Protocol = LinkableMarker;
12366
12367    fn from_channel(inner: fidl::Channel) -> Self {
12368        Self::new(inner)
12369    }
12370
12371    fn into_channel(self) -> fidl::Channel {
12372        self.client.into_channel()
12373    }
12374
12375    fn as_channel(&self) -> &fidl::Channel {
12376        self.client.as_channel()
12377    }
12378}
12379
12380#[cfg(target_os = "fuchsia")]
12381impl LinkableSynchronousProxy {
12382    pub fn new(channel: fidl::Channel) -> Self {
12383        Self { client: fidl::client::sync::Client::new(channel) }
12384    }
12385
12386    pub fn into_channel(self) -> fidl::Channel {
12387        self.client.into_channel()
12388    }
12389
12390    /// Waits until an event arrives and returns it. It is safe for other
12391    /// threads to make concurrent requests while waiting for an event.
12392    pub fn wait_for_event(
12393        &self,
12394        deadline: zx::MonotonicInstant,
12395    ) -> Result<LinkableEvent, fidl::Error> {
12396        LinkableEvent::decode(self.client.wait_for_event::<LinkableMarker>(deadline)?)
12397    }
12398
12399    /// Creates a link to this this object with name `dst` in the directory represented by
12400    /// `dst_parent_token`.
12401    ///
12402    /// `dst` must be a resolved object name. Including "/" in the string will return
12403    /// `ZX_ERR_INVALID_ARGS`.
12404    ///
12405    /// This method requires the maximal set of rights supported by the filesystem for this object.
12406    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12407    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12408    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12409    /// `ZX_ERR_ACCESS_DENIED`.
12410    ///
12411    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12412    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12413    ///
12414    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12415    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12416    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12417    ///
12418    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12419    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12420    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12421    pub fn r#link_into(
12422        &self,
12423        mut dst_parent_token: fidl::Event,
12424        mut dst: &str,
12425        ___deadline: zx::MonotonicInstant,
12426    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12427        let _response = self.client.send_query::<
12428            LinkableLinkIntoRequest,
12429            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12430            LinkableMarker,
12431        >(
12432            (dst_parent_token, dst,),
12433            0x54f3949246a03e74,
12434            fidl::encoding::DynamicFlags::empty(),
12435            ___deadline,
12436        )?;
12437        Ok(_response.map(|x| x))
12438    }
12439}
12440
12441#[cfg(target_os = "fuchsia")]
12442impl From<LinkableSynchronousProxy> for zx::NullableHandle {
12443    fn from(value: LinkableSynchronousProxy) -> Self {
12444        value.into_channel().into()
12445    }
12446}
12447
12448#[cfg(target_os = "fuchsia")]
12449impl From<fidl::Channel> for LinkableSynchronousProxy {
12450    fn from(value: fidl::Channel) -> Self {
12451        Self::new(value)
12452    }
12453}
12454
12455#[cfg(target_os = "fuchsia")]
12456impl fidl::endpoints::FromClient for LinkableSynchronousProxy {
12457    type Protocol = LinkableMarker;
12458
12459    fn from_client(value: fidl::endpoints::ClientEnd<LinkableMarker>) -> Self {
12460        Self::new(value.into_channel())
12461    }
12462}
12463
12464#[derive(Debug, Clone)]
12465pub struct LinkableProxy {
12466    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12467}
12468
12469impl fidl::endpoints::Proxy for LinkableProxy {
12470    type Protocol = LinkableMarker;
12471
12472    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12473        Self::new(inner)
12474    }
12475
12476    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12477        self.client.into_channel().map_err(|client| Self { client })
12478    }
12479
12480    fn as_channel(&self) -> &::fidl::AsyncChannel {
12481        self.client.as_channel()
12482    }
12483}
12484
12485impl LinkableProxy {
12486    /// Create a new Proxy for fuchsia.io/Linkable.
12487    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12488        let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12489        Self { client: fidl::client::Client::new(channel, protocol_name) }
12490    }
12491
12492    /// Get a Stream of events from the remote end of the protocol.
12493    ///
12494    /// # Panics
12495    ///
12496    /// Panics if the event stream was already taken.
12497    pub fn take_event_stream(&self) -> LinkableEventStream {
12498        LinkableEventStream { event_receiver: self.client.take_event_receiver() }
12499    }
12500
12501    /// Creates a link to this this object with name `dst` in the directory represented by
12502    /// `dst_parent_token`.
12503    ///
12504    /// `dst` must be a resolved object name. Including "/" in the string will return
12505    /// `ZX_ERR_INVALID_ARGS`.
12506    ///
12507    /// This method requires the maximal set of rights supported by the filesystem for this object.
12508    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12509    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12510    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12511    /// `ZX_ERR_ACCESS_DENIED`.
12512    ///
12513    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12514    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12515    ///
12516    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12517    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12518    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12519    ///
12520    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12521    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12522    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12523    pub fn r#link_into(
12524        &self,
12525        mut dst_parent_token: fidl::Event,
12526        mut dst: &str,
12527    ) -> fidl::client::QueryResponseFut<
12528        LinkableLinkIntoResult,
12529        fidl::encoding::DefaultFuchsiaResourceDialect,
12530    > {
12531        LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
12532    }
12533}
12534
12535impl LinkableProxyInterface for LinkableProxy {
12536    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
12537        LinkableLinkIntoResult,
12538        fidl::encoding::DefaultFuchsiaResourceDialect,
12539    >;
12540    fn r#link_into(
12541        &self,
12542        mut dst_parent_token: fidl::Event,
12543        mut dst: &str,
12544    ) -> Self::LinkIntoResponseFut {
12545        fn _decode(
12546            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12547        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
12548            let _response = fidl::client::decode_transaction_body::<
12549                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
12550                fidl::encoding::DefaultFuchsiaResourceDialect,
12551                0x54f3949246a03e74,
12552            >(_buf?)?;
12553            Ok(_response.map(|x| x))
12554        }
12555        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
12556            (dst_parent_token, dst),
12557            0x54f3949246a03e74,
12558            fidl::encoding::DynamicFlags::empty(),
12559            _decode,
12560        )
12561    }
12562}
12563
12564pub struct LinkableEventStream {
12565    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12566}
12567
12568impl std::marker::Unpin for LinkableEventStream {}
12569
12570impl futures::stream::FusedStream for LinkableEventStream {
12571    fn is_terminated(&self) -> bool {
12572        self.event_receiver.is_terminated()
12573    }
12574}
12575
12576impl futures::Stream for LinkableEventStream {
12577    type Item = Result<LinkableEvent, fidl::Error>;
12578
12579    fn poll_next(
12580        mut self: std::pin::Pin<&mut Self>,
12581        cx: &mut std::task::Context<'_>,
12582    ) -> std::task::Poll<Option<Self::Item>> {
12583        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12584            &mut self.event_receiver,
12585            cx
12586        )?) {
12587            Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
12588            None => std::task::Poll::Ready(None),
12589        }
12590    }
12591}
12592
12593#[derive(Debug)]
12594pub enum LinkableEvent {}
12595
12596impl LinkableEvent {
12597    /// Decodes a message buffer as a [`LinkableEvent`].
12598    fn decode(
12599        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12600    ) -> Result<LinkableEvent, fidl::Error> {
12601        let (bytes, _handles) = buf.split_mut();
12602        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12603        debug_assert_eq!(tx_header.tx_id, 0);
12604        match tx_header.ordinal {
12605            _ => Err(fidl::Error::UnknownOrdinal {
12606                ordinal: tx_header.ordinal,
12607                protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12608            }),
12609        }
12610    }
12611}
12612
12613/// A Stream of incoming requests for fuchsia.io/Linkable.
12614pub struct LinkableRequestStream {
12615    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12616    is_terminated: bool,
12617}
12618
12619impl std::marker::Unpin for LinkableRequestStream {}
12620
12621impl futures::stream::FusedStream for LinkableRequestStream {
12622    fn is_terminated(&self) -> bool {
12623        self.is_terminated
12624    }
12625}
12626
12627impl fidl::endpoints::RequestStream for LinkableRequestStream {
12628    type Protocol = LinkableMarker;
12629    type ControlHandle = LinkableControlHandle;
12630
12631    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12632        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12633    }
12634
12635    fn control_handle(&self) -> Self::ControlHandle {
12636        LinkableControlHandle { inner: self.inner.clone() }
12637    }
12638
12639    fn into_inner(
12640        self,
12641    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12642    {
12643        (self.inner, self.is_terminated)
12644    }
12645
12646    fn from_inner(
12647        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12648        is_terminated: bool,
12649    ) -> Self {
12650        Self { inner, is_terminated }
12651    }
12652}
12653
12654impl futures::Stream for LinkableRequestStream {
12655    type Item = Result<LinkableRequest, fidl::Error>;
12656
12657    fn poll_next(
12658        mut self: std::pin::Pin<&mut Self>,
12659        cx: &mut std::task::Context<'_>,
12660    ) -> std::task::Poll<Option<Self::Item>> {
12661        let this = &mut *self;
12662        if this.inner.check_shutdown(cx) {
12663            this.is_terminated = true;
12664            return std::task::Poll::Ready(None);
12665        }
12666        if this.is_terminated {
12667            panic!("polled LinkableRequestStream after completion");
12668        }
12669        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12670            |bytes, handles| {
12671                match this.inner.channel().read_etc(cx, bytes, handles) {
12672                    std::task::Poll::Ready(Ok(())) => {}
12673                    std::task::Poll::Pending => return std::task::Poll::Pending,
12674                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12675                        this.is_terminated = true;
12676                        return std::task::Poll::Ready(None);
12677                    }
12678                    std::task::Poll::Ready(Err(e)) => {
12679                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12680                            e.into(),
12681                        ))));
12682                    }
12683                }
12684
12685                // A message has been received from the channel
12686                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12687
12688                std::task::Poll::Ready(Some(match header.ordinal {
12689                    0x54f3949246a03e74 => {
12690                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12691                        let mut req = fidl::new_empty!(
12692                            LinkableLinkIntoRequest,
12693                            fidl::encoding::DefaultFuchsiaResourceDialect
12694                        );
12695                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
12696                        let control_handle = LinkableControlHandle { inner: this.inner.clone() };
12697                        Ok(LinkableRequest::LinkInto {
12698                            dst_parent_token: req.dst_parent_token,
12699                            dst: req.dst,
12700
12701                            responder: LinkableLinkIntoResponder {
12702                                control_handle: std::mem::ManuallyDrop::new(control_handle),
12703                                tx_id: header.tx_id,
12704                            },
12705                        })
12706                    }
12707                    _ => Err(fidl::Error::UnknownOrdinal {
12708                        ordinal: header.ordinal,
12709                        protocol_name:
12710                            <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12711                    }),
12712                }))
12713            },
12714        )
12715    }
12716}
12717
12718#[derive(Debug)]
12719pub enum LinkableRequest {
12720    /// Creates a link to this this object with name `dst` in the directory represented by
12721    /// `dst_parent_token`.
12722    ///
12723    /// `dst` must be a resolved object name. Including "/" in the string will return
12724    /// `ZX_ERR_INVALID_ARGS`.
12725    ///
12726    /// This method requires the maximal set of rights supported by the filesystem for this object.
12727    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
12728    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
12729    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
12730    /// `ZX_ERR_ACCESS_DENIED`.
12731    ///
12732    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
12733    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
12734    ///
12735    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
12736    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
12737    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
12738    ///
12739    /// This method does not have the same atomicity properties has the `Directory::Link` method,
12740    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
12741    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
12742    LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
12743}
12744
12745impl LinkableRequest {
12746    #[allow(irrefutable_let_patterns)]
12747    pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
12748        if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
12749            Some((dst_parent_token, dst, responder))
12750        } else {
12751            None
12752        }
12753    }
12754
12755    /// Name of the method defined in FIDL
12756    pub fn method_name(&self) -> &'static str {
12757        match *self {
12758            LinkableRequest::LinkInto { .. } => "link_into",
12759        }
12760    }
12761}
12762
12763#[derive(Debug, Clone)]
12764pub struct LinkableControlHandle {
12765    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12766}
12767
12768impl fidl::endpoints::ControlHandle for LinkableControlHandle {
12769    fn shutdown(&self) {
12770        self.inner.shutdown()
12771    }
12772
12773    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12774        self.inner.shutdown_with_epitaph(status)
12775    }
12776
12777    fn is_closed(&self) -> bool {
12778        self.inner.channel().is_closed()
12779    }
12780    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12781        self.inner.channel().on_closed()
12782    }
12783
12784    #[cfg(target_os = "fuchsia")]
12785    fn signal_peer(
12786        &self,
12787        clear_mask: zx::Signals,
12788        set_mask: zx::Signals,
12789    ) -> Result<(), zx_status::Status> {
12790        use fidl::Peered;
12791        self.inner.channel().signal_peer(clear_mask, set_mask)
12792    }
12793}
12794
12795impl LinkableControlHandle {}
12796
12797#[must_use = "FIDL methods require a response to be sent"]
12798#[derive(Debug)]
12799pub struct LinkableLinkIntoResponder {
12800    control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
12801    tx_id: u32,
12802}
12803
12804/// Set the the channel to be shutdown (see [`LinkableControlHandle::shutdown`])
12805/// if the responder is dropped without sending a response, so that the client
12806/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12807impl std::ops::Drop for LinkableLinkIntoResponder {
12808    fn drop(&mut self) {
12809        self.control_handle.shutdown();
12810        // Safety: drops once, never accessed again
12811        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12812    }
12813}
12814
12815impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
12816    type ControlHandle = LinkableControlHandle;
12817
12818    fn control_handle(&self) -> &LinkableControlHandle {
12819        &self.control_handle
12820    }
12821
12822    fn drop_without_shutdown(mut self) {
12823        // Safety: drops once, never accessed again due to mem::forget
12824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12825        // Prevent Drop from running (which would shut down the channel)
12826        std::mem::forget(self);
12827    }
12828}
12829
12830impl LinkableLinkIntoResponder {
12831    /// Sends a response to the FIDL transaction.
12832    ///
12833    /// Sets the channel to shutdown if an error occurs.
12834    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12835        let _result = self.send_raw(result);
12836        if _result.is_err() {
12837            self.control_handle.shutdown();
12838        }
12839        self.drop_without_shutdown();
12840        _result
12841    }
12842
12843    /// Similar to "send" but does not shutdown the channel if an error occurs.
12844    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12845        let _result = self.send_raw(result);
12846        self.drop_without_shutdown();
12847        _result
12848    }
12849
12850    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
12851        self.control_handle
12852            .inner
12853            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
12854                result,
12855                self.tx_id,
12856                0x54f3949246a03e74,
12857                fidl::encoding::DynamicFlags::empty(),
12858            )
12859    }
12860}
12861
12862#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12863pub struct NodeMarker;
12864
12865impl fidl::endpoints::ProtocolMarker for NodeMarker {
12866    type Proxy = NodeProxy;
12867    type RequestStream = NodeRequestStream;
12868    #[cfg(target_os = "fuchsia")]
12869    type SynchronousProxy = NodeSynchronousProxy;
12870
12871    const DEBUG_NAME: &'static str = "fuchsia.io.Node";
12872}
12873impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
12874pub type NodeGetFlagsResult = Result<Flags, i32>;
12875pub type NodeSetFlagsResult = Result<(), i32>;
12876pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
12877pub type NodeUpdateAttributesResult = Result<(), i32>;
12878pub type NodeSyncResult = Result<(), i32>;
12879pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
12880pub type NodeSetExtendedAttributeResult = Result<(), i32>;
12881pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
12882
12883pub trait NodeProxyInterface: Send + Sync {
12884    fn r#clone(
12885        &self,
12886        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12887    ) -> Result<(), fidl::Error>;
12888    type CloseResponseFut: std::future::Future<
12889            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
12890        > + Send;
12891    fn r#close(&self) -> Self::CloseResponseFut;
12892    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
12893    fn r#query(&self) -> Self::QueryResponseFut;
12894    fn r#deprecated_clone(
12895        &self,
12896        flags: OpenFlags,
12897        object: fidl::endpoints::ServerEnd<NodeMarker>,
12898    ) -> Result<(), fidl::Error>;
12899    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
12900        + Send;
12901    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
12902    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
12903    fn r#deprecated_set_attr(
12904        &self,
12905        flags: NodeAttributeFlags,
12906        attributes: &NodeAttributes,
12907    ) -> Self::DeprecatedSetAttrResponseFut;
12908    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
12909        + Send;
12910    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
12911    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
12912        + Send;
12913    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
12914    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
12915        + Send;
12916    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
12917    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
12918        + Send;
12919    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
12920    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
12921        + Send;
12922    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
12923    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
12924        + Send;
12925    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
12926    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
12927        + Send;
12928    fn r#update_attributes(
12929        &self,
12930        payload: &MutableNodeAttributes,
12931    ) -> Self::UpdateAttributesResponseFut;
12932    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
12933    fn r#sync(&self) -> Self::SyncResponseFut;
12934    fn r#list_extended_attributes(
12935        &self,
12936        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
12937    ) -> Result<(), fidl::Error>;
12938    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
12939        + Send;
12940    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
12941    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
12942        + Send;
12943    fn r#set_extended_attribute(
12944        &self,
12945        name: &[u8],
12946        value: ExtendedAttributeValue,
12947        mode: SetExtendedAttributeMode,
12948    ) -> Self::SetExtendedAttributeResponseFut;
12949    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
12950        + Send;
12951    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
12952}
12953#[derive(Debug)]
12954#[cfg(target_os = "fuchsia")]
12955pub struct NodeSynchronousProxy {
12956    client: fidl::client::sync::Client,
12957}
12958
12959#[cfg(target_os = "fuchsia")]
12960impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
12961    type Proxy = NodeProxy;
12962    type Protocol = NodeMarker;
12963
12964    fn from_channel(inner: fidl::Channel) -> Self {
12965        Self::new(inner)
12966    }
12967
12968    fn into_channel(self) -> fidl::Channel {
12969        self.client.into_channel()
12970    }
12971
12972    fn as_channel(&self) -> &fidl::Channel {
12973        self.client.as_channel()
12974    }
12975}
12976
12977#[cfg(target_os = "fuchsia")]
12978impl NodeSynchronousProxy {
12979    pub fn new(channel: fidl::Channel) -> Self {
12980        Self { client: fidl::client::sync::Client::new(channel) }
12981    }
12982
12983    pub fn into_channel(self) -> fidl::Channel {
12984        self.client.into_channel()
12985    }
12986
12987    /// Waits until an event arrives and returns it. It is safe for other
12988    /// threads to make concurrent requests while waiting for an event.
12989    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
12990        NodeEvent::decode(self.client.wait_for_event::<NodeMarker>(deadline)?)
12991    }
12992
12993    pub fn r#clone(
12994        &self,
12995        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12996    ) -> Result<(), fidl::Error> {
12997        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12998            (request,),
12999            0x20d8a7aba2168a79,
13000            fidl::encoding::DynamicFlags::empty(),
13001        )
13002    }
13003
13004    /// Terminates the connection.
13005    ///
13006    /// After calling `Close`, the client must not send any other requests.
13007    ///
13008    /// Servers, after sending the status response, should close the connection
13009    /// regardless of status and without sending an epitaph.
13010    ///
13011    /// Closing the client end of the channel should be semantically equivalent
13012    /// to calling `Close` without knowing when the close has completed or its
13013    /// status.
13014    pub fn r#close(
13015        &self,
13016        ___deadline: zx::MonotonicInstant,
13017    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13018        let _response = self.client.send_query::<
13019            fidl::encoding::EmptyPayload,
13020            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13021            NodeMarker,
13022        >(
13023            (),
13024            0x5ac5d459ad7f657e,
13025            fidl::encoding::DynamicFlags::empty(),
13026            ___deadline,
13027        )?;
13028        Ok(_response.map(|x| x))
13029    }
13030
13031    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
13032        let _response = self.client.send_query::<
13033            fidl::encoding::EmptyPayload,
13034            fidl_fuchsia_unknown::QueryableQueryResponse,
13035            NodeMarker,
13036        >(
13037            (),
13038            0x2658edee9decfc06,
13039            fidl::encoding::DynamicFlags::empty(),
13040            ___deadline,
13041        )?;
13042        Ok(_response.protocol)
13043    }
13044
13045    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13046    pub fn r#deprecated_clone(
13047        &self,
13048        mut flags: OpenFlags,
13049        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13050    ) -> Result<(), fidl::Error> {
13051        self.client.send::<NodeDeprecatedCloneRequest>(
13052            (flags, object),
13053            0x5a61678f293ce16f,
13054            fidl::encoding::DynamicFlags::FLEXIBLE,
13055        )
13056    }
13057
13058    /// DEPRECATED - Use `Node.GetAttributes` instead.
13059    pub fn r#deprecated_get_attr(
13060        &self,
13061        ___deadline: zx::MonotonicInstant,
13062    ) -> Result<(i32, NodeAttributes), fidl::Error> {
13063        let _response = self
13064            .client
13065            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetAttrResponse, NodeMarker>(
13066                (),
13067                0x78985e216314dafd,
13068                fidl::encoding::DynamicFlags::empty(),
13069                ___deadline,
13070            )?;
13071        Ok((_response.s, _response.attributes))
13072    }
13073
13074    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13075    pub fn r#deprecated_set_attr(
13076        &self,
13077        mut flags: NodeAttributeFlags,
13078        mut attributes: &NodeAttributes,
13079        ___deadline: zx::MonotonicInstant,
13080    ) -> Result<i32, fidl::Error> {
13081        let _response = self
13082            .client
13083            .send_query::<NodeDeprecatedSetAttrRequest, NodeDeprecatedSetAttrResponse, NodeMarker>(
13084                (flags, attributes),
13085                0x4186c0f40d938f46,
13086                fidl::encoding::DynamicFlags::empty(),
13087                ___deadline,
13088            )?;
13089        Ok(_response.s)
13090    }
13091
13092    /// [DEPRECATED - Use new GetFlags method instead.]
13093    pub fn r#deprecated_get_flags(
13094        &self,
13095        ___deadline: zx::MonotonicInstant,
13096    ) -> Result<(i32, OpenFlags), fidl::Error> {
13097        let _response = self
13098            .client
13099            .send_query::<fidl::encoding::EmptyPayload, NodeDeprecatedGetFlagsResponse, NodeMarker>(
13100                (),
13101                0x5b88fffb8eda3aa1,
13102                fidl::encoding::DynamicFlags::empty(),
13103                ___deadline,
13104            )?;
13105        Ok((_response.s, _response.flags))
13106    }
13107
13108    /// [DEPRECATED - Use new SetFlags method instead.]
13109    pub fn r#deprecated_set_flags(
13110        &self,
13111        mut flags: OpenFlags,
13112        ___deadline: zx::MonotonicInstant,
13113    ) -> Result<i32, fidl::Error> {
13114        let _response = self.client.send_query::<
13115            NodeDeprecatedSetFlagsRequest,
13116            NodeDeprecatedSetFlagsResponse,
13117            NodeMarker,
13118        >(
13119            (flags,),
13120            0x5295b76c71fde733,
13121            fidl::encoding::DynamicFlags::empty(),
13122            ___deadline,
13123        )?;
13124        Ok(_response.s)
13125    }
13126
13127    /// Queries the flags that apply to this node after it has been opened/created. This method does
13128    /// not require any rights.
13129    ///
13130    /// Note that the final set of flags that apply to the connection may differ from those
13131    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13132    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13133    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13134    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13135    pub fn r#get_flags(
13136        &self,
13137        ___deadline: zx::MonotonicInstant,
13138    ) -> Result<NodeGetFlagsResult, fidl::Error> {
13139        let _response = self.client.send_query::<
13140            fidl::encoding::EmptyPayload,
13141            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13142            NodeMarker,
13143        >(
13144            (),
13145            0x176eb318f64ec23,
13146            fidl::encoding::DynamicFlags::FLEXIBLE,
13147            ___deadline,
13148        )?
13149        .into_result::<NodeMarker>("get_flags")?;
13150        Ok(_response.map(|x| x.flags))
13151    }
13152
13153    /// Sets the flags that apply to this node after it has been opened. This method does not
13154    /// require any rights.
13155    ///
13156    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13157    /// clear append mode.
13158    ///
13159    /// Errors:
13160    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13161    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13162    pub fn r#set_flags(
13163        &self,
13164        mut flags: Flags,
13165        ___deadline: zx::MonotonicInstant,
13166    ) -> Result<NodeSetFlagsResult, fidl::Error> {
13167        let _response = self.client.send_query::<
13168            NodeSetFlagsRequest,
13169            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13170            NodeMarker,
13171        >(
13172            (flags,),
13173            0x55a8028685791ea8,
13174            fidl::encoding::DynamicFlags::FLEXIBLE,
13175            ___deadline,
13176        )?
13177        .into_result::<NodeMarker>("set_flags")?;
13178        Ok(_response.map(|x| x))
13179    }
13180
13181    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13182    /// volume has different settings or the storage is accounted seperately from the rest of the
13183    /// filesystem that may be reported instead of filesystem-wide details.
13184    pub fn r#query_filesystem(
13185        &self,
13186        ___deadline: zx::MonotonicInstant,
13187    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13188        let _response = self
13189            .client
13190            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, NodeMarker>(
13191                (),
13192                0x6f344a1c6b0a0610,
13193                fidl::encoding::DynamicFlags::empty(),
13194                ___deadline,
13195            )?;
13196        Ok((_response.s, _response.info))
13197    }
13198
13199    /// Acquires information about the node.
13200    ///
13201    /// The attributes of a node should be stable, independent of the
13202    /// specific protocol used to access it.
13203    ///
13204    /// If a particular attribute is not applicable or not supported,
13205    /// filesystems should leave the corresponding field absent.
13206    ///
13207    /// + `query` a bit-mask specifying which attributes to fetch. The server
13208    ///   should not return more than necessary.
13209    /// - `attributes` the returned attributes.
13210    ///
13211    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13212    pub fn r#get_attributes(
13213        &self,
13214        mut query: NodeAttributesQuery,
13215        ___deadline: zx::MonotonicInstant,
13216    ) -> Result<NodeGetAttributesResult, fidl::Error> {
13217        let _response = self.client.send_query::<
13218            NodeGetAttributesRequest,
13219            fidl::encoding::ResultType<NodeAttributes2, i32>,
13220            NodeMarker,
13221        >(
13222            (query,),
13223            0x3d4396a638ea053b,
13224            fidl::encoding::DynamicFlags::empty(),
13225            ___deadline,
13226        )?;
13227        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13228    }
13229
13230    /// Updates information about the node.
13231    ///
13232    /// + `attributes` the presence of a table field in `attributes` indicates
13233    /// the intent to update the corresponding attribute.
13234    ///
13235    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13236    ///
13237    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13238    pub fn r#update_attributes(
13239        &self,
13240        mut payload: &MutableNodeAttributes,
13241        ___deadline: zx::MonotonicInstant,
13242    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13243        let _response = self.client.send_query::<
13244            MutableNodeAttributes,
13245            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13246            NodeMarker,
13247        >(
13248            payload,
13249            0x3308c1da5a89bf08,
13250            fidl::encoding::DynamicFlags::empty(),
13251            ___deadline,
13252        )?;
13253        Ok(_response.map(|x| x))
13254    }
13255
13256    /// Synchronizes updates to the node to the underlying media, if it exists.
13257    ///
13258    /// This method will return when the filesystem server has flushed the
13259    /// relevant updates to the underlying media, but does not guarantee the
13260    /// underlying media has persisted the information, nor that any information
13261    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13262    /// between operations.
13263    ///
13264    /// This method does not require any rights.
13265    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
13266        let _response = self.client.send_query::<
13267            fidl::encoding::EmptyPayload,
13268            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13269            NodeMarker,
13270        >(
13271            (),
13272            0x2c5c27ca0ab5dc49,
13273            fidl::encoding::DynamicFlags::empty(),
13274            ___deadline,
13275        )?;
13276        Ok(_response.map(|x| x))
13277    }
13278
13279    /// Creates an iterator over all the extended attribute names associated
13280    /// with this node. If an error occurs it is returned as an epitaph on the
13281    /// iterator request channel, and then the channel is closed.
13282    ///
13283    /// GetExtendedAttributes can be used with any of these names to retrieve
13284    /// the associated value.
13285    ///
13286    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13287    pub fn r#list_extended_attributes(
13288        &self,
13289        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13290    ) -> Result<(), fidl::Error> {
13291        self.client.send::<NodeListExtendedAttributesRequest>(
13292            (iterator,),
13293            0x4b61033de007fcd0,
13294            fidl::encoding::DynamicFlags::empty(),
13295        )
13296    }
13297
13298    /// Get the value associated with the given attribute `name` for this node.
13299    ///
13300    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13301    /// particular structure is imposed on them.
13302    ///
13303    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13304    pub fn r#get_extended_attribute(
13305        &self,
13306        mut name: &[u8],
13307        ___deadline: zx::MonotonicInstant,
13308    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
13309        let _response = self.client.send_query::<
13310            NodeGetExtendedAttributeRequest,
13311            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
13312            NodeMarker,
13313        >(
13314            (name,),
13315            0x45ffa3ccfdeb76db,
13316            fidl::encoding::DynamicFlags::empty(),
13317            ___deadline,
13318        )?;
13319        Ok(_response.map(|x| x))
13320    }
13321
13322    /// Set the value for the given attribute `name` to `value` for this node.
13323    ///
13324    /// The attribute name may exist, in which case the attribute is updated.
13325    /// If the attribute doesn't exist, it is created. The name should have no
13326    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13327    ///
13328    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13329    pub fn r#set_extended_attribute(
13330        &self,
13331        mut name: &[u8],
13332        mut value: ExtendedAttributeValue,
13333        mut mode: SetExtendedAttributeMode,
13334        ___deadline: zx::MonotonicInstant,
13335    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
13336        let _response = self.client.send_query::<
13337            NodeSetExtendedAttributeRequest,
13338            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13339            NodeMarker,
13340        >(
13341            (name, &mut value, mode,),
13342            0x4a951362f681f23c,
13343            fidl::encoding::DynamicFlags::empty(),
13344            ___deadline,
13345        )?;
13346        Ok(_response.map(|x| x))
13347    }
13348
13349    /// Remove the specified extended attribute.
13350    ///
13351    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13352    ///
13353    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13354    pub fn r#remove_extended_attribute(
13355        &self,
13356        mut name: &[u8],
13357        ___deadline: zx::MonotonicInstant,
13358    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
13359        let _response = self.client.send_query::<
13360            NodeRemoveExtendedAttributeRequest,
13361            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13362            NodeMarker,
13363        >(
13364            (name,),
13365            0x7a0b9f3a9bf9032d,
13366            fidl::encoding::DynamicFlags::empty(),
13367            ___deadline,
13368        )?;
13369        Ok(_response.map(|x| x))
13370    }
13371}
13372
13373#[cfg(target_os = "fuchsia")]
13374impl From<NodeSynchronousProxy> for zx::NullableHandle {
13375    fn from(value: NodeSynchronousProxy) -> Self {
13376        value.into_channel().into()
13377    }
13378}
13379
13380#[cfg(target_os = "fuchsia")]
13381impl From<fidl::Channel> for NodeSynchronousProxy {
13382    fn from(value: fidl::Channel) -> Self {
13383        Self::new(value)
13384    }
13385}
13386
13387#[cfg(target_os = "fuchsia")]
13388impl fidl::endpoints::FromClient for NodeSynchronousProxy {
13389    type Protocol = NodeMarker;
13390
13391    fn from_client(value: fidl::endpoints::ClientEnd<NodeMarker>) -> Self {
13392        Self::new(value.into_channel())
13393    }
13394}
13395
13396#[derive(Debug, Clone)]
13397pub struct NodeProxy {
13398    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13399}
13400
13401impl fidl::endpoints::Proxy for NodeProxy {
13402    type Protocol = NodeMarker;
13403
13404    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13405        Self::new(inner)
13406    }
13407
13408    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13409        self.client.into_channel().map_err(|client| Self { client })
13410    }
13411
13412    fn as_channel(&self) -> &::fidl::AsyncChannel {
13413        self.client.as_channel()
13414    }
13415}
13416
13417impl NodeProxy {
13418    /// Create a new Proxy for fuchsia.io/Node.
13419    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13420        let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13421        Self { client: fidl::client::Client::new(channel, protocol_name) }
13422    }
13423
13424    /// Get a Stream of events from the remote end of the protocol.
13425    ///
13426    /// # Panics
13427    ///
13428    /// Panics if the event stream was already taken.
13429    pub fn take_event_stream(&self) -> NodeEventStream {
13430        NodeEventStream { event_receiver: self.client.take_event_receiver() }
13431    }
13432
13433    pub fn r#clone(
13434        &self,
13435        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13436    ) -> Result<(), fidl::Error> {
13437        NodeProxyInterface::r#clone(self, request)
13438    }
13439
13440    /// Terminates the connection.
13441    ///
13442    /// After calling `Close`, the client must not send any other requests.
13443    ///
13444    /// Servers, after sending the status response, should close the connection
13445    /// regardless of status and without sending an epitaph.
13446    ///
13447    /// Closing the client end of the channel should be semantically equivalent
13448    /// to calling `Close` without knowing when the close has completed or its
13449    /// status.
13450    pub fn r#close(
13451        &self,
13452    ) -> fidl::client::QueryResponseFut<
13453        fidl_fuchsia_unknown::CloseableCloseResult,
13454        fidl::encoding::DefaultFuchsiaResourceDialect,
13455    > {
13456        NodeProxyInterface::r#close(self)
13457    }
13458
13459    pub fn r#query(
13460        &self,
13461    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
13462    {
13463        NodeProxyInterface::r#query(self)
13464    }
13465
13466    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
13467    pub fn r#deprecated_clone(
13468        &self,
13469        mut flags: OpenFlags,
13470        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13471    ) -> Result<(), fidl::Error> {
13472        NodeProxyInterface::r#deprecated_clone(self, flags, object)
13473    }
13474
13475    /// DEPRECATED - Use `Node.GetAttributes` instead.
13476    pub fn r#deprecated_get_attr(
13477        &self,
13478    ) -> fidl::client::QueryResponseFut<
13479        (i32, NodeAttributes),
13480        fidl::encoding::DefaultFuchsiaResourceDialect,
13481    > {
13482        NodeProxyInterface::r#deprecated_get_attr(self)
13483    }
13484
13485    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
13486    pub fn r#deprecated_set_attr(
13487        &self,
13488        mut flags: NodeAttributeFlags,
13489        mut attributes: &NodeAttributes,
13490    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13491        NodeProxyInterface::r#deprecated_set_attr(self, flags, attributes)
13492    }
13493
13494    /// [DEPRECATED - Use new GetFlags method instead.]
13495    pub fn r#deprecated_get_flags(
13496        &self,
13497    ) -> fidl::client::QueryResponseFut<
13498        (i32, OpenFlags),
13499        fidl::encoding::DefaultFuchsiaResourceDialect,
13500    > {
13501        NodeProxyInterface::r#deprecated_get_flags(self)
13502    }
13503
13504    /// [DEPRECATED - Use new SetFlags method instead.]
13505    pub fn r#deprecated_set_flags(
13506        &self,
13507        mut flags: OpenFlags,
13508    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
13509        NodeProxyInterface::r#deprecated_set_flags(self, flags)
13510    }
13511
13512    /// Queries the flags that apply to this node after it has been opened/created. This method does
13513    /// not require any rights.
13514    ///
13515    /// Note that the final set of flags that apply to the connection may differ from those
13516    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
13517    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
13518    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
13519    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
13520    pub fn r#get_flags(
13521        &self,
13522    ) -> fidl::client::QueryResponseFut<
13523        NodeGetFlagsResult,
13524        fidl::encoding::DefaultFuchsiaResourceDialect,
13525    > {
13526        NodeProxyInterface::r#get_flags(self)
13527    }
13528
13529    /// Sets the flags that apply to this node after it has been opened. This method does not
13530    /// require any rights.
13531    ///
13532    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
13533    /// clear append mode.
13534    ///
13535    /// Errors:
13536    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
13537    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
13538    pub fn r#set_flags(
13539        &self,
13540        mut flags: Flags,
13541    ) -> fidl::client::QueryResponseFut<
13542        NodeSetFlagsResult,
13543        fidl::encoding::DefaultFuchsiaResourceDialect,
13544    > {
13545        NodeProxyInterface::r#set_flags(self, flags)
13546    }
13547
13548    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
13549    /// volume has different settings or the storage is accounted seperately from the rest of the
13550    /// filesystem that may be reported instead of filesystem-wide details.
13551    pub fn r#query_filesystem(
13552        &self,
13553    ) -> fidl::client::QueryResponseFut<
13554        (i32, Option<Box<FilesystemInfo>>),
13555        fidl::encoding::DefaultFuchsiaResourceDialect,
13556    > {
13557        NodeProxyInterface::r#query_filesystem(self)
13558    }
13559
13560    /// Acquires information about the node.
13561    ///
13562    /// The attributes of a node should be stable, independent of the
13563    /// specific protocol used to access it.
13564    ///
13565    /// If a particular attribute is not applicable or not supported,
13566    /// filesystems should leave the corresponding field absent.
13567    ///
13568    /// + `query` a bit-mask specifying which attributes to fetch. The server
13569    ///   should not return more than necessary.
13570    /// - `attributes` the returned attributes.
13571    ///
13572    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13573    pub fn r#get_attributes(
13574        &self,
13575        mut query: NodeAttributesQuery,
13576    ) -> fidl::client::QueryResponseFut<
13577        NodeGetAttributesResult,
13578        fidl::encoding::DefaultFuchsiaResourceDialect,
13579    > {
13580        NodeProxyInterface::r#get_attributes(self, query)
13581    }
13582
13583    /// Updates information about the node.
13584    ///
13585    /// + `attributes` the presence of a table field in `attributes` indicates
13586    /// the intent to update the corresponding attribute.
13587    ///
13588    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
13589    ///
13590    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13591    pub fn r#update_attributes(
13592        &self,
13593        mut payload: &MutableNodeAttributes,
13594    ) -> fidl::client::QueryResponseFut<
13595        NodeUpdateAttributesResult,
13596        fidl::encoding::DefaultFuchsiaResourceDialect,
13597    > {
13598        NodeProxyInterface::r#update_attributes(self, payload)
13599    }
13600
13601    /// Synchronizes updates to the node to the underlying media, if it exists.
13602    ///
13603    /// This method will return when the filesystem server has flushed the
13604    /// relevant updates to the underlying media, but does not guarantee the
13605    /// underlying media has persisted the information, nor that any information
13606    /// is committed to hardware. Clients may use `Sync` to ensure ordering
13607    /// between operations.
13608    ///
13609    /// This method does not require any rights.
13610    pub fn r#sync(
13611        &self,
13612    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
13613    {
13614        NodeProxyInterface::r#sync(self)
13615    }
13616
13617    /// Creates an iterator over all the extended attribute names associated
13618    /// with this node. If an error occurs it is returned as an epitaph on the
13619    /// iterator request channel, and then the channel is closed.
13620    ///
13621    /// GetExtendedAttributes can be used with any of these names to retrieve
13622    /// the associated value.
13623    ///
13624    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13625    pub fn r#list_extended_attributes(
13626        &self,
13627        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13628    ) -> Result<(), fidl::Error> {
13629        NodeProxyInterface::r#list_extended_attributes(self, iterator)
13630    }
13631
13632    /// Get the value associated with the given attribute `name` for this node.
13633    ///
13634    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
13635    /// particular structure is imposed on them.
13636    ///
13637    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
13638    pub fn r#get_extended_attribute(
13639        &self,
13640        mut name: &[u8],
13641    ) -> fidl::client::QueryResponseFut<
13642        NodeGetExtendedAttributeResult,
13643        fidl::encoding::DefaultFuchsiaResourceDialect,
13644    > {
13645        NodeProxyInterface::r#get_extended_attribute(self, name)
13646    }
13647
13648    /// Set the value for the given attribute `name` to `value` for this node.
13649    ///
13650    /// The attribute name may exist, in which case the attribute is updated.
13651    /// If the attribute doesn't exist, it is created. The name should have no
13652    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
13653    ///
13654    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13655    pub fn r#set_extended_attribute(
13656        &self,
13657        mut name: &[u8],
13658        mut value: ExtendedAttributeValue,
13659        mut mode: SetExtendedAttributeMode,
13660    ) -> fidl::client::QueryResponseFut<
13661        NodeSetExtendedAttributeResult,
13662        fidl::encoding::DefaultFuchsiaResourceDialect,
13663    > {
13664        NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
13665    }
13666
13667    /// Remove the specified extended attribute.
13668    ///
13669    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
13670    ///
13671    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
13672    pub fn r#remove_extended_attribute(
13673        &self,
13674        mut name: &[u8],
13675    ) -> fidl::client::QueryResponseFut<
13676        NodeRemoveExtendedAttributeResult,
13677        fidl::encoding::DefaultFuchsiaResourceDialect,
13678    > {
13679        NodeProxyInterface::r#remove_extended_attribute(self, name)
13680    }
13681}
13682
13683impl NodeProxyInterface for NodeProxy {
13684    fn r#clone(
13685        &self,
13686        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
13687    ) -> Result<(), fidl::Error> {
13688        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
13689            (request,),
13690            0x20d8a7aba2168a79,
13691            fidl::encoding::DynamicFlags::empty(),
13692        )
13693    }
13694
13695    type CloseResponseFut = fidl::client::QueryResponseFut<
13696        fidl_fuchsia_unknown::CloseableCloseResult,
13697        fidl::encoding::DefaultFuchsiaResourceDialect,
13698    >;
13699    fn r#close(&self) -> Self::CloseResponseFut {
13700        fn _decode(
13701            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13702        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
13703            let _response = fidl::client::decode_transaction_body::<
13704                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13705                fidl::encoding::DefaultFuchsiaResourceDialect,
13706                0x5ac5d459ad7f657e,
13707            >(_buf?)?;
13708            Ok(_response.map(|x| x))
13709        }
13710        self.client.send_query_and_decode::<
13711            fidl::encoding::EmptyPayload,
13712            fidl_fuchsia_unknown::CloseableCloseResult,
13713        >(
13714            (),
13715            0x5ac5d459ad7f657e,
13716            fidl::encoding::DynamicFlags::empty(),
13717            _decode,
13718        )
13719    }
13720
13721    type QueryResponseFut =
13722        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
13723    fn r#query(&self) -> Self::QueryResponseFut {
13724        fn _decode(
13725            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13726        ) -> Result<Vec<u8>, fidl::Error> {
13727            let _response = fidl::client::decode_transaction_body::<
13728                fidl_fuchsia_unknown::QueryableQueryResponse,
13729                fidl::encoding::DefaultFuchsiaResourceDialect,
13730                0x2658edee9decfc06,
13731            >(_buf?)?;
13732            Ok(_response.protocol)
13733        }
13734        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
13735            (),
13736            0x2658edee9decfc06,
13737            fidl::encoding::DynamicFlags::empty(),
13738            _decode,
13739        )
13740    }
13741
13742    fn r#deprecated_clone(
13743        &self,
13744        mut flags: OpenFlags,
13745        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
13746    ) -> Result<(), fidl::Error> {
13747        self.client.send::<NodeDeprecatedCloneRequest>(
13748            (flags, object),
13749            0x5a61678f293ce16f,
13750            fidl::encoding::DynamicFlags::FLEXIBLE,
13751        )
13752    }
13753
13754    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
13755        (i32, NodeAttributes),
13756        fidl::encoding::DefaultFuchsiaResourceDialect,
13757    >;
13758    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
13759        fn _decode(
13760            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13761        ) -> Result<(i32, NodeAttributes), fidl::Error> {
13762            let _response = fidl::client::decode_transaction_body::<
13763                NodeDeprecatedGetAttrResponse,
13764                fidl::encoding::DefaultFuchsiaResourceDialect,
13765                0x78985e216314dafd,
13766            >(_buf?)?;
13767            Ok((_response.s, _response.attributes))
13768        }
13769        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
13770            (),
13771            0x78985e216314dafd,
13772            fidl::encoding::DynamicFlags::empty(),
13773            _decode,
13774        )
13775    }
13776
13777    type DeprecatedSetAttrResponseFut =
13778        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13779    fn r#deprecated_set_attr(
13780        &self,
13781        mut flags: NodeAttributeFlags,
13782        mut attributes: &NodeAttributes,
13783    ) -> Self::DeprecatedSetAttrResponseFut {
13784        fn _decode(
13785            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13786        ) -> Result<i32, fidl::Error> {
13787            let _response = fidl::client::decode_transaction_body::<
13788                NodeDeprecatedSetAttrResponse,
13789                fidl::encoding::DefaultFuchsiaResourceDialect,
13790                0x4186c0f40d938f46,
13791            >(_buf?)?;
13792            Ok(_response.s)
13793        }
13794        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
13795            (flags, attributes),
13796            0x4186c0f40d938f46,
13797            fidl::encoding::DynamicFlags::empty(),
13798            _decode,
13799        )
13800    }
13801
13802    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
13803        (i32, OpenFlags),
13804        fidl::encoding::DefaultFuchsiaResourceDialect,
13805    >;
13806    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
13807        fn _decode(
13808            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13809        ) -> Result<(i32, OpenFlags), fidl::Error> {
13810            let _response = fidl::client::decode_transaction_body::<
13811                NodeDeprecatedGetFlagsResponse,
13812                fidl::encoding::DefaultFuchsiaResourceDialect,
13813                0x5b88fffb8eda3aa1,
13814            >(_buf?)?;
13815            Ok((_response.s, _response.flags))
13816        }
13817        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
13818            (),
13819            0x5b88fffb8eda3aa1,
13820            fidl::encoding::DynamicFlags::empty(),
13821            _decode,
13822        )
13823    }
13824
13825    type DeprecatedSetFlagsResponseFut =
13826        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
13827    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
13828        fn _decode(
13829            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13830        ) -> Result<i32, fidl::Error> {
13831            let _response = fidl::client::decode_transaction_body::<
13832                NodeDeprecatedSetFlagsResponse,
13833                fidl::encoding::DefaultFuchsiaResourceDialect,
13834                0x5295b76c71fde733,
13835            >(_buf?)?;
13836            Ok(_response.s)
13837        }
13838        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
13839            (flags,),
13840            0x5295b76c71fde733,
13841            fidl::encoding::DynamicFlags::empty(),
13842            _decode,
13843        )
13844    }
13845
13846    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
13847        NodeGetFlagsResult,
13848        fidl::encoding::DefaultFuchsiaResourceDialect,
13849    >;
13850    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
13851        fn _decode(
13852            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13853        ) -> Result<NodeGetFlagsResult, fidl::Error> {
13854            let _response = fidl::client::decode_transaction_body::<
13855                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
13856                fidl::encoding::DefaultFuchsiaResourceDialect,
13857                0x176eb318f64ec23,
13858            >(_buf?)?
13859            .into_result::<NodeMarker>("get_flags")?;
13860            Ok(_response.map(|x| x.flags))
13861        }
13862        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
13863            (),
13864            0x176eb318f64ec23,
13865            fidl::encoding::DynamicFlags::FLEXIBLE,
13866            _decode,
13867        )
13868    }
13869
13870    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
13871        NodeSetFlagsResult,
13872        fidl::encoding::DefaultFuchsiaResourceDialect,
13873    >;
13874    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
13875        fn _decode(
13876            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13877        ) -> Result<NodeSetFlagsResult, fidl::Error> {
13878            let _response = fidl::client::decode_transaction_body::<
13879                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
13880                fidl::encoding::DefaultFuchsiaResourceDialect,
13881                0x55a8028685791ea8,
13882            >(_buf?)?
13883            .into_result::<NodeMarker>("set_flags")?;
13884            Ok(_response.map(|x| x))
13885        }
13886        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
13887            (flags,),
13888            0x55a8028685791ea8,
13889            fidl::encoding::DynamicFlags::FLEXIBLE,
13890            _decode,
13891        )
13892    }
13893
13894    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
13895        (i32, Option<Box<FilesystemInfo>>),
13896        fidl::encoding::DefaultFuchsiaResourceDialect,
13897    >;
13898    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
13899        fn _decode(
13900            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13901        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
13902            let _response = fidl::client::decode_transaction_body::<
13903                NodeQueryFilesystemResponse,
13904                fidl::encoding::DefaultFuchsiaResourceDialect,
13905                0x6f344a1c6b0a0610,
13906            >(_buf?)?;
13907            Ok((_response.s, _response.info))
13908        }
13909        self.client.send_query_and_decode::<
13910            fidl::encoding::EmptyPayload,
13911            (i32, Option<Box<FilesystemInfo>>),
13912        >(
13913            (),
13914            0x6f344a1c6b0a0610,
13915            fidl::encoding::DynamicFlags::empty(),
13916            _decode,
13917        )
13918    }
13919
13920    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
13921        NodeGetAttributesResult,
13922        fidl::encoding::DefaultFuchsiaResourceDialect,
13923    >;
13924    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
13925        fn _decode(
13926            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13927        ) -> Result<NodeGetAttributesResult, fidl::Error> {
13928            let _response = fidl::client::decode_transaction_body::<
13929                fidl::encoding::ResultType<NodeAttributes2, i32>,
13930                fidl::encoding::DefaultFuchsiaResourceDialect,
13931                0x3d4396a638ea053b,
13932            >(_buf?)?;
13933            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
13934        }
13935        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
13936            (query,),
13937            0x3d4396a638ea053b,
13938            fidl::encoding::DynamicFlags::empty(),
13939            _decode,
13940        )
13941    }
13942
13943    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
13944        NodeUpdateAttributesResult,
13945        fidl::encoding::DefaultFuchsiaResourceDialect,
13946    >;
13947    fn r#update_attributes(
13948        &self,
13949        mut payload: &MutableNodeAttributes,
13950    ) -> Self::UpdateAttributesResponseFut {
13951        fn _decode(
13952            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13953        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
13954            let _response = fidl::client::decode_transaction_body::<
13955                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13956                fidl::encoding::DefaultFuchsiaResourceDialect,
13957                0x3308c1da5a89bf08,
13958            >(_buf?)?;
13959            Ok(_response.map(|x| x))
13960        }
13961        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
13962            payload,
13963            0x3308c1da5a89bf08,
13964            fidl::encoding::DynamicFlags::empty(),
13965            _decode,
13966        )
13967    }
13968
13969    type SyncResponseFut = fidl::client::QueryResponseFut<
13970        NodeSyncResult,
13971        fidl::encoding::DefaultFuchsiaResourceDialect,
13972    >;
13973    fn r#sync(&self) -> Self::SyncResponseFut {
13974        fn _decode(
13975            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
13976        ) -> Result<NodeSyncResult, fidl::Error> {
13977            let _response = fidl::client::decode_transaction_body::<
13978                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
13979                fidl::encoding::DefaultFuchsiaResourceDialect,
13980                0x2c5c27ca0ab5dc49,
13981            >(_buf?)?;
13982            Ok(_response.map(|x| x))
13983        }
13984        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
13985            (),
13986            0x2c5c27ca0ab5dc49,
13987            fidl::encoding::DynamicFlags::empty(),
13988            _decode,
13989        )
13990    }
13991
13992    fn r#list_extended_attributes(
13993        &self,
13994        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
13995    ) -> Result<(), fidl::Error> {
13996        self.client.send::<NodeListExtendedAttributesRequest>(
13997            (iterator,),
13998            0x4b61033de007fcd0,
13999            fidl::encoding::DynamicFlags::empty(),
14000        )
14001    }
14002
14003    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14004        NodeGetExtendedAttributeResult,
14005        fidl::encoding::DefaultFuchsiaResourceDialect,
14006    >;
14007    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
14008        fn _decode(
14009            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14010        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
14011            let _response = fidl::client::decode_transaction_body::<
14012                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
14013                fidl::encoding::DefaultFuchsiaResourceDialect,
14014                0x45ffa3ccfdeb76db,
14015            >(_buf?)?;
14016            Ok(_response.map(|x| x))
14017        }
14018        self.client.send_query_and_decode::<
14019            NodeGetExtendedAttributeRequest,
14020            NodeGetExtendedAttributeResult,
14021        >(
14022            (name,),
14023            0x45ffa3ccfdeb76db,
14024            fidl::encoding::DynamicFlags::empty(),
14025            _decode,
14026        )
14027    }
14028
14029    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14030        NodeSetExtendedAttributeResult,
14031        fidl::encoding::DefaultFuchsiaResourceDialect,
14032    >;
14033    fn r#set_extended_attribute(
14034        &self,
14035        mut name: &[u8],
14036        mut value: ExtendedAttributeValue,
14037        mut mode: SetExtendedAttributeMode,
14038    ) -> Self::SetExtendedAttributeResponseFut {
14039        fn _decode(
14040            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14041        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
14042            let _response = fidl::client::decode_transaction_body::<
14043                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14044                fidl::encoding::DefaultFuchsiaResourceDialect,
14045                0x4a951362f681f23c,
14046            >(_buf?)?;
14047            Ok(_response.map(|x| x))
14048        }
14049        self.client.send_query_and_decode::<
14050            NodeSetExtendedAttributeRequest,
14051            NodeSetExtendedAttributeResult,
14052        >(
14053            (name, &mut value, mode,),
14054            0x4a951362f681f23c,
14055            fidl::encoding::DynamicFlags::empty(),
14056            _decode,
14057        )
14058    }
14059
14060    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
14061        NodeRemoveExtendedAttributeResult,
14062        fidl::encoding::DefaultFuchsiaResourceDialect,
14063    >;
14064    fn r#remove_extended_attribute(
14065        &self,
14066        mut name: &[u8],
14067    ) -> Self::RemoveExtendedAttributeResponseFut {
14068        fn _decode(
14069            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
14070        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
14071            let _response = fidl::client::decode_transaction_body::<
14072                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
14073                fidl::encoding::DefaultFuchsiaResourceDialect,
14074                0x7a0b9f3a9bf9032d,
14075            >(_buf?)?;
14076            Ok(_response.map(|x| x))
14077        }
14078        self.client.send_query_and_decode::<
14079            NodeRemoveExtendedAttributeRequest,
14080            NodeRemoveExtendedAttributeResult,
14081        >(
14082            (name,),
14083            0x7a0b9f3a9bf9032d,
14084            fidl::encoding::DynamicFlags::empty(),
14085            _decode,
14086        )
14087    }
14088}
14089
14090pub struct NodeEventStream {
14091    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
14092}
14093
14094impl std::marker::Unpin for NodeEventStream {}
14095
14096impl futures::stream::FusedStream for NodeEventStream {
14097    fn is_terminated(&self) -> bool {
14098        self.event_receiver.is_terminated()
14099    }
14100}
14101
14102impl futures::Stream for NodeEventStream {
14103    type Item = Result<NodeEvent, fidl::Error>;
14104
14105    fn poll_next(
14106        mut self: std::pin::Pin<&mut Self>,
14107        cx: &mut std::task::Context<'_>,
14108    ) -> std::task::Poll<Option<Self::Item>> {
14109        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
14110            &mut self.event_receiver,
14111            cx
14112        )?) {
14113            Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
14114            None => std::task::Poll::Ready(None),
14115        }
14116    }
14117}
14118
14119#[derive(Debug)]
14120pub enum NodeEvent {
14121    OnOpen_ {
14122        s: i32,
14123        info: Option<Box<NodeInfoDeprecated>>,
14124    },
14125    OnRepresentation {
14126        payload: Representation,
14127    },
14128    #[non_exhaustive]
14129    _UnknownEvent {
14130        /// Ordinal of the event that was sent.
14131        ordinal: u64,
14132    },
14133}
14134
14135impl NodeEvent {
14136    #[allow(irrefutable_let_patterns)]
14137    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
14138        if let NodeEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
14139    }
14140    #[allow(irrefutable_let_patterns)]
14141    pub fn into_on_representation(self) -> Option<Representation> {
14142        if let NodeEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
14143    }
14144
14145    /// Decodes a message buffer as a [`NodeEvent`].
14146    fn decode(
14147        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
14148    ) -> Result<NodeEvent, fidl::Error> {
14149        let (bytes, _handles) = buf.split_mut();
14150        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14151        debug_assert_eq!(tx_header.tx_id, 0);
14152        match tx_header.ordinal {
14153            0x7fc7bbb1dbfd1972 => {
14154                let mut out = fidl::new_empty!(
14155                    NodeOnOpenRequest,
14156                    fidl::encoding::DefaultFuchsiaResourceDialect
14157                );
14158                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
14159                Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
14160            }
14161            0x5cb40567d80a510c => {
14162                let mut out =
14163                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
14164                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
14165                Ok((NodeEvent::OnRepresentation { payload: out }))
14166            }
14167            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
14168                Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
14169            }
14170            _ => Err(fidl::Error::UnknownOrdinal {
14171                ordinal: tx_header.ordinal,
14172                protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14173            }),
14174        }
14175    }
14176}
14177
14178/// A Stream of incoming requests for fuchsia.io/Node.
14179pub struct NodeRequestStream {
14180    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14181    is_terminated: bool,
14182}
14183
14184impl std::marker::Unpin for NodeRequestStream {}
14185
14186impl futures::stream::FusedStream for NodeRequestStream {
14187    fn is_terminated(&self) -> bool {
14188        self.is_terminated
14189    }
14190}
14191
14192impl fidl::endpoints::RequestStream for NodeRequestStream {
14193    type Protocol = NodeMarker;
14194    type ControlHandle = NodeControlHandle;
14195
14196    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
14197        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
14198    }
14199
14200    fn control_handle(&self) -> Self::ControlHandle {
14201        NodeControlHandle { inner: self.inner.clone() }
14202    }
14203
14204    fn into_inner(
14205        self,
14206    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
14207    {
14208        (self.inner, self.is_terminated)
14209    }
14210
14211    fn from_inner(
14212        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14213        is_terminated: bool,
14214    ) -> Self {
14215        Self { inner, is_terminated }
14216    }
14217}
14218
14219impl futures::Stream for NodeRequestStream {
14220    type Item = Result<NodeRequest, fidl::Error>;
14221
14222    fn poll_next(
14223        mut self: std::pin::Pin<&mut Self>,
14224        cx: &mut std::task::Context<'_>,
14225    ) -> std::task::Poll<Option<Self::Item>> {
14226        let this = &mut *self;
14227        if this.inner.check_shutdown(cx) {
14228            this.is_terminated = true;
14229            return std::task::Poll::Ready(None);
14230        }
14231        if this.is_terminated {
14232            panic!("polled NodeRequestStream after completion");
14233        }
14234        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
14235            |bytes, handles| {
14236                match this.inner.channel().read_etc(cx, bytes, handles) {
14237                    std::task::Poll::Ready(Ok(())) => {}
14238                    std::task::Poll::Pending => return std::task::Poll::Pending,
14239                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
14240                        this.is_terminated = true;
14241                        return std::task::Poll::Ready(None);
14242                    }
14243                    std::task::Poll::Ready(Err(e)) => {
14244                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
14245                            e.into(),
14246                        ))));
14247                    }
14248                }
14249
14250                // A message has been received from the channel
14251                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
14252
14253                std::task::Poll::Ready(Some(match header.ordinal {
14254                    0x20d8a7aba2168a79 => {
14255                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14256                        let mut req = fidl::new_empty!(
14257                            fidl_fuchsia_unknown::CloneableCloneRequest,
14258                            fidl::encoding::DefaultFuchsiaResourceDialect
14259                        );
14260                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14261                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14262                        Ok(NodeRequest::Clone { request: req.request, control_handle })
14263                    }
14264                    0x5ac5d459ad7f657e => {
14265                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14266                        let mut req = fidl::new_empty!(
14267                            fidl::encoding::EmptyPayload,
14268                            fidl::encoding::DefaultFuchsiaResourceDialect
14269                        );
14270                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14271                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14272                        Ok(NodeRequest::Close {
14273                            responder: NodeCloseResponder {
14274                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14275                                tx_id: header.tx_id,
14276                            },
14277                        })
14278                    }
14279                    0x2658edee9decfc06 => {
14280                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14281                        let mut req = fidl::new_empty!(
14282                            fidl::encoding::EmptyPayload,
14283                            fidl::encoding::DefaultFuchsiaResourceDialect
14284                        );
14285                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14286                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14287                        Ok(NodeRequest::Query {
14288                            responder: NodeQueryResponder {
14289                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14290                                tx_id: header.tx_id,
14291                            },
14292                        })
14293                    }
14294                    0x5a61678f293ce16f => {
14295                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14296                        let mut req = fidl::new_empty!(
14297                            NodeDeprecatedCloneRequest,
14298                            fidl::encoding::DefaultFuchsiaResourceDialect
14299                        );
14300                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
14301                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14302                        Ok(NodeRequest::DeprecatedClone {
14303                            flags: req.flags,
14304                            object: req.object,
14305
14306                            control_handle,
14307                        })
14308                    }
14309                    0x78985e216314dafd => {
14310                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14311                        let mut req = fidl::new_empty!(
14312                            fidl::encoding::EmptyPayload,
14313                            fidl::encoding::DefaultFuchsiaResourceDialect
14314                        );
14315                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14316                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14317                        Ok(NodeRequest::DeprecatedGetAttr {
14318                            responder: NodeDeprecatedGetAttrResponder {
14319                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14320                                tx_id: header.tx_id,
14321                            },
14322                        })
14323                    }
14324                    0x4186c0f40d938f46 => {
14325                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14326                        let mut req = fidl::new_empty!(
14327                            NodeDeprecatedSetAttrRequest,
14328                            fidl::encoding::DefaultFuchsiaResourceDialect
14329                        );
14330                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
14331                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14332                        Ok(NodeRequest::DeprecatedSetAttr {
14333                            flags: req.flags,
14334                            attributes: req.attributes,
14335
14336                            responder: NodeDeprecatedSetAttrResponder {
14337                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14338                                tx_id: header.tx_id,
14339                            },
14340                        })
14341                    }
14342                    0x5b88fffb8eda3aa1 => {
14343                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14344                        let mut req = fidl::new_empty!(
14345                            fidl::encoding::EmptyPayload,
14346                            fidl::encoding::DefaultFuchsiaResourceDialect
14347                        );
14348                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14349                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14350                        Ok(NodeRequest::DeprecatedGetFlags {
14351                            responder: NodeDeprecatedGetFlagsResponder {
14352                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14353                                tx_id: header.tx_id,
14354                            },
14355                        })
14356                    }
14357                    0x5295b76c71fde733 => {
14358                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14359                        let mut req = fidl::new_empty!(
14360                            NodeDeprecatedSetFlagsRequest,
14361                            fidl::encoding::DefaultFuchsiaResourceDialect
14362                        );
14363                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14364                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14365                        Ok(NodeRequest::DeprecatedSetFlags {
14366                            flags: req.flags,
14367
14368                            responder: NodeDeprecatedSetFlagsResponder {
14369                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14370                                tx_id: header.tx_id,
14371                            },
14372                        })
14373                    }
14374                    0x176eb318f64ec23 => {
14375                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14376                        let mut req = fidl::new_empty!(
14377                            fidl::encoding::EmptyPayload,
14378                            fidl::encoding::DefaultFuchsiaResourceDialect
14379                        );
14380                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14381                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14382                        Ok(NodeRequest::GetFlags {
14383                            responder: NodeGetFlagsResponder {
14384                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14385                                tx_id: header.tx_id,
14386                            },
14387                        })
14388                    }
14389                    0x55a8028685791ea8 => {
14390                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14391                        let mut req = fidl::new_empty!(
14392                            NodeSetFlagsRequest,
14393                            fidl::encoding::DefaultFuchsiaResourceDialect
14394                        );
14395                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
14396                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14397                        Ok(NodeRequest::SetFlags {
14398                            flags: req.flags,
14399
14400                            responder: NodeSetFlagsResponder {
14401                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14402                                tx_id: header.tx_id,
14403                            },
14404                        })
14405                    }
14406                    0x6f344a1c6b0a0610 => {
14407                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14408                        let mut req = fidl::new_empty!(
14409                            fidl::encoding::EmptyPayload,
14410                            fidl::encoding::DefaultFuchsiaResourceDialect
14411                        );
14412                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14413                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14414                        Ok(NodeRequest::QueryFilesystem {
14415                            responder: NodeQueryFilesystemResponder {
14416                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14417                                tx_id: header.tx_id,
14418                            },
14419                        })
14420                    }
14421                    0x3d4396a638ea053b => {
14422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14423                        let mut req = fidl::new_empty!(
14424                            NodeGetAttributesRequest,
14425                            fidl::encoding::DefaultFuchsiaResourceDialect
14426                        );
14427                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14428                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14429                        Ok(NodeRequest::GetAttributes {
14430                            query: req.query,
14431
14432                            responder: NodeGetAttributesResponder {
14433                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14434                                tx_id: header.tx_id,
14435                            },
14436                        })
14437                    }
14438                    0x3308c1da5a89bf08 => {
14439                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14440                        let mut req = fidl::new_empty!(
14441                            MutableNodeAttributes,
14442                            fidl::encoding::DefaultFuchsiaResourceDialect
14443                        );
14444                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
14445                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14446                        Ok(NodeRequest::UpdateAttributes {
14447                            payload: req,
14448                            responder: NodeUpdateAttributesResponder {
14449                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14450                                tx_id: header.tx_id,
14451                            },
14452                        })
14453                    }
14454                    0x2c5c27ca0ab5dc49 => {
14455                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14456                        let mut req = fidl::new_empty!(
14457                            fidl::encoding::EmptyPayload,
14458                            fidl::encoding::DefaultFuchsiaResourceDialect
14459                        );
14460                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
14461                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14462                        Ok(NodeRequest::Sync {
14463                            responder: NodeSyncResponder {
14464                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14465                                tx_id: header.tx_id,
14466                            },
14467                        })
14468                    }
14469                    0x4b61033de007fcd0 => {
14470                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
14471                        let mut req = fidl::new_empty!(
14472                            NodeListExtendedAttributesRequest,
14473                            fidl::encoding::DefaultFuchsiaResourceDialect
14474                        );
14475                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
14476                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14477                        Ok(NodeRequest::ListExtendedAttributes {
14478                            iterator: req.iterator,
14479
14480                            control_handle,
14481                        })
14482                    }
14483                    0x45ffa3ccfdeb76db => {
14484                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14485                        let mut req = fidl::new_empty!(
14486                            NodeGetExtendedAttributeRequest,
14487                            fidl::encoding::DefaultFuchsiaResourceDialect
14488                        );
14489                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14490                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14491                        Ok(NodeRequest::GetExtendedAttribute {
14492                            name: req.name,
14493
14494                            responder: NodeGetExtendedAttributeResponder {
14495                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14496                                tx_id: header.tx_id,
14497                            },
14498                        })
14499                    }
14500                    0x4a951362f681f23c => {
14501                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14502                        let mut req = fidl::new_empty!(
14503                            NodeSetExtendedAttributeRequest,
14504                            fidl::encoding::DefaultFuchsiaResourceDialect
14505                        );
14506                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14507                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14508                        Ok(NodeRequest::SetExtendedAttribute {
14509                            name: req.name,
14510                            value: req.value,
14511                            mode: req.mode,
14512
14513                            responder: NodeSetExtendedAttributeResponder {
14514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14515                                tx_id: header.tx_id,
14516                            },
14517                        })
14518                    }
14519                    0x7a0b9f3a9bf9032d => {
14520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
14521                        let mut req = fidl::new_empty!(
14522                            NodeRemoveExtendedAttributeRequest,
14523                            fidl::encoding::DefaultFuchsiaResourceDialect
14524                        );
14525                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
14526                        let control_handle = NodeControlHandle { inner: this.inner.clone() };
14527                        Ok(NodeRequest::RemoveExtendedAttribute {
14528                            name: req.name,
14529
14530                            responder: NodeRemoveExtendedAttributeResponder {
14531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
14532                                tx_id: header.tx_id,
14533                            },
14534                        })
14535                    }
14536                    _ if header.tx_id == 0
14537                        && header
14538                            .dynamic_flags()
14539                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14540                    {
14541                        Ok(NodeRequest::_UnknownMethod {
14542                            ordinal: header.ordinal,
14543                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14544                            method_type: fidl::MethodType::OneWay,
14545                        })
14546                    }
14547                    _ if header
14548                        .dynamic_flags()
14549                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
14550                    {
14551                        this.inner.send_framework_err(
14552                            fidl::encoding::FrameworkErr::UnknownMethod,
14553                            header.tx_id,
14554                            header.ordinal,
14555                            header.dynamic_flags(),
14556                            (bytes, handles),
14557                        )?;
14558                        Ok(NodeRequest::_UnknownMethod {
14559                            ordinal: header.ordinal,
14560                            control_handle: NodeControlHandle { inner: this.inner.clone() },
14561                            method_type: fidl::MethodType::TwoWay,
14562                        })
14563                    }
14564                    _ => Err(fidl::Error::UnknownOrdinal {
14565                        ordinal: header.ordinal,
14566                        protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
14567                    }),
14568                }))
14569            },
14570        )
14571    }
14572}
14573
14574/// Node defines the minimal interface for entities which can be accessed in a filesystem.
14575#[derive(Debug)]
14576pub enum NodeRequest {
14577    Clone {
14578        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14579        control_handle: NodeControlHandle,
14580    },
14581    /// Terminates the connection.
14582    ///
14583    /// After calling `Close`, the client must not send any other requests.
14584    ///
14585    /// Servers, after sending the status response, should close the connection
14586    /// regardless of status and without sending an epitaph.
14587    ///
14588    /// Closing the client end of the channel should be semantically equivalent
14589    /// to calling `Close` without knowing when the close has completed or its
14590    /// status.
14591    Close {
14592        responder: NodeCloseResponder,
14593    },
14594    Query {
14595        responder: NodeQueryResponder,
14596    },
14597    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
14598    DeprecatedClone {
14599        flags: OpenFlags,
14600        object: fidl::endpoints::ServerEnd<NodeMarker>,
14601        control_handle: NodeControlHandle,
14602    },
14603    /// DEPRECATED - Use `Node.GetAttributes` instead.
14604    DeprecatedGetAttr {
14605        responder: NodeDeprecatedGetAttrResponder,
14606    },
14607    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
14608    DeprecatedSetAttr {
14609        flags: NodeAttributeFlags,
14610        attributes: NodeAttributes,
14611        responder: NodeDeprecatedSetAttrResponder,
14612    },
14613    /// [DEPRECATED - Use new GetFlags method instead.]
14614    DeprecatedGetFlags {
14615        responder: NodeDeprecatedGetFlagsResponder,
14616    },
14617    /// [DEPRECATED - Use new SetFlags method instead.]
14618    DeprecatedSetFlags {
14619        flags: OpenFlags,
14620        responder: NodeDeprecatedSetFlagsResponder,
14621    },
14622    /// Queries the flags that apply to this node after it has been opened/created. This method does
14623    /// not require any rights.
14624    ///
14625    /// Note that the final set of flags that apply to the connection may differ from those
14626    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
14627    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
14628    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
14629    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
14630    GetFlags {
14631        responder: NodeGetFlagsResponder,
14632    },
14633    /// Sets the flags that apply to this node after it has been opened. This method does not
14634    /// require any rights.
14635    ///
14636    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
14637    /// clear append mode.
14638    ///
14639    /// Errors:
14640    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
14641    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
14642    SetFlags {
14643        flags: Flags,
14644        responder: NodeSetFlagsResponder,
14645    },
14646    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
14647    /// volume has different settings or the storage is accounted seperately from the rest of the
14648    /// filesystem that may be reported instead of filesystem-wide details.
14649    QueryFilesystem {
14650        responder: NodeQueryFilesystemResponder,
14651    },
14652    /// Acquires information about the node.
14653    ///
14654    /// The attributes of a node should be stable, independent of the
14655    /// specific protocol used to access it.
14656    ///
14657    /// If a particular attribute is not applicable or not supported,
14658    /// filesystems should leave the corresponding field absent.
14659    ///
14660    /// + `query` a bit-mask specifying which attributes to fetch. The server
14661    ///   should not return more than necessary.
14662    /// - `attributes` the returned attributes.
14663    ///
14664    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14665    GetAttributes {
14666        query: NodeAttributesQuery,
14667        responder: NodeGetAttributesResponder,
14668    },
14669    /// Updates information about the node.
14670    ///
14671    /// + `attributes` the presence of a table field in `attributes` indicates
14672    /// the intent to update the corresponding attribute.
14673    ///
14674    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
14675    ///
14676    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14677    UpdateAttributes {
14678        payload: MutableNodeAttributes,
14679        responder: NodeUpdateAttributesResponder,
14680    },
14681    /// Synchronizes updates to the node to the underlying media, if it exists.
14682    ///
14683    /// This method will return when the filesystem server has flushed the
14684    /// relevant updates to the underlying media, but does not guarantee the
14685    /// underlying media has persisted the information, nor that any information
14686    /// is committed to hardware. Clients may use `Sync` to ensure ordering
14687    /// between operations.
14688    ///
14689    /// This method does not require any rights.
14690    Sync {
14691        responder: NodeSyncResponder,
14692    },
14693    /// Creates an iterator over all the extended attribute names associated
14694    /// with this node. If an error occurs it is returned as an epitaph on the
14695    /// iterator request channel, and then the channel is closed.
14696    ///
14697    /// GetExtendedAttributes can be used with any of these names to retrieve
14698    /// the associated value.
14699    ///
14700    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14701    ListExtendedAttributes {
14702        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
14703        control_handle: NodeControlHandle,
14704    },
14705    /// Get the value associated with the given attribute `name` for this node.
14706    ///
14707    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
14708    /// particular structure is imposed on them.
14709    ///
14710    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
14711    GetExtendedAttribute {
14712        name: Vec<u8>,
14713        responder: NodeGetExtendedAttributeResponder,
14714    },
14715    /// Set the value for the given attribute `name` to `value` for this node.
14716    ///
14717    /// The attribute name may exist, in which case the attribute is updated.
14718    /// If the attribute doesn't exist, it is created. The name should have no
14719    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
14720    ///
14721    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14722    SetExtendedAttribute {
14723        name: Vec<u8>,
14724        value: ExtendedAttributeValue,
14725        mode: SetExtendedAttributeMode,
14726        responder: NodeSetExtendedAttributeResponder,
14727    },
14728    /// Remove the specified extended attribute.
14729    ///
14730    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
14731    ///
14732    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
14733    RemoveExtendedAttribute {
14734        name: Vec<u8>,
14735        responder: NodeRemoveExtendedAttributeResponder,
14736    },
14737    /// An interaction was received which does not match any known method.
14738    #[non_exhaustive]
14739    _UnknownMethod {
14740        /// Ordinal of the method that was called.
14741        ordinal: u64,
14742        control_handle: NodeControlHandle,
14743        method_type: fidl::MethodType,
14744    },
14745}
14746
14747impl NodeRequest {
14748    #[allow(irrefutable_let_patterns)]
14749    pub fn into_clone(
14750        self,
14751    ) -> Option<(
14752        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
14753        NodeControlHandle,
14754    )> {
14755        if let NodeRequest::Clone { request, control_handle } = self {
14756            Some((request, control_handle))
14757        } else {
14758            None
14759        }
14760    }
14761
14762    #[allow(irrefutable_let_patterns)]
14763    pub fn into_close(self) -> Option<(NodeCloseResponder)> {
14764        if let NodeRequest::Close { responder } = self { Some((responder)) } else { None }
14765    }
14766
14767    #[allow(irrefutable_let_patterns)]
14768    pub fn into_query(self) -> Option<(NodeQueryResponder)> {
14769        if let NodeRequest::Query { responder } = self { Some((responder)) } else { None }
14770    }
14771
14772    #[allow(irrefutable_let_patterns)]
14773    pub fn into_deprecated_clone(
14774        self,
14775    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
14776        if let NodeRequest::DeprecatedClone { flags, object, control_handle } = self {
14777            Some((flags, object, control_handle))
14778        } else {
14779            None
14780        }
14781    }
14782
14783    #[allow(irrefutable_let_patterns)]
14784    pub fn into_deprecated_get_attr(self) -> Option<(NodeDeprecatedGetAttrResponder)> {
14785        if let NodeRequest::DeprecatedGetAttr { responder } = self {
14786            Some((responder))
14787        } else {
14788            None
14789        }
14790    }
14791
14792    #[allow(irrefutable_let_patterns)]
14793    pub fn into_deprecated_set_attr(
14794        self,
14795    ) -> Option<(NodeAttributeFlags, NodeAttributes, NodeDeprecatedSetAttrResponder)> {
14796        if let NodeRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
14797            Some((flags, attributes, responder))
14798        } else {
14799            None
14800        }
14801    }
14802
14803    #[allow(irrefutable_let_patterns)]
14804    pub fn into_deprecated_get_flags(self) -> Option<(NodeDeprecatedGetFlagsResponder)> {
14805        if let NodeRequest::DeprecatedGetFlags { responder } = self {
14806            Some((responder))
14807        } else {
14808            None
14809        }
14810    }
14811
14812    #[allow(irrefutable_let_patterns)]
14813    pub fn into_deprecated_set_flags(self) -> Option<(OpenFlags, NodeDeprecatedSetFlagsResponder)> {
14814        if let NodeRequest::DeprecatedSetFlags { flags, responder } = self {
14815            Some((flags, responder))
14816        } else {
14817            None
14818        }
14819    }
14820
14821    #[allow(irrefutable_let_patterns)]
14822    pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
14823        if let NodeRequest::GetFlags { responder } = self { Some((responder)) } else { None }
14824    }
14825
14826    #[allow(irrefutable_let_patterns)]
14827    pub fn into_set_flags(self) -> Option<(Flags, NodeSetFlagsResponder)> {
14828        if let NodeRequest::SetFlags { flags, responder } = self {
14829            Some((flags, responder))
14830        } else {
14831            None
14832        }
14833    }
14834
14835    #[allow(irrefutable_let_patterns)]
14836    pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
14837        if let NodeRequest::QueryFilesystem { responder } = self { Some((responder)) } else { None }
14838    }
14839
14840    #[allow(irrefutable_let_patterns)]
14841    pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
14842        if let NodeRequest::GetAttributes { query, responder } = self {
14843            Some((query, responder))
14844        } else {
14845            None
14846        }
14847    }
14848
14849    #[allow(irrefutable_let_patterns)]
14850    pub fn into_update_attributes(
14851        self,
14852    ) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
14853        if let NodeRequest::UpdateAttributes { payload, responder } = self {
14854            Some((payload, responder))
14855        } else {
14856            None
14857        }
14858    }
14859
14860    #[allow(irrefutable_let_patterns)]
14861    pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
14862        if let NodeRequest::Sync { responder } = self { Some((responder)) } else { None }
14863    }
14864
14865    #[allow(irrefutable_let_patterns)]
14866    pub fn into_list_extended_attributes(
14867        self,
14868    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
14869    {
14870        if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
14871            Some((iterator, control_handle))
14872        } else {
14873            None
14874        }
14875    }
14876
14877    #[allow(irrefutable_let_patterns)]
14878    pub fn into_get_extended_attribute(
14879        self,
14880    ) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
14881        if let NodeRequest::GetExtendedAttribute { name, responder } = self {
14882            Some((name, responder))
14883        } else {
14884            None
14885        }
14886    }
14887
14888    #[allow(irrefutable_let_patterns)]
14889    pub fn into_set_extended_attribute(
14890        self,
14891    ) -> Option<(
14892        Vec<u8>,
14893        ExtendedAttributeValue,
14894        SetExtendedAttributeMode,
14895        NodeSetExtendedAttributeResponder,
14896    )> {
14897        if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
14898            Some((name, value, mode, responder))
14899        } else {
14900            None
14901        }
14902    }
14903
14904    #[allow(irrefutable_let_patterns)]
14905    pub fn into_remove_extended_attribute(
14906        self,
14907    ) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
14908        if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
14909            Some((name, responder))
14910        } else {
14911            None
14912        }
14913    }
14914
14915    /// Name of the method defined in FIDL
14916    pub fn method_name(&self) -> &'static str {
14917        match *self {
14918            NodeRequest::Clone { .. } => "clone",
14919            NodeRequest::Close { .. } => "close",
14920            NodeRequest::Query { .. } => "query",
14921            NodeRequest::DeprecatedClone { .. } => "deprecated_clone",
14922            NodeRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
14923            NodeRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
14924            NodeRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
14925            NodeRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
14926            NodeRequest::GetFlags { .. } => "get_flags",
14927            NodeRequest::SetFlags { .. } => "set_flags",
14928            NodeRequest::QueryFilesystem { .. } => "query_filesystem",
14929            NodeRequest::GetAttributes { .. } => "get_attributes",
14930            NodeRequest::UpdateAttributes { .. } => "update_attributes",
14931            NodeRequest::Sync { .. } => "sync",
14932            NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
14933            NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
14934            NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
14935            NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
14936            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
14937                "unknown one-way method"
14938            }
14939            NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
14940                "unknown two-way method"
14941            }
14942        }
14943    }
14944}
14945
14946#[derive(Debug, Clone)]
14947pub struct NodeControlHandle {
14948    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
14949}
14950
14951impl fidl::endpoints::ControlHandle for NodeControlHandle {
14952    fn shutdown(&self) {
14953        self.inner.shutdown()
14954    }
14955
14956    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
14957        self.inner.shutdown_with_epitaph(status)
14958    }
14959
14960    fn is_closed(&self) -> bool {
14961        self.inner.channel().is_closed()
14962    }
14963    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
14964        self.inner.channel().on_closed()
14965    }
14966
14967    #[cfg(target_os = "fuchsia")]
14968    fn signal_peer(
14969        &self,
14970        clear_mask: zx::Signals,
14971        set_mask: zx::Signals,
14972    ) -> Result<(), zx_status::Status> {
14973        use fidl::Peered;
14974        self.inner.channel().signal_peer(clear_mask, set_mask)
14975    }
14976}
14977
14978impl NodeControlHandle {
14979    pub fn send_on_open_(
14980        &self,
14981        mut s: i32,
14982        mut info: Option<NodeInfoDeprecated>,
14983    ) -> Result<(), fidl::Error> {
14984        self.inner.send::<NodeOnOpenRequest>(
14985            (s, info.as_mut()),
14986            0,
14987            0x7fc7bbb1dbfd1972,
14988            fidl::encoding::DynamicFlags::FLEXIBLE,
14989        )
14990    }
14991
14992    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
14993        self.inner.send::<Representation>(
14994            &mut payload,
14995            0,
14996            0x5cb40567d80a510c,
14997            fidl::encoding::DynamicFlags::empty(),
14998        )
14999    }
15000}
15001
15002#[must_use = "FIDL methods require a response to be sent"]
15003#[derive(Debug)]
15004pub struct NodeCloseResponder {
15005    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15006    tx_id: u32,
15007}
15008
15009/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15010/// if the responder is dropped without sending a response, so that the client
15011/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15012impl std::ops::Drop for NodeCloseResponder {
15013    fn drop(&mut self) {
15014        self.control_handle.shutdown();
15015        // Safety: drops once, never accessed again
15016        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15017    }
15018}
15019
15020impl fidl::endpoints::Responder for NodeCloseResponder {
15021    type ControlHandle = NodeControlHandle;
15022
15023    fn control_handle(&self) -> &NodeControlHandle {
15024        &self.control_handle
15025    }
15026
15027    fn drop_without_shutdown(mut self) {
15028        // Safety: drops once, never accessed again due to mem::forget
15029        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15030        // Prevent Drop from running (which would shut down the channel)
15031        std::mem::forget(self);
15032    }
15033}
15034
15035impl NodeCloseResponder {
15036    /// Sends a response to the FIDL transaction.
15037    ///
15038    /// Sets the channel to shutdown if an error occurs.
15039    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15040        let _result = self.send_raw(result);
15041        if _result.is_err() {
15042            self.control_handle.shutdown();
15043        }
15044        self.drop_without_shutdown();
15045        _result
15046    }
15047
15048    /// Similar to "send" but does not shutdown the channel if an error occurs.
15049    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15050        let _result = self.send_raw(result);
15051        self.drop_without_shutdown();
15052        _result
15053    }
15054
15055    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15056        self.control_handle
15057            .inner
15058            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15059                result,
15060                self.tx_id,
15061                0x5ac5d459ad7f657e,
15062                fidl::encoding::DynamicFlags::empty(),
15063            )
15064    }
15065}
15066
15067#[must_use = "FIDL methods require a response to be sent"]
15068#[derive(Debug)]
15069pub struct NodeQueryResponder {
15070    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15071    tx_id: u32,
15072}
15073
15074/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15075/// if the responder is dropped without sending a response, so that the client
15076/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15077impl std::ops::Drop for NodeQueryResponder {
15078    fn drop(&mut self) {
15079        self.control_handle.shutdown();
15080        // Safety: drops once, never accessed again
15081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15082    }
15083}
15084
15085impl fidl::endpoints::Responder for NodeQueryResponder {
15086    type ControlHandle = NodeControlHandle;
15087
15088    fn control_handle(&self) -> &NodeControlHandle {
15089        &self.control_handle
15090    }
15091
15092    fn drop_without_shutdown(mut self) {
15093        // Safety: drops once, never accessed again due to mem::forget
15094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15095        // Prevent Drop from running (which would shut down the channel)
15096        std::mem::forget(self);
15097    }
15098}
15099
15100impl NodeQueryResponder {
15101    /// Sends a response to the FIDL transaction.
15102    ///
15103    /// Sets the channel to shutdown if an error occurs.
15104    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15105        let _result = self.send_raw(protocol);
15106        if _result.is_err() {
15107            self.control_handle.shutdown();
15108        }
15109        self.drop_without_shutdown();
15110        _result
15111    }
15112
15113    /// Similar to "send" but does not shutdown the channel if an error occurs.
15114    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15115        let _result = self.send_raw(protocol);
15116        self.drop_without_shutdown();
15117        _result
15118    }
15119
15120    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
15121        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
15122            (protocol,),
15123            self.tx_id,
15124            0x2658edee9decfc06,
15125            fidl::encoding::DynamicFlags::empty(),
15126        )
15127    }
15128}
15129
15130#[must_use = "FIDL methods require a response to be sent"]
15131#[derive(Debug)]
15132pub struct NodeDeprecatedGetAttrResponder {
15133    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15134    tx_id: u32,
15135}
15136
15137/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15138/// if the responder is dropped without sending a response, so that the client
15139/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15140impl std::ops::Drop for NodeDeprecatedGetAttrResponder {
15141    fn drop(&mut self) {
15142        self.control_handle.shutdown();
15143        // Safety: drops once, never accessed again
15144        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15145    }
15146}
15147
15148impl fidl::endpoints::Responder for NodeDeprecatedGetAttrResponder {
15149    type ControlHandle = NodeControlHandle;
15150
15151    fn control_handle(&self) -> &NodeControlHandle {
15152        &self.control_handle
15153    }
15154
15155    fn drop_without_shutdown(mut self) {
15156        // Safety: drops once, never accessed again due to mem::forget
15157        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15158        // Prevent Drop from running (which would shut down the channel)
15159        std::mem::forget(self);
15160    }
15161}
15162
15163impl NodeDeprecatedGetAttrResponder {
15164    /// Sends a response to the FIDL transaction.
15165    ///
15166    /// Sets the channel to shutdown if an error occurs.
15167    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15168        let _result = self.send_raw(s, attributes);
15169        if _result.is_err() {
15170            self.control_handle.shutdown();
15171        }
15172        self.drop_without_shutdown();
15173        _result
15174    }
15175
15176    /// Similar to "send" but does not shutdown the channel if an error occurs.
15177    pub fn send_no_shutdown_on_err(
15178        self,
15179        mut s: i32,
15180        mut attributes: &NodeAttributes,
15181    ) -> Result<(), fidl::Error> {
15182        let _result = self.send_raw(s, attributes);
15183        self.drop_without_shutdown();
15184        _result
15185    }
15186
15187    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
15188        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
15189            (s, attributes),
15190            self.tx_id,
15191            0x78985e216314dafd,
15192            fidl::encoding::DynamicFlags::empty(),
15193        )
15194    }
15195}
15196
15197#[must_use = "FIDL methods require a response to be sent"]
15198#[derive(Debug)]
15199pub struct NodeDeprecatedSetAttrResponder {
15200    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15201    tx_id: u32,
15202}
15203
15204/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15205/// if the responder is dropped without sending a response, so that the client
15206/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15207impl std::ops::Drop for NodeDeprecatedSetAttrResponder {
15208    fn drop(&mut self) {
15209        self.control_handle.shutdown();
15210        // Safety: drops once, never accessed again
15211        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15212    }
15213}
15214
15215impl fidl::endpoints::Responder for NodeDeprecatedSetAttrResponder {
15216    type ControlHandle = NodeControlHandle;
15217
15218    fn control_handle(&self) -> &NodeControlHandle {
15219        &self.control_handle
15220    }
15221
15222    fn drop_without_shutdown(mut self) {
15223        // Safety: drops once, never accessed again due to mem::forget
15224        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15225        // Prevent Drop from running (which would shut down the channel)
15226        std::mem::forget(self);
15227    }
15228}
15229
15230impl NodeDeprecatedSetAttrResponder {
15231    /// Sends a response to the FIDL transaction.
15232    ///
15233    /// Sets the channel to shutdown if an error occurs.
15234    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15235        let _result = self.send_raw(s);
15236        if _result.is_err() {
15237            self.control_handle.shutdown();
15238        }
15239        self.drop_without_shutdown();
15240        _result
15241    }
15242
15243    /// Similar to "send" but does not shutdown the channel if an error occurs.
15244    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15245        let _result = self.send_raw(s);
15246        self.drop_without_shutdown();
15247        _result
15248    }
15249
15250    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15251        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
15252            (s,),
15253            self.tx_id,
15254            0x4186c0f40d938f46,
15255            fidl::encoding::DynamicFlags::empty(),
15256        )
15257    }
15258}
15259
15260#[must_use = "FIDL methods require a response to be sent"]
15261#[derive(Debug)]
15262pub struct NodeDeprecatedGetFlagsResponder {
15263    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15264    tx_id: u32,
15265}
15266
15267/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15268/// if the responder is dropped without sending a response, so that the client
15269/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15270impl std::ops::Drop for NodeDeprecatedGetFlagsResponder {
15271    fn drop(&mut self) {
15272        self.control_handle.shutdown();
15273        // Safety: drops once, never accessed again
15274        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15275    }
15276}
15277
15278impl fidl::endpoints::Responder for NodeDeprecatedGetFlagsResponder {
15279    type ControlHandle = NodeControlHandle;
15280
15281    fn control_handle(&self) -> &NodeControlHandle {
15282        &self.control_handle
15283    }
15284
15285    fn drop_without_shutdown(mut self) {
15286        // Safety: drops once, never accessed again due to mem::forget
15287        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15288        // Prevent Drop from running (which would shut down the channel)
15289        std::mem::forget(self);
15290    }
15291}
15292
15293impl NodeDeprecatedGetFlagsResponder {
15294    /// Sends a response to the FIDL transaction.
15295    ///
15296    /// Sets the channel to shutdown if an error occurs.
15297    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15298        let _result = self.send_raw(s, flags);
15299        if _result.is_err() {
15300            self.control_handle.shutdown();
15301        }
15302        self.drop_without_shutdown();
15303        _result
15304    }
15305
15306    /// Similar to "send" but does not shutdown the channel if an error occurs.
15307    pub fn send_no_shutdown_on_err(
15308        self,
15309        mut s: i32,
15310        mut flags: OpenFlags,
15311    ) -> Result<(), fidl::Error> {
15312        let _result = self.send_raw(s, flags);
15313        self.drop_without_shutdown();
15314        _result
15315    }
15316
15317    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
15318        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
15319            (s, flags),
15320            self.tx_id,
15321            0x5b88fffb8eda3aa1,
15322            fidl::encoding::DynamicFlags::empty(),
15323        )
15324    }
15325}
15326
15327#[must_use = "FIDL methods require a response to be sent"]
15328#[derive(Debug)]
15329pub struct NodeDeprecatedSetFlagsResponder {
15330    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15331    tx_id: u32,
15332}
15333
15334/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15335/// if the responder is dropped without sending a response, so that the client
15336/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15337impl std::ops::Drop for NodeDeprecatedSetFlagsResponder {
15338    fn drop(&mut self) {
15339        self.control_handle.shutdown();
15340        // Safety: drops once, never accessed again
15341        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15342    }
15343}
15344
15345impl fidl::endpoints::Responder for NodeDeprecatedSetFlagsResponder {
15346    type ControlHandle = NodeControlHandle;
15347
15348    fn control_handle(&self) -> &NodeControlHandle {
15349        &self.control_handle
15350    }
15351
15352    fn drop_without_shutdown(mut self) {
15353        // Safety: drops once, never accessed again due to mem::forget
15354        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15355        // Prevent Drop from running (which would shut down the channel)
15356        std::mem::forget(self);
15357    }
15358}
15359
15360impl NodeDeprecatedSetFlagsResponder {
15361    /// Sends a response to the FIDL transaction.
15362    ///
15363    /// Sets the channel to shutdown if an error occurs.
15364    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
15365        let _result = self.send_raw(s);
15366        if _result.is_err() {
15367            self.control_handle.shutdown();
15368        }
15369        self.drop_without_shutdown();
15370        _result
15371    }
15372
15373    /// Similar to "send" but does not shutdown the channel if an error occurs.
15374    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
15375        let _result = self.send_raw(s);
15376        self.drop_without_shutdown();
15377        _result
15378    }
15379
15380    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
15381        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
15382            (s,),
15383            self.tx_id,
15384            0x5295b76c71fde733,
15385            fidl::encoding::DynamicFlags::empty(),
15386        )
15387    }
15388}
15389
15390#[must_use = "FIDL methods require a response to be sent"]
15391#[derive(Debug)]
15392pub struct NodeGetFlagsResponder {
15393    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15394    tx_id: u32,
15395}
15396
15397/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15398/// if the responder is dropped without sending a response, so that the client
15399/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15400impl std::ops::Drop for NodeGetFlagsResponder {
15401    fn drop(&mut self) {
15402        self.control_handle.shutdown();
15403        // Safety: drops once, never accessed again
15404        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15405    }
15406}
15407
15408impl fidl::endpoints::Responder for NodeGetFlagsResponder {
15409    type ControlHandle = NodeControlHandle;
15410
15411    fn control_handle(&self) -> &NodeControlHandle {
15412        &self.control_handle
15413    }
15414
15415    fn drop_without_shutdown(mut self) {
15416        // Safety: drops once, never accessed again due to mem::forget
15417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15418        // Prevent Drop from running (which would shut down the channel)
15419        std::mem::forget(self);
15420    }
15421}
15422
15423impl NodeGetFlagsResponder {
15424    /// Sends a response to the FIDL transaction.
15425    ///
15426    /// Sets the channel to shutdown if an error occurs.
15427    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15428        let _result = self.send_raw(result);
15429        if _result.is_err() {
15430            self.control_handle.shutdown();
15431        }
15432        self.drop_without_shutdown();
15433        _result
15434    }
15435
15436    /// Similar to "send" but does not shutdown the channel if an error occurs.
15437    pub fn send_no_shutdown_on_err(
15438        self,
15439        mut result: Result<Flags, i32>,
15440    ) -> Result<(), fidl::Error> {
15441        let _result = self.send_raw(result);
15442        self.drop_without_shutdown();
15443        _result
15444    }
15445
15446    fn send_raw(&self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
15447        self.control_handle
15448            .inner
15449            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
15450                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
15451                self.tx_id,
15452                0x176eb318f64ec23,
15453                fidl::encoding::DynamicFlags::FLEXIBLE,
15454            )
15455    }
15456}
15457
15458#[must_use = "FIDL methods require a response to be sent"]
15459#[derive(Debug)]
15460pub struct NodeSetFlagsResponder {
15461    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15462    tx_id: u32,
15463}
15464
15465/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15466/// if the responder is dropped without sending a response, so that the client
15467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15468impl std::ops::Drop for NodeSetFlagsResponder {
15469    fn drop(&mut self) {
15470        self.control_handle.shutdown();
15471        // Safety: drops once, never accessed again
15472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15473    }
15474}
15475
15476impl fidl::endpoints::Responder for NodeSetFlagsResponder {
15477    type ControlHandle = NodeControlHandle;
15478
15479    fn control_handle(&self) -> &NodeControlHandle {
15480        &self.control_handle
15481    }
15482
15483    fn drop_without_shutdown(mut self) {
15484        // Safety: drops once, never accessed again due to mem::forget
15485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15486        // Prevent Drop from running (which would shut down the channel)
15487        std::mem::forget(self);
15488    }
15489}
15490
15491impl NodeSetFlagsResponder {
15492    /// Sends a response to the FIDL transaction.
15493    ///
15494    /// Sets the channel to shutdown if an error occurs.
15495    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15496        let _result = self.send_raw(result);
15497        if _result.is_err() {
15498            self.control_handle.shutdown();
15499        }
15500        self.drop_without_shutdown();
15501        _result
15502    }
15503
15504    /// Similar to "send" but does not shutdown the channel if an error occurs.
15505    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15506        let _result = self.send_raw(result);
15507        self.drop_without_shutdown();
15508        _result
15509    }
15510
15511    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15512        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
15513            fidl::encoding::EmptyStruct,
15514            i32,
15515        >>(
15516            fidl::encoding::FlexibleResult::new(result),
15517            self.tx_id,
15518            0x55a8028685791ea8,
15519            fidl::encoding::DynamicFlags::FLEXIBLE,
15520        )
15521    }
15522}
15523
15524#[must_use = "FIDL methods require a response to be sent"]
15525#[derive(Debug)]
15526pub struct NodeQueryFilesystemResponder {
15527    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15528    tx_id: u32,
15529}
15530
15531/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15532/// if the responder is dropped without sending a response, so that the client
15533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15534impl std::ops::Drop for NodeQueryFilesystemResponder {
15535    fn drop(&mut self) {
15536        self.control_handle.shutdown();
15537        // Safety: drops once, never accessed again
15538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15539    }
15540}
15541
15542impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
15543    type ControlHandle = NodeControlHandle;
15544
15545    fn control_handle(&self) -> &NodeControlHandle {
15546        &self.control_handle
15547    }
15548
15549    fn drop_without_shutdown(mut self) {
15550        // Safety: drops once, never accessed again due to mem::forget
15551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15552        // Prevent Drop from running (which would shut down the channel)
15553        std::mem::forget(self);
15554    }
15555}
15556
15557impl NodeQueryFilesystemResponder {
15558    /// Sends a response to the FIDL transaction.
15559    ///
15560    /// Sets the channel to shutdown if an error occurs.
15561    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15562        let _result = self.send_raw(s, info);
15563        if _result.is_err() {
15564            self.control_handle.shutdown();
15565        }
15566        self.drop_without_shutdown();
15567        _result
15568    }
15569
15570    /// Similar to "send" but does not shutdown the channel if an error occurs.
15571    pub fn send_no_shutdown_on_err(
15572        self,
15573        mut s: i32,
15574        mut info: Option<&FilesystemInfo>,
15575    ) -> Result<(), fidl::Error> {
15576        let _result = self.send_raw(s, info);
15577        self.drop_without_shutdown();
15578        _result
15579    }
15580
15581    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
15582        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
15583            (s, info),
15584            self.tx_id,
15585            0x6f344a1c6b0a0610,
15586            fidl::encoding::DynamicFlags::empty(),
15587        )
15588    }
15589}
15590
15591#[must_use = "FIDL methods require a response to be sent"]
15592#[derive(Debug)]
15593pub struct NodeGetAttributesResponder {
15594    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15595    tx_id: u32,
15596}
15597
15598/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15599/// if the responder is dropped without sending a response, so that the client
15600/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15601impl std::ops::Drop for NodeGetAttributesResponder {
15602    fn drop(&mut self) {
15603        self.control_handle.shutdown();
15604        // Safety: drops once, never accessed again
15605        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15606    }
15607}
15608
15609impl fidl::endpoints::Responder for NodeGetAttributesResponder {
15610    type ControlHandle = NodeControlHandle;
15611
15612    fn control_handle(&self) -> &NodeControlHandle {
15613        &self.control_handle
15614    }
15615
15616    fn drop_without_shutdown(mut self) {
15617        // Safety: drops once, never accessed again due to mem::forget
15618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15619        // Prevent Drop from running (which would shut down the channel)
15620        std::mem::forget(self);
15621    }
15622}
15623
15624impl NodeGetAttributesResponder {
15625    /// Sends a response to the FIDL transaction.
15626    ///
15627    /// Sets the channel to shutdown if an error occurs.
15628    pub fn send(
15629        self,
15630        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15631    ) -> Result<(), fidl::Error> {
15632        let _result = self.send_raw(result);
15633        if _result.is_err() {
15634            self.control_handle.shutdown();
15635        }
15636        self.drop_without_shutdown();
15637        _result
15638    }
15639
15640    /// Similar to "send" but does not shutdown the channel if an error occurs.
15641    pub fn send_no_shutdown_on_err(
15642        self,
15643        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15644    ) -> Result<(), fidl::Error> {
15645        let _result = self.send_raw(result);
15646        self.drop_without_shutdown();
15647        _result
15648    }
15649
15650    fn send_raw(
15651        &self,
15652        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
15653    ) -> Result<(), fidl::Error> {
15654        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
15655            result,
15656            self.tx_id,
15657            0x3d4396a638ea053b,
15658            fidl::encoding::DynamicFlags::empty(),
15659        )
15660    }
15661}
15662
15663#[must_use = "FIDL methods require a response to be sent"]
15664#[derive(Debug)]
15665pub struct NodeUpdateAttributesResponder {
15666    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15667    tx_id: u32,
15668}
15669
15670/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15671/// if the responder is dropped without sending a response, so that the client
15672/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15673impl std::ops::Drop for NodeUpdateAttributesResponder {
15674    fn drop(&mut self) {
15675        self.control_handle.shutdown();
15676        // Safety: drops once, never accessed again
15677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15678    }
15679}
15680
15681impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
15682    type ControlHandle = NodeControlHandle;
15683
15684    fn control_handle(&self) -> &NodeControlHandle {
15685        &self.control_handle
15686    }
15687
15688    fn drop_without_shutdown(mut self) {
15689        // Safety: drops once, never accessed again due to mem::forget
15690        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15691        // Prevent Drop from running (which would shut down the channel)
15692        std::mem::forget(self);
15693    }
15694}
15695
15696impl NodeUpdateAttributesResponder {
15697    /// Sends a response to the FIDL transaction.
15698    ///
15699    /// Sets the channel to shutdown if an error occurs.
15700    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15701        let _result = self.send_raw(result);
15702        if _result.is_err() {
15703            self.control_handle.shutdown();
15704        }
15705        self.drop_without_shutdown();
15706        _result
15707    }
15708
15709    /// Similar to "send" but does not shutdown the channel if an error occurs.
15710    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15711        let _result = self.send_raw(result);
15712        self.drop_without_shutdown();
15713        _result
15714    }
15715
15716    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15717        self.control_handle
15718            .inner
15719            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15720                result,
15721                self.tx_id,
15722                0x3308c1da5a89bf08,
15723                fidl::encoding::DynamicFlags::empty(),
15724            )
15725    }
15726}
15727
15728#[must_use = "FIDL methods require a response to be sent"]
15729#[derive(Debug)]
15730pub struct NodeSyncResponder {
15731    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15732    tx_id: u32,
15733}
15734
15735/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15736/// if the responder is dropped without sending a response, so that the client
15737/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15738impl std::ops::Drop for NodeSyncResponder {
15739    fn drop(&mut self) {
15740        self.control_handle.shutdown();
15741        // Safety: drops once, never accessed again
15742        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15743    }
15744}
15745
15746impl fidl::endpoints::Responder for NodeSyncResponder {
15747    type ControlHandle = NodeControlHandle;
15748
15749    fn control_handle(&self) -> &NodeControlHandle {
15750        &self.control_handle
15751    }
15752
15753    fn drop_without_shutdown(mut self) {
15754        // Safety: drops once, never accessed again due to mem::forget
15755        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15756        // Prevent Drop from running (which would shut down the channel)
15757        std::mem::forget(self);
15758    }
15759}
15760
15761impl NodeSyncResponder {
15762    /// Sends a response to the FIDL transaction.
15763    ///
15764    /// Sets the channel to shutdown if an error occurs.
15765    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15766        let _result = self.send_raw(result);
15767        if _result.is_err() {
15768            self.control_handle.shutdown();
15769        }
15770        self.drop_without_shutdown();
15771        _result
15772    }
15773
15774    /// Similar to "send" but does not shutdown the channel if an error occurs.
15775    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15776        let _result = self.send_raw(result);
15777        self.drop_without_shutdown();
15778        _result
15779    }
15780
15781    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15782        self.control_handle
15783            .inner
15784            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15785                result,
15786                self.tx_id,
15787                0x2c5c27ca0ab5dc49,
15788                fidl::encoding::DynamicFlags::empty(),
15789            )
15790    }
15791}
15792
15793#[must_use = "FIDL methods require a response to be sent"]
15794#[derive(Debug)]
15795pub struct NodeGetExtendedAttributeResponder {
15796    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15797    tx_id: u32,
15798}
15799
15800/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15801/// if the responder is dropped without sending a response, so that the client
15802/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15803impl std::ops::Drop for NodeGetExtendedAttributeResponder {
15804    fn drop(&mut self) {
15805        self.control_handle.shutdown();
15806        // Safety: drops once, never accessed again
15807        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15808    }
15809}
15810
15811impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
15812    type ControlHandle = NodeControlHandle;
15813
15814    fn control_handle(&self) -> &NodeControlHandle {
15815        &self.control_handle
15816    }
15817
15818    fn drop_without_shutdown(mut self) {
15819        // Safety: drops once, never accessed again due to mem::forget
15820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15821        // Prevent Drop from running (which would shut down the channel)
15822        std::mem::forget(self);
15823    }
15824}
15825
15826impl NodeGetExtendedAttributeResponder {
15827    /// Sends a response to the FIDL transaction.
15828    ///
15829    /// Sets the channel to shutdown if an error occurs.
15830    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15831        let _result = self.send_raw(result);
15832        if _result.is_err() {
15833            self.control_handle.shutdown();
15834        }
15835        self.drop_without_shutdown();
15836        _result
15837    }
15838
15839    /// Similar to "send" but does not shutdown the channel if an error occurs.
15840    pub fn send_no_shutdown_on_err(
15841        self,
15842        mut result: Result<ExtendedAttributeValue, i32>,
15843    ) -> Result<(), fidl::Error> {
15844        let _result = self.send_raw(result);
15845        self.drop_without_shutdown();
15846        _result
15847    }
15848
15849    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
15850        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
15851            result.as_mut().map_err(|e| *e),
15852            self.tx_id,
15853            0x45ffa3ccfdeb76db,
15854            fidl::encoding::DynamicFlags::empty(),
15855        )
15856    }
15857}
15858
15859#[must_use = "FIDL methods require a response to be sent"]
15860#[derive(Debug)]
15861pub struct NodeSetExtendedAttributeResponder {
15862    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15863    tx_id: u32,
15864}
15865
15866/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15867/// if the responder is dropped without sending a response, so that the client
15868/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15869impl std::ops::Drop for NodeSetExtendedAttributeResponder {
15870    fn drop(&mut self) {
15871        self.control_handle.shutdown();
15872        // Safety: drops once, never accessed again
15873        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15874    }
15875}
15876
15877impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
15878    type ControlHandle = NodeControlHandle;
15879
15880    fn control_handle(&self) -> &NodeControlHandle {
15881        &self.control_handle
15882    }
15883
15884    fn drop_without_shutdown(mut self) {
15885        // Safety: drops once, never accessed again due to mem::forget
15886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15887        // Prevent Drop from running (which would shut down the channel)
15888        std::mem::forget(self);
15889    }
15890}
15891
15892impl NodeSetExtendedAttributeResponder {
15893    /// Sends a response to the FIDL transaction.
15894    ///
15895    /// Sets the channel to shutdown if an error occurs.
15896    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15897        let _result = self.send_raw(result);
15898        if _result.is_err() {
15899            self.control_handle.shutdown();
15900        }
15901        self.drop_without_shutdown();
15902        _result
15903    }
15904
15905    /// Similar to "send" but does not shutdown the channel if an error occurs.
15906    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15907        let _result = self.send_raw(result);
15908        self.drop_without_shutdown();
15909        _result
15910    }
15911
15912    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15913        self.control_handle
15914            .inner
15915            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15916                result,
15917                self.tx_id,
15918                0x4a951362f681f23c,
15919                fidl::encoding::DynamicFlags::empty(),
15920            )
15921    }
15922}
15923
15924#[must_use = "FIDL methods require a response to be sent"]
15925#[derive(Debug)]
15926pub struct NodeRemoveExtendedAttributeResponder {
15927    control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
15928    tx_id: u32,
15929}
15930
15931/// Set the the channel to be shutdown (see [`NodeControlHandle::shutdown`])
15932/// if the responder is dropped without sending a response, so that the client
15933/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
15934impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
15935    fn drop(&mut self) {
15936        self.control_handle.shutdown();
15937        // Safety: drops once, never accessed again
15938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15939    }
15940}
15941
15942impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
15943    type ControlHandle = NodeControlHandle;
15944
15945    fn control_handle(&self) -> &NodeControlHandle {
15946        &self.control_handle
15947    }
15948
15949    fn drop_without_shutdown(mut self) {
15950        // Safety: drops once, never accessed again due to mem::forget
15951        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
15952        // Prevent Drop from running (which would shut down the channel)
15953        std::mem::forget(self);
15954    }
15955}
15956
15957impl NodeRemoveExtendedAttributeResponder {
15958    /// Sends a response to the FIDL transaction.
15959    ///
15960    /// Sets the channel to shutdown if an error occurs.
15961    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15962        let _result = self.send_raw(result);
15963        if _result.is_err() {
15964            self.control_handle.shutdown();
15965        }
15966        self.drop_without_shutdown();
15967        _result
15968    }
15969
15970    /// Similar to "send" but does not shutdown the channel if an error occurs.
15971    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15972        let _result = self.send_raw(result);
15973        self.drop_without_shutdown();
15974        _result
15975    }
15976
15977    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
15978        self.control_handle
15979            .inner
15980            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
15981                result,
15982                self.tx_id,
15983                0x7a0b9f3a9bf9032d,
15984                fidl::encoding::DynamicFlags::empty(),
15985            )
15986    }
15987}
15988
15989#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15990pub struct OpenableMarker;
15991
15992impl fidl::endpoints::ProtocolMarker for OpenableMarker {
15993    type Proxy = OpenableProxy;
15994    type RequestStream = OpenableRequestStream;
15995    #[cfg(target_os = "fuchsia")]
15996    type SynchronousProxy = OpenableSynchronousProxy;
15997
15998    const DEBUG_NAME: &'static str = "(anonymous) Openable";
15999}
16000
16001pub trait OpenableProxyInterface: Send + Sync {
16002    fn r#open(
16003        &self,
16004        path: &str,
16005        flags: Flags,
16006        options: &Options,
16007        object: fidl::Channel,
16008    ) -> Result<(), fidl::Error>;
16009}
16010#[derive(Debug)]
16011#[cfg(target_os = "fuchsia")]
16012pub struct OpenableSynchronousProxy {
16013    client: fidl::client::sync::Client,
16014}
16015
16016#[cfg(target_os = "fuchsia")]
16017impl fidl::endpoints::SynchronousProxy for OpenableSynchronousProxy {
16018    type Proxy = OpenableProxy;
16019    type Protocol = OpenableMarker;
16020
16021    fn from_channel(inner: fidl::Channel) -> Self {
16022        Self::new(inner)
16023    }
16024
16025    fn into_channel(self) -> fidl::Channel {
16026        self.client.into_channel()
16027    }
16028
16029    fn as_channel(&self) -> &fidl::Channel {
16030        self.client.as_channel()
16031    }
16032}
16033
16034#[cfg(target_os = "fuchsia")]
16035impl OpenableSynchronousProxy {
16036    pub fn new(channel: fidl::Channel) -> Self {
16037        Self { client: fidl::client::sync::Client::new(channel) }
16038    }
16039
16040    pub fn into_channel(self) -> fidl::Channel {
16041        self.client.into_channel()
16042    }
16043
16044    /// Waits until an event arrives and returns it. It is safe for other
16045    /// threads to make concurrent requests while waiting for an event.
16046    pub fn wait_for_event(
16047        &self,
16048        deadline: zx::MonotonicInstant,
16049    ) -> Result<OpenableEvent, fidl::Error> {
16050        OpenableEvent::decode(self.client.wait_for_event::<OpenableMarker>(deadline)?)
16051    }
16052
16053    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16054    /// epitaph sent on the `object` channel.
16055    ///
16056    /// Errors:
16057    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16058    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16059    pub fn r#open(
16060        &self,
16061        mut path: &str,
16062        mut flags: Flags,
16063        mut options: &Options,
16064        mut object: fidl::Channel,
16065    ) -> Result<(), fidl::Error> {
16066        self.client.send::<OpenableOpenRequest>(
16067            (path, flags, options, object),
16068            0x568ddcb9a9cbb6d9,
16069            fidl::encoding::DynamicFlags::FLEXIBLE,
16070        )
16071    }
16072}
16073
16074#[cfg(target_os = "fuchsia")]
16075impl From<OpenableSynchronousProxy> for zx::NullableHandle {
16076    fn from(value: OpenableSynchronousProxy) -> Self {
16077        value.into_channel().into()
16078    }
16079}
16080
16081#[cfg(target_os = "fuchsia")]
16082impl From<fidl::Channel> for OpenableSynchronousProxy {
16083    fn from(value: fidl::Channel) -> Self {
16084        Self::new(value)
16085    }
16086}
16087
16088#[cfg(target_os = "fuchsia")]
16089impl fidl::endpoints::FromClient for OpenableSynchronousProxy {
16090    type Protocol = OpenableMarker;
16091
16092    fn from_client(value: fidl::endpoints::ClientEnd<OpenableMarker>) -> Self {
16093        Self::new(value.into_channel())
16094    }
16095}
16096
16097#[derive(Debug, Clone)]
16098pub struct OpenableProxy {
16099    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16100}
16101
16102impl fidl::endpoints::Proxy for OpenableProxy {
16103    type Protocol = OpenableMarker;
16104
16105    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16106        Self::new(inner)
16107    }
16108
16109    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16110        self.client.into_channel().map_err(|client| Self { client })
16111    }
16112
16113    fn as_channel(&self) -> &::fidl::AsyncChannel {
16114        self.client.as_channel()
16115    }
16116}
16117
16118impl OpenableProxy {
16119    /// Create a new Proxy for fuchsia.io/Openable.
16120    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16121        let protocol_name = <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16122        Self { client: fidl::client::Client::new(channel, protocol_name) }
16123    }
16124
16125    /// Get a Stream of events from the remote end of the protocol.
16126    ///
16127    /// # Panics
16128    ///
16129    /// Panics if the event stream was already taken.
16130    pub fn take_event_stream(&self) -> OpenableEventStream {
16131        OpenableEventStream { event_receiver: self.client.take_event_receiver() }
16132    }
16133
16134    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16135    /// epitaph sent on the `object` channel.
16136    ///
16137    /// Errors:
16138    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16139    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16140    pub fn r#open(
16141        &self,
16142        mut path: &str,
16143        mut flags: Flags,
16144        mut options: &Options,
16145        mut object: fidl::Channel,
16146    ) -> Result<(), fidl::Error> {
16147        OpenableProxyInterface::r#open(self, path, flags, options, object)
16148    }
16149}
16150
16151impl OpenableProxyInterface for OpenableProxy {
16152    fn r#open(
16153        &self,
16154        mut path: &str,
16155        mut flags: Flags,
16156        mut options: &Options,
16157        mut object: fidl::Channel,
16158    ) -> Result<(), fidl::Error> {
16159        self.client.send::<OpenableOpenRequest>(
16160            (path, flags, options, object),
16161            0x568ddcb9a9cbb6d9,
16162            fidl::encoding::DynamicFlags::FLEXIBLE,
16163        )
16164    }
16165}
16166
16167pub struct OpenableEventStream {
16168    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16169}
16170
16171impl std::marker::Unpin for OpenableEventStream {}
16172
16173impl futures::stream::FusedStream for OpenableEventStream {
16174    fn is_terminated(&self) -> bool {
16175        self.event_receiver.is_terminated()
16176    }
16177}
16178
16179impl futures::Stream for OpenableEventStream {
16180    type Item = Result<OpenableEvent, fidl::Error>;
16181
16182    fn poll_next(
16183        mut self: std::pin::Pin<&mut Self>,
16184        cx: &mut std::task::Context<'_>,
16185    ) -> std::task::Poll<Option<Self::Item>> {
16186        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16187            &mut self.event_receiver,
16188            cx
16189        )?) {
16190            Some(buf) => std::task::Poll::Ready(Some(OpenableEvent::decode(buf))),
16191            None => std::task::Poll::Ready(None),
16192        }
16193    }
16194}
16195
16196#[derive(Debug)]
16197pub enum OpenableEvent {
16198    #[non_exhaustive]
16199    _UnknownEvent {
16200        /// Ordinal of the event that was sent.
16201        ordinal: u64,
16202    },
16203}
16204
16205impl OpenableEvent {
16206    /// Decodes a message buffer as a [`OpenableEvent`].
16207    fn decode(
16208        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16209    ) -> Result<OpenableEvent, fidl::Error> {
16210        let (bytes, _handles) = buf.split_mut();
16211        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16212        debug_assert_eq!(tx_header.tx_id, 0);
16213        match tx_header.ordinal {
16214            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
16215                Ok(OpenableEvent::_UnknownEvent { ordinal: tx_header.ordinal })
16216            }
16217            _ => Err(fidl::Error::UnknownOrdinal {
16218                ordinal: tx_header.ordinal,
16219                protocol_name: <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16220            }),
16221        }
16222    }
16223}
16224
16225/// A Stream of incoming requests for fuchsia.io/Openable.
16226pub struct OpenableRequestStream {
16227    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16228    is_terminated: bool,
16229}
16230
16231impl std::marker::Unpin for OpenableRequestStream {}
16232
16233impl futures::stream::FusedStream for OpenableRequestStream {
16234    fn is_terminated(&self) -> bool {
16235        self.is_terminated
16236    }
16237}
16238
16239impl fidl::endpoints::RequestStream for OpenableRequestStream {
16240    type Protocol = OpenableMarker;
16241    type ControlHandle = OpenableControlHandle;
16242
16243    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16244        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16245    }
16246
16247    fn control_handle(&self) -> Self::ControlHandle {
16248        OpenableControlHandle { inner: self.inner.clone() }
16249    }
16250
16251    fn into_inner(
16252        self,
16253    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16254    {
16255        (self.inner, self.is_terminated)
16256    }
16257
16258    fn from_inner(
16259        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16260        is_terminated: bool,
16261    ) -> Self {
16262        Self { inner, is_terminated }
16263    }
16264}
16265
16266impl futures::Stream for OpenableRequestStream {
16267    type Item = Result<OpenableRequest, fidl::Error>;
16268
16269    fn poll_next(
16270        mut self: std::pin::Pin<&mut Self>,
16271        cx: &mut std::task::Context<'_>,
16272    ) -> std::task::Poll<Option<Self::Item>> {
16273        let this = &mut *self;
16274        if this.inner.check_shutdown(cx) {
16275            this.is_terminated = true;
16276            return std::task::Poll::Ready(None);
16277        }
16278        if this.is_terminated {
16279            panic!("polled OpenableRequestStream after completion");
16280        }
16281        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16282            |bytes, handles| {
16283                match this.inner.channel().read_etc(cx, bytes, handles) {
16284                    std::task::Poll::Ready(Ok(())) => {}
16285                    std::task::Poll::Pending => return std::task::Poll::Pending,
16286                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16287                        this.is_terminated = true;
16288                        return std::task::Poll::Ready(None);
16289                    }
16290                    std::task::Poll::Ready(Err(e)) => {
16291                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16292                            e.into(),
16293                        ))));
16294                    }
16295                }
16296
16297                // A message has been received from the channel
16298                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16299
16300                std::task::Poll::Ready(Some(match header.ordinal {
16301                    0x568ddcb9a9cbb6d9 => {
16302                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
16303                        let mut req = fidl::new_empty!(
16304                            OpenableOpenRequest,
16305                            fidl::encoding::DefaultFuchsiaResourceDialect
16306                        );
16307                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
16308                        let control_handle = OpenableControlHandle { inner: this.inner.clone() };
16309                        Ok(OpenableRequest::Open {
16310                            path: req.path,
16311                            flags: req.flags,
16312                            options: req.options,
16313                            object: req.object,
16314
16315                            control_handle,
16316                        })
16317                    }
16318                    _ if header.tx_id == 0
16319                        && header
16320                            .dynamic_flags()
16321                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16322                    {
16323                        Ok(OpenableRequest::_UnknownMethod {
16324                            ordinal: header.ordinal,
16325                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16326                            method_type: fidl::MethodType::OneWay,
16327                        })
16328                    }
16329                    _ if header
16330                        .dynamic_flags()
16331                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
16332                    {
16333                        this.inner.send_framework_err(
16334                            fidl::encoding::FrameworkErr::UnknownMethod,
16335                            header.tx_id,
16336                            header.ordinal,
16337                            header.dynamic_flags(),
16338                            (bytes, handles),
16339                        )?;
16340                        Ok(OpenableRequest::_UnknownMethod {
16341                            ordinal: header.ordinal,
16342                            control_handle: OpenableControlHandle { inner: this.inner.clone() },
16343                            method_type: fidl::MethodType::TwoWay,
16344                        })
16345                    }
16346                    _ => Err(fidl::Error::UnknownOrdinal {
16347                        ordinal: header.ordinal,
16348                        protocol_name:
16349                            <OpenableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16350                    }),
16351                }))
16352            },
16353        )
16354    }
16355}
16356
16357/// Openable defines a node which is capable of opening other objects.
16358#[derive(Debug)]
16359pub enum OpenableRequest {
16360    /// Open (or create) a node relative to this directory. Any errors are communicated via an
16361    /// epitaph sent on the `object` channel.
16362    ///
16363    /// Errors:
16364    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
16365    /// * See [`Flags`] for other errors which may be communicated based on `flags`
16366    Open {
16367        path: String,
16368        flags: Flags,
16369        options: Options,
16370        object: fidl::Channel,
16371        control_handle: OpenableControlHandle,
16372    },
16373    /// An interaction was received which does not match any known method.
16374    #[non_exhaustive]
16375    _UnknownMethod {
16376        /// Ordinal of the method that was called.
16377        ordinal: u64,
16378        control_handle: OpenableControlHandle,
16379        method_type: fidl::MethodType,
16380    },
16381}
16382
16383impl OpenableRequest {
16384    #[allow(irrefutable_let_patterns)]
16385    pub fn into_open(
16386        self,
16387    ) -> Option<(String, Flags, Options, fidl::Channel, OpenableControlHandle)> {
16388        if let OpenableRequest::Open { path, flags, options, object, control_handle } = self {
16389            Some((path, flags, options, object, control_handle))
16390        } else {
16391            None
16392        }
16393    }
16394
16395    /// Name of the method defined in FIDL
16396    pub fn method_name(&self) -> &'static str {
16397        match *self {
16398            OpenableRequest::Open { .. } => "open",
16399            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
16400                "unknown one-way method"
16401            }
16402            OpenableRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
16403                "unknown two-way method"
16404            }
16405        }
16406    }
16407}
16408
16409#[derive(Debug, Clone)]
16410pub struct OpenableControlHandle {
16411    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16412}
16413
16414impl fidl::endpoints::ControlHandle for OpenableControlHandle {
16415    fn shutdown(&self) {
16416        self.inner.shutdown()
16417    }
16418
16419    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16420        self.inner.shutdown_with_epitaph(status)
16421    }
16422
16423    fn is_closed(&self) -> bool {
16424        self.inner.channel().is_closed()
16425    }
16426    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16427        self.inner.channel().on_closed()
16428    }
16429
16430    #[cfg(target_os = "fuchsia")]
16431    fn signal_peer(
16432        &self,
16433        clear_mask: zx::Signals,
16434        set_mask: zx::Signals,
16435    ) -> Result<(), zx_status::Status> {
16436        use fidl::Peered;
16437        self.inner.channel().signal_peer(clear_mask, set_mask)
16438    }
16439}
16440
16441impl OpenableControlHandle {}
16442
16443#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16444pub struct ReadableMarker;
16445
16446impl fidl::endpoints::ProtocolMarker for ReadableMarker {
16447    type Proxy = ReadableProxy;
16448    type RequestStream = ReadableRequestStream;
16449    #[cfg(target_os = "fuchsia")]
16450    type SynchronousProxy = ReadableSynchronousProxy;
16451
16452    const DEBUG_NAME: &'static str = "(anonymous) Readable";
16453}
16454pub type ReadableReadResult = Result<Vec<u8>, i32>;
16455
16456pub trait ReadableProxyInterface: Send + Sync {
16457    type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
16458        + Send;
16459    fn r#read(&self, count: u64) -> Self::ReadResponseFut;
16460}
16461#[derive(Debug)]
16462#[cfg(target_os = "fuchsia")]
16463pub struct ReadableSynchronousProxy {
16464    client: fidl::client::sync::Client,
16465}
16466
16467#[cfg(target_os = "fuchsia")]
16468impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
16469    type Proxy = ReadableProxy;
16470    type Protocol = ReadableMarker;
16471
16472    fn from_channel(inner: fidl::Channel) -> Self {
16473        Self::new(inner)
16474    }
16475
16476    fn into_channel(self) -> fidl::Channel {
16477        self.client.into_channel()
16478    }
16479
16480    fn as_channel(&self) -> &fidl::Channel {
16481        self.client.as_channel()
16482    }
16483}
16484
16485#[cfg(target_os = "fuchsia")]
16486impl ReadableSynchronousProxy {
16487    pub fn new(channel: fidl::Channel) -> Self {
16488        Self { client: fidl::client::sync::Client::new(channel) }
16489    }
16490
16491    pub fn into_channel(self) -> fidl::Channel {
16492        self.client.into_channel()
16493    }
16494
16495    /// Waits until an event arrives and returns it. It is safe for other
16496    /// threads to make concurrent requests while waiting for an event.
16497    pub fn wait_for_event(
16498        &self,
16499        deadline: zx::MonotonicInstant,
16500    ) -> Result<ReadableEvent, fidl::Error> {
16501        ReadableEvent::decode(self.client.wait_for_event::<ReadableMarker>(deadline)?)
16502    }
16503
16504    /// Reads up to 'count' bytes at the seek offset.
16505    /// The seek offset is moved forward by the number of bytes read.
16506    ///
16507    /// ## Invariants
16508    ///
16509    /// * The returned `data.length` will never be greater than `count`.
16510    /// * If `data.length` is less than `count`, it means that the seek offset
16511    ///   has reached the end of file as part of this operation.
16512    /// * If `data.length` is zero while `count` is not, it means that the
16513    ///   seek offset is already at or beyond the end of file, and no data could
16514    ///   be read.
16515    /// * If `count` is zero, the server should perform all the checks ensuring
16516    ///   read access without actually read anything, and return an empty
16517    ///   `data` vector.
16518    ///
16519    /// This method requires the [`Rights.READ_BYTES`] right.
16520    ///
16521    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16522    pub fn r#read(
16523        &self,
16524        mut count: u64,
16525        ___deadline: zx::MonotonicInstant,
16526    ) -> Result<ReadableReadResult, fidl::Error> {
16527        let _response = self.client.send_query::<
16528            ReadableReadRequest,
16529            fidl::encoding::ResultType<ReadableReadResponse, i32>,
16530            ReadableMarker,
16531        >(
16532            (count,),
16533            0x57e419a298c8ede,
16534            fidl::encoding::DynamicFlags::empty(),
16535            ___deadline,
16536        )?;
16537        Ok(_response.map(|x| x.data))
16538    }
16539}
16540
16541#[cfg(target_os = "fuchsia")]
16542impl From<ReadableSynchronousProxy> for zx::NullableHandle {
16543    fn from(value: ReadableSynchronousProxy) -> Self {
16544        value.into_channel().into()
16545    }
16546}
16547
16548#[cfg(target_os = "fuchsia")]
16549impl From<fidl::Channel> for ReadableSynchronousProxy {
16550    fn from(value: fidl::Channel) -> Self {
16551        Self::new(value)
16552    }
16553}
16554
16555#[cfg(target_os = "fuchsia")]
16556impl fidl::endpoints::FromClient for ReadableSynchronousProxy {
16557    type Protocol = ReadableMarker;
16558
16559    fn from_client(value: fidl::endpoints::ClientEnd<ReadableMarker>) -> Self {
16560        Self::new(value.into_channel())
16561    }
16562}
16563
16564#[derive(Debug, Clone)]
16565pub struct ReadableProxy {
16566    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
16567}
16568
16569impl fidl::endpoints::Proxy for ReadableProxy {
16570    type Protocol = ReadableMarker;
16571
16572    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
16573        Self::new(inner)
16574    }
16575
16576    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
16577        self.client.into_channel().map_err(|client| Self { client })
16578    }
16579
16580    fn as_channel(&self) -> &::fidl::AsyncChannel {
16581        self.client.as_channel()
16582    }
16583}
16584
16585impl ReadableProxy {
16586    /// Create a new Proxy for fuchsia.io/Readable.
16587    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
16588        let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
16589        Self { client: fidl::client::Client::new(channel, protocol_name) }
16590    }
16591
16592    /// Get a Stream of events from the remote end of the protocol.
16593    ///
16594    /// # Panics
16595    ///
16596    /// Panics if the event stream was already taken.
16597    pub fn take_event_stream(&self) -> ReadableEventStream {
16598        ReadableEventStream { event_receiver: self.client.take_event_receiver() }
16599    }
16600
16601    /// Reads up to 'count' bytes at the seek offset.
16602    /// The seek offset is moved forward by the number of bytes read.
16603    ///
16604    /// ## Invariants
16605    ///
16606    /// * The returned `data.length` will never be greater than `count`.
16607    /// * If `data.length` is less than `count`, it means that the seek offset
16608    ///   has reached the end of file as part of this operation.
16609    /// * If `data.length` is zero while `count` is not, it means that the
16610    ///   seek offset is already at or beyond the end of file, and no data could
16611    ///   be read.
16612    /// * If `count` is zero, the server should perform all the checks ensuring
16613    ///   read access without actually read anything, and return an empty
16614    ///   `data` vector.
16615    ///
16616    /// This method requires the [`Rights.READ_BYTES`] right.
16617    ///
16618    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16619    pub fn r#read(
16620        &self,
16621        mut count: u64,
16622    ) -> fidl::client::QueryResponseFut<
16623        ReadableReadResult,
16624        fidl::encoding::DefaultFuchsiaResourceDialect,
16625    > {
16626        ReadableProxyInterface::r#read(self, count)
16627    }
16628}
16629
16630impl ReadableProxyInterface for ReadableProxy {
16631    type ReadResponseFut = fidl::client::QueryResponseFut<
16632        ReadableReadResult,
16633        fidl::encoding::DefaultFuchsiaResourceDialect,
16634    >;
16635    fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
16636        fn _decode(
16637            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
16638        ) -> Result<ReadableReadResult, fidl::Error> {
16639            let _response = fidl::client::decode_transaction_body::<
16640                fidl::encoding::ResultType<ReadableReadResponse, i32>,
16641                fidl::encoding::DefaultFuchsiaResourceDialect,
16642                0x57e419a298c8ede,
16643            >(_buf?)?;
16644            Ok(_response.map(|x| x.data))
16645        }
16646        self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
16647            (count,),
16648            0x57e419a298c8ede,
16649            fidl::encoding::DynamicFlags::empty(),
16650            _decode,
16651        )
16652    }
16653}
16654
16655pub struct ReadableEventStream {
16656    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
16657}
16658
16659impl std::marker::Unpin for ReadableEventStream {}
16660
16661impl futures::stream::FusedStream for ReadableEventStream {
16662    fn is_terminated(&self) -> bool {
16663        self.event_receiver.is_terminated()
16664    }
16665}
16666
16667impl futures::Stream for ReadableEventStream {
16668    type Item = Result<ReadableEvent, fidl::Error>;
16669
16670    fn poll_next(
16671        mut self: std::pin::Pin<&mut Self>,
16672        cx: &mut std::task::Context<'_>,
16673    ) -> std::task::Poll<Option<Self::Item>> {
16674        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
16675            &mut self.event_receiver,
16676            cx
16677        )?) {
16678            Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
16679            None => std::task::Poll::Ready(None),
16680        }
16681    }
16682}
16683
16684#[derive(Debug)]
16685pub enum ReadableEvent {}
16686
16687impl ReadableEvent {
16688    /// Decodes a message buffer as a [`ReadableEvent`].
16689    fn decode(
16690        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
16691    ) -> Result<ReadableEvent, fidl::Error> {
16692        let (bytes, _handles) = buf.split_mut();
16693        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16694        debug_assert_eq!(tx_header.tx_id, 0);
16695        match tx_header.ordinal {
16696            _ => Err(fidl::Error::UnknownOrdinal {
16697                ordinal: tx_header.ordinal,
16698                protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16699            }),
16700        }
16701    }
16702}
16703
16704/// A Stream of incoming requests for fuchsia.io/Readable.
16705pub struct ReadableRequestStream {
16706    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16707    is_terminated: bool,
16708}
16709
16710impl std::marker::Unpin for ReadableRequestStream {}
16711
16712impl futures::stream::FusedStream for ReadableRequestStream {
16713    fn is_terminated(&self) -> bool {
16714        self.is_terminated
16715    }
16716}
16717
16718impl fidl::endpoints::RequestStream for ReadableRequestStream {
16719    type Protocol = ReadableMarker;
16720    type ControlHandle = ReadableControlHandle;
16721
16722    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
16723        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
16724    }
16725
16726    fn control_handle(&self) -> Self::ControlHandle {
16727        ReadableControlHandle { inner: self.inner.clone() }
16728    }
16729
16730    fn into_inner(
16731        self,
16732    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
16733    {
16734        (self.inner, self.is_terminated)
16735    }
16736
16737    fn from_inner(
16738        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16739        is_terminated: bool,
16740    ) -> Self {
16741        Self { inner, is_terminated }
16742    }
16743}
16744
16745impl futures::Stream for ReadableRequestStream {
16746    type Item = Result<ReadableRequest, fidl::Error>;
16747
16748    fn poll_next(
16749        mut self: std::pin::Pin<&mut Self>,
16750        cx: &mut std::task::Context<'_>,
16751    ) -> std::task::Poll<Option<Self::Item>> {
16752        let this = &mut *self;
16753        if this.inner.check_shutdown(cx) {
16754            this.is_terminated = true;
16755            return std::task::Poll::Ready(None);
16756        }
16757        if this.is_terminated {
16758            panic!("polled ReadableRequestStream after completion");
16759        }
16760        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
16761            |bytes, handles| {
16762                match this.inner.channel().read_etc(cx, bytes, handles) {
16763                    std::task::Poll::Ready(Ok(())) => {}
16764                    std::task::Poll::Pending => return std::task::Poll::Pending,
16765                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
16766                        this.is_terminated = true;
16767                        return std::task::Poll::Ready(None);
16768                    }
16769                    std::task::Poll::Ready(Err(e)) => {
16770                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
16771                            e.into(),
16772                        ))));
16773                    }
16774                }
16775
16776                // A message has been received from the channel
16777                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
16778
16779                std::task::Poll::Ready(Some(match header.ordinal {
16780                    0x57e419a298c8ede => {
16781                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
16782                        let mut req = fidl::new_empty!(
16783                            ReadableReadRequest,
16784                            fidl::encoding::DefaultFuchsiaResourceDialect
16785                        );
16786                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
16787                        let control_handle = ReadableControlHandle { inner: this.inner.clone() };
16788                        Ok(ReadableRequest::Read {
16789                            count: req.count,
16790
16791                            responder: ReadableReadResponder {
16792                                control_handle: std::mem::ManuallyDrop::new(control_handle),
16793                                tx_id: header.tx_id,
16794                            },
16795                        })
16796                    }
16797                    _ => Err(fidl::Error::UnknownOrdinal {
16798                        ordinal: header.ordinal,
16799                        protocol_name:
16800                            <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
16801                    }),
16802                }))
16803            },
16804        )
16805    }
16806}
16807
16808#[derive(Debug)]
16809pub enum ReadableRequest {
16810    /// Reads up to 'count' bytes at the seek offset.
16811    /// The seek offset is moved forward by the number of bytes read.
16812    ///
16813    /// ## Invariants
16814    ///
16815    /// * The returned `data.length` will never be greater than `count`.
16816    /// * If `data.length` is less than `count`, it means that the seek offset
16817    ///   has reached the end of file as part of this operation.
16818    /// * If `data.length` is zero while `count` is not, it means that the
16819    ///   seek offset is already at or beyond the end of file, and no data could
16820    ///   be read.
16821    /// * If `count` is zero, the server should perform all the checks ensuring
16822    ///   read access without actually read anything, and return an empty
16823    ///   `data` vector.
16824    ///
16825    /// This method requires the [`Rights.READ_BYTES`] right.
16826    ///
16827    /// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
16828    Read { count: u64, responder: ReadableReadResponder },
16829}
16830
16831impl ReadableRequest {
16832    #[allow(irrefutable_let_patterns)]
16833    pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
16834        if let ReadableRequest::Read { count, responder } = self {
16835            Some((count, responder))
16836        } else {
16837            None
16838        }
16839    }
16840
16841    /// Name of the method defined in FIDL
16842    pub fn method_name(&self) -> &'static str {
16843        match *self {
16844            ReadableRequest::Read { .. } => "read",
16845        }
16846    }
16847}
16848
16849#[derive(Debug, Clone)]
16850pub struct ReadableControlHandle {
16851    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
16852}
16853
16854impl fidl::endpoints::ControlHandle for ReadableControlHandle {
16855    fn shutdown(&self) {
16856        self.inner.shutdown()
16857    }
16858
16859    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
16860        self.inner.shutdown_with_epitaph(status)
16861    }
16862
16863    fn is_closed(&self) -> bool {
16864        self.inner.channel().is_closed()
16865    }
16866    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
16867        self.inner.channel().on_closed()
16868    }
16869
16870    #[cfg(target_os = "fuchsia")]
16871    fn signal_peer(
16872        &self,
16873        clear_mask: zx::Signals,
16874        set_mask: zx::Signals,
16875    ) -> Result<(), zx_status::Status> {
16876        use fidl::Peered;
16877        self.inner.channel().signal_peer(clear_mask, set_mask)
16878    }
16879}
16880
16881impl ReadableControlHandle {}
16882
16883#[must_use = "FIDL methods require a response to be sent"]
16884#[derive(Debug)]
16885pub struct ReadableReadResponder {
16886    control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
16887    tx_id: u32,
16888}
16889
16890/// Set the the channel to be shutdown (see [`ReadableControlHandle::shutdown`])
16891/// if the responder is dropped without sending a response, so that the client
16892/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
16893impl std::ops::Drop for ReadableReadResponder {
16894    fn drop(&mut self) {
16895        self.control_handle.shutdown();
16896        // Safety: drops once, never accessed again
16897        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16898    }
16899}
16900
16901impl fidl::endpoints::Responder for ReadableReadResponder {
16902    type ControlHandle = ReadableControlHandle;
16903
16904    fn control_handle(&self) -> &ReadableControlHandle {
16905        &self.control_handle
16906    }
16907
16908    fn drop_without_shutdown(mut self) {
16909        // Safety: drops once, never accessed again due to mem::forget
16910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
16911        // Prevent Drop from running (which would shut down the channel)
16912        std::mem::forget(self);
16913    }
16914}
16915
16916impl ReadableReadResponder {
16917    /// Sends a response to the FIDL transaction.
16918    ///
16919    /// Sets the channel to shutdown if an error occurs.
16920    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16921        let _result = self.send_raw(result);
16922        if _result.is_err() {
16923            self.control_handle.shutdown();
16924        }
16925        self.drop_without_shutdown();
16926        _result
16927    }
16928
16929    /// Similar to "send" but does not shutdown the channel if an error occurs.
16930    pub fn send_no_shutdown_on_err(
16931        self,
16932        mut result: Result<&[u8], i32>,
16933    ) -> Result<(), fidl::Error> {
16934        let _result = self.send_raw(result);
16935        self.drop_without_shutdown();
16936        _result
16937    }
16938
16939    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
16940        self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
16941            result.map(|data| (data,)),
16942            self.tx_id,
16943            0x57e419a298c8ede,
16944            fidl::encoding::DynamicFlags::empty(),
16945        )
16946    }
16947}
16948
16949#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
16950pub struct SymlinkMarker;
16951
16952impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
16953    type Proxy = SymlinkProxy;
16954    type RequestStream = SymlinkRequestStream;
16955    #[cfg(target_os = "fuchsia")]
16956    type SynchronousProxy = SymlinkSynchronousProxy;
16957
16958    const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
16959}
16960impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
16961
16962pub trait SymlinkProxyInterface: Send + Sync {
16963    type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
16964        + Send;
16965    fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
16966    fn r#clone(
16967        &self,
16968        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
16969    ) -> Result<(), fidl::Error>;
16970    type CloseResponseFut: std::future::Future<
16971            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
16972        > + Send;
16973    fn r#close(&self) -> Self::CloseResponseFut;
16974    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
16975    fn r#query(&self) -> Self::QueryResponseFut;
16976    fn r#deprecated_clone(
16977        &self,
16978        flags: OpenFlags,
16979        object: fidl::endpoints::ServerEnd<NodeMarker>,
16980    ) -> Result<(), fidl::Error>;
16981    type DeprecatedGetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
16982        + Send;
16983    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut;
16984    type DeprecatedSetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
16985    fn r#deprecated_set_attr(
16986        &self,
16987        flags: NodeAttributeFlags,
16988        attributes: &NodeAttributes,
16989    ) -> Self::DeprecatedSetAttrResponseFut;
16990    type DeprecatedGetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
16991        + Send;
16992    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut;
16993    type DeprecatedSetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
16994        + Send;
16995    fn r#deprecated_set_flags(&self, flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut;
16996    type GetFlagsResponseFut: std::future::Future<Output = Result<NodeGetFlagsResult, fidl::Error>>
16997        + Send;
16998    fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
16999    type SetFlagsResponseFut: std::future::Future<Output = Result<NodeSetFlagsResult, fidl::Error>>
17000        + Send;
17001    fn r#set_flags(&self, flags: Flags) -> Self::SetFlagsResponseFut;
17002    type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
17003        + Send;
17004    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
17005    type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
17006        + Send;
17007    fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
17008    type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
17009        + Send;
17010    fn r#update_attributes(
17011        &self,
17012        payload: &MutableNodeAttributes,
17013    ) -> Self::UpdateAttributesResponseFut;
17014    type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
17015    fn r#sync(&self) -> Self::SyncResponseFut;
17016    fn r#list_extended_attributes(
17017        &self,
17018        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17019    ) -> Result<(), fidl::Error>;
17020    type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
17021        + Send;
17022    fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
17023    type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
17024        + Send;
17025    fn r#set_extended_attribute(
17026        &self,
17027        name: &[u8],
17028        value: ExtendedAttributeValue,
17029        mode: SetExtendedAttributeMode,
17030    ) -> Self::SetExtendedAttributeResponseFut;
17031    type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
17032        + Send;
17033    fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
17034    fn r#open(
17035        &self,
17036        path: &str,
17037        flags: Flags,
17038        options: &Options,
17039        object: fidl::Channel,
17040    ) -> Result<(), fidl::Error>;
17041    type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
17042    fn r#describe(&self) -> Self::DescribeResponseFut;
17043}
17044#[derive(Debug)]
17045#[cfg(target_os = "fuchsia")]
17046pub struct SymlinkSynchronousProxy {
17047    client: fidl::client::sync::Client,
17048}
17049
17050#[cfg(target_os = "fuchsia")]
17051impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
17052    type Proxy = SymlinkProxy;
17053    type Protocol = SymlinkMarker;
17054
17055    fn from_channel(inner: fidl::Channel) -> Self {
17056        Self::new(inner)
17057    }
17058
17059    fn into_channel(self) -> fidl::Channel {
17060        self.client.into_channel()
17061    }
17062
17063    fn as_channel(&self) -> &fidl::Channel {
17064        self.client.as_channel()
17065    }
17066}
17067
17068#[cfg(target_os = "fuchsia")]
17069impl SymlinkSynchronousProxy {
17070    pub fn new(channel: fidl::Channel) -> Self {
17071        Self { client: fidl::client::sync::Client::new(channel) }
17072    }
17073
17074    pub fn into_channel(self) -> fidl::Channel {
17075        self.client.into_channel()
17076    }
17077
17078    /// Waits until an event arrives and returns it. It is safe for other
17079    /// threads to make concurrent requests while waiting for an event.
17080    pub fn wait_for_event(
17081        &self,
17082        deadline: zx::MonotonicInstant,
17083    ) -> Result<SymlinkEvent, fidl::Error> {
17084        SymlinkEvent::decode(self.client.wait_for_event::<SymlinkMarker>(deadline)?)
17085    }
17086
17087    /// Creates a link to this this object with name `dst` in the directory represented by
17088    /// `dst_parent_token`.
17089    ///
17090    /// `dst` must be a resolved object name. Including "/" in the string will return
17091    /// `ZX_ERR_INVALID_ARGS`.
17092    ///
17093    /// This method requires the maximal set of rights supported by the filesystem for this object.
17094    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17095    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17096    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17097    /// `ZX_ERR_ACCESS_DENIED`.
17098    ///
17099    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17100    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17101    ///
17102    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17103    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17104    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17105    ///
17106    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17107    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17108    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17109    pub fn r#link_into(
17110        &self,
17111        mut dst_parent_token: fidl::Event,
17112        mut dst: &str,
17113        ___deadline: zx::MonotonicInstant,
17114    ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17115        let _response = self.client.send_query::<
17116            LinkableLinkIntoRequest,
17117            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17118            SymlinkMarker,
17119        >(
17120            (dst_parent_token, dst,),
17121            0x54f3949246a03e74,
17122            fidl::encoding::DynamicFlags::empty(),
17123            ___deadline,
17124        )?;
17125        Ok(_response.map(|x| x))
17126    }
17127
17128    pub fn r#clone(
17129        &self,
17130        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17131    ) -> Result<(), fidl::Error> {
17132        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17133            (request,),
17134            0x20d8a7aba2168a79,
17135            fidl::encoding::DynamicFlags::empty(),
17136        )
17137    }
17138
17139    /// Terminates the connection.
17140    ///
17141    /// After calling `Close`, the client must not send any other requests.
17142    ///
17143    /// Servers, after sending the status response, should close the connection
17144    /// regardless of status and without sending an epitaph.
17145    ///
17146    /// Closing the client end of the channel should be semantically equivalent
17147    /// to calling `Close` without knowing when the close has completed or its
17148    /// status.
17149    pub fn r#close(
17150        &self,
17151        ___deadline: zx::MonotonicInstant,
17152    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17153        let _response = self.client.send_query::<
17154            fidl::encoding::EmptyPayload,
17155            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17156            SymlinkMarker,
17157        >(
17158            (),
17159            0x5ac5d459ad7f657e,
17160            fidl::encoding::DynamicFlags::empty(),
17161            ___deadline,
17162        )?;
17163        Ok(_response.map(|x| x))
17164    }
17165
17166    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
17167        let _response = self.client.send_query::<
17168            fidl::encoding::EmptyPayload,
17169            fidl_fuchsia_unknown::QueryableQueryResponse,
17170            SymlinkMarker,
17171        >(
17172            (),
17173            0x2658edee9decfc06,
17174            fidl::encoding::DynamicFlags::empty(),
17175            ___deadline,
17176        )?;
17177        Ok(_response.protocol)
17178    }
17179
17180    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17181    pub fn r#deprecated_clone(
17182        &self,
17183        mut flags: OpenFlags,
17184        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17185    ) -> Result<(), fidl::Error> {
17186        self.client.send::<NodeDeprecatedCloneRequest>(
17187            (flags, object),
17188            0x5a61678f293ce16f,
17189            fidl::encoding::DynamicFlags::FLEXIBLE,
17190        )
17191    }
17192
17193    /// DEPRECATED - Use `Node.GetAttributes` instead.
17194    pub fn r#deprecated_get_attr(
17195        &self,
17196        ___deadline: zx::MonotonicInstant,
17197    ) -> Result<(i32, NodeAttributes), fidl::Error> {
17198        let _response = self.client.send_query::<
17199            fidl::encoding::EmptyPayload,
17200            NodeDeprecatedGetAttrResponse,
17201            SymlinkMarker,
17202        >(
17203            (),
17204            0x78985e216314dafd,
17205            fidl::encoding::DynamicFlags::empty(),
17206            ___deadline,
17207        )?;
17208        Ok((_response.s, _response.attributes))
17209    }
17210
17211    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17212    pub fn r#deprecated_set_attr(
17213        &self,
17214        mut flags: NodeAttributeFlags,
17215        mut attributes: &NodeAttributes,
17216        ___deadline: zx::MonotonicInstant,
17217    ) -> Result<i32, fidl::Error> {
17218        let _response = self.client.send_query::<
17219            NodeDeprecatedSetAttrRequest,
17220            NodeDeprecatedSetAttrResponse,
17221            SymlinkMarker,
17222        >(
17223            (flags, attributes,),
17224            0x4186c0f40d938f46,
17225            fidl::encoding::DynamicFlags::empty(),
17226            ___deadline,
17227        )?;
17228        Ok(_response.s)
17229    }
17230
17231    /// [DEPRECATED - Use new GetFlags method instead.]
17232    pub fn r#deprecated_get_flags(
17233        &self,
17234        ___deadline: zx::MonotonicInstant,
17235    ) -> Result<(i32, OpenFlags), fidl::Error> {
17236        let _response = self.client.send_query::<
17237            fidl::encoding::EmptyPayload,
17238            NodeDeprecatedGetFlagsResponse,
17239            SymlinkMarker,
17240        >(
17241            (),
17242            0x5b88fffb8eda3aa1,
17243            fidl::encoding::DynamicFlags::empty(),
17244            ___deadline,
17245        )?;
17246        Ok((_response.s, _response.flags))
17247    }
17248
17249    /// [DEPRECATED - Use new SetFlags method instead.]
17250    pub fn r#deprecated_set_flags(
17251        &self,
17252        mut flags: OpenFlags,
17253        ___deadline: zx::MonotonicInstant,
17254    ) -> Result<i32, fidl::Error> {
17255        let _response = self.client.send_query::<
17256            NodeDeprecatedSetFlagsRequest,
17257            NodeDeprecatedSetFlagsResponse,
17258            SymlinkMarker,
17259        >(
17260            (flags,),
17261            0x5295b76c71fde733,
17262            fidl::encoding::DynamicFlags::empty(),
17263            ___deadline,
17264        )?;
17265        Ok(_response.s)
17266    }
17267
17268    /// Queries the flags that apply to this node after it has been opened/created. This method does
17269    /// not require any rights.
17270    ///
17271    /// Note that the final set of flags that apply to the connection may differ from those
17272    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17273    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17274    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17275    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17276    pub fn r#get_flags(
17277        &self,
17278        ___deadline: zx::MonotonicInstant,
17279    ) -> Result<NodeGetFlagsResult, fidl::Error> {
17280        let _response = self.client.send_query::<
17281            fidl::encoding::EmptyPayload,
17282            fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
17283            SymlinkMarker,
17284        >(
17285            (),
17286            0x176eb318f64ec23,
17287            fidl::encoding::DynamicFlags::FLEXIBLE,
17288            ___deadline,
17289        )?
17290        .into_result::<SymlinkMarker>("get_flags")?;
17291        Ok(_response.map(|x| x.flags))
17292    }
17293
17294    /// Sets the flags that apply to this node after it has been opened. This method does not
17295    /// require any rights.
17296    ///
17297    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17298    /// clear append mode.
17299    ///
17300    /// Errors:
17301    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17302    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17303    pub fn r#set_flags(
17304        &self,
17305        mut flags: Flags,
17306        ___deadline: zx::MonotonicInstant,
17307    ) -> Result<NodeSetFlagsResult, fidl::Error> {
17308        let _response = self.client.send_query::<
17309            NodeSetFlagsRequest,
17310            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
17311            SymlinkMarker,
17312        >(
17313            (flags,),
17314            0x55a8028685791ea8,
17315            fidl::encoding::DynamicFlags::FLEXIBLE,
17316            ___deadline,
17317        )?
17318        .into_result::<SymlinkMarker>("set_flags")?;
17319        Ok(_response.map(|x| x))
17320    }
17321
17322    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17323    /// volume has different settings or the storage is accounted seperately from the rest of the
17324    /// filesystem that may be reported instead of filesystem-wide details.
17325    pub fn r#query_filesystem(
17326        &self,
17327        ___deadline: zx::MonotonicInstant,
17328    ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
17329        let _response = self
17330            .client
17331            .send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse, SymlinkMarker>(
17332                (),
17333                0x6f344a1c6b0a0610,
17334                fidl::encoding::DynamicFlags::empty(),
17335                ___deadline,
17336            )?;
17337        Ok((_response.s, _response.info))
17338    }
17339
17340    /// Acquires information about the node.
17341    ///
17342    /// The attributes of a node should be stable, independent of the
17343    /// specific protocol used to access it.
17344    ///
17345    /// If a particular attribute is not applicable or not supported,
17346    /// filesystems should leave the corresponding field absent.
17347    ///
17348    /// + `query` a bit-mask specifying which attributes to fetch. The server
17349    ///   should not return more than necessary.
17350    /// - `attributes` the returned attributes.
17351    ///
17352    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17353    pub fn r#get_attributes(
17354        &self,
17355        mut query: NodeAttributesQuery,
17356        ___deadline: zx::MonotonicInstant,
17357    ) -> Result<NodeGetAttributesResult, fidl::Error> {
17358        let _response = self.client.send_query::<
17359            NodeGetAttributesRequest,
17360            fidl::encoding::ResultType<NodeAttributes2, i32>,
17361            SymlinkMarker,
17362        >(
17363            (query,),
17364            0x3d4396a638ea053b,
17365            fidl::encoding::DynamicFlags::empty(),
17366            ___deadline,
17367        )?;
17368        Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
17369    }
17370
17371    /// Updates information about the node.
17372    ///
17373    /// + `attributes` the presence of a table field in `attributes` indicates
17374    /// the intent to update the corresponding attribute.
17375    ///
17376    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17377    ///
17378    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17379    pub fn r#update_attributes(
17380        &self,
17381        mut payload: &MutableNodeAttributes,
17382        ___deadline: zx::MonotonicInstant,
17383    ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
17384        let _response = self.client.send_query::<
17385            MutableNodeAttributes,
17386            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17387            SymlinkMarker,
17388        >(
17389            payload,
17390            0x3308c1da5a89bf08,
17391            fidl::encoding::DynamicFlags::empty(),
17392            ___deadline,
17393        )?;
17394        Ok(_response.map(|x| x))
17395    }
17396
17397    /// Synchronizes updates to the node to the underlying media, if it exists.
17398    ///
17399    /// This method will return when the filesystem server has flushed the
17400    /// relevant updates to the underlying media, but does not guarantee the
17401    /// underlying media has persisted the information, nor that any information
17402    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17403    /// between operations.
17404    ///
17405    /// This method does not require any rights.
17406    pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
17407        let _response = self.client.send_query::<
17408            fidl::encoding::EmptyPayload,
17409            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17410            SymlinkMarker,
17411        >(
17412            (),
17413            0x2c5c27ca0ab5dc49,
17414            fidl::encoding::DynamicFlags::empty(),
17415            ___deadline,
17416        )?;
17417        Ok(_response.map(|x| x))
17418    }
17419
17420    /// Creates an iterator over all the extended attribute names associated
17421    /// with this node. If an error occurs it is returned as an epitaph on the
17422    /// iterator request channel, and then the channel is closed.
17423    ///
17424    /// GetExtendedAttributes can be used with any of these names to retrieve
17425    /// the associated value.
17426    ///
17427    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17428    pub fn r#list_extended_attributes(
17429        &self,
17430        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17431    ) -> Result<(), fidl::Error> {
17432        self.client.send::<NodeListExtendedAttributesRequest>(
17433            (iterator,),
17434            0x4b61033de007fcd0,
17435            fidl::encoding::DynamicFlags::empty(),
17436        )
17437    }
17438
17439    /// Get the value associated with the given attribute `name` for this node.
17440    ///
17441    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17442    /// particular structure is imposed on them.
17443    ///
17444    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17445    pub fn r#get_extended_attribute(
17446        &self,
17447        mut name: &[u8],
17448        ___deadline: zx::MonotonicInstant,
17449    ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
17450        let _response = self.client.send_query::<
17451            NodeGetExtendedAttributeRequest,
17452            fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
17453            SymlinkMarker,
17454        >(
17455            (name,),
17456            0x45ffa3ccfdeb76db,
17457            fidl::encoding::DynamicFlags::empty(),
17458            ___deadline,
17459        )?;
17460        Ok(_response.map(|x| x))
17461    }
17462
17463    /// Set the value for the given attribute `name` to `value` for this node.
17464    ///
17465    /// The attribute name may exist, in which case the attribute is updated.
17466    /// If the attribute doesn't exist, it is created. The name should have no
17467    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17468    ///
17469    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17470    pub fn r#set_extended_attribute(
17471        &self,
17472        mut name: &[u8],
17473        mut value: ExtendedAttributeValue,
17474        mut mode: SetExtendedAttributeMode,
17475        ___deadline: zx::MonotonicInstant,
17476    ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
17477        let _response = self.client.send_query::<
17478            NodeSetExtendedAttributeRequest,
17479            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17480            SymlinkMarker,
17481        >(
17482            (name, &mut value, mode,),
17483            0x4a951362f681f23c,
17484            fidl::encoding::DynamicFlags::empty(),
17485            ___deadline,
17486        )?;
17487        Ok(_response.map(|x| x))
17488    }
17489
17490    /// Remove the specified extended attribute.
17491    ///
17492    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17493    ///
17494    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17495    pub fn r#remove_extended_attribute(
17496        &self,
17497        mut name: &[u8],
17498        ___deadline: zx::MonotonicInstant,
17499    ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
17500        let _response = self.client.send_query::<
17501            NodeRemoveExtendedAttributeRequest,
17502            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17503            SymlinkMarker,
17504        >(
17505            (name,),
17506            0x7a0b9f3a9bf9032d,
17507            fidl::encoding::DynamicFlags::empty(),
17508            ___deadline,
17509        )?;
17510        Ok(_response.map(|x| x))
17511    }
17512
17513    /// Open (or create) a node relative to this directory. Any errors are communicated via an
17514    /// epitaph sent on the `object` channel.
17515    ///
17516    /// Errors:
17517    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
17518    /// * See [`Flags`] for other errors which may be communicated based on `flags`
17519    pub fn r#open(
17520        &self,
17521        mut path: &str,
17522        mut flags: Flags,
17523        mut options: &Options,
17524        mut object: fidl::Channel,
17525    ) -> Result<(), fidl::Error> {
17526        self.client.send::<OpenableOpenRequest>(
17527            (path, flags, options, object),
17528            0x568ddcb9a9cbb6d9,
17529            fidl::encoding::DynamicFlags::FLEXIBLE,
17530        )
17531    }
17532
17533    pub fn r#describe(
17534        &self,
17535        ___deadline: zx::MonotonicInstant,
17536    ) -> Result<SymlinkInfo, fidl::Error> {
17537        let _response = self.client.send_query::<
17538            fidl::encoding::EmptyPayload,
17539            fidl::encoding::FlexibleType<SymlinkInfo>,
17540            SymlinkMarker,
17541        >(
17542            (),
17543            0x742c2ea5e89831f3,
17544            fidl::encoding::DynamicFlags::FLEXIBLE,
17545            ___deadline,
17546        )?
17547        .into_result::<SymlinkMarker>("describe")?;
17548        Ok(_response)
17549    }
17550}
17551
17552#[cfg(target_os = "fuchsia")]
17553impl From<SymlinkSynchronousProxy> for zx::NullableHandle {
17554    fn from(value: SymlinkSynchronousProxy) -> Self {
17555        value.into_channel().into()
17556    }
17557}
17558
17559#[cfg(target_os = "fuchsia")]
17560impl From<fidl::Channel> for SymlinkSynchronousProxy {
17561    fn from(value: fidl::Channel) -> Self {
17562        Self::new(value)
17563    }
17564}
17565
17566#[cfg(target_os = "fuchsia")]
17567impl fidl::endpoints::FromClient for SymlinkSynchronousProxy {
17568    type Protocol = SymlinkMarker;
17569
17570    fn from_client(value: fidl::endpoints::ClientEnd<SymlinkMarker>) -> Self {
17571        Self::new(value.into_channel())
17572    }
17573}
17574
17575#[derive(Debug, Clone)]
17576pub struct SymlinkProxy {
17577    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
17578}
17579
17580impl fidl::endpoints::Proxy for SymlinkProxy {
17581    type Protocol = SymlinkMarker;
17582
17583    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
17584        Self::new(inner)
17585    }
17586
17587    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
17588        self.client.into_channel().map_err(|client| Self { client })
17589    }
17590
17591    fn as_channel(&self) -> &::fidl::AsyncChannel {
17592        self.client.as_channel()
17593    }
17594}
17595
17596impl SymlinkProxy {
17597    /// Create a new Proxy for fuchsia.io/Symlink.
17598    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
17599        let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
17600        Self { client: fidl::client::Client::new(channel, protocol_name) }
17601    }
17602
17603    /// Get a Stream of events from the remote end of the protocol.
17604    ///
17605    /// # Panics
17606    ///
17607    /// Panics if the event stream was already taken.
17608    pub fn take_event_stream(&self) -> SymlinkEventStream {
17609        SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
17610    }
17611
17612    /// Creates a link to this this object with name `dst` in the directory represented by
17613    /// `dst_parent_token`.
17614    ///
17615    /// `dst` must be a resolved object name. Including "/" in the string will return
17616    /// `ZX_ERR_INVALID_ARGS`.
17617    ///
17618    /// This method requires the maximal set of rights supported by the filesystem for this object.
17619    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
17620    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
17621    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
17622    /// `ZX_ERR_ACCESS_DENIED`.
17623    ///
17624    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
17625    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
17626    ///
17627    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
17628    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
17629    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
17630    ///
17631    /// This method does not have the same atomicity properties has the `Directory::Link` method,
17632    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
17633    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
17634    pub fn r#link_into(
17635        &self,
17636        mut dst_parent_token: fidl::Event,
17637        mut dst: &str,
17638    ) -> fidl::client::QueryResponseFut<
17639        LinkableLinkIntoResult,
17640        fidl::encoding::DefaultFuchsiaResourceDialect,
17641    > {
17642        SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
17643    }
17644
17645    pub fn r#clone(
17646        &self,
17647        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17648    ) -> Result<(), fidl::Error> {
17649        SymlinkProxyInterface::r#clone(self, request)
17650    }
17651
17652    /// Terminates the connection.
17653    ///
17654    /// After calling `Close`, the client must not send any other requests.
17655    ///
17656    /// Servers, after sending the status response, should close the connection
17657    /// regardless of status and without sending an epitaph.
17658    ///
17659    /// Closing the client end of the channel should be semantically equivalent
17660    /// to calling `Close` without knowing when the close has completed or its
17661    /// status.
17662    pub fn r#close(
17663        &self,
17664    ) -> fidl::client::QueryResponseFut<
17665        fidl_fuchsia_unknown::CloseableCloseResult,
17666        fidl::encoding::DefaultFuchsiaResourceDialect,
17667    > {
17668        SymlinkProxyInterface::r#close(self)
17669    }
17670
17671    pub fn r#query(
17672        &self,
17673    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
17674    {
17675        SymlinkProxyInterface::r#query(self)
17676    }
17677
17678    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
17679    pub fn r#deprecated_clone(
17680        &self,
17681        mut flags: OpenFlags,
17682        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
17683    ) -> Result<(), fidl::Error> {
17684        SymlinkProxyInterface::r#deprecated_clone(self, flags, object)
17685    }
17686
17687    /// DEPRECATED - Use `Node.GetAttributes` instead.
17688    pub fn r#deprecated_get_attr(
17689        &self,
17690    ) -> fidl::client::QueryResponseFut<
17691        (i32, NodeAttributes),
17692        fidl::encoding::DefaultFuchsiaResourceDialect,
17693    > {
17694        SymlinkProxyInterface::r#deprecated_get_attr(self)
17695    }
17696
17697    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
17698    pub fn r#deprecated_set_attr(
17699        &self,
17700        mut flags: NodeAttributeFlags,
17701        mut attributes: &NodeAttributes,
17702    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17703        SymlinkProxyInterface::r#deprecated_set_attr(self, flags, attributes)
17704    }
17705
17706    /// [DEPRECATED - Use new GetFlags method instead.]
17707    pub fn r#deprecated_get_flags(
17708        &self,
17709    ) -> fidl::client::QueryResponseFut<
17710        (i32, OpenFlags),
17711        fidl::encoding::DefaultFuchsiaResourceDialect,
17712    > {
17713        SymlinkProxyInterface::r#deprecated_get_flags(self)
17714    }
17715
17716    /// [DEPRECATED - Use new SetFlags method instead.]
17717    pub fn r#deprecated_set_flags(
17718        &self,
17719        mut flags: OpenFlags,
17720    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
17721        SymlinkProxyInterface::r#deprecated_set_flags(self, flags)
17722    }
17723
17724    /// Queries the flags that apply to this node after it has been opened/created. This method does
17725    /// not require any rights.
17726    ///
17727    /// Note that the final set of flags that apply to the connection may differ from those
17728    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
17729    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
17730    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
17731    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
17732    pub fn r#get_flags(
17733        &self,
17734    ) -> fidl::client::QueryResponseFut<
17735        NodeGetFlagsResult,
17736        fidl::encoding::DefaultFuchsiaResourceDialect,
17737    > {
17738        SymlinkProxyInterface::r#get_flags(self)
17739    }
17740
17741    /// Sets the flags that apply to this node after it has been opened. This method does not
17742    /// require any rights.
17743    ///
17744    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
17745    /// clear append mode.
17746    ///
17747    /// Errors:
17748    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
17749    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
17750    pub fn r#set_flags(
17751        &self,
17752        mut flags: Flags,
17753    ) -> fidl::client::QueryResponseFut<
17754        NodeSetFlagsResult,
17755        fidl::encoding::DefaultFuchsiaResourceDialect,
17756    > {
17757        SymlinkProxyInterface::r#set_flags(self, flags)
17758    }
17759
17760    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
17761    /// volume has different settings or the storage is accounted seperately from the rest of the
17762    /// filesystem that may be reported instead of filesystem-wide details.
17763    pub fn r#query_filesystem(
17764        &self,
17765    ) -> fidl::client::QueryResponseFut<
17766        (i32, Option<Box<FilesystemInfo>>),
17767        fidl::encoding::DefaultFuchsiaResourceDialect,
17768    > {
17769        SymlinkProxyInterface::r#query_filesystem(self)
17770    }
17771
17772    /// Acquires information about the node.
17773    ///
17774    /// The attributes of a node should be stable, independent of the
17775    /// specific protocol used to access it.
17776    ///
17777    /// If a particular attribute is not applicable or not supported,
17778    /// filesystems should leave the corresponding field absent.
17779    ///
17780    /// + `query` a bit-mask specifying which attributes to fetch. The server
17781    ///   should not return more than necessary.
17782    /// - `attributes` the returned attributes.
17783    ///
17784    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17785    pub fn r#get_attributes(
17786        &self,
17787        mut query: NodeAttributesQuery,
17788    ) -> fidl::client::QueryResponseFut<
17789        NodeGetAttributesResult,
17790        fidl::encoding::DefaultFuchsiaResourceDialect,
17791    > {
17792        SymlinkProxyInterface::r#get_attributes(self, query)
17793    }
17794
17795    /// Updates information about the node.
17796    ///
17797    /// + `attributes` the presence of a table field in `attributes` indicates
17798    /// the intent to update the corresponding attribute.
17799    ///
17800    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
17801    ///
17802    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17803    pub fn r#update_attributes(
17804        &self,
17805        mut payload: &MutableNodeAttributes,
17806    ) -> fidl::client::QueryResponseFut<
17807        NodeUpdateAttributesResult,
17808        fidl::encoding::DefaultFuchsiaResourceDialect,
17809    > {
17810        SymlinkProxyInterface::r#update_attributes(self, payload)
17811    }
17812
17813    /// Synchronizes updates to the node to the underlying media, if it exists.
17814    ///
17815    /// This method will return when the filesystem server has flushed the
17816    /// relevant updates to the underlying media, but does not guarantee the
17817    /// underlying media has persisted the information, nor that any information
17818    /// is committed to hardware. Clients may use `Sync` to ensure ordering
17819    /// between operations.
17820    ///
17821    /// This method does not require any rights.
17822    pub fn r#sync(
17823        &self,
17824    ) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
17825    {
17826        SymlinkProxyInterface::r#sync(self)
17827    }
17828
17829    /// Creates an iterator over all the extended attribute names associated
17830    /// with this node. If an error occurs it is returned as an epitaph on the
17831    /// iterator request channel, and then the channel is closed.
17832    ///
17833    /// GetExtendedAttributes can be used with any of these names to retrieve
17834    /// the associated value.
17835    ///
17836    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17837    pub fn r#list_extended_attributes(
17838        &self,
17839        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
17840    ) -> Result<(), fidl::Error> {
17841        SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
17842    }
17843
17844    /// Get the value associated with the given attribute `name` for this node.
17845    ///
17846    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
17847    /// particular structure is imposed on them.
17848    ///
17849    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
17850    pub fn r#get_extended_attribute(
17851        &self,
17852        mut name: &[u8],
17853    ) -> fidl::client::QueryResponseFut<
17854        NodeGetExtendedAttributeResult,
17855        fidl::encoding::DefaultFuchsiaResourceDialect,
17856    > {
17857        SymlinkProxyInterface::r#get_extended_attribute(self, name)
17858    }
17859
17860    /// Set the value for the given attribute `name` to `value` for this node.
17861    ///
17862    /// The attribute name may exist, in which case the attribute is updated.
17863    /// If the attribute doesn't exist, it is created. The name should have no
17864    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
17865    ///
17866    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17867    pub fn r#set_extended_attribute(
17868        &self,
17869        mut name: &[u8],
17870        mut value: ExtendedAttributeValue,
17871        mut mode: SetExtendedAttributeMode,
17872    ) -> fidl::client::QueryResponseFut<
17873        NodeSetExtendedAttributeResult,
17874        fidl::encoding::DefaultFuchsiaResourceDialect,
17875    > {
17876        SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
17877    }
17878
17879    /// Remove the specified extended attribute.
17880    ///
17881    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
17882    ///
17883    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
17884    pub fn r#remove_extended_attribute(
17885        &self,
17886        mut name: &[u8],
17887    ) -> fidl::client::QueryResponseFut<
17888        NodeRemoveExtendedAttributeResult,
17889        fidl::encoding::DefaultFuchsiaResourceDialect,
17890    > {
17891        SymlinkProxyInterface::r#remove_extended_attribute(self, name)
17892    }
17893
17894    /// Open (or create) a node relative to this directory. Any errors are communicated via an
17895    /// epitaph sent on the `object` channel.
17896    ///
17897    /// Errors:
17898    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
17899    /// * See [`Flags`] for other errors which may be communicated based on `flags`
17900    pub fn r#open(
17901        &self,
17902        mut path: &str,
17903        mut flags: Flags,
17904        mut options: &Options,
17905        mut object: fidl::Channel,
17906    ) -> Result<(), fidl::Error> {
17907        SymlinkProxyInterface::r#open(self, path, flags, options, object)
17908    }
17909
17910    pub fn r#describe(
17911        &self,
17912    ) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
17913    {
17914        SymlinkProxyInterface::r#describe(self)
17915    }
17916}
17917
17918impl SymlinkProxyInterface for SymlinkProxy {
17919    type LinkIntoResponseFut = fidl::client::QueryResponseFut<
17920        LinkableLinkIntoResult,
17921        fidl::encoding::DefaultFuchsiaResourceDialect,
17922    >;
17923    fn r#link_into(
17924        &self,
17925        mut dst_parent_token: fidl::Event,
17926        mut dst: &str,
17927    ) -> Self::LinkIntoResponseFut {
17928        fn _decode(
17929            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17930        ) -> Result<LinkableLinkIntoResult, fidl::Error> {
17931            let _response = fidl::client::decode_transaction_body::<
17932                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17933                fidl::encoding::DefaultFuchsiaResourceDialect,
17934                0x54f3949246a03e74,
17935            >(_buf?)?;
17936            Ok(_response.map(|x| x))
17937        }
17938        self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
17939            (dst_parent_token, dst),
17940            0x54f3949246a03e74,
17941            fidl::encoding::DynamicFlags::empty(),
17942            _decode,
17943        )
17944    }
17945
17946    fn r#clone(
17947        &self,
17948        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
17949    ) -> Result<(), fidl::Error> {
17950        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
17951            (request,),
17952            0x20d8a7aba2168a79,
17953            fidl::encoding::DynamicFlags::empty(),
17954        )
17955    }
17956
17957    type CloseResponseFut = fidl::client::QueryResponseFut<
17958        fidl_fuchsia_unknown::CloseableCloseResult,
17959        fidl::encoding::DefaultFuchsiaResourceDialect,
17960    >;
17961    fn r#close(&self) -> Self::CloseResponseFut {
17962        fn _decode(
17963            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17964        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
17965            let _response = fidl::client::decode_transaction_body::<
17966                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
17967                fidl::encoding::DefaultFuchsiaResourceDialect,
17968                0x5ac5d459ad7f657e,
17969            >(_buf?)?;
17970            Ok(_response.map(|x| x))
17971        }
17972        self.client.send_query_and_decode::<
17973            fidl::encoding::EmptyPayload,
17974            fidl_fuchsia_unknown::CloseableCloseResult,
17975        >(
17976            (),
17977            0x5ac5d459ad7f657e,
17978            fidl::encoding::DynamicFlags::empty(),
17979            _decode,
17980        )
17981    }
17982
17983    type QueryResponseFut =
17984        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
17985    fn r#query(&self) -> Self::QueryResponseFut {
17986        fn _decode(
17987            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
17988        ) -> Result<Vec<u8>, fidl::Error> {
17989            let _response = fidl::client::decode_transaction_body::<
17990                fidl_fuchsia_unknown::QueryableQueryResponse,
17991                fidl::encoding::DefaultFuchsiaResourceDialect,
17992                0x2658edee9decfc06,
17993            >(_buf?)?;
17994            Ok(_response.protocol)
17995        }
17996        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
17997            (),
17998            0x2658edee9decfc06,
17999            fidl::encoding::DynamicFlags::empty(),
18000            _decode,
18001        )
18002    }
18003
18004    fn r#deprecated_clone(
18005        &self,
18006        mut flags: OpenFlags,
18007        mut object: fidl::endpoints::ServerEnd<NodeMarker>,
18008    ) -> Result<(), fidl::Error> {
18009        self.client.send::<NodeDeprecatedCloneRequest>(
18010            (flags, object),
18011            0x5a61678f293ce16f,
18012            fidl::encoding::DynamicFlags::FLEXIBLE,
18013        )
18014    }
18015
18016    type DeprecatedGetAttrResponseFut = fidl::client::QueryResponseFut<
18017        (i32, NodeAttributes),
18018        fidl::encoding::DefaultFuchsiaResourceDialect,
18019    >;
18020    fn r#deprecated_get_attr(&self) -> Self::DeprecatedGetAttrResponseFut {
18021        fn _decode(
18022            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18023        ) -> Result<(i32, NodeAttributes), fidl::Error> {
18024            let _response = fidl::client::decode_transaction_body::<
18025                NodeDeprecatedGetAttrResponse,
18026                fidl::encoding::DefaultFuchsiaResourceDialect,
18027                0x78985e216314dafd,
18028            >(_buf?)?;
18029            Ok((_response.s, _response.attributes))
18030        }
18031        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
18032            (),
18033            0x78985e216314dafd,
18034            fidl::encoding::DynamicFlags::empty(),
18035            _decode,
18036        )
18037    }
18038
18039    type DeprecatedSetAttrResponseFut =
18040        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18041    fn r#deprecated_set_attr(
18042        &self,
18043        mut flags: NodeAttributeFlags,
18044        mut attributes: &NodeAttributes,
18045    ) -> Self::DeprecatedSetAttrResponseFut {
18046        fn _decode(
18047            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18048        ) -> Result<i32, fidl::Error> {
18049            let _response = fidl::client::decode_transaction_body::<
18050                NodeDeprecatedSetAttrResponse,
18051                fidl::encoding::DefaultFuchsiaResourceDialect,
18052                0x4186c0f40d938f46,
18053            >(_buf?)?;
18054            Ok(_response.s)
18055        }
18056        self.client.send_query_and_decode::<NodeDeprecatedSetAttrRequest, i32>(
18057            (flags, attributes),
18058            0x4186c0f40d938f46,
18059            fidl::encoding::DynamicFlags::empty(),
18060            _decode,
18061        )
18062    }
18063
18064    type DeprecatedGetFlagsResponseFut = fidl::client::QueryResponseFut<
18065        (i32, OpenFlags),
18066        fidl::encoding::DefaultFuchsiaResourceDialect,
18067    >;
18068    fn r#deprecated_get_flags(&self) -> Self::DeprecatedGetFlagsResponseFut {
18069        fn _decode(
18070            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18071        ) -> Result<(i32, OpenFlags), fidl::Error> {
18072            let _response = fidl::client::decode_transaction_body::<
18073                NodeDeprecatedGetFlagsResponse,
18074                fidl::encoding::DefaultFuchsiaResourceDialect,
18075                0x5b88fffb8eda3aa1,
18076            >(_buf?)?;
18077            Ok((_response.s, _response.flags))
18078        }
18079        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
18080            (),
18081            0x5b88fffb8eda3aa1,
18082            fidl::encoding::DynamicFlags::empty(),
18083            _decode,
18084        )
18085    }
18086
18087    type DeprecatedSetFlagsResponseFut =
18088        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
18089    fn r#deprecated_set_flags(&self, mut flags: OpenFlags) -> Self::DeprecatedSetFlagsResponseFut {
18090        fn _decode(
18091            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18092        ) -> Result<i32, fidl::Error> {
18093            let _response = fidl::client::decode_transaction_body::<
18094                NodeDeprecatedSetFlagsResponse,
18095                fidl::encoding::DefaultFuchsiaResourceDialect,
18096                0x5295b76c71fde733,
18097            >(_buf?)?;
18098            Ok(_response.s)
18099        }
18100        self.client.send_query_and_decode::<NodeDeprecatedSetFlagsRequest, i32>(
18101            (flags,),
18102            0x5295b76c71fde733,
18103            fidl::encoding::DynamicFlags::empty(),
18104            _decode,
18105        )
18106    }
18107
18108    type GetFlagsResponseFut = fidl::client::QueryResponseFut<
18109        NodeGetFlagsResult,
18110        fidl::encoding::DefaultFuchsiaResourceDialect,
18111    >;
18112    fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
18113        fn _decode(
18114            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18115        ) -> Result<NodeGetFlagsResult, fidl::Error> {
18116            let _response = fidl::client::decode_transaction_body::<
18117                fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>,
18118                fidl::encoding::DefaultFuchsiaResourceDialect,
18119                0x176eb318f64ec23,
18120            >(_buf?)?
18121            .into_result::<SymlinkMarker>("get_flags")?;
18122            Ok(_response.map(|x| x.flags))
18123        }
18124        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeGetFlagsResult>(
18125            (),
18126            0x176eb318f64ec23,
18127            fidl::encoding::DynamicFlags::FLEXIBLE,
18128            _decode,
18129        )
18130    }
18131
18132    type SetFlagsResponseFut = fidl::client::QueryResponseFut<
18133        NodeSetFlagsResult,
18134        fidl::encoding::DefaultFuchsiaResourceDialect,
18135    >;
18136    fn r#set_flags(&self, mut flags: Flags) -> Self::SetFlagsResponseFut {
18137        fn _decode(
18138            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18139        ) -> Result<NodeSetFlagsResult, fidl::Error> {
18140            let _response = fidl::client::decode_transaction_body::<
18141                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
18142                fidl::encoding::DefaultFuchsiaResourceDialect,
18143                0x55a8028685791ea8,
18144            >(_buf?)?
18145            .into_result::<SymlinkMarker>("set_flags")?;
18146            Ok(_response.map(|x| x))
18147        }
18148        self.client.send_query_and_decode::<NodeSetFlagsRequest, NodeSetFlagsResult>(
18149            (flags,),
18150            0x55a8028685791ea8,
18151            fidl::encoding::DynamicFlags::FLEXIBLE,
18152            _decode,
18153        )
18154    }
18155
18156    type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
18157        (i32, Option<Box<FilesystemInfo>>),
18158        fidl::encoding::DefaultFuchsiaResourceDialect,
18159    >;
18160    fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
18161        fn _decode(
18162            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18163        ) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
18164            let _response = fidl::client::decode_transaction_body::<
18165                NodeQueryFilesystemResponse,
18166                fidl::encoding::DefaultFuchsiaResourceDialect,
18167                0x6f344a1c6b0a0610,
18168            >(_buf?)?;
18169            Ok((_response.s, _response.info))
18170        }
18171        self.client.send_query_and_decode::<
18172            fidl::encoding::EmptyPayload,
18173            (i32, Option<Box<FilesystemInfo>>),
18174        >(
18175            (),
18176            0x6f344a1c6b0a0610,
18177            fidl::encoding::DynamicFlags::empty(),
18178            _decode,
18179        )
18180    }
18181
18182    type GetAttributesResponseFut = fidl::client::QueryResponseFut<
18183        NodeGetAttributesResult,
18184        fidl::encoding::DefaultFuchsiaResourceDialect,
18185    >;
18186    fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
18187        fn _decode(
18188            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18189        ) -> Result<NodeGetAttributesResult, fidl::Error> {
18190            let _response = fidl::client::decode_transaction_body::<
18191                fidl::encoding::ResultType<NodeAttributes2, i32>,
18192                fidl::encoding::DefaultFuchsiaResourceDialect,
18193                0x3d4396a638ea053b,
18194            >(_buf?)?;
18195            Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
18196        }
18197        self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
18198            (query,),
18199            0x3d4396a638ea053b,
18200            fidl::encoding::DynamicFlags::empty(),
18201            _decode,
18202        )
18203    }
18204
18205    type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
18206        NodeUpdateAttributesResult,
18207        fidl::encoding::DefaultFuchsiaResourceDialect,
18208    >;
18209    fn r#update_attributes(
18210        &self,
18211        mut payload: &MutableNodeAttributes,
18212    ) -> Self::UpdateAttributesResponseFut {
18213        fn _decode(
18214            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18215        ) -> Result<NodeUpdateAttributesResult, fidl::Error> {
18216            let _response = fidl::client::decode_transaction_body::<
18217                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18218                fidl::encoding::DefaultFuchsiaResourceDialect,
18219                0x3308c1da5a89bf08,
18220            >(_buf?)?;
18221            Ok(_response.map(|x| x))
18222        }
18223        self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
18224            payload,
18225            0x3308c1da5a89bf08,
18226            fidl::encoding::DynamicFlags::empty(),
18227            _decode,
18228        )
18229    }
18230
18231    type SyncResponseFut = fidl::client::QueryResponseFut<
18232        NodeSyncResult,
18233        fidl::encoding::DefaultFuchsiaResourceDialect,
18234    >;
18235    fn r#sync(&self) -> Self::SyncResponseFut {
18236        fn _decode(
18237            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18238        ) -> Result<NodeSyncResult, fidl::Error> {
18239            let _response = fidl::client::decode_transaction_body::<
18240                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18241                fidl::encoding::DefaultFuchsiaResourceDialect,
18242                0x2c5c27ca0ab5dc49,
18243            >(_buf?)?;
18244            Ok(_response.map(|x| x))
18245        }
18246        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
18247            (),
18248            0x2c5c27ca0ab5dc49,
18249            fidl::encoding::DynamicFlags::empty(),
18250            _decode,
18251        )
18252    }
18253
18254    fn r#list_extended_attributes(
18255        &self,
18256        mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
18257    ) -> Result<(), fidl::Error> {
18258        self.client.send::<NodeListExtendedAttributesRequest>(
18259            (iterator,),
18260            0x4b61033de007fcd0,
18261            fidl::encoding::DynamicFlags::empty(),
18262        )
18263    }
18264
18265    type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18266        NodeGetExtendedAttributeResult,
18267        fidl::encoding::DefaultFuchsiaResourceDialect,
18268    >;
18269    fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
18270        fn _decode(
18271            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18272        ) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
18273            let _response = fidl::client::decode_transaction_body::<
18274                fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
18275                fidl::encoding::DefaultFuchsiaResourceDialect,
18276                0x45ffa3ccfdeb76db,
18277            >(_buf?)?;
18278            Ok(_response.map(|x| x))
18279        }
18280        self.client.send_query_and_decode::<
18281            NodeGetExtendedAttributeRequest,
18282            NodeGetExtendedAttributeResult,
18283        >(
18284            (name,),
18285            0x45ffa3ccfdeb76db,
18286            fidl::encoding::DynamicFlags::empty(),
18287            _decode,
18288        )
18289    }
18290
18291    type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18292        NodeSetExtendedAttributeResult,
18293        fidl::encoding::DefaultFuchsiaResourceDialect,
18294    >;
18295    fn r#set_extended_attribute(
18296        &self,
18297        mut name: &[u8],
18298        mut value: ExtendedAttributeValue,
18299        mut mode: SetExtendedAttributeMode,
18300    ) -> Self::SetExtendedAttributeResponseFut {
18301        fn _decode(
18302            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18303        ) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
18304            let _response = fidl::client::decode_transaction_body::<
18305                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18306                fidl::encoding::DefaultFuchsiaResourceDialect,
18307                0x4a951362f681f23c,
18308            >(_buf?)?;
18309            Ok(_response.map(|x| x))
18310        }
18311        self.client.send_query_and_decode::<
18312            NodeSetExtendedAttributeRequest,
18313            NodeSetExtendedAttributeResult,
18314        >(
18315            (name, &mut value, mode,),
18316            0x4a951362f681f23c,
18317            fidl::encoding::DynamicFlags::empty(),
18318            _decode,
18319        )
18320    }
18321
18322    type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
18323        NodeRemoveExtendedAttributeResult,
18324        fidl::encoding::DefaultFuchsiaResourceDialect,
18325    >;
18326    fn r#remove_extended_attribute(
18327        &self,
18328        mut name: &[u8],
18329    ) -> Self::RemoveExtendedAttributeResponseFut {
18330        fn _decode(
18331            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18332        ) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
18333            let _response = fidl::client::decode_transaction_body::<
18334                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
18335                fidl::encoding::DefaultFuchsiaResourceDialect,
18336                0x7a0b9f3a9bf9032d,
18337            >(_buf?)?;
18338            Ok(_response.map(|x| x))
18339        }
18340        self.client.send_query_and_decode::<
18341            NodeRemoveExtendedAttributeRequest,
18342            NodeRemoveExtendedAttributeResult,
18343        >(
18344            (name,),
18345            0x7a0b9f3a9bf9032d,
18346            fidl::encoding::DynamicFlags::empty(),
18347            _decode,
18348        )
18349    }
18350
18351    fn r#open(
18352        &self,
18353        mut path: &str,
18354        mut flags: Flags,
18355        mut options: &Options,
18356        mut object: fidl::Channel,
18357    ) -> Result<(), fidl::Error> {
18358        self.client.send::<OpenableOpenRequest>(
18359            (path, flags, options, object),
18360            0x568ddcb9a9cbb6d9,
18361            fidl::encoding::DynamicFlags::FLEXIBLE,
18362        )
18363    }
18364
18365    type DescribeResponseFut =
18366        fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
18367    fn r#describe(&self) -> Self::DescribeResponseFut {
18368        fn _decode(
18369            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
18370        ) -> Result<SymlinkInfo, fidl::Error> {
18371            let _response = fidl::client::decode_transaction_body::<
18372                fidl::encoding::FlexibleType<SymlinkInfo>,
18373                fidl::encoding::DefaultFuchsiaResourceDialect,
18374                0x742c2ea5e89831f3,
18375            >(_buf?)?
18376            .into_result::<SymlinkMarker>("describe")?;
18377            Ok(_response)
18378        }
18379        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
18380            (),
18381            0x742c2ea5e89831f3,
18382            fidl::encoding::DynamicFlags::FLEXIBLE,
18383            _decode,
18384        )
18385    }
18386}
18387
18388pub struct SymlinkEventStream {
18389    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
18390}
18391
18392impl std::marker::Unpin for SymlinkEventStream {}
18393
18394impl futures::stream::FusedStream for SymlinkEventStream {
18395    fn is_terminated(&self) -> bool {
18396        self.event_receiver.is_terminated()
18397    }
18398}
18399
18400impl futures::Stream for SymlinkEventStream {
18401    type Item = Result<SymlinkEvent, fidl::Error>;
18402
18403    fn poll_next(
18404        mut self: std::pin::Pin<&mut Self>,
18405        cx: &mut std::task::Context<'_>,
18406    ) -> std::task::Poll<Option<Self::Item>> {
18407        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
18408            &mut self.event_receiver,
18409            cx
18410        )?) {
18411            Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
18412            None => std::task::Poll::Ready(None),
18413        }
18414    }
18415}
18416
18417#[derive(Debug)]
18418pub enum SymlinkEvent {
18419    OnOpen_ {
18420        s: i32,
18421        info: Option<Box<NodeInfoDeprecated>>,
18422    },
18423    OnRepresentation {
18424        payload: Representation,
18425    },
18426    #[non_exhaustive]
18427    _UnknownEvent {
18428        /// Ordinal of the event that was sent.
18429        ordinal: u64,
18430    },
18431}
18432
18433impl SymlinkEvent {
18434    #[allow(irrefutable_let_patterns)]
18435    pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
18436        if let SymlinkEvent::OnOpen_ { s, info } = self { Some((s, info)) } else { None }
18437    }
18438    #[allow(irrefutable_let_patterns)]
18439    pub fn into_on_representation(self) -> Option<Representation> {
18440        if let SymlinkEvent::OnRepresentation { payload } = self { Some((payload)) } else { None }
18441    }
18442
18443    /// Decodes a message buffer as a [`SymlinkEvent`].
18444    fn decode(
18445        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
18446    ) -> Result<SymlinkEvent, fidl::Error> {
18447        let (bytes, _handles) = buf.split_mut();
18448        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18449        debug_assert_eq!(tx_header.tx_id, 0);
18450        match tx_header.ordinal {
18451            0x7fc7bbb1dbfd1972 => {
18452                let mut out = fidl::new_empty!(
18453                    NodeOnOpenRequest,
18454                    fidl::encoding::DefaultFuchsiaResourceDialect
18455                );
18456                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
18457                Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
18458            }
18459            0x5cb40567d80a510c => {
18460                let mut out =
18461                    fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
18462                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
18463                Ok((SymlinkEvent::OnRepresentation { payload: out }))
18464            }
18465            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
18466                Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
18467            }
18468            _ => Err(fidl::Error::UnknownOrdinal {
18469                ordinal: tx_header.ordinal,
18470                protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18471            }),
18472        }
18473    }
18474}
18475
18476/// A Stream of incoming requests for fuchsia.io/Symlink.
18477pub struct SymlinkRequestStream {
18478    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18479    is_terminated: bool,
18480}
18481
18482impl std::marker::Unpin for SymlinkRequestStream {}
18483
18484impl futures::stream::FusedStream for SymlinkRequestStream {
18485    fn is_terminated(&self) -> bool {
18486        self.is_terminated
18487    }
18488}
18489
18490impl fidl::endpoints::RequestStream for SymlinkRequestStream {
18491    type Protocol = SymlinkMarker;
18492    type ControlHandle = SymlinkControlHandle;
18493
18494    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
18495        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
18496    }
18497
18498    fn control_handle(&self) -> Self::ControlHandle {
18499        SymlinkControlHandle { inner: self.inner.clone() }
18500    }
18501
18502    fn into_inner(
18503        self,
18504    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
18505    {
18506        (self.inner, self.is_terminated)
18507    }
18508
18509    fn from_inner(
18510        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
18511        is_terminated: bool,
18512    ) -> Self {
18513        Self { inner, is_terminated }
18514    }
18515}
18516
18517impl futures::Stream for SymlinkRequestStream {
18518    type Item = Result<SymlinkRequest, fidl::Error>;
18519
18520    fn poll_next(
18521        mut self: std::pin::Pin<&mut Self>,
18522        cx: &mut std::task::Context<'_>,
18523    ) -> std::task::Poll<Option<Self::Item>> {
18524        let this = &mut *self;
18525        if this.inner.check_shutdown(cx) {
18526            this.is_terminated = true;
18527            return std::task::Poll::Ready(None);
18528        }
18529        if this.is_terminated {
18530            panic!("polled SymlinkRequestStream after completion");
18531        }
18532        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
18533            |bytes, handles| {
18534                match this.inner.channel().read_etc(cx, bytes, handles) {
18535                    std::task::Poll::Ready(Ok(())) => {}
18536                    std::task::Poll::Pending => return std::task::Poll::Pending,
18537                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
18538                        this.is_terminated = true;
18539                        return std::task::Poll::Ready(None);
18540                    }
18541                    std::task::Poll::Ready(Err(e)) => {
18542                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
18543                            e.into(),
18544                        ))));
18545                    }
18546                }
18547
18548                // A message has been received from the channel
18549                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
18550
18551                std::task::Poll::Ready(Some(match header.ordinal {
18552                    0x54f3949246a03e74 => {
18553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18554                        let mut req = fidl::new_empty!(
18555                            LinkableLinkIntoRequest,
18556                            fidl::encoding::DefaultFuchsiaResourceDialect
18557                        );
18558                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
18559                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18560                        Ok(SymlinkRequest::LinkInto {
18561                            dst_parent_token: req.dst_parent_token,
18562                            dst: req.dst,
18563
18564                            responder: SymlinkLinkIntoResponder {
18565                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18566                                tx_id: header.tx_id,
18567                            },
18568                        })
18569                    }
18570                    0x20d8a7aba2168a79 => {
18571                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18572                        let mut req = fidl::new_empty!(
18573                            fidl_fuchsia_unknown::CloneableCloneRequest,
18574                            fidl::encoding::DefaultFuchsiaResourceDialect
18575                        );
18576                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18577                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18578                        Ok(SymlinkRequest::Clone { request: req.request, control_handle })
18579                    }
18580                    0x5ac5d459ad7f657e => {
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::Close {
18589                            responder: SymlinkCloseResponder {
18590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18591                                tx_id: header.tx_id,
18592                            },
18593                        })
18594                    }
18595                    0x2658edee9decfc06 => {
18596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18597                        let mut req = fidl::new_empty!(
18598                            fidl::encoding::EmptyPayload,
18599                            fidl::encoding::DefaultFuchsiaResourceDialect
18600                        );
18601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18602                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18603                        Ok(SymlinkRequest::Query {
18604                            responder: SymlinkQueryResponder {
18605                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18606                                tx_id: header.tx_id,
18607                            },
18608                        })
18609                    }
18610                    0x5a61678f293ce16f => {
18611                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18612                        let mut req = fidl::new_empty!(
18613                            NodeDeprecatedCloneRequest,
18614                            fidl::encoding::DefaultFuchsiaResourceDialect
18615                        );
18616                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedCloneRequest>(&header, _body_bytes, handles, &mut req)?;
18617                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18618                        Ok(SymlinkRequest::DeprecatedClone {
18619                            flags: req.flags,
18620                            object: req.object,
18621
18622                            control_handle,
18623                        })
18624                    }
18625                    0x78985e216314dafd => {
18626                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18627                        let mut req = fidl::new_empty!(
18628                            fidl::encoding::EmptyPayload,
18629                            fidl::encoding::DefaultFuchsiaResourceDialect
18630                        );
18631                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18632                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18633                        Ok(SymlinkRequest::DeprecatedGetAttr {
18634                            responder: SymlinkDeprecatedGetAttrResponder {
18635                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18636                                tx_id: header.tx_id,
18637                            },
18638                        })
18639                    }
18640                    0x4186c0f40d938f46 => {
18641                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18642                        let mut req = fidl::new_empty!(
18643                            NodeDeprecatedSetAttrRequest,
18644                            fidl::encoding::DefaultFuchsiaResourceDialect
18645                        );
18646                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
18647                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18648                        Ok(SymlinkRequest::DeprecatedSetAttr {
18649                            flags: req.flags,
18650                            attributes: req.attributes,
18651
18652                            responder: SymlinkDeprecatedSetAttrResponder {
18653                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18654                                tx_id: header.tx_id,
18655                            },
18656                        })
18657                    }
18658                    0x5b88fffb8eda3aa1 => {
18659                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18660                        let mut req = fidl::new_empty!(
18661                            fidl::encoding::EmptyPayload,
18662                            fidl::encoding::DefaultFuchsiaResourceDialect
18663                        );
18664                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18665                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18666                        Ok(SymlinkRequest::DeprecatedGetFlags {
18667                            responder: SymlinkDeprecatedGetFlagsResponder {
18668                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18669                                tx_id: header.tx_id,
18670                            },
18671                        })
18672                    }
18673                    0x5295b76c71fde733 => {
18674                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18675                        let mut req = fidl::new_empty!(
18676                            NodeDeprecatedSetFlagsRequest,
18677                            fidl::encoding::DefaultFuchsiaResourceDialect
18678                        );
18679                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeDeprecatedSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18680                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18681                        Ok(SymlinkRequest::DeprecatedSetFlags {
18682                            flags: req.flags,
18683
18684                            responder: SymlinkDeprecatedSetFlagsResponder {
18685                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18686                                tx_id: header.tx_id,
18687                            },
18688                        })
18689                    }
18690                    0x176eb318f64ec23 => {
18691                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18692                        let mut req = fidl::new_empty!(
18693                            fidl::encoding::EmptyPayload,
18694                            fidl::encoding::DefaultFuchsiaResourceDialect
18695                        );
18696                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18697                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18698                        Ok(SymlinkRequest::GetFlags {
18699                            responder: SymlinkGetFlagsResponder {
18700                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18701                                tx_id: header.tx_id,
18702                            },
18703                        })
18704                    }
18705                    0x55a8028685791ea8 => {
18706                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18707                        let mut req = fidl::new_empty!(
18708                            NodeSetFlagsRequest,
18709                            fidl::encoding::DefaultFuchsiaResourceDialect
18710                        );
18711                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
18712                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18713                        Ok(SymlinkRequest::SetFlags {
18714                            flags: req.flags,
18715
18716                            responder: SymlinkSetFlagsResponder {
18717                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18718                                tx_id: header.tx_id,
18719                            },
18720                        })
18721                    }
18722                    0x6f344a1c6b0a0610 => {
18723                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18724                        let mut req = fidl::new_empty!(
18725                            fidl::encoding::EmptyPayload,
18726                            fidl::encoding::DefaultFuchsiaResourceDialect
18727                        );
18728                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18729                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18730                        Ok(SymlinkRequest::QueryFilesystem {
18731                            responder: SymlinkQueryFilesystemResponder {
18732                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18733                                tx_id: header.tx_id,
18734                            },
18735                        })
18736                    }
18737                    0x3d4396a638ea053b => {
18738                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18739                        let mut req = fidl::new_empty!(
18740                            NodeGetAttributesRequest,
18741                            fidl::encoding::DefaultFuchsiaResourceDialect
18742                        );
18743                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18744                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18745                        Ok(SymlinkRequest::GetAttributes {
18746                            query: req.query,
18747
18748                            responder: SymlinkGetAttributesResponder {
18749                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18750                                tx_id: header.tx_id,
18751                            },
18752                        })
18753                    }
18754                    0x3308c1da5a89bf08 => {
18755                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18756                        let mut req = fidl::new_empty!(
18757                            MutableNodeAttributes,
18758                            fidl::encoding::DefaultFuchsiaResourceDialect
18759                        );
18760                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
18761                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18762                        Ok(SymlinkRequest::UpdateAttributes {
18763                            payload: req,
18764                            responder: SymlinkUpdateAttributesResponder {
18765                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18766                                tx_id: header.tx_id,
18767                            },
18768                        })
18769                    }
18770                    0x2c5c27ca0ab5dc49 => {
18771                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18772                        let mut req = fidl::new_empty!(
18773                            fidl::encoding::EmptyPayload,
18774                            fidl::encoding::DefaultFuchsiaResourceDialect
18775                        );
18776                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18777                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18778                        Ok(SymlinkRequest::Sync {
18779                            responder: SymlinkSyncResponder {
18780                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18781                                tx_id: header.tx_id,
18782                            },
18783                        })
18784                    }
18785                    0x4b61033de007fcd0 => {
18786                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18787                        let mut req = fidl::new_empty!(
18788                            NodeListExtendedAttributesRequest,
18789                            fidl::encoding::DefaultFuchsiaResourceDialect
18790                        );
18791                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
18792                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18793                        Ok(SymlinkRequest::ListExtendedAttributes {
18794                            iterator: req.iterator,
18795
18796                            control_handle,
18797                        })
18798                    }
18799                    0x45ffa3ccfdeb76db => {
18800                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18801                        let mut req = fidl::new_empty!(
18802                            NodeGetExtendedAttributeRequest,
18803                            fidl::encoding::DefaultFuchsiaResourceDialect
18804                        );
18805                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18806                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18807                        Ok(SymlinkRequest::GetExtendedAttribute {
18808                            name: req.name,
18809
18810                            responder: SymlinkGetExtendedAttributeResponder {
18811                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18812                                tx_id: header.tx_id,
18813                            },
18814                        })
18815                    }
18816                    0x4a951362f681f23c => {
18817                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18818                        let mut req = fidl::new_empty!(
18819                            NodeSetExtendedAttributeRequest,
18820                            fidl::encoding::DefaultFuchsiaResourceDialect
18821                        );
18822                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18823                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18824                        Ok(SymlinkRequest::SetExtendedAttribute {
18825                            name: req.name,
18826                            value: req.value,
18827                            mode: req.mode,
18828
18829                            responder: SymlinkSetExtendedAttributeResponder {
18830                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18831                                tx_id: header.tx_id,
18832                            },
18833                        })
18834                    }
18835                    0x7a0b9f3a9bf9032d => {
18836                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18837                        let mut req = fidl::new_empty!(
18838                            NodeRemoveExtendedAttributeRequest,
18839                            fidl::encoding::DefaultFuchsiaResourceDialect
18840                        );
18841                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
18842                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18843                        Ok(SymlinkRequest::RemoveExtendedAttribute {
18844                            name: req.name,
18845
18846                            responder: SymlinkRemoveExtendedAttributeResponder {
18847                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18848                                tx_id: header.tx_id,
18849                            },
18850                        })
18851                    }
18852                    0x568ddcb9a9cbb6d9 => {
18853                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
18854                        let mut req = fidl::new_empty!(
18855                            OpenableOpenRequest,
18856                            fidl::encoding::DefaultFuchsiaResourceDialect
18857                        );
18858                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenableOpenRequest>(&header, _body_bytes, handles, &mut req)?;
18859                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18860                        Ok(SymlinkRequest::Open {
18861                            path: req.path,
18862                            flags: req.flags,
18863                            options: req.options,
18864                            object: req.object,
18865
18866                            control_handle,
18867                        })
18868                    }
18869                    0x742c2ea5e89831f3 => {
18870                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
18871                        let mut req = fidl::new_empty!(
18872                            fidl::encoding::EmptyPayload,
18873                            fidl::encoding::DefaultFuchsiaResourceDialect
18874                        );
18875                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
18876                        let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
18877                        Ok(SymlinkRequest::Describe {
18878                            responder: SymlinkDescribeResponder {
18879                                control_handle: std::mem::ManuallyDrop::new(control_handle),
18880                                tx_id: header.tx_id,
18881                            },
18882                        })
18883                    }
18884                    _ if header.tx_id == 0
18885                        && header
18886                            .dynamic_flags()
18887                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18888                    {
18889                        Ok(SymlinkRequest::_UnknownMethod {
18890                            ordinal: header.ordinal,
18891                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18892                            method_type: fidl::MethodType::OneWay,
18893                        })
18894                    }
18895                    _ if header
18896                        .dynamic_flags()
18897                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
18898                    {
18899                        this.inner.send_framework_err(
18900                            fidl::encoding::FrameworkErr::UnknownMethod,
18901                            header.tx_id,
18902                            header.ordinal,
18903                            header.dynamic_flags(),
18904                            (bytes, handles),
18905                        )?;
18906                        Ok(SymlinkRequest::_UnknownMethod {
18907                            ordinal: header.ordinal,
18908                            control_handle: SymlinkControlHandle { inner: this.inner.clone() },
18909                            method_type: fidl::MethodType::TwoWay,
18910                        })
18911                    }
18912                    _ => Err(fidl::Error::UnknownOrdinal {
18913                        ordinal: header.ordinal,
18914                        protocol_name:
18915                            <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
18916                    }),
18917                }))
18918            },
18919        )
18920    }
18921}
18922
18923/// A ['Node'] which contains a symbolic link.
18924#[derive(Debug)]
18925pub enum SymlinkRequest {
18926    /// Creates a link to this this object with name `dst` in the directory represented by
18927    /// `dst_parent_token`.
18928    ///
18929    /// `dst` must be a resolved object name. Including "/" in the string will return
18930    /// `ZX_ERR_INVALID_ARGS`.
18931    ///
18932    /// This method requires the maximal set of rights supported by the filesystem for this object.
18933    /// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
18934    /// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
18935    /// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
18936    /// `ZX_ERR_ACCESS_DENIED`.
18937    ///
18938    /// If this object has no links and is *NOT* an unnamed temporary object (objects opened with
18939    /// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.
18940    ///
18941    /// For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
18942    /// the object will be permanently linked to the filesystem. Requires that the unnamed temporary
18943    /// object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.
18944    ///
18945    /// This method does not have the same atomicity properties has the `Directory::Link` method,
18946    /// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
18947    /// because `LinkInto` will not prevent the source from being renamed or unlinked.
18948    LinkInto {
18949        dst_parent_token: fidl::Event,
18950        dst: String,
18951        responder: SymlinkLinkIntoResponder,
18952    },
18953    Clone {
18954        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
18955        control_handle: SymlinkControlHandle,
18956    },
18957    /// Terminates the connection.
18958    ///
18959    /// After calling `Close`, the client must not send any other requests.
18960    ///
18961    /// Servers, after sending the status response, should close the connection
18962    /// regardless of status and without sending an epitaph.
18963    ///
18964    /// Closing the client end of the channel should be semantically equivalent
18965    /// to calling `Close` without knowing when the close has completed or its
18966    /// status.
18967    Close {
18968        responder: SymlinkCloseResponder,
18969    },
18970    Query {
18971        responder: SymlinkQueryResponder,
18972    },
18973    /// DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.
18974    DeprecatedClone {
18975        flags: OpenFlags,
18976        object: fidl::endpoints::ServerEnd<NodeMarker>,
18977        control_handle: SymlinkControlHandle,
18978    },
18979    /// DEPRECATED - Use `Node.GetAttributes` instead.
18980    DeprecatedGetAttr {
18981        responder: SymlinkDeprecatedGetAttrResponder,
18982    },
18983    /// DEPRECATED - Use `Node.UpdateAttributes` instead.
18984    DeprecatedSetAttr {
18985        flags: NodeAttributeFlags,
18986        attributes: NodeAttributes,
18987        responder: SymlinkDeprecatedSetAttrResponder,
18988    },
18989    /// [DEPRECATED - Use new GetFlags method instead.]
18990    DeprecatedGetFlags {
18991        responder: SymlinkDeprecatedGetFlagsResponder,
18992    },
18993    /// [DEPRECATED - Use new SetFlags method instead.]
18994    DeprecatedSetFlags {
18995        flags: OpenFlags,
18996        responder: SymlinkDeprecatedSetFlagsResponder,
18997    },
18998    /// Queries the flags that apply to this node after it has been opened/created. This method does
18999    /// not require any rights.
19000    ///
19001    /// Note that the final set of flags that apply to the connection may differ from those
19002    /// specified with the `fuchsia.io/Directory.Open` request used to create it:
19003    ///  - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.
19004    ///  - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.
19005    ///  - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.
19006    GetFlags {
19007        responder: SymlinkGetFlagsResponder,
19008    },
19009    /// Sets the flags that apply to this node after it has been opened. This method does not
19010    /// require any rights.
19011    ///
19012    /// Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will
19013    /// clear append mode.
19014    ///
19015    /// Errors:
19016    ///  - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.
19017    ///  - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.
19018    SetFlags {
19019        flags: Flags,
19020        responder: SymlinkSetFlagsResponder,
19021    },
19022    /// Query the filesystem for details specific to the filesystem and/or volume. If the current
19023    /// volume has different settings or the storage is accounted seperately from the rest of the
19024    /// filesystem that may be reported instead of filesystem-wide details.
19025    QueryFilesystem {
19026        responder: SymlinkQueryFilesystemResponder,
19027    },
19028    /// Acquires information about the node.
19029    ///
19030    /// The attributes of a node should be stable, independent of the
19031    /// specific protocol used to access it.
19032    ///
19033    /// If a particular attribute is not applicable or not supported,
19034    /// filesystems should leave the corresponding field absent.
19035    ///
19036    /// + `query` a bit-mask specifying which attributes to fetch. The server
19037    ///   should not return more than necessary.
19038    /// - `attributes` the returned attributes.
19039    ///
19040    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19041    GetAttributes {
19042        query: NodeAttributesQuery,
19043        responder: SymlinkGetAttributesResponder,
19044    },
19045    /// Updates information about the node.
19046    ///
19047    /// + `attributes` the presence of a table field in `attributes` indicates
19048    /// the intent to update the corresponding attribute.
19049    ///
19050    /// Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.
19051    ///
19052    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19053    UpdateAttributes {
19054        payload: MutableNodeAttributes,
19055        responder: SymlinkUpdateAttributesResponder,
19056    },
19057    /// Synchronizes updates to the node to the underlying media, if it exists.
19058    ///
19059    /// This method will return when the filesystem server has flushed the
19060    /// relevant updates to the underlying media, but does not guarantee the
19061    /// underlying media has persisted the information, nor that any information
19062    /// is committed to hardware. Clients may use `Sync` to ensure ordering
19063    /// between operations.
19064    ///
19065    /// This method does not require any rights.
19066    Sync {
19067        responder: SymlinkSyncResponder,
19068    },
19069    /// Creates an iterator over all the extended attribute names associated
19070    /// with this node. If an error occurs it is returned as an epitaph on the
19071    /// iterator request channel, and then the channel is closed.
19072    ///
19073    /// GetExtendedAttributes can be used with any of these names to retrieve
19074    /// the associated value.
19075    ///
19076    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19077    ListExtendedAttributes {
19078        iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
19079        control_handle: SymlinkControlHandle,
19080    },
19081    /// Get the value associated with the given attribute `name` for this node.
19082    ///
19083    /// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
19084    /// particular structure is imposed on them.
19085    ///
19086    /// This method requires the [`Rights.GET_ATTRIBUTES`] right.
19087    GetExtendedAttribute {
19088        name: Vec<u8>,
19089        responder: SymlinkGetExtendedAttributeResponder,
19090    },
19091    /// Set the value for the given attribute `name` to `value` for this node.
19092    ///
19093    /// The attribute name may exist, in which case the attribute is updated.
19094    /// If the attribute doesn't exist, it is created. The name should have no
19095    /// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
19096    ///
19097    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19098    SetExtendedAttribute {
19099        name: Vec<u8>,
19100        value: ExtendedAttributeValue,
19101        mode: SetExtendedAttributeMode,
19102        responder: SymlinkSetExtendedAttributeResponder,
19103    },
19104    /// Remove the specified extended attribute.
19105    ///
19106    /// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
19107    ///
19108    /// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
19109    RemoveExtendedAttribute {
19110        name: Vec<u8>,
19111        responder: SymlinkRemoveExtendedAttributeResponder,
19112    },
19113    /// Open (or create) a node relative to this directory. Any errors are communicated via an
19114    /// epitaph sent on the `object` channel.
19115    ///
19116    /// Errors:
19117    /// * `ZX_ERR_BAD_PATH` if `path` is invalid
19118    /// * See [`Flags`] for other errors which may be communicated based on `flags`
19119    Open {
19120        path: String,
19121        flags: Flags,
19122        options: Options,
19123        object: fidl::Channel,
19124        control_handle: SymlinkControlHandle,
19125    },
19126    Describe {
19127        responder: SymlinkDescribeResponder,
19128    },
19129    /// An interaction was received which does not match any known method.
19130    #[non_exhaustive]
19131    _UnknownMethod {
19132        /// Ordinal of the method that was called.
19133        ordinal: u64,
19134        control_handle: SymlinkControlHandle,
19135        method_type: fidl::MethodType,
19136    },
19137}
19138
19139impl SymlinkRequest {
19140    #[allow(irrefutable_let_patterns)]
19141    pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
19142        if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
19143            Some((dst_parent_token, dst, responder))
19144        } else {
19145            None
19146        }
19147    }
19148
19149    #[allow(irrefutable_let_patterns)]
19150    pub fn into_clone(
19151        self,
19152    ) -> Option<(
19153        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
19154        SymlinkControlHandle,
19155    )> {
19156        if let SymlinkRequest::Clone { request, control_handle } = self {
19157            Some((request, control_handle))
19158        } else {
19159            None
19160        }
19161    }
19162
19163    #[allow(irrefutable_let_patterns)]
19164    pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
19165        if let SymlinkRequest::Close { responder } = self { Some((responder)) } else { None }
19166    }
19167
19168    #[allow(irrefutable_let_patterns)]
19169    pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
19170        if let SymlinkRequest::Query { responder } = self { Some((responder)) } else { None }
19171    }
19172
19173    #[allow(irrefutable_let_patterns)]
19174    pub fn into_deprecated_clone(
19175        self,
19176    ) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
19177        if let SymlinkRequest::DeprecatedClone { flags, object, control_handle } = self {
19178            Some((flags, object, control_handle))
19179        } else {
19180            None
19181        }
19182    }
19183
19184    #[allow(irrefutable_let_patterns)]
19185    pub fn into_deprecated_get_attr(self) -> Option<(SymlinkDeprecatedGetAttrResponder)> {
19186        if let SymlinkRequest::DeprecatedGetAttr { responder } = self {
19187            Some((responder))
19188        } else {
19189            None
19190        }
19191    }
19192
19193    #[allow(irrefutable_let_patterns)]
19194    pub fn into_deprecated_set_attr(
19195        self,
19196    ) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkDeprecatedSetAttrResponder)> {
19197        if let SymlinkRequest::DeprecatedSetAttr { flags, attributes, responder } = self {
19198            Some((flags, attributes, responder))
19199        } else {
19200            None
19201        }
19202    }
19203
19204    #[allow(irrefutable_let_patterns)]
19205    pub fn into_deprecated_get_flags(self) -> Option<(SymlinkDeprecatedGetFlagsResponder)> {
19206        if let SymlinkRequest::DeprecatedGetFlags { responder } = self {
19207            Some((responder))
19208        } else {
19209            None
19210        }
19211    }
19212
19213    #[allow(irrefutable_let_patterns)]
19214    pub fn into_deprecated_set_flags(
19215        self,
19216    ) -> Option<(OpenFlags, SymlinkDeprecatedSetFlagsResponder)> {
19217        if let SymlinkRequest::DeprecatedSetFlags { flags, responder } = self {
19218            Some((flags, responder))
19219        } else {
19220            None
19221        }
19222    }
19223
19224    #[allow(irrefutable_let_patterns)]
19225    pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
19226        if let SymlinkRequest::GetFlags { responder } = self { Some((responder)) } else { None }
19227    }
19228
19229    #[allow(irrefutable_let_patterns)]
19230    pub fn into_set_flags(self) -> Option<(Flags, SymlinkSetFlagsResponder)> {
19231        if let SymlinkRequest::SetFlags { flags, responder } = self {
19232            Some((flags, responder))
19233        } else {
19234            None
19235        }
19236    }
19237
19238    #[allow(irrefutable_let_patterns)]
19239    pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
19240        if let SymlinkRequest::QueryFilesystem { responder } = self {
19241            Some((responder))
19242        } else {
19243            None
19244        }
19245    }
19246
19247    #[allow(irrefutable_let_patterns)]
19248    pub fn into_get_attributes(
19249        self,
19250    ) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
19251        if let SymlinkRequest::GetAttributes { query, responder } = self {
19252            Some((query, responder))
19253        } else {
19254            None
19255        }
19256    }
19257
19258    #[allow(irrefutable_let_patterns)]
19259    pub fn into_update_attributes(
19260        self,
19261    ) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
19262        if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
19263            Some((payload, responder))
19264        } else {
19265            None
19266        }
19267    }
19268
19269    #[allow(irrefutable_let_patterns)]
19270    pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
19271        if let SymlinkRequest::Sync { responder } = self { Some((responder)) } else { None }
19272    }
19273
19274    #[allow(irrefutable_let_patterns)]
19275    pub fn into_list_extended_attributes(
19276        self,
19277    ) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
19278    {
19279        if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
19280            Some((iterator, control_handle))
19281        } else {
19282            None
19283        }
19284    }
19285
19286    #[allow(irrefutable_let_patterns)]
19287    pub fn into_get_extended_attribute(
19288        self,
19289    ) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
19290        if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
19291            Some((name, responder))
19292        } else {
19293            None
19294        }
19295    }
19296
19297    #[allow(irrefutable_let_patterns)]
19298    pub fn into_set_extended_attribute(
19299        self,
19300    ) -> Option<(
19301        Vec<u8>,
19302        ExtendedAttributeValue,
19303        SetExtendedAttributeMode,
19304        SymlinkSetExtendedAttributeResponder,
19305    )> {
19306        if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
19307            Some((name, value, mode, responder))
19308        } else {
19309            None
19310        }
19311    }
19312
19313    #[allow(irrefutable_let_patterns)]
19314    pub fn into_remove_extended_attribute(
19315        self,
19316    ) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
19317        if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
19318            Some((name, responder))
19319        } else {
19320            None
19321        }
19322    }
19323
19324    #[allow(irrefutable_let_patterns)]
19325    pub fn into_open(
19326        self,
19327    ) -> Option<(String, Flags, Options, fidl::Channel, SymlinkControlHandle)> {
19328        if let SymlinkRequest::Open { path, flags, options, object, control_handle } = self {
19329            Some((path, flags, options, object, control_handle))
19330        } else {
19331            None
19332        }
19333    }
19334
19335    #[allow(irrefutable_let_patterns)]
19336    pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
19337        if let SymlinkRequest::Describe { responder } = self { Some((responder)) } else { None }
19338    }
19339
19340    /// Name of the method defined in FIDL
19341    pub fn method_name(&self) -> &'static str {
19342        match *self {
19343            SymlinkRequest::LinkInto { .. } => "link_into",
19344            SymlinkRequest::Clone { .. } => "clone",
19345            SymlinkRequest::Close { .. } => "close",
19346            SymlinkRequest::Query { .. } => "query",
19347            SymlinkRequest::DeprecatedClone { .. } => "deprecated_clone",
19348            SymlinkRequest::DeprecatedGetAttr { .. } => "deprecated_get_attr",
19349            SymlinkRequest::DeprecatedSetAttr { .. } => "deprecated_set_attr",
19350            SymlinkRequest::DeprecatedGetFlags { .. } => "deprecated_get_flags",
19351            SymlinkRequest::DeprecatedSetFlags { .. } => "deprecated_set_flags",
19352            SymlinkRequest::GetFlags { .. } => "get_flags",
19353            SymlinkRequest::SetFlags { .. } => "set_flags",
19354            SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
19355            SymlinkRequest::GetAttributes { .. } => "get_attributes",
19356            SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
19357            SymlinkRequest::Sync { .. } => "sync",
19358            SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
19359            SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
19360            SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
19361            SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
19362            SymlinkRequest::Open { .. } => "open",
19363            SymlinkRequest::Describe { .. } => "describe",
19364            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
19365                "unknown one-way method"
19366            }
19367            SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
19368                "unknown two-way method"
19369            }
19370        }
19371    }
19372}
19373
19374#[derive(Debug, Clone)]
19375pub struct SymlinkControlHandle {
19376    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
19377}
19378
19379impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
19380    fn shutdown(&self) {
19381        self.inner.shutdown()
19382    }
19383
19384    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
19385        self.inner.shutdown_with_epitaph(status)
19386    }
19387
19388    fn is_closed(&self) -> bool {
19389        self.inner.channel().is_closed()
19390    }
19391    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
19392        self.inner.channel().on_closed()
19393    }
19394
19395    #[cfg(target_os = "fuchsia")]
19396    fn signal_peer(
19397        &self,
19398        clear_mask: zx::Signals,
19399        set_mask: zx::Signals,
19400    ) -> Result<(), zx_status::Status> {
19401        use fidl::Peered;
19402        self.inner.channel().signal_peer(clear_mask, set_mask)
19403    }
19404}
19405
19406impl SymlinkControlHandle {
19407    pub fn send_on_open_(
19408        &self,
19409        mut s: i32,
19410        mut info: Option<NodeInfoDeprecated>,
19411    ) -> Result<(), fidl::Error> {
19412        self.inner.send::<NodeOnOpenRequest>(
19413            (s, info.as_mut()),
19414            0,
19415            0x7fc7bbb1dbfd1972,
19416            fidl::encoding::DynamicFlags::FLEXIBLE,
19417        )
19418    }
19419
19420    pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
19421        self.inner.send::<Representation>(
19422            &mut payload,
19423            0,
19424            0x5cb40567d80a510c,
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 SymlinkLinkIntoResponder {
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 SymlinkLinkIntoResponder {
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 SymlinkLinkIntoResponder {
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 SymlinkLinkIntoResponder {
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                0x54f3949246a03e74,
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 SymlinkCloseResponder {
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 SymlinkCloseResponder {
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 SymlinkCloseResponder {
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 SymlinkCloseResponder {
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 result: Result<(), i32>) -> Result<(), fidl::Error> {
19533        let _result = self.send_raw(result);
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 result: Result<(), i32>) -> Result<(), fidl::Error> {
19543        let _result = self.send_raw(result);
19544        self.drop_without_shutdown();
19545        _result
19546    }
19547
19548    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19549        self.control_handle
19550            .inner
19551            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
19552                result,
19553                self.tx_id,
19554                0x5ac5d459ad7f657e,
19555                fidl::encoding::DynamicFlags::empty(),
19556            )
19557    }
19558}
19559
19560#[must_use = "FIDL methods require a response to be sent"]
19561#[derive(Debug)]
19562pub struct SymlinkQueryResponder {
19563    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19564    tx_id: u32,
19565}
19566
19567/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19568/// if the responder is dropped without sending a response, so that the client
19569/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19570impl std::ops::Drop for SymlinkQueryResponder {
19571    fn drop(&mut self) {
19572        self.control_handle.shutdown();
19573        // Safety: drops once, never accessed again
19574        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19575    }
19576}
19577
19578impl fidl::endpoints::Responder for SymlinkQueryResponder {
19579    type ControlHandle = SymlinkControlHandle;
19580
19581    fn control_handle(&self) -> &SymlinkControlHandle {
19582        &self.control_handle
19583    }
19584
19585    fn drop_without_shutdown(mut self) {
19586        // Safety: drops once, never accessed again due to mem::forget
19587        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19588        // Prevent Drop from running (which would shut down the channel)
19589        std::mem::forget(self);
19590    }
19591}
19592
19593impl SymlinkQueryResponder {
19594    /// Sends a response to the FIDL transaction.
19595    ///
19596    /// Sets the channel to shutdown if an error occurs.
19597    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19598        let _result = self.send_raw(protocol);
19599        if _result.is_err() {
19600            self.control_handle.shutdown();
19601        }
19602        self.drop_without_shutdown();
19603        _result
19604    }
19605
19606    /// Similar to "send" but does not shutdown the channel if an error occurs.
19607    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19608        let _result = self.send_raw(protocol);
19609        self.drop_without_shutdown();
19610        _result
19611    }
19612
19613    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
19614        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
19615            (protocol,),
19616            self.tx_id,
19617            0x2658edee9decfc06,
19618            fidl::encoding::DynamicFlags::empty(),
19619        )
19620    }
19621}
19622
19623#[must_use = "FIDL methods require a response to be sent"]
19624#[derive(Debug)]
19625pub struct SymlinkDeprecatedGetAttrResponder {
19626    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19627    tx_id: u32,
19628}
19629
19630/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19631/// if the responder is dropped without sending a response, so that the client
19632/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19633impl std::ops::Drop for SymlinkDeprecatedGetAttrResponder {
19634    fn drop(&mut self) {
19635        self.control_handle.shutdown();
19636        // Safety: drops once, never accessed again
19637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19638    }
19639}
19640
19641impl fidl::endpoints::Responder for SymlinkDeprecatedGetAttrResponder {
19642    type ControlHandle = SymlinkControlHandle;
19643
19644    fn control_handle(&self) -> &SymlinkControlHandle {
19645        &self.control_handle
19646    }
19647
19648    fn drop_without_shutdown(mut self) {
19649        // Safety: drops once, never accessed again due to mem::forget
19650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19651        // Prevent Drop from running (which would shut down the channel)
19652        std::mem::forget(self);
19653    }
19654}
19655
19656impl SymlinkDeprecatedGetAttrResponder {
19657    /// Sends a response to the FIDL transaction.
19658    ///
19659    /// Sets the channel to shutdown if an error occurs.
19660    pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19661        let _result = self.send_raw(s, attributes);
19662        if _result.is_err() {
19663            self.control_handle.shutdown();
19664        }
19665        self.drop_without_shutdown();
19666        _result
19667    }
19668
19669    /// Similar to "send" but does not shutdown the channel if an error occurs.
19670    pub fn send_no_shutdown_on_err(
19671        self,
19672        mut s: i32,
19673        mut attributes: &NodeAttributes,
19674    ) -> Result<(), fidl::Error> {
19675        let _result = self.send_raw(s, attributes);
19676        self.drop_without_shutdown();
19677        _result
19678    }
19679
19680    fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
19681        self.control_handle.inner.send::<NodeDeprecatedGetAttrResponse>(
19682            (s, attributes),
19683            self.tx_id,
19684            0x78985e216314dafd,
19685            fidl::encoding::DynamicFlags::empty(),
19686        )
19687    }
19688}
19689
19690#[must_use = "FIDL methods require a response to be sent"]
19691#[derive(Debug)]
19692pub struct SymlinkDeprecatedSetAttrResponder {
19693    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19694    tx_id: u32,
19695}
19696
19697/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19698/// if the responder is dropped without sending a response, so that the client
19699/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19700impl std::ops::Drop for SymlinkDeprecatedSetAttrResponder {
19701    fn drop(&mut self) {
19702        self.control_handle.shutdown();
19703        // Safety: drops once, never accessed again
19704        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19705    }
19706}
19707
19708impl fidl::endpoints::Responder for SymlinkDeprecatedSetAttrResponder {
19709    type ControlHandle = SymlinkControlHandle;
19710
19711    fn control_handle(&self) -> &SymlinkControlHandle {
19712        &self.control_handle
19713    }
19714
19715    fn drop_without_shutdown(mut self) {
19716        // Safety: drops once, never accessed again due to mem::forget
19717        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19718        // Prevent Drop from running (which would shut down the channel)
19719        std::mem::forget(self);
19720    }
19721}
19722
19723impl SymlinkDeprecatedSetAttrResponder {
19724    /// Sends a response to the FIDL transaction.
19725    ///
19726    /// Sets the channel to shutdown if an error occurs.
19727    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19728        let _result = self.send_raw(s);
19729        if _result.is_err() {
19730            self.control_handle.shutdown();
19731        }
19732        self.drop_without_shutdown();
19733        _result
19734    }
19735
19736    /// Similar to "send" but does not shutdown the channel if an error occurs.
19737    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19738        let _result = self.send_raw(s);
19739        self.drop_without_shutdown();
19740        _result
19741    }
19742
19743    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19744        self.control_handle.inner.send::<NodeDeprecatedSetAttrResponse>(
19745            (s,),
19746            self.tx_id,
19747            0x4186c0f40d938f46,
19748            fidl::encoding::DynamicFlags::empty(),
19749        )
19750    }
19751}
19752
19753#[must_use = "FIDL methods require a response to be sent"]
19754#[derive(Debug)]
19755pub struct SymlinkDeprecatedGetFlagsResponder {
19756    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19757    tx_id: u32,
19758}
19759
19760/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19761/// if the responder is dropped without sending a response, so that the client
19762/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19763impl std::ops::Drop for SymlinkDeprecatedGetFlagsResponder {
19764    fn drop(&mut self) {
19765        self.control_handle.shutdown();
19766        // Safety: drops once, never accessed again
19767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19768    }
19769}
19770
19771impl fidl::endpoints::Responder for SymlinkDeprecatedGetFlagsResponder {
19772    type ControlHandle = SymlinkControlHandle;
19773
19774    fn control_handle(&self) -> &SymlinkControlHandle {
19775        &self.control_handle
19776    }
19777
19778    fn drop_without_shutdown(mut self) {
19779        // Safety: drops once, never accessed again due to mem::forget
19780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19781        // Prevent Drop from running (which would shut down the channel)
19782        std::mem::forget(self);
19783    }
19784}
19785
19786impl SymlinkDeprecatedGetFlagsResponder {
19787    /// Sends a response to the FIDL transaction.
19788    ///
19789    /// Sets the channel to shutdown if an error occurs.
19790    pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19791        let _result = self.send_raw(s, flags);
19792        if _result.is_err() {
19793            self.control_handle.shutdown();
19794        }
19795        self.drop_without_shutdown();
19796        _result
19797    }
19798
19799    /// Similar to "send" but does not shutdown the channel if an error occurs.
19800    pub fn send_no_shutdown_on_err(
19801        self,
19802        mut s: i32,
19803        mut flags: OpenFlags,
19804    ) -> Result<(), fidl::Error> {
19805        let _result = self.send_raw(s, flags);
19806        self.drop_without_shutdown();
19807        _result
19808    }
19809
19810    fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
19811        self.control_handle.inner.send::<NodeDeprecatedGetFlagsResponse>(
19812            (s, flags),
19813            self.tx_id,
19814            0x5b88fffb8eda3aa1,
19815            fidl::encoding::DynamicFlags::empty(),
19816        )
19817    }
19818}
19819
19820#[must_use = "FIDL methods require a response to be sent"]
19821#[derive(Debug)]
19822pub struct SymlinkDeprecatedSetFlagsResponder {
19823    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19824    tx_id: u32,
19825}
19826
19827/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19828/// if the responder is dropped without sending a response, so that the client
19829/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19830impl std::ops::Drop for SymlinkDeprecatedSetFlagsResponder {
19831    fn drop(&mut self) {
19832        self.control_handle.shutdown();
19833        // Safety: drops once, never accessed again
19834        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19835    }
19836}
19837
19838impl fidl::endpoints::Responder for SymlinkDeprecatedSetFlagsResponder {
19839    type ControlHandle = SymlinkControlHandle;
19840
19841    fn control_handle(&self) -> &SymlinkControlHandle {
19842        &self.control_handle
19843    }
19844
19845    fn drop_without_shutdown(mut self) {
19846        // Safety: drops once, never accessed again due to mem::forget
19847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19848        // Prevent Drop from running (which would shut down the channel)
19849        std::mem::forget(self);
19850    }
19851}
19852
19853impl SymlinkDeprecatedSetFlagsResponder {
19854    /// Sends a response to the FIDL transaction.
19855    ///
19856    /// Sets the channel to shutdown if an error occurs.
19857    pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
19858        let _result = self.send_raw(s);
19859        if _result.is_err() {
19860            self.control_handle.shutdown();
19861        }
19862        self.drop_without_shutdown();
19863        _result
19864    }
19865
19866    /// Similar to "send" but does not shutdown the channel if an error occurs.
19867    pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
19868        let _result = self.send_raw(s);
19869        self.drop_without_shutdown();
19870        _result
19871    }
19872
19873    fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
19874        self.control_handle.inner.send::<NodeDeprecatedSetFlagsResponse>(
19875            (s,),
19876            self.tx_id,
19877            0x5295b76c71fde733,
19878            fidl::encoding::DynamicFlags::empty(),
19879        )
19880    }
19881}
19882
19883#[must_use = "FIDL methods require a response to be sent"]
19884#[derive(Debug)]
19885pub struct SymlinkGetFlagsResponder {
19886    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19887    tx_id: u32,
19888}
19889
19890/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19891/// if the responder is dropped without sending a response, so that the client
19892/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19893impl std::ops::Drop for SymlinkGetFlagsResponder {
19894    fn drop(&mut self) {
19895        self.control_handle.shutdown();
19896        // Safety: drops once, never accessed again
19897        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19898    }
19899}
19900
19901impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
19902    type ControlHandle = SymlinkControlHandle;
19903
19904    fn control_handle(&self) -> &SymlinkControlHandle {
19905        &self.control_handle
19906    }
19907
19908    fn drop_without_shutdown(mut self) {
19909        // Safety: drops once, never accessed again due to mem::forget
19910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19911        // Prevent Drop from running (which would shut down the channel)
19912        std::mem::forget(self);
19913    }
19914}
19915
19916impl SymlinkGetFlagsResponder {
19917    /// Sends a response to the FIDL transaction.
19918    ///
19919    /// Sets the channel to shutdown if an error occurs.
19920    pub fn send(self, mut result: Result<Flags, i32>) -> Result<(), fidl::Error> {
19921        let _result = self.send_raw(result);
19922        if _result.is_err() {
19923            self.control_handle.shutdown();
19924        }
19925        self.drop_without_shutdown();
19926        _result
19927    }
19928
19929    /// Similar to "send" but does not shutdown the channel if an error occurs.
19930    pub fn send_no_shutdown_on_err(
19931        self,
19932        mut result: Result<Flags, i32>,
19933    ) -> 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<Flags, i32>) -> Result<(), fidl::Error> {
19940        self.control_handle
19941            .inner
19942            .send::<fidl::encoding::FlexibleResultType<NodeGetFlagsResponse, i32>>(
19943                fidl::encoding::FlexibleResult::new(result.map(|flags| (flags,))),
19944                self.tx_id,
19945                0x176eb318f64ec23,
19946                fidl::encoding::DynamicFlags::FLEXIBLE,
19947            )
19948    }
19949}
19950
19951#[must_use = "FIDL methods require a response to be sent"]
19952#[derive(Debug)]
19953pub struct SymlinkSetFlagsResponder {
19954    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
19955    tx_id: u32,
19956}
19957
19958/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
19959/// if the responder is dropped without sending a response, so that the client
19960/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
19961impl std::ops::Drop for SymlinkSetFlagsResponder {
19962    fn drop(&mut self) {
19963        self.control_handle.shutdown();
19964        // Safety: drops once, never accessed again
19965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19966    }
19967}
19968
19969impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
19970    type ControlHandle = SymlinkControlHandle;
19971
19972    fn control_handle(&self) -> &SymlinkControlHandle {
19973        &self.control_handle
19974    }
19975
19976    fn drop_without_shutdown(mut self) {
19977        // Safety: drops once, never accessed again due to mem::forget
19978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
19979        // Prevent Drop from running (which would shut down the channel)
19980        std::mem::forget(self);
19981    }
19982}
19983
19984impl SymlinkSetFlagsResponder {
19985    /// Sends a response to the FIDL transaction.
19986    ///
19987    /// Sets the channel to shutdown if an error occurs.
19988    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19989        let _result = self.send_raw(result);
19990        if _result.is_err() {
19991            self.control_handle.shutdown();
19992        }
19993        self.drop_without_shutdown();
19994        _result
19995    }
19996
19997    /// Similar to "send" but does not shutdown the channel if an error occurs.
19998    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
19999        let _result = self.send_raw(result);
20000        self.drop_without_shutdown();
20001        _result
20002    }
20003
20004    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20005        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
20006            fidl::encoding::EmptyStruct,
20007            i32,
20008        >>(
20009            fidl::encoding::FlexibleResult::new(result),
20010            self.tx_id,
20011            0x55a8028685791ea8,
20012            fidl::encoding::DynamicFlags::FLEXIBLE,
20013        )
20014    }
20015}
20016
20017#[must_use = "FIDL methods require a response to be sent"]
20018#[derive(Debug)]
20019pub struct SymlinkQueryFilesystemResponder {
20020    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20021    tx_id: u32,
20022}
20023
20024/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20025/// if the responder is dropped without sending a response, so that the client
20026/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20027impl std::ops::Drop for SymlinkQueryFilesystemResponder {
20028    fn drop(&mut self) {
20029        self.control_handle.shutdown();
20030        // Safety: drops once, never accessed again
20031        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20032    }
20033}
20034
20035impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
20036    type ControlHandle = SymlinkControlHandle;
20037
20038    fn control_handle(&self) -> &SymlinkControlHandle {
20039        &self.control_handle
20040    }
20041
20042    fn drop_without_shutdown(mut self) {
20043        // Safety: drops once, never accessed again due to mem::forget
20044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20045        // Prevent Drop from running (which would shut down the channel)
20046        std::mem::forget(self);
20047    }
20048}
20049
20050impl SymlinkQueryFilesystemResponder {
20051    /// Sends a response to the FIDL transaction.
20052    ///
20053    /// Sets the channel to shutdown if an error occurs.
20054    pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20055        let _result = self.send_raw(s, info);
20056        if _result.is_err() {
20057            self.control_handle.shutdown();
20058        }
20059        self.drop_without_shutdown();
20060        _result
20061    }
20062
20063    /// Similar to "send" but does not shutdown the channel if an error occurs.
20064    pub fn send_no_shutdown_on_err(
20065        self,
20066        mut s: i32,
20067        mut info: Option<&FilesystemInfo>,
20068    ) -> Result<(), fidl::Error> {
20069        let _result = self.send_raw(s, info);
20070        self.drop_without_shutdown();
20071        _result
20072    }
20073
20074    fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
20075        self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
20076            (s, info),
20077            self.tx_id,
20078            0x6f344a1c6b0a0610,
20079            fidl::encoding::DynamicFlags::empty(),
20080        )
20081    }
20082}
20083
20084#[must_use = "FIDL methods require a response to be sent"]
20085#[derive(Debug)]
20086pub struct SymlinkGetAttributesResponder {
20087    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20088    tx_id: u32,
20089}
20090
20091/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20092/// if the responder is dropped without sending a response, so that the client
20093/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20094impl std::ops::Drop for SymlinkGetAttributesResponder {
20095    fn drop(&mut self) {
20096        self.control_handle.shutdown();
20097        // Safety: drops once, never accessed again
20098        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20099    }
20100}
20101
20102impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
20103    type ControlHandle = SymlinkControlHandle;
20104
20105    fn control_handle(&self) -> &SymlinkControlHandle {
20106        &self.control_handle
20107    }
20108
20109    fn drop_without_shutdown(mut self) {
20110        // Safety: drops once, never accessed again due to mem::forget
20111        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20112        // Prevent Drop from running (which would shut down the channel)
20113        std::mem::forget(self);
20114    }
20115}
20116
20117impl SymlinkGetAttributesResponder {
20118    /// Sends a response to the FIDL transaction.
20119    ///
20120    /// Sets the channel to shutdown if an error occurs.
20121    pub fn send(
20122        self,
20123        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20124    ) -> Result<(), fidl::Error> {
20125        let _result = self.send_raw(result);
20126        if _result.is_err() {
20127            self.control_handle.shutdown();
20128        }
20129        self.drop_without_shutdown();
20130        _result
20131    }
20132
20133    /// Similar to "send" but does not shutdown the channel if an error occurs.
20134    pub fn send_no_shutdown_on_err(
20135        self,
20136        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20137    ) -> Result<(), fidl::Error> {
20138        let _result = self.send_raw(result);
20139        self.drop_without_shutdown();
20140        _result
20141    }
20142
20143    fn send_raw(
20144        &self,
20145        mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
20146    ) -> Result<(), fidl::Error> {
20147        self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
20148            result,
20149            self.tx_id,
20150            0x3d4396a638ea053b,
20151            fidl::encoding::DynamicFlags::empty(),
20152        )
20153    }
20154}
20155
20156#[must_use = "FIDL methods require a response to be sent"]
20157#[derive(Debug)]
20158pub struct SymlinkUpdateAttributesResponder {
20159    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20160    tx_id: u32,
20161}
20162
20163/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20164/// if the responder is dropped without sending a response, so that the client
20165/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20166impl std::ops::Drop for SymlinkUpdateAttributesResponder {
20167    fn drop(&mut self) {
20168        self.control_handle.shutdown();
20169        // Safety: drops once, never accessed again
20170        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20171    }
20172}
20173
20174impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
20175    type ControlHandle = SymlinkControlHandle;
20176
20177    fn control_handle(&self) -> &SymlinkControlHandle {
20178        &self.control_handle
20179    }
20180
20181    fn drop_without_shutdown(mut self) {
20182        // Safety: drops once, never accessed again due to mem::forget
20183        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20184        // Prevent Drop from running (which would shut down the channel)
20185        std::mem::forget(self);
20186    }
20187}
20188
20189impl SymlinkUpdateAttributesResponder {
20190    /// Sends a response to the FIDL transaction.
20191    ///
20192    /// Sets the channel to shutdown if an error occurs.
20193    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20194        let _result = self.send_raw(result);
20195        if _result.is_err() {
20196            self.control_handle.shutdown();
20197        }
20198        self.drop_without_shutdown();
20199        _result
20200    }
20201
20202    /// Similar to "send" but does not shutdown the channel if an error occurs.
20203    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20204        let _result = self.send_raw(result);
20205        self.drop_without_shutdown();
20206        _result
20207    }
20208
20209    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20210        self.control_handle
20211            .inner
20212            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20213                result,
20214                self.tx_id,
20215                0x3308c1da5a89bf08,
20216                fidl::encoding::DynamicFlags::empty(),
20217            )
20218    }
20219}
20220
20221#[must_use = "FIDL methods require a response to be sent"]
20222#[derive(Debug)]
20223pub struct SymlinkSyncResponder {
20224    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20225    tx_id: u32,
20226}
20227
20228/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20229/// if the responder is dropped without sending a response, so that the client
20230/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20231impl std::ops::Drop for SymlinkSyncResponder {
20232    fn drop(&mut self) {
20233        self.control_handle.shutdown();
20234        // Safety: drops once, never accessed again
20235        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20236    }
20237}
20238
20239impl fidl::endpoints::Responder for SymlinkSyncResponder {
20240    type ControlHandle = SymlinkControlHandle;
20241
20242    fn control_handle(&self) -> &SymlinkControlHandle {
20243        &self.control_handle
20244    }
20245
20246    fn drop_without_shutdown(mut self) {
20247        // Safety: drops once, never accessed again due to mem::forget
20248        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20249        // Prevent Drop from running (which would shut down the channel)
20250        std::mem::forget(self);
20251    }
20252}
20253
20254impl SymlinkSyncResponder {
20255    /// Sends a response to the FIDL transaction.
20256    ///
20257    /// Sets the channel to shutdown if an error occurs.
20258    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20259        let _result = self.send_raw(result);
20260        if _result.is_err() {
20261            self.control_handle.shutdown();
20262        }
20263        self.drop_without_shutdown();
20264        _result
20265    }
20266
20267    /// Similar to "send" but does not shutdown the channel if an error occurs.
20268    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20269        let _result = self.send_raw(result);
20270        self.drop_without_shutdown();
20271        _result
20272    }
20273
20274    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20275        self.control_handle
20276            .inner
20277            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20278                result,
20279                self.tx_id,
20280                0x2c5c27ca0ab5dc49,
20281                fidl::encoding::DynamicFlags::empty(),
20282            )
20283    }
20284}
20285
20286#[must_use = "FIDL methods require a response to be sent"]
20287#[derive(Debug)]
20288pub struct SymlinkGetExtendedAttributeResponder {
20289    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20290    tx_id: u32,
20291}
20292
20293/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20294/// if the responder is dropped without sending a response, so that the client
20295/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20296impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
20297    fn drop(&mut self) {
20298        self.control_handle.shutdown();
20299        // Safety: drops once, never accessed again
20300        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20301    }
20302}
20303
20304impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
20305    type ControlHandle = SymlinkControlHandle;
20306
20307    fn control_handle(&self) -> &SymlinkControlHandle {
20308        &self.control_handle
20309    }
20310
20311    fn drop_without_shutdown(mut self) {
20312        // Safety: drops once, never accessed again due to mem::forget
20313        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20314        // Prevent Drop from running (which would shut down the channel)
20315        std::mem::forget(self);
20316    }
20317}
20318
20319impl SymlinkGetExtendedAttributeResponder {
20320    /// Sends a response to the FIDL transaction.
20321    ///
20322    /// Sets the channel to shutdown if an error occurs.
20323    pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20324        let _result = self.send_raw(result);
20325        if _result.is_err() {
20326            self.control_handle.shutdown();
20327        }
20328        self.drop_without_shutdown();
20329        _result
20330    }
20331
20332    /// Similar to "send" but does not shutdown the channel if an error occurs.
20333    pub fn send_no_shutdown_on_err(
20334        self,
20335        mut result: Result<ExtendedAttributeValue, i32>,
20336    ) -> Result<(), fidl::Error> {
20337        let _result = self.send_raw(result);
20338        self.drop_without_shutdown();
20339        _result
20340    }
20341
20342    fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
20343        self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
20344            result.as_mut().map_err(|e| *e),
20345            self.tx_id,
20346            0x45ffa3ccfdeb76db,
20347            fidl::encoding::DynamicFlags::empty(),
20348        )
20349    }
20350}
20351
20352#[must_use = "FIDL methods require a response to be sent"]
20353#[derive(Debug)]
20354pub struct SymlinkSetExtendedAttributeResponder {
20355    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20356    tx_id: u32,
20357}
20358
20359/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20360/// if the responder is dropped without sending a response, so that the client
20361/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20362impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
20363    fn drop(&mut self) {
20364        self.control_handle.shutdown();
20365        // Safety: drops once, never accessed again
20366        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20367    }
20368}
20369
20370impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
20371    type ControlHandle = SymlinkControlHandle;
20372
20373    fn control_handle(&self) -> &SymlinkControlHandle {
20374        &self.control_handle
20375    }
20376
20377    fn drop_without_shutdown(mut self) {
20378        // Safety: drops once, never accessed again due to mem::forget
20379        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20380        // Prevent Drop from running (which would shut down the channel)
20381        std::mem::forget(self);
20382    }
20383}
20384
20385impl SymlinkSetExtendedAttributeResponder {
20386    /// Sends a response to the FIDL transaction.
20387    ///
20388    /// Sets the channel to shutdown if an error occurs.
20389    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20390        let _result = self.send_raw(result);
20391        if _result.is_err() {
20392            self.control_handle.shutdown();
20393        }
20394        self.drop_without_shutdown();
20395        _result
20396    }
20397
20398    /// Similar to "send" but does not shutdown the channel if an error occurs.
20399    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20400        let _result = self.send_raw(result);
20401        self.drop_without_shutdown();
20402        _result
20403    }
20404
20405    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20406        self.control_handle
20407            .inner
20408            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20409                result,
20410                self.tx_id,
20411                0x4a951362f681f23c,
20412                fidl::encoding::DynamicFlags::empty(),
20413            )
20414    }
20415}
20416
20417#[must_use = "FIDL methods require a response to be sent"]
20418#[derive(Debug)]
20419pub struct SymlinkRemoveExtendedAttributeResponder {
20420    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20421    tx_id: u32,
20422}
20423
20424/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20425/// if the responder is dropped without sending a response, so that the client
20426/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20427impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
20428    fn drop(&mut self) {
20429        self.control_handle.shutdown();
20430        // Safety: drops once, never accessed again
20431        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20432    }
20433}
20434
20435impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
20436    type ControlHandle = SymlinkControlHandle;
20437
20438    fn control_handle(&self) -> &SymlinkControlHandle {
20439        &self.control_handle
20440    }
20441
20442    fn drop_without_shutdown(mut self) {
20443        // Safety: drops once, never accessed again due to mem::forget
20444        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20445        // Prevent Drop from running (which would shut down the channel)
20446        std::mem::forget(self);
20447    }
20448}
20449
20450impl SymlinkRemoveExtendedAttributeResponder {
20451    /// Sends a response to the FIDL transaction.
20452    ///
20453    /// Sets the channel to shutdown if an error occurs.
20454    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20455        let _result = self.send_raw(result);
20456        if _result.is_err() {
20457            self.control_handle.shutdown();
20458        }
20459        self.drop_without_shutdown();
20460        _result
20461    }
20462
20463    /// Similar to "send" but does not shutdown the channel if an error occurs.
20464    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20465        let _result = self.send_raw(result);
20466        self.drop_without_shutdown();
20467        _result
20468    }
20469
20470    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
20471        self.control_handle
20472            .inner
20473            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
20474                result,
20475                self.tx_id,
20476                0x7a0b9f3a9bf9032d,
20477                fidl::encoding::DynamicFlags::empty(),
20478            )
20479    }
20480}
20481
20482#[must_use = "FIDL methods require a response to be sent"]
20483#[derive(Debug)]
20484pub struct SymlinkDescribeResponder {
20485    control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
20486    tx_id: u32,
20487}
20488
20489/// Set the the channel to be shutdown (see [`SymlinkControlHandle::shutdown`])
20490/// if the responder is dropped without sending a response, so that the client
20491/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
20492impl std::ops::Drop for SymlinkDescribeResponder {
20493    fn drop(&mut self) {
20494        self.control_handle.shutdown();
20495        // Safety: drops once, never accessed again
20496        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20497    }
20498}
20499
20500impl fidl::endpoints::Responder for SymlinkDescribeResponder {
20501    type ControlHandle = SymlinkControlHandle;
20502
20503    fn control_handle(&self) -> &SymlinkControlHandle {
20504        &self.control_handle
20505    }
20506
20507    fn drop_without_shutdown(mut self) {
20508        // Safety: drops once, never accessed again due to mem::forget
20509        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
20510        // Prevent Drop from running (which would shut down the channel)
20511        std::mem::forget(self);
20512    }
20513}
20514
20515impl SymlinkDescribeResponder {
20516    /// Sends a response to the FIDL transaction.
20517    ///
20518    /// Sets the channel to shutdown if an error occurs.
20519    pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20520        let _result = self.send_raw(payload);
20521        if _result.is_err() {
20522            self.control_handle.shutdown();
20523        }
20524        self.drop_without_shutdown();
20525        _result
20526    }
20527
20528    /// Similar to "send" but does not shutdown the channel if an error occurs.
20529    pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20530        let _result = self.send_raw(payload);
20531        self.drop_without_shutdown();
20532        _result
20533    }
20534
20535    fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
20536        self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
20537            fidl::encoding::Flexible::new(payload),
20538            self.tx_id,
20539            0x742c2ea5e89831f3,
20540            fidl::encoding::DynamicFlags::FLEXIBLE,
20541        )
20542    }
20543}
20544
20545#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
20546pub struct WritableMarker;
20547
20548impl fidl::endpoints::ProtocolMarker for WritableMarker {
20549    type Proxy = WritableProxy;
20550    type RequestStream = WritableRequestStream;
20551    #[cfg(target_os = "fuchsia")]
20552    type SynchronousProxy = WritableSynchronousProxy;
20553
20554    const DEBUG_NAME: &'static str = "(anonymous) Writable";
20555}
20556pub type WritableWriteResult = Result<u64, i32>;
20557
20558pub trait WritableProxyInterface: Send + Sync {
20559    type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
20560        + Send;
20561    fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
20562}
20563#[derive(Debug)]
20564#[cfg(target_os = "fuchsia")]
20565pub struct WritableSynchronousProxy {
20566    client: fidl::client::sync::Client,
20567}
20568
20569#[cfg(target_os = "fuchsia")]
20570impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
20571    type Proxy = WritableProxy;
20572    type Protocol = WritableMarker;
20573
20574    fn from_channel(inner: fidl::Channel) -> Self {
20575        Self::new(inner)
20576    }
20577
20578    fn into_channel(self) -> fidl::Channel {
20579        self.client.into_channel()
20580    }
20581
20582    fn as_channel(&self) -> &fidl::Channel {
20583        self.client.as_channel()
20584    }
20585}
20586
20587#[cfg(target_os = "fuchsia")]
20588impl WritableSynchronousProxy {
20589    pub fn new(channel: fidl::Channel) -> Self {
20590        Self { client: fidl::client::sync::Client::new(channel) }
20591    }
20592
20593    pub fn into_channel(self) -> fidl::Channel {
20594        self.client.into_channel()
20595    }
20596
20597    /// Waits until an event arrives and returns it. It is safe for other
20598    /// threads to make concurrent requests while waiting for an event.
20599    pub fn wait_for_event(
20600        &self,
20601        deadline: zx::MonotonicInstant,
20602    ) -> Result<WritableEvent, fidl::Error> {
20603        WritableEvent::decode(self.client.wait_for_event::<WritableMarker>(deadline)?)
20604    }
20605
20606    /// Writes data at the seek offset.
20607    /// The seek offset is moved forward by the number of bytes written.
20608    /// If the file is in append mode, the seek offset is first set to the end
20609    /// of the file, followed by the write, in one atomic step.
20610    ///
20611    /// The file size may grow if the seek offset plus `data.length` is beyond
20612    /// the current end of file.
20613    ///
20614    /// + request `data` the byte buffer to write to the file.
20615    /// - response `actual_count` the number of bytes written.
20616    ///
20617    /// ## Invariants
20618    ///
20619    /// * The returned `actual_count` will never be greater than `data.length`.
20620    /// * If the server is unable to write all the data due to e.g. not enough
20621    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20622    ///   could be written, an error is returned.
20623    /// * If `data.length` is zero, the server should perform all the checks
20624    ///   ensuring write access without mutating the file and return a
20625    ///   successful write of zero bytes.  The seek offset is still updated if
20626    ///   in append mode.
20627    ///
20628    /// This method requires the [`Rights.WRITE_BYTES`] right.
20629    pub fn r#write(
20630        &self,
20631        mut data: &[u8],
20632        ___deadline: zx::MonotonicInstant,
20633    ) -> Result<WritableWriteResult, fidl::Error> {
20634        let _response = self.client.send_query::<
20635            WritableWriteRequest,
20636            fidl::encoding::ResultType<WritableWriteResponse, i32>,
20637            WritableMarker,
20638        >(
20639            (data,),
20640            0x6a31437832469f82,
20641            fidl::encoding::DynamicFlags::empty(),
20642            ___deadline,
20643        )?;
20644        Ok(_response.map(|x| x.actual_count))
20645    }
20646}
20647
20648#[cfg(target_os = "fuchsia")]
20649impl From<WritableSynchronousProxy> for zx::NullableHandle {
20650    fn from(value: WritableSynchronousProxy) -> Self {
20651        value.into_channel().into()
20652    }
20653}
20654
20655#[cfg(target_os = "fuchsia")]
20656impl From<fidl::Channel> for WritableSynchronousProxy {
20657    fn from(value: fidl::Channel) -> Self {
20658        Self::new(value)
20659    }
20660}
20661
20662#[cfg(target_os = "fuchsia")]
20663impl fidl::endpoints::FromClient for WritableSynchronousProxy {
20664    type Protocol = WritableMarker;
20665
20666    fn from_client(value: fidl::endpoints::ClientEnd<WritableMarker>) -> Self {
20667        Self::new(value.into_channel())
20668    }
20669}
20670
20671#[derive(Debug, Clone)]
20672pub struct WritableProxy {
20673    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
20674}
20675
20676impl fidl::endpoints::Proxy for WritableProxy {
20677    type Protocol = WritableMarker;
20678
20679    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
20680        Self::new(inner)
20681    }
20682
20683    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
20684        self.client.into_channel().map_err(|client| Self { client })
20685    }
20686
20687    fn as_channel(&self) -> &::fidl::AsyncChannel {
20688        self.client.as_channel()
20689    }
20690}
20691
20692impl WritableProxy {
20693    /// Create a new Proxy for fuchsia.io/Writable.
20694    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
20695        let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
20696        Self { client: fidl::client::Client::new(channel, protocol_name) }
20697    }
20698
20699    /// Get a Stream of events from the remote end of the protocol.
20700    ///
20701    /// # Panics
20702    ///
20703    /// Panics if the event stream was already taken.
20704    pub fn take_event_stream(&self) -> WritableEventStream {
20705        WritableEventStream { event_receiver: self.client.take_event_receiver() }
20706    }
20707
20708    /// Writes data at the seek offset.
20709    /// The seek offset is moved forward by the number of bytes written.
20710    /// If the file is in append mode, the seek offset is first set to the end
20711    /// of the file, followed by the write, in one atomic step.
20712    ///
20713    /// The file size may grow if the seek offset plus `data.length` is beyond
20714    /// the current end of file.
20715    ///
20716    /// + request `data` the byte buffer to write to the file.
20717    /// - response `actual_count` the number of bytes written.
20718    ///
20719    /// ## Invariants
20720    ///
20721    /// * The returned `actual_count` will never be greater than `data.length`.
20722    /// * If the server is unable to write all the data due to e.g. not enough
20723    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20724    ///   could be written, an error is returned.
20725    /// * If `data.length` is zero, the server should perform all the checks
20726    ///   ensuring write access without mutating the file and return a
20727    ///   successful write of zero bytes.  The seek offset is still updated if
20728    ///   in append mode.
20729    ///
20730    /// This method requires the [`Rights.WRITE_BYTES`] right.
20731    pub fn r#write(
20732        &self,
20733        mut data: &[u8],
20734    ) -> fidl::client::QueryResponseFut<
20735        WritableWriteResult,
20736        fidl::encoding::DefaultFuchsiaResourceDialect,
20737    > {
20738        WritableProxyInterface::r#write(self, data)
20739    }
20740}
20741
20742impl WritableProxyInterface for WritableProxy {
20743    type WriteResponseFut = fidl::client::QueryResponseFut<
20744        WritableWriteResult,
20745        fidl::encoding::DefaultFuchsiaResourceDialect,
20746    >;
20747    fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
20748        fn _decode(
20749            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
20750        ) -> Result<WritableWriteResult, fidl::Error> {
20751            let _response = fidl::client::decode_transaction_body::<
20752                fidl::encoding::ResultType<WritableWriteResponse, i32>,
20753                fidl::encoding::DefaultFuchsiaResourceDialect,
20754                0x6a31437832469f82,
20755            >(_buf?)?;
20756            Ok(_response.map(|x| x.actual_count))
20757        }
20758        self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
20759            (data,),
20760            0x6a31437832469f82,
20761            fidl::encoding::DynamicFlags::empty(),
20762            _decode,
20763        )
20764    }
20765}
20766
20767pub struct WritableEventStream {
20768    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
20769}
20770
20771impl std::marker::Unpin for WritableEventStream {}
20772
20773impl futures::stream::FusedStream for WritableEventStream {
20774    fn is_terminated(&self) -> bool {
20775        self.event_receiver.is_terminated()
20776    }
20777}
20778
20779impl futures::Stream for WritableEventStream {
20780    type Item = Result<WritableEvent, fidl::Error>;
20781
20782    fn poll_next(
20783        mut self: std::pin::Pin<&mut Self>,
20784        cx: &mut std::task::Context<'_>,
20785    ) -> std::task::Poll<Option<Self::Item>> {
20786        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
20787            &mut self.event_receiver,
20788            cx
20789        )?) {
20790            Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
20791            None => std::task::Poll::Ready(None),
20792        }
20793    }
20794}
20795
20796#[derive(Debug)]
20797pub enum WritableEvent {}
20798
20799impl WritableEvent {
20800    /// Decodes a message buffer as a [`WritableEvent`].
20801    fn decode(
20802        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
20803    ) -> Result<WritableEvent, fidl::Error> {
20804        let (bytes, _handles) = buf.split_mut();
20805        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20806        debug_assert_eq!(tx_header.tx_id, 0);
20807        match tx_header.ordinal {
20808            _ => Err(fidl::Error::UnknownOrdinal {
20809                ordinal: tx_header.ordinal,
20810                protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20811            }),
20812        }
20813    }
20814}
20815
20816/// A Stream of incoming requests for fuchsia.io/Writable.
20817pub struct WritableRequestStream {
20818    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20819    is_terminated: bool,
20820}
20821
20822impl std::marker::Unpin for WritableRequestStream {}
20823
20824impl futures::stream::FusedStream for WritableRequestStream {
20825    fn is_terminated(&self) -> bool {
20826        self.is_terminated
20827    }
20828}
20829
20830impl fidl::endpoints::RequestStream for WritableRequestStream {
20831    type Protocol = WritableMarker;
20832    type ControlHandle = WritableControlHandle;
20833
20834    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
20835        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
20836    }
20837
20838    fn control_handle(&self) -> Self::ControlHandle {
20839        WritableControlHandle { inner: self.inner.clone() }
20840    }
20841
20842    fn into_inner(
20843        self,
20844    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
20845    {
20846        (self.inner, self.is_terminated)
20847    }
20848
20849    fn from_inner(
20850        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20851        is_terminated: bool,
20852    ) -> Self {
20853        Self { inner, is_terminated }
20854    }
20855}
20856
20857impl futures::Stream for WritableRequestStream {
20858    type Item = Result<WritableRequest, fidl::Error>;
20859
20860    fn poll_next(
20861        mut self: std::pin::Pin<&mut Self>,
20862        cx: &mut std::task::Context<'_>,
20863    ) -> std::task::Poll<Option<Self::Item>> {
20864        let this = &mut *self;
20865        if this.inner.check_shutdown(cx) {
20866            this.is_terminated = true;
20867            return std::task::Poll::Ready(None);
20868        }
20869        if this.is_terminated {
20870            panic!("polled WritableRequestStream after completion");
20871        }
20872        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
20873            |bytes, handles| {
20874                match this.inner.channel().read_etc(cx, bytes, handles) {
20875                    std::task::Poll::Ready(Ok(())) => {}
20876                    std::task::Poll::Pending => return std::task::Poll::Pending,
20877                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
20878                        this.is_terminated = true;
20879                        return std::task::Poll::Ready(None);
20880                    }
20881                    std::task::Poll::Ready(Err(e)) => {
20882                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
20883                            e.into(),
20884                        ))));
20885                    }
20886                }
20887
20888                // A message has been received from the channel
20889                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
20890
20891                std::task::Poll::Ready(Some(match header.ordinal {
20892                    0x6a31437832469f82 => {
20893                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
20894                        let mut req = fidl::new_empty!(
20895                            WritableWriteRequest,
20896                            fidl::encoding::DefaultFuchsiaResourceDialect
20897                        );
20898                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
20899                        let control_handle = WritableControlHandle { inner: this.inner.clone() };
20900                        Ok(WritableRequest::Write {
20901                            data: req.data,
20902
20903                            responder: WritableWriteResponder {
20904                                control_handle: std::mem::ManuallyDrop::new(control_handle),
20905                                tx_id: header.tx_id,
20906                            },
20907                        })
20908                    }
20909                    _ => Err(fidl::Error::UnknownOrdinal {
20910                        ordinal: header.ordinal,
20911                        protocol_name:
20912                            <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
20913                    }),
20914                }))
20915            },
20916        )
20917    }
20918}
20919
20920#[derive(Debug)]
20921pub enum WritableRequest {
20922    /// Writes data at the seek offset.
20923    /// The seek offset is moved forward by the number of bytes written.
20924    /// If the file is in append mode, the seek offset is first set to the end
20925    /// of the file, followed by the write, in one atomic step.
20926    ///
20927    /// The file size may grow if the seek offset plus `data.length` is beyond
20928    /// the current end of file.
20929    ///
20930    /// + request `data` the byte buffer to write to the file.
20931    /// - response `actual_count` the number of bytes written.
20932    ///
20933    /// ## Invariants
20934    ///
20935    /// * The returned `actual_count` will never be greater than `data.length`.
20936    /// * If the server is unable to write all the data due to e.g. not enough
20937    ///   space, `actual_count` may be less than `data.length`.  If no bytes
20938    ///   could be written, an error is returned.
20939    /// * If `data.length` is zero, the server should perform all the checks
20940    ///   ensuring write access without mutating the file and return a
20941    ///   successful write of zero bytes.  The seek offset is still updated if
20942    ///   in append mode.
20943    ///
20944    /// This method requires the [`Rights.WRITE_BYTES`] right.
20945    Write { data: Vec<u8>, responder: WritableWriteResponder },
20946}
20947
20948impl WritableRequest {
20949    #[allow(irrefutable_let_patterns)]
20950    pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
20951        if let WritableRequest::Write { data, responder } = self {
20952            Some((data, responder))
20953        } else {
20954            None
20955        }
20956    }
20957
20958    /// Name of the method defined in FIDL
20959    pub fn method_name(&self) -> &'static str {
20960        match *self {
20961            WritableRequest::Write { .. } => "write",
20962        }
20963    }
20964}
20965
20966#[derive(Debug, Clone)]
20967pub struct WritableControlHandle {
20968    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
20969}
20970
20971impl fidl::endpoints::ControlHandle for WritableControlHandle {
20972    fn shutdown(&self) {
20973        self.inner.shutdown()
20974    }
20975
20976    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
20977        self.inner.shutdown_with_epitaph(status)
20978    }
20979
20980    fn is_closed(&self) -> bool {
20981        self.inner.channel().is_closed()
20982    }
20983    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
20984        self.inner.channel().on_closed()
20985    }
20986
20987    #[cfg(target_os = "fuchsia")]
20988    fn signal_peer(
20989        &self,
20990        clear_mask: zx::Signals,
20991        set_mask: zx::Signals,
20992    ) -> Result<(), zx_status::Status> {
20993        use fidl::Peered;
20994        self.inner.channel().signal_peer(clear_mask, set_mask)
20995    }
20996}
20997
20998impl WritableControlHandle {}
20999
21000#[must_use = "FIDL methods require a response to be sent"]
21001#[derive(Debug)]
21002pub struct WritableWriteResponder {
21003    control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
21004    tx_id: u32,
21005}
21006
21007/// Set the the channel to be shutdown (see [`WritableControlHandle::shutdown`])
21008/// if the responder is dropped without sending a response, so that the client
21009/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
21010impl std::ops::Drop for WritableWriteResponder {
21011    fn drop(&mut self) {
21012        self.control_handle.shutdown();
21013        // Safety: drops once, never accessed again
21014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21015    }
21016}
21017
21018impl fidl::endpoints::Responder for WritableWriteResponder {
21019    type ControlHandle = WritableControlHandle;
21020
21021    fn control_handle(&self) -> &WritableControlHandle {
21022        &self.control_handle
21023    }
21024
21025    fn drop_without_shutdown(mut self) {
21026        // Safety: drops once, never accessed again due to mem::forget
21027        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
21028        // Prevent Drop from running (which would shut down the channel)
21029        std::mem::forget(self);
21030    }
21031}
21032
21033impl WritableWriteResponder {
21034    /// Sends a response to the FIDL transaction.
21035    ///
21036    /// Sets the channel to shutdown if an error occurs.
21037    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21038        let _result = self.send_raw(result);
21039        if _result.is_err() {
21040            self.control_handle.shutdown();
21041        }
21042        self.drop_without_shutdown();
21043        _result
21044    }
21045
21046    /// Similar to "send" but does not shutdown the channel if an error occurs.
21047    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21048        let _result = self.send_raw(result);
21049        self.drop_without_shutdown();
21050        _result
21051    }
21052
21053    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
21054        self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
21055            result.map(|actual_count| (actual_count,)),
21056            self.tx_id,
21057            0x6a31437832469f82,
21058            fidl::encoding::DynamicFlags::empty(),
21059        )
21060    }
21061}
21062
21063mod internal {
21064    use super::*;
21065
21066    impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
21067        type Borrowed<'a> = &'a mut Self;
21068        fn take_or_borrow<'a>(
21069            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21070        ) -> Self::Borrowed<'a> {
21071            value
21072        }
21073    }
21074
21075    unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
21076        type Owned = Self;
21077
21078        #[inline(always)]
21079        fn inline_align(_context: fidl::encoding::Context) -> usize {
21080            8
21081        }
21082
21083        #[inline(always)]
21084        fn inline_size(_context: fidl::encoding::Context) -> usize {
21085            40
21086        }
21087    }
21088
21089    unsafe impl
21090        fidl::encoding::Encode<
21091            DirectoryCreateSymlinkRequest,
21092            fidl::encoding::DefaultFuchsiaResourceDialect,
21093        > for &mut DirectoryCreateSymlinkRequest
21094    {
21095        #[inline]
21096        unsafe fn encode(
21097            self,
21098            encoder: &mut fidl::encoding::Encoder<
21099                '_,
21100                fidl::encoding::DefaultFuchsiaResourceDialect,
21101            >,
21102            offset: usize,
21103            _depth: fidl::encoding::Depth,
21104        ) -> fidl::Result<()> {
21105            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21106            // Delegate to tuple encoding.
21107            fidl::encoding::Encode::<
21108                DirectoryCreateSymlinkRequest,
21109                fidl::encoding::DefaultFuchsiaResourceDialect,
21110            >::encode(
21111                (
21112                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21113                        &self.name,
21114                    ),
21115                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
21116                        &self.target,
21117                    ),
21118                    <fidl::encoding::Optional<
21119                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21120                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21121                        &mut self.connection
21122                    ),
21123                ),
21124                encoder,
21125                offset,
21126                _depth,
21127            )
21128        }
21129    }
21130    unsafe impl<
21131        T0: fidl::encoding::Encode<
21132                fidl::encoding::BoundedString<255>,
21133                fidl::encoding::DefaultFuchsiaResourceDialect,
21134            >,
21135        T1: fidl::encoding::Encode<
21136                fidl::encoding::Vector<u8, 4095>,
21137                fidl::encoding::DefaultFuchsiaResourceDialect,
21138            >,
21139        T2: fidl::encoding::Encode<
21140                fidl::encoding::Optional<
21141                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21142                >,
21143                fidl::encoding::DefaultFuchsiaResourceDialect,
21144            >,
21145    >
21146        fidl::encoding::Encode<
21147            DirectoryCreateSymlinkRequest,
21148            fidl::encoding::DefaultFuchsiaResourceDialect,
21149        > for (T0, T1, T2)
21150    {
21151        #[inline]
21152        unsafe fn encode(
21153            self,
21154            encoder: &mut fidl::encoding::Encoder<
21155                '_,
21156                fidl::encoding::DefaultFuchsiaResourceDialect,
21157            >,
21158            offset: usize,
21159            depth: fidl::encoding::Depth,
21160        ) -> fidl::Result<()> {
21161            encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
21162            // Zero out padding regions. There's no need to apply masks
21163            // because the unmasked parts will be overwritten by fields.
21164            unsafe {
21165                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
21166                (ptr as *mut u64).write_unaligned(0);
21167            }
21168            // Write the fields.
21169            self.0.encode(encoder, offset + 0, depth)?;
21170            self.1.encode(encoder, offset + 16, depth)?;
21171            self.2.encode(encoder, offset + 32, depth)?;
21172            Ok(())
21173        }
21174    }
21175
21176    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21177        for DirectoryCreateSymlinkRequest
21178    {
21179        #[inline(always)]
21180        fn new_empty() -> Self {
21181            Self {
21182                name: fidl::new_empty!(
21183                    fidl::encoding::BoundedString<255>,
21184                    fidl::encoding::DefaultFuchsiaResourceDialect
21185                ),
21186                target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
21187                connection: fidl::new_empty!(
21188                    fidl::encoding::Optional<
21189                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21190                    >,
21191                    fidl::encoding::DefaultFuchsiaResourceDialect
21192                ),
21193            }
21194        }
21195
21196        #[inline]
21197        unsafe fn decode(
21198            &mut self,
21199            decoder: &mut fidl::encoding::Decoder<
21200                '_,
21201                fidl::encoding::DefaultFuchsiaResourceDialect,
21202            >,
21203            offset: usize,
21204            _depth: fidl::encoding::Depth,
21205        ) -> fidl::Result<()> {
21206            decoder.debug_check_bounds::<Self>(offset);
21207            // Verify that padding bytes are zero.
21208            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
21209            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21210            let mask = 0xffffffff00000000u64;
21211            let maskedval = padval & mask;
21212            if maskedval != 0 {
21213                return Err(fidl::Error::NonZeroPadding {
21214                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
21215                });
21216            }
21217            fidl::decode!(
21218                fidl::encoding::BoundedString<255>,
21219                fidl::encoding::DefaultFuchsiaResourceDialect,
21220                &mut self.name,
21221                decoder,
21222                offset + 0,
21223                _depth
21224            )?;
21225            fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
21226            fidl::decode!(
21227                fidl::encoding::Optional<
21228                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
21229                >,
21230                fidl::encoding::DefaultFuchsiaResourceDialect,
21231                &mut self.connection,
21232                decoder,
21233                offset + 32,
21234                _depth
21235            )?;
21236            Ok(())
21237        }
21238    }
21239
21240    impl fidl::encoding::ResourceTypeMarker for DirectoryDeprecatedOpenRequest {
21241        type Borrowed<'a> = &'a mut Self;
21242        fn take_or_borrow<'a>(
21243            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21244        ) -> Self::Borrowed<'a> {
21245            value
21246        }
21247    }
21248
21249    unsafe impl fidl::encoding::TypeMarker for DirectoryDeprecatedOpenRequest {
21250        type Owned = Self;
21251
21252        #[inline(always)]
21253        fn inline_align(_context: fidl::encoding::Context) -> usize {
21254            8
21255        }
21256
21257        #[inline(always)]
21258        fn inline_size(_context: fidl::encoding::Context) -> usize {
21259            32
21260        }
21261    }
21262
21263    unsafe impl
21264        fidl::encoding::Encode<
21265            DirectoryDeprecatedOpenRequest,
21266            fidl::encoding::DefaultFuchsiaResourceDialect,
21267        > for &mut DirectoryDeprecatedOpenRequest
21268    {
21269        #[inline]
21270        unsafe fn encode(
21271            self,
21272            encoder: &mut fidl::encoding::Encoder<
21273                '_,
21274                fidl::encoding::DefaultFuchsiaResourceDialect,
21275            >,
21276            offset: usize,
21277            _depth: fidl::encoding::Depth,
21278        ) -> fidl::Result<()> {
21279            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21280            // Delegate to tuple encoding.
21281            fidl::encoding::Encode::<DirectoryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21282                (
21283                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
21284                    <ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
21285                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
21286                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
21287                ),
21288                encoder, offset, _depth
21289            )
21290        }
21291    }
21292    unsafe impl<
21293        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
21294        T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
21295        T2: fidl::encoding::Encode<
21296                fidl::encoding::BoundedString<4095>,
21297                fidl::encoding::DefaultFuchsiaResourceDialect,
21298            >,
21299        T3: fidl::encoding::Encode<
21300                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21301                fidl::encoding::DefaultFuchsiaResourceDialect,
21302            >,
21303    >
21304        fidl::encoding::Encode<
21305            DirectoryDeprecatedOpenRequest,
21306            fidl::encoding::DefaultFuchsiaResourceDialect,
21307        > for (T0, T1, T2, T3)
21308    {
21309        #[inline]
21310        unsafe fn encode(
21311            self,
21312            encoder: &mut fidl::encoding::Encoder<
21313                '_,
21314                fidl::encoding::DefaultFuchsiaResourceDialect,
21315            >,
21316            offset: usize,
21317            depth: fidl::encoding::Depth,
21318        ) -> fidl::Result<()> {
21319            encoder.debug_check_bounds::<DirectoryDeprecatedOpenRequest>(offset);
21320            // Zero out padding regions. There's no need to apply masks
21321            // because the unmasked parts will be overwritten by fields.
21322            unsafe {
21323                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
21324                (ptr as *mut u64).write_unaligned(0);
21325            }
21326            // Write the fields.
21327            self.0.encode(encoder, offset + 0, depth)?;
21328            self.1.encode(encoder, offset + 4, depth)?;
21329            self.2.encode(encoder, offset + 8, depth)?;
21330            self.3.encode(encoder, offset + 24, depth)?;
21331            Ok(())
21332        }
21333    }
21334
21335    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21336        for DirectoryDeprecatedOpenRequest
21337    {
21338        #[inline(always)]
21339        fn new_empty() -> Self {
21340            Self {
21341                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
21342                mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
21343                path: fidl::new_empty!(
21344                    fidl::encoding::BoundedString<4095>,
21345                    fidl::encoding::DefaultFuchsiaResourceDialect
21346                ),
21347                object: fidl::new_empty!(
21348                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21349                    fidl::encoding::DefaultFuchsiaResourceDialect
21350                ),
21351            }
21352        }
21353
21354        #[inline]
21355        unsafe fn decode(
21356            &mut self,
21357            decoder: &mut fidl::encoding::Decoder<
21358                '_,
21359                fidl::encoding::DefaultFuchsiaResourceDialect,
21360            >,
21361            offset: usize,
21362            _depth: fidl::encoding::Depth,
21363        ) -> fidl::Result<()> {
21364            decoder.debug_check_bounds::<Self>(offset);
21365            // Verify that padding bytes are zero.
21366            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
21367            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21368            let mask = 0xffffffff00000000u64;
21369            let maskedval = padval & mask;
21370            if maskedval != 0 {
21371                return Err(fidl::Error::NonZeroPadding {
21372                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
21373                });
21374            }
21375            fidl::decode!(
21376                OpenFlags,
21377                fidl::encoding::DefaultFuchsiaResourceDialect,
21378                &mut self.flags,
21379                decoder,
21380                offset + 0,
21381                _depth
21382            )?;
21383            fidl::decode!(
21384                ModeType,
21385                fidl::encoding::DefaultFuchsiaResourceDialect,
21386                &mut self.mode,
21387                decoder,
21388                offset + 4,
21389                _depth
21390            )?;
21391            fidl::decode!(
21392                fidl::encoding::BoundedString<4095>,
21393                fidl::encoding::DefaultFuchsiaResourceDialect,
21394                &mut self.path,
21395                decoder,
21396                offset + 8,
21397                _depth
21398            )?;
21399            fidl::decode!(
21400                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
21401                fidl::encoding::DefaultFuchsiaResourceDialect,
21402                &mut self.object,
21403                decoder,
21404                offset + 24,
21405                _depth
21406            )?;
21407            Ok(())
21408        }
21409    }
21410
21411    impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
21412        type Borrowed<'a> = &'a mut Self;
21413        fn take_or_borrow<'a>(
21414            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21415        ) -> Self::Borrowed<'a> {
21416            value
21417        }
21418    }
21419
21420    unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
21421        type Owned = Self;
21422
21423        #[inline(always)]
21424        fn inline_align(_context: fidl::encoding::Context) -> usize {
21425            4
21426        }
21427
21428        #[inline(always)]
21429        fn inline_size(_context: fidl::encoding::Context) -> usize {
21430            8
21431        }
21432    }
21433
21434    unsafe impl
21435        fidl::encoding::Encode<
21436            DirectoryGetTokenResponse,
21437            fidl::encoding::DefaultFuchsiaResourceDialect,
21438        > for &mut DirectoryGetTokenResponse
21439    {
21440        #[inline]
21441        unsafe fn encode(
21442            self,
21443            encoder: &mut fidl::encoding::Encoder<
21444                '_,
21445                fidl::encoding::DefaultFuchsiaResourceDialect,
21446            >,
21447            offset: usize,
21448            _depth: fidl::encoding::Depth,
21449        ) -> fidl::Result<()> {
21450            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21451            // Delegate to tuple encoding.
21452            fidl::encoding::Encode::<
21453                DirectoryGetTokenResponse,
21454                fidl::encoding::DefaultFuchsiaResourceDialect,
21455            >::encode(
21456                (
21457                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
21458                    <fidl::encoding::Optional<
21459                        fidl::encoding::HandleType<
21460                            fidl::NullableHandle,
21461                            { fidl::ObjectType::NONE.into_raw() },
21462                            2147483648,
21463                        >,
21464                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21465                        &mut self.token
21466                    ),
21467                ),
21468                encoder,
21469                offset,
21470                _depth,
21471            )
21472        }
21473    }
21474    unsafe impl<
21475        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21476        T1: fidl::encoding::Encode<
21477                fidl::encoding::Optional<
21478                    fidl::encoding::HandleType<
21479                        fidl::NullableHandle,
21480                        { fidl::ObjectType::NONE.into_raw() },
21481                        2147483648,
21482                    >,
21483                >,
21484                fidl::encoding::DefaultFuchsiaResourceDialect,
21485            >,
21486    >
21487        fidl::encoding::Encode<
21488            DirectoryGetTokenResponse,
21489            fidl::encoding::DefaultFuchsiaResourceDialect,
21490        > for (T0, T1)
21491    {
21492        #[inline]
21493        unsafe fn encode(
21494            self,
21495            encoder: &mut fidl::encoding::Encoder<
21496                '_,
21497                fidl::encoding::DefaultFuchsiaResourceDialect,
21498            >,
21499            offset: usize,
21500            depth: fidl::encoding::Depth,
21501        ) -> fidl::Result<()> {
21502            encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
21503            // Zero out padding regions. There's no need to apply masks
21504            // because the unmasked parts will be overwritten by fields.
21505            // Write the fields.
21506            self.0.encode(encoder, offset + 0, depth)?;
21507            self.1.encode(encoder, offset + 4, depth)?;
21508            Ok(())
21509        }
21510    }
21511
21512    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21513        for DirectoryGetTokenResponse
21514    {
21515        #[inline(always)]
21516        fn new_empty() -> Self {
21517            Self {
21518                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
21519                token: fidl::new_empty!(
21520                    fidl::encoding::Optional<
21521                        fidl::encoding::HandleType<
21522                            fidl::NullableHandle,
21523                            { fidl::ObjectType::NONE.into_raw() },
21524                            2147483648,
21525                        >,
21526                    >,
21527                    fidl::encoding::DefaultFuchsiaResourceDialect
21528                ),
21529            }
21530        }
21531
21532        #[inline]
21533        unsafe fn decode(
21534            &mut self,
21535            decoder: &mut fidl::encoding::Decoder<
21536                '_,
21537                fidl::encoding::DefaultFuchsiaResourceDialect,
21538            >,
21539            offset: usize,
21540            _depth: fidl::encoding::Depth,
21541        ) -> fidl::Result<()> {
21542            decoder.debug_check_bounds::<Self>(offset);
21543            // Verify that padding bytes are zero.
21544            fidl::decode!(
21545                i32,
21546                fidl::encoding::DefaultFuchsiaResourceDialect,
21547                &mut self.s,
21548                decoder,
21549                offset + 0,
21550                _depth
21551            )?;
21552            fidl::decode!(
21553                fidl::encoding::Optional<
21554                    fidl::encoding::HandleType<
21555                        fidl::NullableHandle,
21556                        { fidl::ObjectType::NONE.into_raw() },
21557                        2147483648,
21558                    >,
21559                >,
21560                fidl::encoding::DefaultFuchsiaResourceDialect,
21561                &mut self.token,
21562                decoder,
21563                offset + 4,
21564                _depth
21565            )?;
21566            Ok(())
21567        }
21568    }
21569
21570    impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
21571        type Borrowed<'a> = &'a mut Self;
21572        fn take_or_borrow<'a>(
21573            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21574        ) -> Self::Borrowed<'a> {
21575            value
21576        }
21577    }
21578
21579    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
21580        type Owned = Self;
21581
21582        #[inline(always)]
21583        fn inline_align(_context: fidl::encoding::Context) -> usize {
21584            8
21585        }
21586
21587        #[inline(always)]
21588        fn inline_size(_context: fidl::encoding::Context) -> usize {
21589            40
21590        }
21591    }
21592
21593    unsafe impl
21594        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21595        for &mut DirectoryLinkRequest
21596    {
21597        #[inline]
21598        unsafe fn encode(
21599            self,
21600            encoder: &mut fidl::encoding::Encoder<
21601                '_,
21602                fidl::encoding::DefaultFuchsiaResourceDialect,
21603            >,
21604            offset: usize,
21605            _depth: fidl::encoding::Depth,
21606        ) -> fidl::Result<()> {
21607            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21608            // Delegate to tuple encoding.
21609            fidl::encoding::Encode::<
21610                DirectoryLinkRequest,
21611                fidl::encoding::DefaultFuchsiaResourceDialect,
21612            >::encode(
21613                (
21614                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21615                        &self.src,
21616                    ),
21617                    <fidl::encoding::HandleType<
21618                        fidl::NullableHandle,
21619                        { fidl::ObjectType::NONE.into_raw() },
21620                        2147483648,
21621                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21622                        &mut self.dst_parent_token,
21623                    ),
21624                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21625                        &self.dst,
21626                    ),
21627                ),
21628                encoder,
21629                offset,
21630                _depth,
21631            )
21632        }
21633    }
21634    unsafe impl<
21635        T0: fidl::encoding::Encode<
21636                fidl::encoding::BoundedString<255>,
21637                fidl::encoding::DefaultFuchsiaResourceDialect,
21638            >,
21639        T1: fidl::encoding::Encode<
21640                fidl::encoding::HandleType<
21641                    fidl::NullableHandle,
21642                    { fidl::ObjectType::NONE.into_raw() },
21643                    2147483648,
21644                >,
21645                fidl::encoding::DefaultFuchsiaResourceDialect,
21646            >,
21647        T2: fidl::encoding::Encode<
21648                fidl::encoding::BoundedString<255>,
21649                fidl::encoding::DefaultFuchsiaResourceDialect,
21650            >,
21651    >
21652        fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21653        for (T0, T1, T2)
21654    {
21655        #[inline]
21656        unsafe fn encode(
21657            self,
21658            encoder: &mut fidl::encoding::Encoder<
21659                '_,
21660                fidl::encoding::DefaultFuchsiaResourceDialect,
21661            >,
21662            offset: usize,
21663            depth: fidl::encoding::Depth,
21664        ) -> fidl::Result<()> {
21665            encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
21666            // Zero out padding regions. There's no need to apply masks
21667            // because the unmasked parts will be overwritten by fields.
21668            unsafe {
21669                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21670                (ptr as *mut u64).write_unaligned(0);
21671            }
21672            // Write the fields.
21673            self.0.encode(encoder, offset + 0, depth)?;
21674            self.1.encode(encoder, offset + 16, depth)?;
21675            self.2.encode(encoder, offset + 24, depth)?;
21676            Ok(())
21677        }
21678    }
21679
21680    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21681        for DirectoryLinkRequest
21682    {
21683        #[inline(always)]
21684        fn new_empty() -> Self {
21685            Self {
21686                src: fidl::new_empty!(
21687                    fidl::encoding::BoundedString<255>,
21688                    fidl::encoding::DefaultFuchsiaResourceDialect
21689                ),
21690                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21691                dst: fidl::new_empty!(
21692                    fidl::encoding::BoundedString<255>,
21693                    fidl::encoding::DefaultFuchsiaResourceDialect
21694                ),
21695            }
21696        }
21697
21698        #[inline]
21699        unsafe fn decode(
21700            &mut self,
21701            decoder: &mut fidl::encoding::Decoder<
21702                '_,
21703                fidl::encoding::DefaultFuchsiaResourceDialect,
21704            >,
21705            offset: usize,
21706            _depth: fidl::encoding::Depth,
21707        ) -> fidl::Result<()> {
21708            decoder.debug_check_bounds::<Self>(offset);
21709            // Verify that padding bytes are zero.
21710            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21711            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21712            let mask = 0xffffffff00000000u64;
21713            let maskedval = padval & mask;
21714            if maskedval != 0 {
21715                return Err(fidl::Error::NonZeroPadding {
21716                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21717                });
21718            }
21719            fidl::decode!(
21720                fidl::encoding::BoundedString<255>,
21721                fidl::encoding::DefaultFuchsiaResourceDialect,
21722                &mut self.src,
21723                decoder,
21724                offset + 0,
21725                _depth
21726            )?;
21727            fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
21728            fidl::decode!(
21729                fidl::encoding::BoundedString<255>,
21730                fidl::encoding::DefaultFuchsiaResourceDialect,
21731                &mut self.dst,
21732                decoder,
21733                offset + 24,
21734                _depth
21735            )?;
21736            Ok(())
21737        }
21738    }
21739
21740    impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
21741        type Borrowed<'a> = &'a mut Self;
21742        fn take_or_borrow<'a>(
21743            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21744        ) -> Self::Borrowed<'a> {
21745            value
21746        }
21747    }
21748
21749    unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
21750        type Owned = Self;
21751
21752        #[inline(always)]
21753        fn inline_align(_context: fidl::encoding::Context) -> usize {
21754            8
21755        }
21756
21757        #[inline(always)]
21758        fn inline_size(_context: fidl::encoding::Context) -> usize {
21759            40
21760        }
21761    }
21762
21763    unsafe impl
21764        fidl::encoding::Encode<
21765            DirectoryRenameRequest,
21766            fidl::encoding::DefaultFuchsiaResourceDialect,
21767        > for &mut DirectoryRenameRequest
21768    {
21769        #[inline]
21770        unsafe fn encode(
21771            self,
21772            encoder: &mut fidl::encoding::Encoder<
21773                '_,
21774                fidl::encoding::DefaultFuchsiaResourceDialect,
21775            >,
21776            offset: usize,
21777            _depth: fidl::encoding::Depth,
21778        ) -> fidl::Result<()> {
21779            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21780            // Delegate to tuple encoding.
21781            fidl::encoding::Encode::<
21782                DirectoryRenameRequest,
21783                fidl::encoding::DefaultFuchsiaResourceDialect,
21784            >::encode(
21785                (
21786                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21787                        &self.src,
21788                    ),
21789                    <fidl::encoding::HandleType<
21790                        fidl::Event,
21791                        { fidl::ObjectType::EVENT.into_raw() },
21792                        2147483648,
21793                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21794                        &mut self.dst_parent_token,
21795                    ),
21796                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
21797                        &self.dst,
21798                    ),
21799                ),
21800                encoder,
21801                offset,
21802                _depth,
21803            )
21804        }
21805    }
21806    unsafe impl<
21807        T0: fidl::encoding::Encode<
21808                fidl::encoding::BoundedString<255>,
21809                fidl::encoding::DefaultFuchsiaResourceDialect,
21810            >,
21811        T1: fidl::encoding::Encode<
21812                fidl::encoding::HandleType<
21813                    fidl::Event,
21814                    { fidl::ObjectType::EVENT.into_raw() },
21815                    2147483648,
21816                >,
21817                fidl::encoding::DefaultFuchsiaResourceDialect,
21818            >,
21819        T2: fidl::encoding::Encode<
21820                fidl::encoding::BoundedString<255>,
21821                fidl::encoding::DefaultFuchsiaResourceDialect,
21822            >,
21823    >
21824        fidl::encoding::Encode<
21825            DirectoryRenameRequest,
21826            fidl::encoding::DefaultFuchsiaResourceDialect,
21827        > for (T0, T1, T2)
21828    {
21829        #[inline]
21830        unsafe fn encode(
21831            self,
21832            encoder: &mut fidl::encoding::Encoder<
21833                '_,
21834                fidl::encoding::DefaultFuchsiaResourceDialect,
21835            >,
21836            offset: usize,
21837            depth: fidl::encoding::Depth,
21838        ) -> fidl::Result<()> {
21839            encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
21840            // Zero out padding regions. There's no need to apply masks
21841            // because the unmasked parts will be overwritten by fields.
21842            unsafe {
21843                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
21844                (ptr as *mut u64).write_unaligned(0);
21845            }
21846            // Write the fields.
21847            self.0.encode(encoder, offset + 0, depth)?;
21848            self.1.encode(encoder, offset + 16, depth)?;
21849            self.2.encode(encoder, offset + 24, depth)?;
21850            Ok(())
21851        }
21852    }
21853
21854    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21855        for DirectoryRenameRequest
21856    {
21857        #[inline(always)]
21858        fn new_empty() -> Self {
21859            Self {
21860                src: fidl::new_empty!(
21861                    fidl::encoding::BoundedString<255>,
21862                    fidl::encoding::DefaultFuchsiaResourceDialect
21863                ),
21864                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21865                dst: fidl::new_empty!(
21866                    fidl::encoding::BoundedString<255>,
21867                    fidl::encoding::DefaultFuchsiaResourceDialect
21868                ),
21869            }
21870        }
21871
21872        #[inline]
21873        unsafe fn decode(
21874            &mut self,
21875            decoder: &mut fidl::encoding::Decoder<
21876                '_,
21877                fidl::encoding::DefaultFuchsiaResourceDialect,
21878            >,
21879            offset: usize,
21880            _depth: fidl::encoding::Depth,
21881        ) -> fidl::Result<()> {
21882            decoder.debug_check_bounds::<Self>(offset);
21883            // Verify that padding bytes are zero.
21884            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
21885            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21886            let mask = 0xffffffff00000000u64;
21887            let maskedval = padval & mask;
21888            if maskedval != 0 {
21889                return Err(fidl::Error::NonZeroPadding {
21890                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
21891                });
21892            }
21893            fidl::decode!(
21894                fidl::encoding::BoundedString<255>,
21895                fidl::encoding::DefaultFuchsiaResourceDialect,
21896                &mut self.src,
21897                decoder,
21898                offset + 0,
21899                _depth
21900            )?;
21901            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)?;
21902            fidl::decode!(
21903                fidl::encoding::BoundedString<255>,
21904                fidl::encoding::DefaultFuchsiaResourceDialect,
21905                &mut self.dst,
21906                decoder,
21907                offset + 24,
21908                _depth
21909            )?;
21910            Ok(())
21911        }
21912    }
21913
21914    impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
21915        type Borrowed<'a> = &'a mut Self;
21916        fn take_or_borrow<'a>(
21917            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21918        ) -> Self::Borrowed<'a> {
21919            value
21920        }
21921    }
21922
21923    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
21924        type Owned = Self;
21925
21926        #[inline(always)]
21927        fn inline_align(_context: fidl::encoding::Context) -> usize {
21928            4
21929        }
21930
21931        #[inline(always)]
21932        fn inline_size(_context: fidl::encoding::Context) -> usize {
21933            12
21934        }
21935    }
21936
21937    unsafe impl
21938        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21939        for &mut DirectoryWatchRequest
21940    {
21941        #[inline]
21942        unsafe fn encode(
21943            self,
21944            encoder: &mut fidl::encoding::Encoder<
21945                '_,
21946                fidl::encoding::DefaultFuchsiaResourceDialect,
21947            >,
21948            offset: usize,
21949            _depth: fidl::encoding::Depth,
21950        ) -> fidl::Result<()> {
21951            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21952            // Delegate to tuple encoding.
21953            fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21954                (
21955                    <WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
21956                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
21957                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
21958                ),
21959                encoder, offset, _depth
21960            )
21961        }
21962    }
21963    unsafe impl<
21964        T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
21965        T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
21966        T2: fidl::encoding::Encode<
21967                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
21968                fidl::encoding::DefaultFuchsiaResourceDialect,
21969            >,
21970    >
21971        fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
21972        for (T0, T1, T2)
21973    {
21974        #[inline]
21975        unsafe fn encode(
21976            self,
21977            encoder: &mut fidl::encoding::Encoder<
21978                '_,
21979                fidl::encoding::DefaultFuchsiaResourceDialect,
21980            >,
21981            offset: usize,
21982            depth: fidl::encoding::Depth,
21983        ) -> fidl::Result<()> {
21984            encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
21985            // Zero out padding regions. There's no need to apply masks
21986            // because the unmasked parts will be overwritten by fields.
21987            // Write the fields.
21988            self.0.encode(encoder, offset + 0, depth)?;
21989            self.1.encode(encoder, offset + 4, depth)?;
21990            self.2.encode(encoder, offset + 8, depth)?;
21991            Ok(())
21992        }
21993    }
21994
21995    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21996        for DirectoryWatchRequest
21997    {
21998        #[inline(always)]
21999        fn new_empty() -> Self {
22000            Self {
22001                mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
22002                options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
22003                watcher: fidl::new_empty!(
22004                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22005                    fidl::encoding::DefaultFuchsiaResourceDialect
22006                ),
22007            }
22008        }
22009
22010        #[inline]
22011        unsafe fn decode(
22012            &mut self,
22013            decoder: &mut fidl::encoding::Decoder<
22014                '_,
22015                fidl::encoding::DefaultFuchsiaResourceDialect,
22016            >,
22017            offset: usize,
22018            _depth: fidl::encoding::Depth,
22019        ) -> fidl::Result<()> {
22020            decoder.debug_check_bounds::<Self>(offset);
22021            // Verify that padding bytes are zero.
22022            fidl::decode!(
22023                WatchMask,
22024                fidl::encoding::DefaultFuchsiaResourceDialect,
22025                &mut self.mask,
22026                decoder,
22027                offset + 0,
22028                _depth
22029            )?;
22030            fidl::decode!(
22031                u32,
22032                fidl::encoding::DefaultFuchsiaResourceDialect,
22033                &mut self.options,
22034                decoder,
22035                offset + 4,
22036                _depth
22037            )?;
22038            fidl::decode!(
22039                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
22040                fidl::encoding::DefaultFuchsiaResourceDialect,
22041                &mut self.watcher,
22042                decoder,
22043                offset + 8,
22044                _depth
22045            )?;
22046            Ok(())
22047        }
22048    }
22049
22050    impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
22051        type Borrowed<'a> = &'a mut Self;
22052        fn take_or_borrow<'a>(
22053            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22054        ) -> Self::Borrowed<'a> {
22055            value
22056        }
22057    }
22058
22059    unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
22060        type Owned = Self;
22061
22062        #[inline(always)]
22063        fn inline_align(_context: fidl::encoding::Context) -> usize {
22064            8
22065        }
22066
22067        #[inline(always)]
22068        fn inline_size(_context: fidl::encoding::Context) -> usize {
22069            24
22070        }
22071    }
22072
22073    unsafe impl
22074        fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22075        for &mut FileAllocateRequest
22076    {
22077        #[inline]
22078        unsafe fn encode(
22079            self,
22080            encoder: &mut fidl::encoding::Encoder<
22081                '_,
22082                fidl::encoding::DefaultFuchsiaResourceDialect,
22083            >,
22084            offset: usize,
22085            _depth: fidl::encoding::Depth,
22086        ) -> fidl::Result<()> {
22087            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22088            // Delegate to tuple encoding.
22089            fidl::encoding::Encode::<
22090                FileAllocateRequest,
22091                fidl::encoding::DefaultFuchsiaResourceDialect,
22092            >::encode(
22093                (
22094                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
22095                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
22096                    <AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
22097                ),
22098                encoder,
22099                offset,
22100                _depth,
22101            )
22102        }
22103    }
22104    unsafe impl<
22105        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22106        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
22107        T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
22108    > fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22109        for (T0, T1, T2)
22110    {
22111        #[inline]
22112        unsafe fn encode(
22113            self,
22114            encoder: &mut fidl::encoding::Encoder<
22115                '_,
22116                fidl::encoding::DefaultFuchsiaResourceDialect,
22117            >,
22118            offset: usize,
22119            depth: fidl::encoding::Depth,
22120        ) -> fidl::Result<()> {
22121            encoder.debug_check_bounds::<FileAllocateRequest>(offset);
22122            // Zero out padding regions. There's no need to apply masks
22123            // because the unmasked parts will be overwritten by fields.
22124            unsafe {
22125                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
22126                (ptr as *mut u64).write_unaligned(0);
22127            }
22128            // Write the fields.
22129            self.0.encode(encoder, offset + 0, depth)?;
22130            self.1.encode(encoder, offset + 8, depth)?;
22131            self.2.encode(encoder, offset + 16, depth)?;
22132            Ok(())
22133        }
22134    }
22135
22136    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22137        for FileAllocateRequest
22138    {
22139        #[inline(always)]
22140        fn new_empty() -> Self {
22141            Self {
22142                offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22143                length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
22144                mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
22145            }
22146        }
22147
22148        #[inline]
22149        unsafe fn decode(
22150            &mut self,
22151            decoder: &mut fidl::encoding::Decoder<
22152                '_,
22153                fidl::encoding::DefaultFuchsiaResourceDialect,
22154            >,
22155            offset: usize,
22156            _depth: fidl::encoding::Depth,
22157        ) -> fidl::Result<()> {
22158            decoder.debug_check_bounds::<Self>(offset);
22159            // Verify that padding bytes are zero.
22160            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
22161            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22162            let mask = 0xffffffff00000000u64;
22163            let maskedval = padval & mask;
22164            if maskedval != 0 {
22165                return Err(fidl::Error::NonZeroPadding {
22166                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
22167                });
22168            }
22169            fidl::decode!(
22170                u64,
22171                fidl::encoding::DefaultFuchsiaResourceDialect,
22172                &mut self.offset,
22173                decoder,
22174                offset + 0,
22175                _depth
22176            )?;
22177            fidl::decode!(
22178                u64,
22179                fidl::encoding::DefaultFuchsiaResourceDialect,
22180                &mut self.length,
22181                decoder,
22182                offset + 8,
22183                _depth
22184            )?;
22185            fidl::decode!(
22186                AllocateMode,
22187                fidl::encoding::DefaultFuchsiaResourceDialect,
22188                &mut self.mode,
22189                decoder,
22190                offset + 16,
22191                _depth
22192            )?;
22193            Ok(())
22194        }
22195    }
22196
22197    impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
22198        type Borrowed<'a> = &'a mut Self;
22199        fn take_or_borrow<'a>(
22200            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22201        ) -> Self::Borrowed<'a> {
22202            value
22203        }
22204    }
22205
22206    unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
22207        type Owned = Self;
22208
22209        #[inline(always)]
22210        fn inline_align(_context: fidl::encoding::Context) -> usize {
22211            8
22212        }
22213
22214        #[inline(always)]
22215        fn inline_size(_context: fidl::encoding::Context) -> usize {
22216            16
22217        }
22218    }
22219
22220    unsafe impl
22221        fidl::encoding::Encode<
22222            FileEnableVerityRequest,
22223            fidl::encoding::DefaultFuchsiaResourceDialect,
22224        > for &mut FileEnableVerityRequest
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::<FileEnableVerityRequest>(offset);
22237            // Delegate to tuple encoding.
22238            fidl::encoding::Encode::<
22239                FileEnableVerityRequest,
22240                fidl::encoding::DefaultFuchsiaResourceDialect,
22241            >::encode(
22242                (<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
22243                encoder,
22244                offset,
22245                _depth,
22246            )
22247        }
22248    }
22249    unsafe impl<
22250        T0: fidl::encoding::Encode<VerificationOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
22251    >
22252        fidl::encoding::Encode<
22253            FileEnableVerityRequest,
22254            fidl::encoding::DefaultFuchsiaResourceDialect,
22255        > for (T0,)
22256    {
22257        #[inline]
22258        unsafe fn encode(
22259            self,
22260            encoder: &mut fidl::encoding::Encoder<
22261                '_,
22262                fidl::encoding::DefaultFuchsiaResourceDialect,
22263            >,
22264            offset: usize,
22265            depth: fidl::encoding::Depth,
22266        ) -> fidl::Result<()> {
22267            encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
22268            // Zero out padding regions. There's no need to apply masks
22269            // because the unmasked parts will be overwritten by fields.
22270            // Write the fields.
22271            self.0.encode(encoder, offset + 0, depth)?;
22272            Ok(())
22273        }
22274    }
22275
22276    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22277        for FileEnableVerityRequest
22278    {
22279        #[inline(always)]
22280        fn new_empty() -> Self {
22281            Self {
22282                options: fidl::new_empty!(
22283                    VerificationOptions,
22284                    fidl::encoding::DefaultFuchsiaResourceDialect
22285                ),
22286            }
22287        }
22288
22289        #[inline]
22290        unsafe fn decode(
22291            &mut self,
22292            decoder: &mut fidl::encoding::Decoder<
22293                '_,
22294                fidl::encoding::DefaultFuchsiaResourceDialect,
22295            >,
22296            offset: usize,
22297            _depth: fidl::encoding::Depth,
22298        ) -> fidl::Result<()> {
22299            decoder.debug_check_bounds::<Self>(offset);
22300            // Verify that padding bytes are zero.
22301            fidl::decode!(
22302                VerificationOptions,
22303                fidl::encoding::DefaultFuchsiaResourceDialect,
22304                &mut self.options,
22305                decoder,
22306                offset + 0,
22307                _depth
22308            )?;
22309            Ok(())
22310        }
22311    }
22312
22313    impl fidl::encoding::ResourceTypeMarker for FileObject {
22314        type Borrowed<'a> = &'a mut Self;
22315        fn take_or_borrow<'a>(
22316            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22317        ) -> Self::Borrowed<'a> {
22318            value
22319        }
22320    }
22321
22322    unsafe impl fidl::encoding::TypeMarker for FileObject {
22323        type Owned = Self;
22324
22325        #[inline(always)]
22326        fn inline_align(_context: fidl::encoding::Context) -> usize {
22327            4
22328        }
22329
22330        #[inline(always)]
22331        fn inline_size(_context: fidl::encoding::Context) -> usize {
22332            8
22333        }
22334    }
22335
22336    unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22337        for &mut FileObject
22338    {
22339        #[inline]
22340        unsafe fn encode(
22341            self,
22342            encoder: &mut fidl::encoding::Encoder<
22343                '_,
22344                fidl::encoding::DefaultFuchsiaResourceDialect,
22345            >,
22346            offset: usize,
22347            _depth: fidl::encoding::Depth,
22348        ) -> fidl::Result<()> {
22349            encoder.debug_check_bounds::<FileObject>(offset);
22350            // Delegate to tuple encoding.
22351            fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22352                (
22353                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
22354                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
22355                ),
22356                encoder, offset, _depth
22357            )
22358        }
22359    }
22360    unsafe impl<
22361        T0: fidl::encoding::Encode<
22362                fidl::encoding::Optional<
22363                    fidl::encoding::HandleType<
22364                        fidl::Event,
22365                        { fidl::ObjectType::EVENT.into_raw() },
22366                        2147483648,
22367                    >,
22368                >,
22369                fidl::encoding::DefaultFuchsiaResourceDialect,
22370            >,
22371        T1: fidl::encoding::Encode<
22372                fidl::encoding::Optional<
22373                    fidl::encoding::HandleType<
22374                        fidl::Stream,
22375                        { fidl::ObjectType::STREAM.into_raw() },
22376                        2147483648,
22377                    >,
22378                >,
22379                fidl::encoding::DefaultFuchsiaResourceDialect,
22380            >,
22381    > fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
22382        for (T0, T1)
22383    {
22384        #[inline]
22385        unsafe fn encode(
22386            self,
22387            encoder: &mut fidl::encoding::Encoder<
22388                '_,
22389                fidl::encoding::DefaultFuchsiaResourceDialect,
22390            >,
22391            offset: usize,
22392            depth: fidl::encoding::Depth,
22393        ) -> fidl::Result<()> {
22394            encoder.debug_check_bounds::<FileObject>(offset);
22395            // Zero out padding regions. There's no need to apply masks
22396            // because the unmasked parts will be overwritten by fields.
22397            // Write the fields.
22398            self.0.encode(encoder, offset + 0, depth)?;
22399            self.1.encode(encoder, offset + 4, depth)?;
22400            Ok(())
22401        }
22402    }
22403
22404    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
22405        #[inline(always)]
22406        fn new_empty() -> Self {
22407            Self {
22408                event: fidl::new_empty!(
22409                    fidl::encoding::Optional<
22410                        fidl::encoding::HandleType<
22411                            fidl::Event,
22412                            { fidl::ObjectType::EVENT.into_raw() },
22413                            2147483648,
22414                        >,
22415                    >,
22416                    fidl::encoding::DefaultFuchsiaResourceDialect
22417                ),
22418                stream: fidl::new_empty!(
22419                    fidl::encoding::Optional<
22420                        fidl::encoding::HandleType<
22421                            fidl::Stream,
22422                            { fidl::ObjectType::STREAM.into_raw() },
22423                            2147483648,
22424                        >,
22425                    >,
22426                    fidl::encoding::DefaultFuchsiaResourceDialect
22427                ),
22428            }
22429        }
22430
22431        #[inline]
22432        unsafe fn decode(
22433            &mut self,
22434            decoder: &mut fidl::encoding::Decoder<
22435                '_,
22436                fidl::encoding::DefaultFuchsiaResourceDialect,
22437            >,
22438            offset: usize,
22439            _depth: fidl::encoding::Depth,
22440        ) -> fidl::Result<()> {
22441            decoder.debug_check_bounds::<Self>(offset);
22442            // Verify that padding bytes are zero.
22443            fidl::decode!(
22444                fidl::encoding::Optional<
22445                    fidl::encoding::HandleType<
22446                        fidl::Event,
22447                        { fidl::ObjectType::EVENT.into_raw() },
22448                        2147483648,
22449                    >,
22450                >,
22451                fidl::encoding::DefaultFuchsiaResourceDialect,
22452                &mut self.event,
22453                decoder,
22454                offset + 0,
22455                _depth
22456            )?;
22457            fidl::decode!(
22458                fidl::encoding::Optional<
22459                    fidl::encoding::HandleType<
22460                        fidl::Stream,
22461                        { fidl::ObjectType::STREAM.into_raw() },
22462                        2147483648,
22463                    >,
22464                >,
22465                fidl::encoding::DefaultFuchsiaResourceDialect,
22466                &mut self.stream,
22467                decoder,
22468                offset + 4,
22469                _depth
22470            )?;
22471            Ok(())
22472        }
22473    }
22474
22475    impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
22476        type Borrowed<'a> = &'a mut Self;
22477        fn take_or_borrow<'a>(
22478            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22479        ) -> Self::Borrowed<'a> {
22480            value
22481        }
22482    }
22483
22484    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
22485        type Owned = Self;
22486
22487        #[inline(always)]
22488        fn inline_align(_context: fidl::encoding::Context) -> usize {
22489            4
22490        }
22491
22492        #[inline(always)]
22493        fn inline_size(_context: fidl::encoding::Context) -> usize {
22494            4
22495        }
22496    }
22497
22498    unsafe impl
22499        fidl::encoding::Encode<
22500            FileGetBackingMemoryResponse,
22501            fidl::encoding::DefaultFuchsiaResourceDialect,
22502        > for &mut FileGetBackingMemoryResponse
22503    {
22504        #[inline]
22505        unsafe fn encode(
22506            self,
22507            encoder: &mut fidl::encoding::Encoder<
22508                '_,
22509                fidl::encoding::DefaultFuchsiaResourceDialect,
22510            >,
22511            offset: usize,
22512            _depth: fidl::encoding::Depth,
22513        ) -> fidl::Result<()> {
22514            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22515            // Delegate to tuple encoding.
22516            fidl::encoding::Encode::<
22517                FileGetBackingMemoryResponse,
22518                fidl::encoding::DefaultFuchsiaResourceDialect,
22519            >::encode(
22520                (<fidl::encoding::HandleType<
22521                    fidl::Vmo,
22522                    { fidl::ObjectType::VMO.into_raw() },
22523                    2147483648,
22524                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22525                    &mut self.vmo
22526                ),),
22527                encoder,
22528                offset,
22529                _depth,
22530            )
22531        }
22532    }
22533    unsafe impl<
22534        T0: fidl::encoding::Encode<
22535                fidl::encoding::HandleType<
22536                    fidl::Vmo,
22537                    { fidl::ObjectType::VMO.into_raw() },
22538                    2147483648,
22539                >,
22540                fidl::encoding::DefaultFuchsiaResourceDialect,
22541            >,
22542    >
22543        fidl::encoding::Encode<
22544            FileGetBackingMemoryResponse,
22545            fidl::encoding::DefaultFuchsiaResourceDialect,
22546        > for (T0,)
22547    {
22548        #[inline]
22549        unsafe fn encode(
22550            self,
22551            encoder: &mut fidl::encoding::Encoder<
22552                '_,
22553                fidl::encoding::DefaultFuchsiaResourceDialect,
22554            >,
22555            offset: usize,
22556            depth: fidl::encoding::Depth,
22557        ) -> fidl::Result<()> {
22558            encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
22559            // Zero out padding regions. There's no need to apply masks
22560            // because the unmasked parts will be overwritten by fields.
22561            // Write the fields.
22562            self.0.encode(encoder, offset + 0, depth)?;
22563            Ok(())
22564        }
22565    }
22566
22567    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22568        for FileGetBackingMemoryResponse
22569    {
22570        #[inline(always)]
22571        fn new_empty() -> Self {
22572            Self {
22573                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22574            }
22575        }
22576
22577        #[inline]
22578        unsafe fn decode(
22579            &mut self,
22580            decoder: &mut fidl::encoding::Decoder<
22581                '_,
22582                fidl::encoding::DefaultFuchsiaResourceDialect,
22583            >,
22584            offset: usize,
22585            _depth: fidl::encoding::Depth,
22586        ) -> fidl::Result<()> {
22587            decoder.debug_check_bounds::<Self>(offset);
22588            // Verify that padding bytes are zero.
22589            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
22590            Ok(())
22591        }
22592    }
22593
22594    impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
22595        type Borrowed<'a> = &'a mut Self;
22596        fn take_or_borrow<'a>(
22597            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22598        ) -> Self::Borrowed<'a> {
22599            value
22600        }
22601    }
22602
22603    unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
22604        type Owned = Self;
22605
22606        #[inline(always)]
22607        fn inline_align(_context: fidl::encoding::Context) -> usize {
22608            8
22609        }
22610
22611        #[inline(always)]
22612        fn inline_size(_context: fidl::encoding::Context) -> usize {
22613            24
22614        }
22615    }
22616
22617    unsafe impl
22618        fidl::encoding::Encode<
22619            LinkableLinkIntoRequest,
22620            fidl::encoding::DefaultFuchsiaResourceDialect,
22621        > for &mut LinkableLinkIntoRequest
22622    {
22623        #[inline]
22624        unsafe fn encode(
22625            self,
22626            encoder: &mut fidl::encoding::Encoder<
22627                '_,
22628                fidl::encoding::DefaultFuchsiaResourceDialect,
22629            >,
22630            offset: usize,
22631            _depth: fidl::encoding::Depth,
22632        ) -> fidl::Result<()> {
22633            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22634            // Delegate to tuple encoding.
22635            fidl::encoding::Encode::<
22636                LinkableLinkIntoRequest,
22637                fidl::encoding::DefaultFuchsiaResourceDialect,
22638            >::encode(
22639                (
22640                    <fidl::encoding::HandleType<
22641                        fidl::Event,
22642                        { fidl::ObjectType::EVENT.into_raw() },
22643                        2147483648,
22644                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22645                        &mut self.dst_parent_token,
22646                    ),
22647                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
22648                        &self.dst,
22649                    ),
22650                ),
22651                encoder,
22652                offset,
22653                _depth,
22654            )
22655        }
22656    }
22657    unsafe impl<
22658        T0: fidl::encoding::Encode<
22659                fidl::encoding::HandleType<
22660                    fidl::Event,
22661                    { fidl::ObjectType::EVENT.into_raw() },
22662                    2147483648,
22663                >,
22664                fidl::encoding::DefaultFuchsiaResourceDialect,
22665            >,
22666        T1: fidl::encoding::Encode<
22667                fidl::encoding::BoundedString<255>,
22668                fidl::encoding::DefaultFuchsiaResourceDialect,
22669            >,
22670    >
22671        fidl::encoding::Encode<
22672            LinkableLinkIntoRequest,
22673            fidl::encoding::DefaultFuchsiaResourceDialect,
22674        > for (T0, T1)
22675    {
22676        #[inline]
22677        unsafe fn encode(
22678            self,
22679            encoder: &mut fidl::encoding::Encoder<
22680                '_,
22681                fidl::encoding::DefaultFuchsiaResourceDialect,
22682            >,
22683            offset: usize,
22684            depth: fidl::encoding::Depth,
22685        ) -> fidl::Result<()> {
22686            encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
22687            // Zero out padding regions. There's no need to apply masks
22688            // because the unmasked parts will be overwritten by fields.
22689            unsafe {
22690                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
22691                (ptr as *mut u64).write_unaligned(0);
22692            }
22693            // Write the fields.
22694            self.0.encode(encoder, offset + 0, depth)?;
22695            self.1.encode(encoder, offset + 8, depth)?;
22696            Ok(())
22697        }
22698    }
22699
22700    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22701        for LinkableLinkIntoRequest
22702    {
22703        #[inline(always)]
22704        fn new_empty() -> Self {
22705            Self {
22706                dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
22707                dst: fidl::new_empty!(
22708                    fidl::encoding::BoundedString<255>,
22709                    fidl::encoding::DefaultFuchsiaResourceDialect
22710                ),
22711            }
22712        }
22713
22714        #[inline]
22715        unsafe fn decode(
22716            &mut self,
22717            decoder: &mut fidl::encoding::Decoder<
22718                '_,
22719                fidl::encoding::DefaultFuchsiaResourceDialect,
22720            >,
22721            offset: usize,
22722            _depth: fidl::encoding::Depth,
22723        ) -> fidl::Result<()> {
22724            decoder.debug_check_bounds::<Self>(offset);
22725            // Verify that padding bytes are zero.
22726            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
22727            let padval = unsafe { (ptr as *const u64).read_unaligned() };
22728            let mask = 0xffffffff00000000u64;
22729            let maskedval = padval & mask;
22730            if maskedval != 0 {
22731                return Err(fidl::Error::NonZeroPadding {
22732                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
22733                });
22734            }
22735            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)?;
22736            fidl::decode!(
22737                fidl::encoding::BoundedString<255>,
22738                fidl::encoding::DefaultFuchsiaResourceDialect,
22739                &mut self.dst,
22740                decoder,
22741                offset + 8,
22742                _depth
22743            )?;
22744            Ok(())
22745        }
22746    }
22747
22748    impl fidl::encoding::ResourceTypeMarker for NodeDeprecatedCloneRequest {
22749        type Borrowed<'a> = &'a mut Self;
22750        fn take_or_borrow<'a>(
22751            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22752        ) -> Self::Borrowed<'a> {
22753            value
22754        }
22755    }
22756
22757    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedCloneRequest {
22758        type Owned = Self;
22759
22760        #[inline(always)]
22761        fn inline_align(_context: fidl::encoding::Context) -> usize {
22762            4
22763        }
22764
22765        #[inline(always)]
22766        fn inline_size(_context: fidl::encoding::Context) -> usize {
22767            8
22768        }
22769    }
22770
22771    unsafe impl
22772        fidl::encoding::Encode<
22773            NodeDeprecatedCloneRequest,
22774            fidl::encoding::DefaultFuchsiaResourceDialect,
22775        > for &mut NodeDeprecatedCloneRequest
22776    {
22777        #[inline]
22778        unsafe fn encode(
22779            self,
22780            encoder: &mut fidl::encoding::Encoder<
22781                '_,
22782                fidl::encoding::DefaultFuchsiaResourceDialect,
22783            >,
22784            offset: usize,
22785            _depth: fidl::encoding::Depth,
22786        ) -> fidl::Result<()> {
22787            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22788            // Delegate to tuple encoding.
22789            fidl::encoding::Encode::<NodeDeprecatedCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
22790                (
22791                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
22792                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
22793                ),
22794                encoder, offset, _depth
22795            )
22796        }
22797    }
22798    unsafe impl<
22799        T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
22800        T1: fidl::encoding::Encode<
22801                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22802                fidl::encoding::DefaultFuchsiaResourceDialect,
22803            >,
22804    >
22805        fidl::encoding::Encode<
22806            NodeDeprecatedCloneRequest,
22807            fidl::encoding::DefaultFuchsiaResourceDialect,
22808        > for (T0, T1)
22809    {
22810        #[inline]
22811        unsafe fn encode(
22812            self,
22813            encoder: &mut fidl::encoding::Encoder<
22814                '_,
22815                fidl::encoding::DefaultFuchsiaResourceDialect,
22816            >,
22817            offset: usize,
22818            depth: fidl::encoding::Depth,
22819        ) -> fidl::Result<()> {
22820            encoder.debug_check_bounds::<NodeDeprecatedCloneRequest>(offset);
22821            // Zero out padding regions. There's no need to apply masks
22822            // because the unmasked parts will be overwritten by fields.
22823            // Write the fields.
22824            self.0.encode(encoder, offset + 0, depth)?;
22825            self.1.encode(encoder, offset + 4, depth)?;
22826            Ok(())
22827        }
22828    }
22829
22830    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22831        for NodeDeprecatedCloneRequest
22832    {
22833        #[inline(always)]
22834        fn new_empty() -> Self {
22835            Self {
22836                flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
22837                object: fidl::new_empty!(
22838                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22839                    fidl::encoding::DefaultFuchsiaResourceDialect
22840                ),
22841            }
22842        }
22843
22844        #[inline]
22845        unsafe fn decode(
22846            &mut self,
22847            decoder: &mut fidl::encoding::Decoder<
22848                '_,
22849                fidl::encoding::DefaultFuchsiaResourceDialect,
22850            >,
22851            offset: usize,
22852            _depth: fidl::encoding::Depth,
22853        ) -> fidl::Result<()> {
22854            decoder.debug_check_bounds::<Self>(offset);
22855            // Verify that padding bytes are zero.
22856            fidl::decode!(
22857                OpenFlags,
22858                fidl::encoding::DefaultFuchsiaResourceDialect,
22859                &mut self.flags,
22860                decoder,
22861                offset + 0,
22862                _depth
22863            )?;
22864            fidl::decode!(
22865                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
22866                fidl::encoding::DefaultFuchsiaResourceDialect,
22867                &mut self.object,
22868                decoder,
22869                offset + 4,
22870                _depth
22871            )?;
22872            Ok(())
22873        }
22874    }
22875
22876    impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
22877        type Borrowed<'a> = &'a mut Self;
22878        fn take_or_borrow<'a>(
22879            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22880        ) -> Self::Borrowed<'a> {
22881            value
22882        }
22883    }
22884
22885    unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
22886        type Owned = Self;
22887
22888        #[inline(always)]
22889        fn inline_align(_context: fidl::encoding::Context) -> usize {
22890            4
22891        }
22892
22893        #[inline(always)]
22894        fn inline_size(_context: fidl::encoding::Context) -> usize {
22895            4
22896        }
22897    }
22898
22899    unsafe impl
22900        fidl::encoding::Encode<
22901            NodeListExtendedAttributesRequest,
22902            fidl::encoding::DefaultFuchsiaResourceDialect,
22903        > for &mut NodeListExtendedAttributesRequest
22904    {
22905        #[inline]
22906        unsafe fn encode(
22907            self,
22908            encoder: &mut fidl::encoding::Encoder<
22909                '_,
22910                fidl::encoding::DefaultFuchsiaResourceDialect,
22911            >,
22912            offset: usize,
22913            _depth: fidl::encoding::Depth,
22914        ) -> fidl::Result<()> {
22915            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22916            // Delegate to tuple encoding.
22917            fidl::encoding::Encode::<
22918                NodeListExtendedAttributesRequest,
22919                fidl::encoding::DefaultFuchsiaResourceDialect,
22920            >::encode(
22921                (<fidl::encoding::Endpoint<
22922                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22923                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
22924                    &mut self.iterator
22925                ),),
22926                encoder,
22927                offset,
22928                _depth,
22929            )
22930        }
22931    }
22932    unsafe impl<
22933        T0: fidl::encoding::Encode<
22934                fidl::encoding::Endpoint<
22935                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22936                >,
22937                fidl::encoding::DefaultFuchsiaResourceDialect,
22938            >,
22939    >
22940        fidl::encoding::Encode<
22941            NodeListExtendedAttributesRequest,
22942            fidl::encoding::DefaultFuchsiaResourceDialect,
22943        > for (T0,)
22944    {
22945        #[inline]
22946        unsafe fn encode(
22947            self,
22948            encoder: &mut fidl::encoding::Encoder<
22949                '_,
22950                fidl::encoding::DefaultFuchsiaResourceDialect,
22951            >,
22952            offset: usize,
22953            depth: fidl::encoding::Depth,
22954        ) -> fidl::Result<()> {
22955            encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
22956            // Zero out padding regions. There's no need to apply masks
22957            // because the unmasked parts will be overwritten by fields.
22958            // Write the fields.
22959            self.0.encode(encoder, offset + 0, depth)?;
22960            Ok(())
22961        }
22962    }
22963
22964    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22965        for NodeListExtendedAttributesRequest
22966    {
22967        #[inline(always)]
22968        fn new_empty() -> Self {
22969            Self {
22970                iterator: fidl::new_empty!(
22971                    fidl::encoding::Endpoint<
22972                        fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22973                    >,
22974                    fidl::encoding::DefaultFuchsiaResourceDialect
22975                ),
22976            }
22977        }
22978
22979        #[inline]
22980        unsafe fn decode(
22981            &mut self,
22982            decoder: &mut fidl::encoding::Decoder<
22983                '_,
22984                fidl::encoding::DefaultFuchsiaResourceDialect,
22985            >,
22986            offset: usize,
22987            _depth: fidl::encoding::Depth,
22988        ) -> fidl::Result<()> {
22989            decoder.debug_check_bounds::<Self>(offset);
22990            // Verify that padding bytes are zero.
22991            fidl::decode!(
22992                fidl::encoding::Endpoint<
22993                    fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
22994                >,
22995                fidl::encoding::DefaultFuchsiaResourceDialect,
22996                &mut self.iterator,
22997                decoder,
22998                offset + 0,
22999                _depth
23000            )?;
23001            Ok(())
23002        }
23003    }
23004
23005    impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
23006        type Borrowed<'a> = &'a mut Self;
23007        fn take_or_borrow<'a>(
23008            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23009        ) -> Self::Borrowed<'a> {
23010            value
23011        }
23012    }
23013
23014    unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
23015        type Owned = Self;
23016
23017        #[inline(always)]
23018        fn inline_align(_context: fidl::encoding::Context) -> usize {
23019            8
23020        }
23021
23022        #[inline(always)]
23023        fn inline_size(_context: fidl::encoding::Context) -> usize {
23024            24
23025        }
23026    }
23027
23028    unsafe impl
23029        fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23030        for &mut NodeOnOpenRequest
23031    {
23032        #[inline]
23033        unsafe fn encode(
23034            self,
23035            encoder: &mut fidl::encoding::Encoder<
23036                '_,
23037                fidl::encoding::DefaultFuchsiaResourceDialect,
23038            >,
23039            offset: usize,
23040            _depth: fidl::encoding::Depth,
23041        ) -> fidl::Result<()> {
23042            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23043            // Delegate to tuple encoding.
23044            fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23045                (
23046                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
23047                    <fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
23048                ),
23049                encoder, offset, _depth
23050            )
23051        }
23052    }
23053    unsafe impl<
23054        T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
23055        T1: fidl::encoding::Encode<
23056                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23057                fidl::encoding::DefaultFuchsiaResourceDialect,
23058            >,
23059    > fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23060        for (T0, T1)
23061    {
23062        #[inline]
23063        unsafe fn encode(
23064            self,
23065            encoder: &mut fidl::encoding::Encoder<
23066                '_,
23067                fidl::encoding::DefaultFuchsiaResourceDialect,
23068            >,
23069            offset: usize,
23070            depth: fidl::encoding::Depth,
23071        ) -> fidl::Result<()> {
23072            encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
23073            // Zero out padding regions. There's no need to apply masks
23074            // because the unmasked parts will be overwritten by fields.
23075            unsafe {
23076                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
23077                (ptr as *mut u64).write_unaligned(0);
23078            }
23079            // Write the fields.
23080            self.0.encode(encoder, offset + 0, depth)?;
23081            self.1.encode(encoder, offset + 8, depth)?;
23082            Ok(())
23083        }
23084    }
23085
23086    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23087        for NodeOnOpenRequest
23088    {
23089        #[inline(always)]
23090        fn new_empty() -> Self {
23091            Self {
23092                s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
23093                info: fidl::new_empty!(
23094                    fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23095                    fidl::encoding::DefaultFuchsiaResourceDialect
23096                ),
23097            }
23098        }
23099
23100        #[inline]
23101        unsafe fn decode(
23102            &mut self,
23103            decoder: &mut fidl::encoding::Decoder<
23104                '_,
23105                fidl::encoding::DefaultFuchsiaResourceDialect,
23106            >,
23107            offset: usize,
23108            _depth: fidl::encoding::Depth,
23109        ) -> fidl::Result<()> {
23110            decoder.debug_check_bounds::<Self>(offset);
23111            // Verify that padding bytes are zero.
23112            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
23113            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23114            let mask = 0xffffffff00000000u64;
23115            let maskedval = padval & mask;
23116            if maskedval != 0 {
23117                return Err(fidl::Error::NonZeroPadding {
23118                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
23119                });
23120            }
23121            fidl::decode!(
23122                i32,
23123                fidl::encoding::DefaultFuchsiaResourceDialect,
23124                &mut self.s,
23125                decoder,
23126                offset + 0,
23127                _depth
23128            )?;
23129            fidl::decode!(
23130                fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
23131                fidl::encoding::DefaultFuchsiaResourceDialect,
23132                &mut self.info,
23133                decoder,
23134                offset + 8,
23135                _depth
23136            )?;
23137            Ok(())
23138        }
23139    }
23140
23141    impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
23142        type Borrowed<'a> = &'a mut Self;
23143        fn take_or_borrow<'a>(
23144            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23145        ) -> Self::Borrowed<'a> {
23146            value
23147        }
23148    }
23149
23150    unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
23151        type Owned = Self;
23152
23153        #[inline(always)]
23154        fn inline_align(_context: fidl::encoding::Context) -> usize {
23155            8
23156        }
23157
23158        #[inline(always)]
23159        fn inline_size(_context: fidl::encoding::Context) -> usize {
23160            40
23161        }
23162    }
23163
23164    unsafe impl
23165        fidl::encoding::Encode<
23166            NodeSetExtendedAttributeRequest,
23167            fidl::encoding::DefaultFuchsiaResourceDialect,
23168        > for &mut NodeSetExtendedAttributeRequest
23169    {
23170        #[inline]
23171        unsafe fn encode(
23172            self,
23173            encoder: &mut fidl::encoding::Encoder<
23174                '_,
23175                fidl::encoding::DefaultFuchsiaResourceDialect,
23176            >,
23177            offset: usize,
23178            _depth: fidl::encoding::Depth,
23179        ) -> fidl::Result<()> {
23180            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23181            // Delegate to tuple encoding.
23182            fidl::encoding::Encode::<
23183                NodeSetExtendedAttributeRequest,
23184                fidl::encoding::DefaultFuchsiaResourceDialect,
23185            >::encode(
23186                (
23187                    <fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
23188                        &self.name,
23189                    ),
23190                    <ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
23191                        &mut self.value,
23192                    ),
23193                    <SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
23194                        &self.mode,
23195                    ),
23196                ),
23197                encoder,
23198                offset,
23199                _depth,
23200            )
23201        }
23202    }
23203    unsafe impl<
23204        T0: fidl::encoding::Encode<
23205                fidl::encoding::Vector<u8, 255>,
23206                fidl::encoding::DefaultFuchsiaResourceDialect,
23207            >,
23208        T1: fidl::encoding::Encode<
23209                ExtendedAttributeValue,
23210                fidl::encoding::DefaultFuchsiaResourceDialect,
23211            >,
23212        T2: fidl::encoding::Encode<
23213                SetExtendedAttributeMode,
23214                fidl::encoding::DefaultFuchsiaResourceDialect,
23215            >,
23216    >
23217        fidl::encoding::Encode<
23218            NodeSetExtendedAttributeRequest,
23219            fidl::encoding::DefaultFuchsiaResourceDialect,
23220        > for (T0, T1, T2)
23221    {
23222        #[inline]
23223        unsafe fn encode(
23224            self,
23225            encoder: &mut fidl::encoding::Encoder<
23226                '_,
23227                fidl::encoding::DefaultFuchsiaResourceDialect,
23228            >,
23229            offset: usize,
23230            depth: fidl::encoding::Depth,
23231        ) -> fidl::Result<()> {
23232            encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
23233            // Zero out padding regions. There's no need to apply masks
23234            // because the unmasked parts will be overwritten by fields.
23235            unsafe {
23236                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
23237                (ptr as *mut u64).write_unaligned(0);
23238            }
23239            // Write the fields.
23240            self.0.encode(encoder, offset + 0, depth)?;
23241            self.1.encode(encoder, offset + 16, depth)?;
23242            self.2.encode(encoder, offset + 32, depth)?;
23243            Ok(())
23244        }
23245    }
23246
23247    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23248        for NodeSetExtendedAttributeRequest
23249    {
23250        #[inline(always)]
23251        fn new_empty() -> Self {
23252            Self {
23253                name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
23254                value: fidl::new_empty!(
23255                    ExtendedAttributeValue,
23256                    fidl::encoding::DefaultFuchsiaResourceDialect
23257                ),
23258                mode: fidl::new_empty!(
23259                    SetExtendedAttributeMode,
23260                    fidl::encoding::DefaultFuchsiaResourceDialect
23261                ),
23262            }
23263        }
23264
23265        #[inline]
23266        unsafe fn decode(
23267            &mut self,
23268            decoder: &mut fidl::encoding::Decoder<
23269                '_,
23270                fidl::encoding::DefaultFuchsiaResourceDialect,
23271            >,
23272            offset: usize,
23273            _depth: fidl::encoding::Depth,
23274        ) -> fidl::Result<()> {
23275            decoder.debug_check_bounds::<Self>(offset);
23276            // Verify that padding bytes are zero.
23277            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
23278            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23279            let mask = 0xffffffff00000000u64;
23280            let maskedval = padval & mask;
23281            if maskedval != 0 {
23282                return Err(fidl::Error::NonZeroPadding {
23283                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
23284                });
23285            }
23286            fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
23287            fidl::decode!(
23288                ExtendedAttributeValue,
23289                fidl::encoding::DefaultFuchsiaResourceDialect,
23290                &mut self.value,
23291                decoder,
23292                offset + 16,
23293                _depth
23294            )?;
23295            fidl::decode!(
23296                SetExtendedAttributeMode,
23297                fidl::encoding::DefaultFuchsiaResourceDialect,
23298                &mut self.mode,
23299                decoder,
23300                offset + 32,
23301                _depth
23302            )?;
23303            Ok(())
23304        }
23305    }
23306
23307    impl fidl::encoding::ResourceTypeMarker for OpenableOpenRequest {
23308        type Borrowed<'a> = &'a mut Self;
23309        fn take_or_borrow<'a>(
23310            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23311        ) -> Self::Borrowed<'a> {
23312            value
23313        }
23314    }
23315
23316    unsafe impl fidl::encoding::TypeMarker for OpenableOpenRequest {
23317        type Owned = Self;
23318
23319        #[inline(always)]
23320        fn inline_align(_context: fidl::encoding::Context) -> usize {
23321            8
23322        }
23323
23324        #[inline(always)]
23325        fn inline_size(_context: fidl::encoding::Context) -> usize {
23326            48
23327        }
23328    }
23329
23330    unsafe impl
23331        fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23332        for &mut OpenableOpenRequest
23333    {
23334        #[inline]
23335        unsafe fn encode(
23336            self,
23337            encoder: &mut fidl::encoding::Encoder<
23338                '_,
23339                fidl::encoding::DefaultFuchsiaResourceDialect,
23340            >,
23341            offset: usize,
23342            _depth: fidl::encoding::Depth,
23343        ) -> fidl::Result<()> {
23344            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23345            // Delegate to tuple encoding.
23346            fidl::encoding::Encode::<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
23347                (
23348                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
23349                    <Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
23350                    <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
23351                    <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
23352                ),
23353                encoder, offset, _depth
23354            )
23355        }
23356    }
23357    unsafe impl<
23358        T0: fidl::encoding::Encode<
23359                fidl::encoding::BoundedString<4095>,
23360                fidl::encoding::DefaultFuchsiaResourceDialect,
23361            >,
23362        T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
23363        T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
23364        T3: fidl::encoding::Encode<
23365                fidl::encoding::HandleType<
23366                    fidl::Channel,
23367                    { fidl::ObjectType::CHANNEL.into_raw() },
23368                    2147483648,
23369                >,
23370                fidl::encoding::DefaultFuchsiaResourceDialect,
23371            >,
23372    > fidl::encoding::Encode<OpenableOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
23373        for (T0, T1, T2, T3)
23374    {
23375        #[inline]
23376        unsafe fn encode(
23377            self,
23378            encoder: &mut fidl::encoding::Encoder<
23379                '_,
23380                fidl::encoding::DefaultFuchsiaResourceDialect,
23381            >,
23382            offset: usize,
23383            depth: fidl::encoding::Depth,
23384        ) -> fidl::Result<()> {
23385            encoder.debug_check_bounds::<OpenableOpenRequest>(offset);
23386            // Zero out padding regions. There's no need to apply masks
23387            // because the unmasked parts will be overwritten by fields.
23388            unsafe {
23389                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
23390                (ptr as *mut u64).write_unaligned(0);
23391            }
23392            // Write the fields.
23393            self.0.encode(encoder, offset + 0, depth)?;
23394            self.1.encode(encoder, offset + 16, depth)?;
23395            self.2.encode(encoder, offset + 24, depth)?;
23396            self.3.encode(encoder, offset + 40, depth)?;
23397            Ok(())
23398        }
23399    }
23400
23401    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23402        for OpenableOpenRequest
23403    {
23404        #[inline(always)]
23405        fn new_empty() -> Self {
23406            Self {
23407                path: fidl::new_empty!(
23408                    fidl::encoding::BoundedString<4095>,
23409                    fidl::encoding::DefaultFuchsiaResourceDialect
23410                ),
23411                flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
23412                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
23413                object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
23414            }
23415        }
23416
23417        #[inline]
23418        unsafe fn decode(
23419            &mut self,
23420            decoder: &mut fidl::encoding::Decoder<
23421                '_,
23422                fidl::encoding::DefaultFuchsiaResourceDialect,
23423            >,
23424            offset: usize,
23425            _depth: fidl::encoding::Depth,
23426        ) -> fidl::Result<()> {
23427            decoder.debug_check_bounds::<Self>(offset);
23428            // Verify that padding bytes are zero.
23429            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
23430            let padval = unsafe { (ptr as *const u64).read_unaligned() };
23431            let mask = 0xffffffff00000000u64;
23432            let maskedval = padval & mask;
23433            if maskedval != 0 {
23434                return Err(fidl::Error::NonZeroPadding {
23435                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
23436                });
23437            }
23438            fidl::decode!(
23439                fidl::encoding::BoundedString<4095>,
23440                fidl::encoding::DefaultFuchsiaResourceDialect,
23441                &mut self.path,
23442                decoder,
23443                offset + 0,
23444                _depth
23445            )?;
23446            fidl::decode!(
23447                Flags,
23448                fidl::encoding::DefaultFuchsiaResourceDialect,
23449                &mut self.flags,
23450                decoder,
23451                offset + 16,
23452                _depth
23453            )?;
23454            fidl::decode!(
23455                Options,
23456                fidl::encoding::DefaultFuchsiaResourceDialect,
23457                &mut self.options,
23458                decoder,
23459                offset + 24,
23460                _depth
23461            )?;
23462            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
23463            Ok(())
23464        }
23465    }
23466
23467    impl ConnectionInfo {
23468        #[inline(always)]
23469        fn max_ordinal_present(&self) -> u64 {
23470            if let Some(_) = self.rights {
23471                return 1;
23472            }
23473            0
23474        }
23475    }
23476
23477    impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
23478        type Borrowed<'a> = &'a mut Self;
23479        fn take_or_borrow<'a>(
23480            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23481        ) -> Self::Borrowed<'a> {
23482            value
23483        }
23484    }
23485
23486    unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
23487        type Owned = Self;
23488
23489        #[inline(always)]
23490        fn inline_align(_context: fidl::encoding::Context) -> usize {
23491            8
23492        }
23493
23494        #[inline(always)]
23495        fn inline_size(_context: fidl::encoding::Context) -> usize {
23496            16
23497        }
23498    }
23499
23500    unsafe impl
23501        fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23502        for &mut ConnectionInfo
23503    {
23504        unsafe fn encode(
23505            self,
23506            encoder: &mut fidl::encoding::Encoder<
23507                '_,
23508                fidl::encoding::DefaultFuchsiaResourceDialect,
23509            >,
23510            offset: usize,
23511            mut depth: fidl::encoding::Depth,
23512        ) -> fidl::Result<()> {
23513            encoder.debug_check_bounds::<ConnectionInfo>(offset);
23514            // Vector header
23515            let max_ordinal: u64 = self.max_ordinal_present();
23516            encoder.write_num(max_ordinal, offset);
23517            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23518            // Calling encoder.out_of_line_offset(0) is not allowed.
23519            if max_ordinal == 0 {
23520                return Ok(());
23521            }
23522            depth.increment()?;
23523            let envelope_size = 8;
23524            let bytes_len = max_ordinal as usize * envelope_size;
23525            #[allow(unused_variables)]
23526            let offset = encoder.out_of_line_offset(bytes_len);
23527            let mut _prev_end_offset: usize = 0;
23528            if 1 > max_ordinal {
23529                return Ok(());
23530            }
23531
23532            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23533            // are envelope_size bytes.
23534            let cur_offset: usize = (1 - 1) * envelope_size;
23535
23536            // Zero reserved fields.
23537            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23538
23539            // Safety:
23540            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23541            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23542            //   envelope_size bytes, there is always sufficient room.
23543            fidl::encoding::encode_in_envelope_optional::<
23544                Operations,
23545                fidl::encoding::DefaultFuchsiaResourceDialect,
23546            >(
23547                self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
23548                encoder,
23549                offset + cur_offset,
23550                depth,
23551            )?;
23552
23553            _prev_end_offset = cur_offset + envelope_size;
23554
23555            Ok(())
23556        }
23557    }
23558
23559    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
23560        for ConnectionInfo
23561    {
23562        #[inline(always)]
23563        fn new_empty() -> Self {
23564            Self::default()
23565        }
23566
23567        unsafe fn decode(
23568            &mut self,
23569            decoder: &mut fidl::encoding::Decoder<
23570                '_,
23571                fidl::encoding::DefaultFuchsiaResourceDialect,
23572            >,
23573            offset: usize,
23574            mut depth: fidl::encoding::Depth,
23575        ) -> fidl::Result<()> {
23576            decoder.debug_check_bounds::<Self>(offset);
23577            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23578                None => return Err(fidl::Error::NotNullable),
23579                Some(len) => len,
23580            };
23581            // Calling decoder.out_of_line_offset(0) is not allowed.
23582            if len == 0 {
23583                return Ok(());
23584            };
23585            depth.increment()?;
23586            let envelope_size = 8;
23587            let bytes_len = len * envelope_size;
23588            let offset = decoder.out_of_line_offset(bytes_len)?;
23589            // Decode the envelope for each type.
23590            let mut _next_ordinal_to_read = 0;
23591            let mut next_offset = offset;
23592            let end_offset = offset + bytes_len;
23593            _next_ordinal_to_read += 1;
23594            if next_offset >= end_offset {
23595                return Ok(());
23596            }
23597
23598            // Decode unknown envelopes for gaps in ordinals.
23599            while _next_ordinal_to_read < 1 {
23600                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23601                _next_ordinal_to_read += 1;
23602                next_offset += envelope_size;
23603            }
23604
23605            let next_out_of_line = decoder.next_out_of_line();
23606            let handles_before = decoder.remaining_handles();
23607            if let Some((inlined, num_bytes, num_handles)) =
23608                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23609            {
23610                let member_inline_size =
23611                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23612                if inlined != (member_inline_size <= 4) {
23613                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23614                }
23615                let inner_offset;
23616                let mut inner_depth = depth.clone();
23617                if inlined {
23618                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23619                    inner_offset = next_offset;
23620                } else {
23621                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23622                    inner_depth.increment()?;
23623                }
23624                let val_ref = self.rights.get_or_insert_with(|| {
23625                    fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
23626                });
23627                fidl::decode!(
23628                    Operations,
23629                    fidl::encoding::DefaultFuchsiaResourceDialect,
23630                    val_ref,
23631                    decoder,
23632                    inner_offset,
23633                    inner_depth
23634                )?;
23635                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23636                {
23637                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23638                }
23639                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23640                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23641                }
23642            }
23643
23644            next_offset += envelope_size;
23645
23646            // Decode the remaining unknown envelopes.
23647            while next_offset < end_offset {
23648                _next_ordinal_to_read += 1;
23649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23650                next_offset += envelope_size;
23651            }
23652
23653            Ok(())
23654        }
23655    }
23656
23657    impl FileInfo {
23658        #[inline(always)]
23659        fn max_ordinal_present(&self) -> u64 {
23660            if let Some(_) = self.attributes {
23661                return 4;
23662            }
23663            if let Some(_) = self.stream {
23664                return 3;
23665            }
23666            if let Some(_) = self.observer {
23667                return 2;
23668            }
23669            if let Some(_) = self.is_append {
23670                return 1;
23671            }
23672            0
23673        }
23674    }
23675
23676    impl fidl::encoding::ResourceTypeMarker for FileInfo {
23677        type Borrowed<'a> = &'a mut Self;
23678        fn take_or_borrow<'a>(
23679            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
23680        ) -> Self::Borrowed<'a> {
23681            value
23682        }
23683    }
23684
23685    unsafe impl fidl::encoding::TypeMarker for FileInfo {
23686        type Owned = Self;
23687
23688        #[inline(always)]
23689        fn inline_align(_context: fidl::encoding::Context) -> usize {
23690            8
23691        }
23692
23693        #[inline(always)]
23694        fn inline_size(_context: fidl::encoding::Context) -> usize {
23695            16
23696        }
23697    }
23698
23699    unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
23700        for &mut FileInfo
23701    {
23702        unsafe fn encode(
23703            self,
23704            encoder: &mut fidl::encoding::Encoder<
23705                '_,
23706                fidl::encoding::DefaultFuchsiaResourceDialect,
23707            >,
23708            offset: usize,
23709            mut depth: fidl::encoding::Depth,
23710        ) -> fidl::Result<()> {
23711            encoder.debug_check_bounds::<FileInfo>(offset);
23712            // Vector header
23713            let max_ordinal: u64 = self.max_ordinal_present();
23714            encoder.write_num(max_ordinal, offset);
23715            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23716            // Calling encoder.out_of_line_offset(0) is not allowed.
23717            if max_ordinal == 0 {
23718                return Ok(());
23719            }
23720            depth.increment()?;
23721            let envelope_size = 8;
23722            let bytes_len = max_ordinal as usize * envelope_size;
23723            #[allow(unused_variables)]
23724            let offset = encoder.out_of_line_offset(bytes_len);
23725            let mut _prev_end_offset: usize = 0;
23726            if 1 > max_ordinal {
23727                return Ok(());
23728            }
23729
23730            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23731            // are envelope_size bytes.
23732            let cur_offset: usize = (1 - 1) * envelope_size;
23733
23734            // Zero reserved fields.
23735            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23736
23737            // Safety:
23738            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23739            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23740            //   envelope_size bytes, there is always sufficient room.
23741            fidl::encoding::encode_in_envelope_optional::<
23742                bool,
23743                fidl::encoding::DefaultFuchsiaResourceDialect,
23744            >(
23745                self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
23746                encoder,
23747                offset + cur_offset,
23748                depth,
23749            )?;
23750
23751            _prev_end_offset = cur_offset + envelope_size;
23752            if 2 > max_ordinal {
23753                return Ok(());
23754            }
23755
23756            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23757            // are envelope_size bytes.
23758            let cur_offset: usize = (2 - 1) * envelope_size;
23759
23760            // Zero reserved fields.
23761            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23762
23763            // Safety:
23764            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23765            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23766            //   envelope_size bytes, there is always sufficient room.
23767            fidl::encoding::encode_in_envelope_optional::<
23768                fidl::encoding::HandleType<
23769                    fidl::Event,
23770                    { fidl::ObjectType::EVENT.into_raw() },
23771                    2147483648,
23772                >,
23773                fidl::encoding::DefaultFuchsiaResourceDialect,
23774            >(
23775                self.observer.as_mut().map(
23776                    <fidl::encoding::HandleType<
23777                        fidl::Event,
23778                        { fidl::ObjectType::EVENT.into_raw() },
23779                        2147483648,
23780                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23781                ),
23782                encoder,
23783                offset + cur_offset,
23784                depth,
23785            )?;
23786
23787            _prev_end_offset = cur_offset + envelope_size;
23788            if 3 > max_ordinal {
23789                return Ok(());
23790            }
23791
23792            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23793            // are envelope_size bytes.
23794            let cur_offset: usize = (3 - 1) * envelope_size;
23795
23796            // Zero reserved fields.
23797            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23798
23799            // Safety:
23800            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23801            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23802            //   envelope_size bytes, there is always sufficient room.
23803            fidl::encoding::encode_in_envelope_optional::<
23804                fidl::encoding::HandleType<
23805                    fidl::Stream,
23806                    { fidl::ObjectType::STREAM.into_raw() },
23807                    2147483648,
23808                >,
23809                fidl::encoding::DefaultFuchsiaResourceDialect,
23810            >(
23811                self.stream.as_mut().map(
23812                    <fidl::encoding::HandleType<
23813                        fidl::Stream,
23814                        { fidl::ObjectType::STREAM.into_raw() },
23815                        2147483648,
23816                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
23817                ),
23818                encoder,
23819                offset + cur_offset,
23820                depth,
23821            )?;
23822
23823            _prev_end_offset = cur_offset + envelope_size;
23824            if 4 > max_ordinal {
23825                return Ok(());
23826            }
23827
23828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
23829            // are envelope_size bytes.
23830            let cur_offset: usize = (4 - 1) * envelope_size;
23831
23832            // Zero reserved fields.
23833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23834
23835            // Safety:
23836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
23837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
23838            //   envelope_size bytes, there is always sufficient room.
23839            fidl::encoding::encode_in_envelope_optional::<
23840                NodeAttributes2,
23841                fidl::encoding::DefaultFuchsiaResourceDialect,
23842            >(
23843                self.attributes
23844                    .as_ref()
23845                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
23846                encoder,
23847                offset + cur_offset,
23848                depth,
23849            )?;
23850
23851            _prev_end_offset = cur_offset + envelope_size;
23852
23853            Ok(())
23854        }
23855    }
23856
23857    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
23858        #[inline(always)]
23859        fn new_empty() -> Self {
23860            Self::default()
23861        }
23862
23863        unsafe fn decode(
23864            &mut self,
23865            decoder: &mut fidl::encoding::Decoder<
23866                '_,
23867                fidl::encoding::DefaultFuchsiaResourceDialect,
23868            >,
23869            offset: usize,
23870            mut depth: fidl::encoding::Depth,
23871        ) -> fidl::Result<()> {
23872            decoder.debug_check_bounds::<Self>(offset);
23873            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23874                None => return Err(fidl::Error::NotNullable),
23875                Some(len) => len,
23876            };
23877            // Calling decoder.out_of_line_offset(0) is not allowed.
23878            if len == 0 {
23879                return Ok(());
23880            };
23881            depth.increment()?;
23882            let envelope_size = 8;
23883            let bytes_len = len * envelope_size;
23884            let offset = decoder.out_of_line_offset(bytes_len)?;
23885            // Decode the envelope for each type.
23886            let mut _next_ordinal_to_read = 0;
23887            let mut next_offset = offset;
23888            let end_offset = offset + bytes_len;
23889            _next_ordinal_to_read += 1;
23890            if next_offset >= end_offset {
23891                return Ok(());
23892            }
23893
23894            // Decode unknown envelopes for gaps in ordinals.
23895            while _next_ordinal_to_read < 1 {
23896                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23897                _next_ordinal_to_read += 1;
23898                next_offset += envelope_size;
23899            }
23900
23901            let next_out_of_line = decoder.next_out_of_line();
23902            let handles_before = decoder.remaining_handles();
23903            if let Some((inlined, num_bytes, num_handles)) =
23904                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23905            {
23906                let member_inline_size =
23907                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23908                if inlined != (member_inline_size <= 4) {
23909                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23910                }
23911                let inner_offset;
23912                let mut inner_depth = depth.clone();
23913                if inlined {
23914                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23915                    inner_offset = next_offset;
23916                } else {
23917                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23918                    inner_depth.increment()?;
23919                }
23920                let val_ref = self.is_append.get_or_insert_with(|| {
23921                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
23922                });
23923                fidl::decode!(
23924                    bool,
23925                    fidl::encoding::DefaultFuchsiaResourceDialect,
23926                    val_ref,
23927                    decoder,
23928                    inner_offset,
23929                    inner_depth
23930                )?;
23931                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23932                {
23933                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23934                }
23935                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23936                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23937                }
23938            }
23939
23940            next_offset += envelope_size;
23941            _next_ordinal_to_read += 1;
23942            if next_offset >= end_offset {
23943                return Ok(());
23944            }
23945
23946            // Decode unknown envelopes for gaps in ordinals.
23947            while _next_ordinal_to_read < 2 {
23948                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23949                _next_ordinal_to_read += 1;
23950                next_offset += envelope_size;
23951            }
23952
23953            let next_out_of_line = decoder.next_out_of_line();
23954            let handles_before = decoder.remaining_handles();
23955            if let Some((inlined, num_bytes, num_handles)) =
23956                fidl::encoding::decode_envelope_header(decoder, next_offset)?
23957            {
23958                let member_inline_size = <fidl::encoding::HandleType<
23959                    fidl::Event,
23960                    { fidl::ObjectType::EVENT.into_raw() },
23961                    2147483648,
23962                > as fidl::encoding::TypeMarker>::inline_size(
23963                    decoder.context
23964                );
23965                if inlined != (member_inline_size <= 4) {
23966                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
23967                }
23968                let inner_offset;
23969                let mut inner_depth = depth.clone();
23970                if inlined {
23971                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23972                    inner_offset = next_offset;
23973                } else {
23974                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23975                    inner_depth.increment()?;
23976                }
23977                let val_ref =
23978                self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
23979                fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
23980                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23981                {
23982                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
23983                }
23984                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23985                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23986                }
23987            }
23988
23989            next_offset += envelope_size;
23990            _next_ordinal_to_read += 1;
23991            if next_offset >= end_offset {
23992                return Ok(());
23993            }
23994
23995            // Decode unknown envelopes for gaps in ordinals.
23996            while _next_ordinal_to_read < 3 {
23997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23998                _next_ordinal_to_read += 1;
23999                next_offset += envelope_size;
24000            }
24001
24002            let next_out_of_line = decoder.next_out_of_line();
24003            let handles_before = decoder.remaining_handles();
24004            if let Some((inlined, num_bytes, num_handles)) =
24005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24006            {
24007                let member_inline_size = <fidl::encoding::HandleType<
24008                    fidl::Stream,
24009                    { fidl::ObjectType::STREAM.into_raw() },
24010                    2147483648,
24011                > as fidl::encoding::TypeMarker>::inline_size(
24012                    decoder.context
24013                );
24014                if inlined != (member_inline_size <= 4) {
24015                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24016                }
24017                let inner_offset;
24018                let mut inner_depth = depth.clone();
24019                if inlined {
24020                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24021                    inner_offset = next_offset;
24022                } else {
24023                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24024                    inner_depth.increment()?;
24025                }
24026                let val_ref =
24027                self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
24028                fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
24029                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24030                {
24031                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24032                }
24033                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24034                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24035                }
24036            }
24037
24038            next_offset += envelope_size;
24039            _next_ordinal_to_read += 1;
24040            if next_offset >= end_offset {
24041                return Ok(());
24042            }
24043
24044            // Decode unknown envelopes for gaps in ordinals.
24045            while _next_ordinal_to_read < 4 {
24046                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24047                _next_ordinal_to_read += 1;
24048                next_offset += envelope_size;
24049            }
24050
24051            let next_out_of_line = decoder.next_out_of_line();
24052            let handles_before = decoder.remaining_handles();
24053            if let Some((inlined, num_bytes, num_handles)) =
24054                fidl::encoding::decode_envelope_header(decoder, next_offset)?
24055            {
24056                let member_inline_size =
24057                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24058                if inlined != (member_inline_size <= 4) {
24059                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
24060                }
24061                let inner_offset;
24062                let mut inner_depth = depth.clone();
24063                if inlined {
24064                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24065                    inner_offset = next_offset;
24066                } else {
24067                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24068                    inner_depth.increment()?;
24069                }
24070                let val_ref = self.attributes.get_or_insert_with(|| {
24071                    fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
24072                });
24073                fidl::decode!(
24074                    NodeAttributes2,
24075                    fidl::encoding::DefaultFuchsiaResourceDialect,
24076                    val_ref,
24077                    decoder,
24078                    inner_offset,
24079                    inner_depth
24080                )?;
24081                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24082                {
24083                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
24084                }
24085                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24086                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24087                }
24088            }
24089
24090            next_offset += envelope_size;
24091
24092            // Decode the remaining unknown envelopes.
24093            while next_offset < end_offset {
24094                _next_ordinal_to_read += 1;
24095                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24096                next_offset += envelope_size;
24097            }
24098
24099            Ok(())
24100        }
24101    }
24102
24103    impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
24104        type Borrowed<'a> = &'a mut Self;
24105        fn take_or_borrow<'a>(
24106            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24107        ) -> Self::Borrowed<'a> {
24108            value
24109        }
24110    }
24111
24112    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
24113        type Owned = Self;
24114
24115        #[inline(always)]
24116        fn inline_align(_context: fidl::encoding::Context) -> usize {
24117            8
24118        }
24119
24120        #[inline(always)]
24121        fn inline_size(_context: fidl::encoding::Context) -> usize {
24122            16
24123        }
24124    }
24125
24126    unsafe impl
24127        fidl::encoding::Encode<
24128            ExtendedAttributeValue,
24129            fidl::encoding::DefaultFuchsiaResourceDialect,
24130        > for &mut ExtendedAttributeValue
24131    {
24132        #[inline]
24133        unsafe fn encode(
24134            self,
24135            encoder: &mut fidl::encoding::Encoder<
24136                '_,
24137                fidl::encoding::DefaultFuchsiaResourceDialect,
24138            >,
24139            offset: usize,
24140            _depth: fidl::encoding::Depth,
24141        ) -> fidl::Result<()> {
24142            encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
24143            encoder.write_num::<u64>(self.ordinal(), offset);
24144            match self {
24145                ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
24146                    fidl::encoding::Vector<u8, 32768>,
24147                    fidl::encoding::DefaultFuchsiaResourceDialect,
24148                >(
24149                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
24150                        val,
24151                    ),
24152                    encoder,
24153                    offset + 8,
24154                    _depth,
24155                ),
24156                ExtendedAttributeValue::Buffer(ref mut val) => {
24157                    fidl::encoding::encode_in_envelope::<
24158                        fidl::encoding::HandleType<
24159                            fidl::Vmo,
24160                            { fidl::ObjectType::VMO.into_raw() },
24161                            2147483648,
24162                        >,
24163                        fidl::encoding::DefaultFuchsiaResourceDialect,
24164                    >(
24165                        <fidl::encoding::HandleType<
24166                            fidl::Vmo,
24167                            { fidl::ObjectType::VMO.into_raw() },
24168                            2147483648,
24169                        > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
24170                            val
24171                        ),
24172                        encoder,
24173                        offset + 8,
24174                        _depth,
24175                    )
24176                }
24177                ExtendedAttributeValue::__SourceBreaking { .. } => {
24178                    Err(fidl::Error::UnknownUnionTag)
24179                }
24180            }
24181        }
24182    }
24183
24184    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24185        for ExtendedAttributeValue
24186    {
24187        #[inline(always)]
24188        fn new_empty() -> Self {
24189            Self::__SourceBreaking { unknown_ordinal: 0 }
24190        }
24191
24192        #[inline]
24193        unsafe fn decode(
24194            &mut self,
24195            decoder: &mut fidl::encoding::Decoder<
24196                '_,
24197                fidl::encoding::DefaultFuchsiaResourceDialect,
24198            >,
24199            offset: usize,
24200            mut depth: fidl::encoding::Depth,
24201        ) -> fidl::Result<()> {
24202            decoder.debug_check_bounds::<Self>(offset);
24203            #[allow(unused_variables)]
24204            let next_out_of_line = decoder.next_out_of_line();
24205            let handles_before = decoder.remaining_handles();
24206            let (ordinal, inlined, num_bytes, num_handles) =
24207                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24208
24209            let member_inline_size = match ordinal {
24210                1 => {
24211                    <fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
24212                        decoder.context,
24213                    )
24214                }
24215                2 => <fidl::encoding::HandleType<
24216                    fidl::Vmo,
24217                    { fidl::ObjectType::VMO.into_raw() },
24218                    2147483648,
24219                > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24220                0 => return Err(fidl::Error::UnknownUnionTag),
24221                _ => num_bytes as usize,
24222            };
24223
24224            if inlined != (member_inline_size <= 4) {
24225                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24226            }
24227            let _inner_offset;
24228            if inlined {
24229                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24230                _inner_offset = offset + 8;
24231            } else {
24232                depth.increment()?;
24233                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24234            }
24235            match ordinal {
24236                1 => {
24237                    #[allow(irrefutable_let_patterns)]
24238                    if let ExtendedAttributeValue::Bytes(_) = self {
24239                        // Do nothing, read the value into the object
24240                    } else {
24241                        // Initialize `self` to the right variant
24242                        *self = ExtendedAttributeValue::Bytes(
24243                            fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
24244                        );
24245                    }
24246                    #[allow(irrefutable_let_patterns)]
24247                    if let ExtendedAttributeValue::Bytes(ref mut val) = self {
24248                        fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24249                    } else {
24250                        unreachable!()
24251                    }
24252                }
24253                2 => {
24254                    #[allow(irrefutable_let_patterns)]
24255                    if let ExtendedAttributeValue::Buffer(_) = self {
24256                        // Do nothing, read the value into the object
24257                    } else {
24258                        // Initialize `self` to the right variant
24259                        *self = ExtendedAttributeValue::Buffer(
24260                            fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
24261                        );
24262                    }
24263                    #[allow(irrefutable_let_patterns)]
24264                    if let ExtendedAttributeValue::Buffer(ref mut val) = self {
24265                        fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
24266                    } else {
24267                        unreachable!()
24268                    }
24269                }
24270                #[allow(deprecated)]
24271                ordinal => {
24272                    for _ in 0..num_handles {
24273                        decoder.drop_next_handle()?;
24274                    }
24275                    *self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
24276                }
24277            }
24278            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24279                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24280            }
24281            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24282                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24283            }
24284            Ok(())
24285        }
24286    }
24287
24288    impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
24289        type Borrowed<'a> = &'a mut Self;
24290        fn take_or_borrow<'a>(
24291            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24292        ) -> Self::Borrowed<'a> {
24293            value
24294        }
24295    }
24296
24297    unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
24298        type Owned = Self;
24299
24300        #[inline(always)]
24301        fn inline_align(_context: fidl::encoding::Context) -> usize {
24302            8
24303        }
24304
24305        #[inline(always)]
24306        fn inline_size(_context: fidl::encoding::Context) -> usize {
24307            16
24308        }
24309    }
24310
24311    unsafe impl
24312        fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
24313        for &mut NodeInfoDeprecated
24314    {
24315        #[inline]
24316        unsafe fn encode(
24317            self,
24318            encoder: &mut fidl::encoding::Encoder<
24319                '_,
24320                fidl::encoding::DefaultFuchsiaResourceDialect,
24321            >,
24322            offset: usize,
24323            _depth: fidl::encoding::Depth,
24324        ) -> fidl::Result<()> {
24325            encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
24326            encoder.write_num::<u64>(self.ordinal(), offset);
24327            match self {
24328                NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
24329                    Service,
24330                    fidl::encoding::DefaultFuchsiaResourceDialect,
24331                >(
24332                    <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
24333                    encoder,
24334                    offset + 8,
24335                    _depth,
24336                ),
24337                NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24338                    FileObject,
24339                    fidl::encoding::DefaultFuchsiaResourceDialect,
24340                >(
24341                    <FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24342                    encoder,
24343                    offset + 8,
24344                    _depth,
24345                ),
24346                NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24347                    DirectoryObject,
24348                    fidl::encoding::DefaultFuchsiaResourceDialect,
24349                >(
24350                    <DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24351                    encoder,
24352                    offset + 8,
24353                    _depth,
24354                ),
24355                NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24356                    SymlinkObject,
24357                    fidl::encoding::DefaultFuchsiaResourceDialect,
24358                >(
24359                    <SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
24360                    encoder,
24361                    offset + 8,
24362                    _depth,
24363                ),
24364            }
24365        }
24366    }
24367
24368    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24369        for NodeInfoDeprecated
24370    {
24371        #[inline(always)]
24372        fn new_empty() -> Self {
24373            Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
24374        }
24375
24376        #[inline]
24377        unsafe fn decode(
24378            &mut self,
24379            decoder: &mut fidl::encoding::Decoder<
24380                '_,
24381                fidl::encoding::DefaultFuchsiaResourceDialect,
24382            >,
24383            offset: usize,
24384            mut depth: fidl::encoding::Depth,
24385        ) -> fidl::Result<()> {
24386            decoder.debug_check_bounds::<Self>(offset);
24387            #[allow(unused_variables)]
24388            let next_out_of_line = decoder.next_out_of_line();
24389            let handles_before = decoder.remaining_handles();
24390            let (ordinal, inlined, num_bytes, num_handles) =
24391                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24392
24393            let member_inline_size = match ordinal {
24394                1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24395                2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24396                3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24397                4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24398                _ => return Err(fidl::Error::UnknownUnionTag),
24399            };
24400
24401            if inlined != (member_inline_size <= 4) {
24402                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24403            }
24404            let _inner_offset;
24405            if inlined {
24406                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24407                _inner_offset = offset + 8;
24408            } else {
24409                depth.increment()?;
24410                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24411            }
24412            match ordinal {
24413                1 => {
24414                    #[allow(irrefutable_let_patterns)]
24415                    if let NodeInfoDeprecated::Service(_) = self {
24416                        // Do nothing, read the value into the object
24417                    } else {
24418                        // Initialize `self` to the right variant
24419                        *self = NodeInfoDeprecated::Service(fidl::new_empty!(
24420                            Service,
24421                            fidl::encoding::DefaultFuchsiaResourceDialect
24422                        ));
24423                    }
24424                    #[allow(irrefutable_let_patterns)]
24425                    if let NodeInfoDeprecated::Service(ref mut val) = self {
24426                        fidl::decode!(
24427                            Service,
24428                            fidl::encoding::DefaultFuchsiaResourceDialect,
24429                            val,
24430                            decoder,
24431                            _inner_offset,
24432                            depth
24433                        )?;
24434                    } else {
24435                        unreachable!()
24436                    }
24437                }
24438                2 => {
24439                    #[allow(irrefutable_let_patterns)]
24440                    if let NodeInfoDeprecated::File(_) = self {
24441                        // Do nothing, read the value into the object
24442                    } else {
24443                        // Initialize `self` to the right variant
24444                        *self = NodeInfoDeprecated::File(fidl::new_empty!(
24445                            FileObject,
24446                            fidl::encoding::DefaultFuchsiaResourceDialect
24447                        ));
24448                    }
24449                    #[allow(irrefutable_let_patterns)]
24450                    if let NodeInfoDeprecated::File(ref mut val) = self {
24451                        fidl::decode!(
24452                            FileObject,
24453                            fidl::encoding::DefaultFuchsiaResourceDialect,
24454                            val,
24455                            decoder,
24456                            _inner_offset,
24457                            depth
24458                        )?;
24459                    } else {
24460                        unreachable!()
24461                    }
24462                }
24463                3 => {
24464                    #[allow(irrefutable_let_patterns)]
24465                    if let NodeInfoDeprecated::Directory(_) = self {
24466                        // Do nothing, read the value into the object
24467                    } else {
24468                        // Initialize `self` to the right variant
24469                        *self = NodeInfoDeprecated::Directory(fidl::new_empty!(
24470                            DirectoryObject,
24471                            fidl::encoding::DefaultFuchsiaResourceDialect
24472                        ));
24473                    }
24474                    #[allow(irrefutable_let_patterns)]
24475                    if let NodeInfoDeprecated::Directory(ref mut val) = self {
24476                        fidl::decode!(
24477                            DirectoryObject,
24478                            fidl::encoding::DefaultFuchsiaResourceDialect,
24479                            val,
24480                            decoder,
24481                            _inner_offset,
24482                            depth
24483                        )?;
24484                    } else {
24485                        unreachable!()
24486                    }
24487                }
24488                4 => {
24489                    #[allow(irrefutable_let_patterns)]
24490                    if let NodeInfoDeprecated::Symlink(_) = self {
24491                        // Do nothing, read the value into the object
24492                    } else {
24493                        // Initialize `self` to the right variant
24494                        *self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
24495                            SymlinkObject,
24496                            fidl::encoding::DefaultFuchsiaResourceDialect
24497                        ));
24498                    }
24499                    #[allow(irrefutable_let_patterns)]
24500                    if let NodeInfoDeprecated::Symlink(ref mut val) = self {
24501                        fidl::decode!(
24502                            SymlinkObject,
24503                            fidl::encoding::DefaultFuchsiaResourceDialect,
24504                            val,
24505                            decoder,
24506                            _inner_offset,
24507                            depth
24508                        )?;
24509                    } else {
24510                        unreachable!()
24511                    }
24512                }
24513                ordinal => panic!("unexpected ordinal {:?}", ordinal),
24514            }
24515            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24516                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24517            }
24518            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24519                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24520            }
24521            Ok(())
24522        }
24523    }
24524
24525    impl fidl::encoding::ResourceTypeMarker for Representation {
24526        type Borrowed<'a> = &'a mut Self;
24527        fn take_or_borrow<'a>(
24528            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
24529        ) -> Self::Borrowed<'a> {
24530            value
24531        }
24532    }
24533
24534    unsafe impl fidl::encoding::TypeMarker for Representation {
24535        type Owned = Self;
24536
24537        #[inline(always)]
24538        fn inline_align(_context: fidl::encoding::Context) -> usize {
24539            8
24540        }
24541
24542        #[inline(always)]
24543        fn inline_size(_context: fidl::encoding::Context) -> usize {
24544            16
24545        }
24546    }
24547
24548    unsafe impl
24549        fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
24550        for &mut Representation
24551    {
24552        #[inline]
24553        unsafe fn encode(
24554            self,
24555            encoder: &mut fidl::encoding::Encoder<
24556                '_,
24557                fidl::encoding::DefaultFuchsiaResourceDialect,
24558            >,
24559            offset: usize,
24560            _depth: fidl::encoding::Depth,
24561        ) -> fidl::Result<()> {
24562            encoder.debug_check_bounds::<Representation>(offset);
24563            encoder.write_num::<u64>(self.ordinal(), offset);
24564            match self {
24565                Representation::Node(ref val) => fidl::encoding::encode_in_envelope::<
24566                    NodeInfo,
24567                    fidl::encoding::DefaultFuchsiaResourceDialect,
24568                >(
24569                    <NodeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24570                    encoder,
24571                    offset + 8,
24572                    _depth,
24573                ),
24574                Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
24575                    DirectoryInfo,
24576                    fidl::encoding::DefaultFuchsiaResourceDialect,
24577                >(
24578                    <DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24579                    encoder,
24580                    offset + 8,
24581                    _depth,
24582                ),
24583                Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
24584                    FileInfo,
24585                    fidl::encoding::DefaultFuchsiaResourceDialect,
24586                >(
24587                    <FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
24588                    encoder,
24589                    offset + 8,
24590                    _depth,
24591                ),
24592                Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
24593                    SymlinkInfo,
24594                    fidl::encoding::DefaultFuchsiaResourceDialect,
24595                >(
24596                    <SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
24597                    encoder,
24598                    offset + 8,
24599                    _depth,
24600                ),
24601                Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24602            }
24603        }
24604    }
24605
24606    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
24607        for Representation
24608    {
24609        #[inline(always)]
24610        fn new_empty() -> Self {
24611            Self::__SourceBreaking { unknown_ordinal: 0 }
24612        }
24613
24614        #[inline]
24615        unsafe fn decode(
24616            &mut self,
24617            decoder: &mut fidl::encoding::Decoder<
24618                '_,
24619                fidl::encoding::DefaultFuchsiaResourceDialect,
24620            >,
24621            offset: usize,
24622            mut depth: fidl::encoding::Depth,
24623        ) -> fidl::Result<()> {
24624            decoder.debug_check_bounds::<Self>(offset);
24625            #[allow(unused_variables)]
24626            let next_out_of_line = decoder.next_out_of_line();
24627            let handles_before = decoder.remaining_handles();
24628            let (ordinal, inlined, num_bytes, num_handles) =
24629                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24630
24631            let member_inline_size = match ordinal {
24632                1 => <NodeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24633                2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24634                3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24635                4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24636                0 => return Err(fidl::Error::UnknownUnionTag),
24637                _ => num_bytes as usize,
24638            };
24639
24640            if inlined != (member_inline_size <= 4) {
24641                return Err(fidl::Error::InvalidInlineBitInEnvelope);
24642            }
24643            let _inner_offset;
24644            if inlined {
24645                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24646                _inner_offset = offset + 8;
24647            } else {
24648                depth.increment()?;
24649                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24650            }
24651            match ordinal {
24652                1 => {
24653                    #[allow(irrefutable_let_patterns)]
24654                    if let Representation::Node(_) = self {
24655                        // Do nothing, read the value into the object
24656                    } else {
24657                        // Initialize `self` to the right variant
24658                        *self = Representation::Node(fidl::new_empty!(
24659                            NodeInfo,
24660                            fidl::encoding::DefaultFuchsiaResourceDialect
24661                        ));
24662                    }
24663                    #[allow(irrefutable_let_patterns)]
24664                    if let Representation::Node(ref mut val) = self {
24665                        fidl::decode!(
24666                            NodeInfo,
24667                            fidl::encoding::DefaultFuchsiaResourceDialect,
24668                            val,
24669                            decoder,
24670                            _inner_offset,
24671                            depth
24672                        )?;
24673                    } else {
24674                        unreachable!()
24675                    }
24676                }
24677                2 => {
24678                    #[allow(irrefutable_let_patterns)]
24679                    if let Representation::Directory(_) = self {
24680                        // Do nothing, read the value into the object
24681                    } else {
24682                        // Initialize `self` to the right variant
24683                        *self = Representation::Directory(fidl::new_empty!(
24684                            DirectoryInfo,
24685                            fidl::encoding::DefaultFuchsiaResourceDialect
24686                        ));
24687                    }
24688                    #[allow(irrefutable_let_patterns)]
24689                    if let Representation::Directory(ref mut val) = self {
24690                        fidl::decode!(
24691                            DirectoryInfo,
24692                            fidl::encoding::DefaultFuchsiaResourceDialect,
24693                            val,
24694                            decoder,
24695                            _inner_offset,
24696                            depth
24697                        )?;
24698                    } else {
24699                        unreachable!()
24700                    }
24701                }
24702                3 => {
24703                    #[allow(irrefutable_let_patterns)]
24704                    if let Representation::File(_) = self {
24705                        // Do nothing, read the value into the object
24706                    } else {
24707                        // Initialize `self` to the right variant
24708                        *self = Representation::File(fidl::new_empty!(
24709                            FileInfo,
24710                            fidl::encoding::DefaultFuchsiaResourceDialect
24711                        ));
24712                    }
24713                    #[allow(irrefutable_let_patterns)]
24714                    if let Representation::File(ref mut val) = self {
24715                        fidl::decode!(
24716                            FileInfo,
24717                            fidl::encoding::DefaultFuchsiaResourceDialect,
24718                            val,
24719                            decoder,
24720                            _inner_offset,
24721                            depth
24722                        )?;
24723                    } else {
24724                        unreachable!()
24725                    }
24726                }
24727                4 => {
24728                    #[allow(irrefutable_let_patterns)]
24729                    if let Representation::Symlink(_) = self {
24730                        // Do nothing, read the value into the object
24731                    } else {
24732                        // Initialize `self` to the right variant
24733                        *self = Representation::Symlink(fidl::new_empty!(
24734                            SymlinkInfo,
24735                            fidl::encoding::DefaultFuchsiaResourceDialect
24736                        ));
24737                    }
24738                    #[allow(irrefutable_let_patterns)]
24739                    if let Representation::Symlink(ref mut val) = self {
24740                        fidl::decode!(
24741                            SymlinkInfo,
24742                            fidl::encoding::DefaultFuchsiaResourceDialect,
24743                            val,
24744                            decoder,
24745                            _inner_offset,
24746                            depth
24747                        )?;
24748                    } else {
24749                        unreachable!()
24750                    }
24751                }
24752                #[allow(deprecated)]
24753                ordinal => {
24754                    for _ in 0..num_handles {
24755                        decoder.drop_next_handle()?;
24756                    }
24757                    *self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
24758                }
24759            }
24760            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24761                return Err(fidl::Error::InvalidNumBytesInEnvelope);
24762            }
24763            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24764                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24765            }
24766            Ok(())
24767        }
24768    }
24769}