1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5::fidl_next::bitflags::bitflags! {
6 #[doc = " The common members definition behind [`Rights`] and [`Abilities`]. Some operations may apply\n only to certain node types (e.g. [`Operations.MODIFY_DIRECTORY`] only applies to directories).\n"]#[derive(
7 Clone,
8 Copy,
9 Debug,
10 PartialEq,
11 Eq,
12 Hash,
13 )]
14 pub struct Operations: u64 {
15 #[doc = " Connecting to a service in a directory.\n"]const CONNECT = 1;
16 #[doc = " Read byte contents of a node or its children.\n"]const READ_BYTES = 2;
17 #[doc = " Writing to the byte contents of a node or its children.\n"]const WRITE_BYTES = 4;
18 #[doc = " Execute the byte contents of a node or its children.\n"]const EXECUTE = 8;
19 #[doc = " Reading the attributes of a node and/or its children.\n"]const GET_ATTRIBUTES = 16;
20 #[doc = " Updating the attributes of a node and/or its children.\n"]const UPDATE_ATTRIBUTES = 32;
21 #[doc = " Reading the list of nodes in a directory.\n"]const ENUMERATE = 64;
22 #[doc = " Opening a node from a directory. Must be specified with [`Rights.ENUMERATE`], as directory\n contents can be probed by opening children.\n"]const TRAVERSE = 128;
23 #[doc = " Modifying the list of nodes in a directory, e.g. creating, renaming, link/unlink, etc...\n Must be specified with [`Rights.ENUMERATE`], as directory contents can be probed via name\n conflicts during node creation.\n"]const MODIFY_DIRECTORY = 256;
24
25 }
26}
27
28impl ::fidl_next::Encodable for Operations {
29 type Encoded = WireOperations;
30}
31
32unsafe impl<___E> ::fidl_next::Encode<___E> for Operations
33where
34 ___E: ?Sized,
35{
36 #[inline]
37 fn encode(
38 self,
39 encoder: &mut ___E,
40 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
41 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
42 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
43 }
44}
45
46unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Operations
47where
48 ___E: ?Sized,
49{
50 #[inline]
51 fn encode_ref(
52 &self,
53 _: &mut ___E,
54 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
55 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
56 ::fidl_next::munge!(let WireOperations { value } = out);
57
58 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
59 return Err(::fidl_next::EncodeError::InvalidStrictBits);
60 }
61
62 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
63 Ok(())
64 }
65}
66
67impl ::core::convert::From<WireOperations> for Operations {
68 fn from(wire: WireOperations) -> Self {
69 Self::from_bits_retain(u64::from(wire.value))
70 }
71}
72
73impl ::fidl_next::FromWire<WireOperations> for Operations {
74 #[inline]
75 fn from_wire(wire: WireOperations) -> Self {
76 Self::from(wire)
77 }
78}
79
80impl ::fidl_next::IntoNatural for WireOperations {
81 type Natural = Operations;
82}
83
84impl ::fidl_next::FromWireRef<WireOperations> for Operations {
85 #[inline]
86 fn from_wire_ref(wire: &WireOperations) -> Self {
87 Self::from(*wire)
88 }
89}
90
91#[derive(Clone, Copy, Debug)]
93#[repr(transparent)]
94pub struct WireOperations {
95 value: ::fidl_next::WireU64,
96}
97
98unsafe impl ::fidl_next::Wire for WireOperations {
99 type Decoded<'de> = Self;
100
101 #[inline]
102 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
103 }
105}
106
107unsafe impl<___D> ::fidl_next::Decode<___D> for WireOperations
108where
109 ___D: ?Sized,
110{
111 fn decode(
112 slot: ::fidl_next::Slot<'_, Self>,
113 _: &mut ___D,
114 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
115 ::fidl_next::munge!(let Self { value } = slot);
116 let set = u64::from(*value);
117 if set & !Operations::all().bits() != 0 {
118 return Err(::fidl_next::DecodeError::InvalidBits {
119 expected: Operations::all().bits() as usize,
120 actual: set as usize,
121 });
122 }
123
124 Ok(())
125 }
126}
127
128impl ::core::convert::From<Operations> for WireOperations {
129 fn from(natural: Operations) -> Self {
130 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
131 }
132}
133
134#[doc = " Abilities are properties intrinsic to a node. They specify which operations are supported by it.\n\n Invoking an operation on a node that does not support it results in `ZX_ERR_NOT_SUPPORTED`.\n Note `ZX_ERR_ACCESS_DENIED` takes precedence over `ZX_ERR_NOT_SUPPORTED` when both apply.\n"]
135pub type Abilities = crate::Operations;
136
137pub type WireAbilities = crate::WireOperations;
139
140#[doc = " The reference point for updating the seek offset. See [`File.Seek`].\n\n This enum matches the `zx_stream_seek_origin_t` enum.\n"]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142#[repr(u32)]
143pub enum SeekOrigin {
144 Start = 0,
145 Current = 1,
146 End = 2,
147}
148
149impl ::fidl_next::Encodable for SeekOrigin {
150 type Encoded = WireSeekOrigin;
151}
152impl ::core::convert::TryFrom<u32> for SeekOrigin {
153 type Error = ::fidl_next::UnknownStrictEnumMemberError;
154 fn try_from(
155 value: u32,
156 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
157 match value {
158 0 => Ok(Self::Start),
159 1 => Ok(Self::Current),
160 2 => Ok(Self::End),
161
162 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
163 }
164 }
165}
166
167unsafe impl<___E> ::fidl_next::Encode<___E> for SeekOrigin
168where
169 ___E: ?Sized,
170{
171 #[inline]
172 fn encode(
173 self,
174 encoder: &mut ___E,
175 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
176 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
177 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
178 }
179}
180
181unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SeekOrigin
182where
183 ___E: ?Sized,
184{
185 #[inline]
186 fn encode_ref(
187 &self,
188 encoder: &mut ___E,
189 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
190 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
191 ::fidl_next::munge!(let WireSeekOrigin { value } = out);
192 let _ = value.write(::fidl_next::WireU32::from(match *self {
193 Self::Start => 0,
194
195 Self::Current => 1,
196
197 Self::End => 2,
198 }));
199
200 Ok(())
201 }
202}
203
204impl ::core::convert::From<WireSeekOrigin> for SeekOrigin {
205 fn from(wire: WireSeekOrigin) -> Self {
206 match u32::from(wire.value) {
207 0 => Self::Start,
208
209 1 => Self::Current,
210
211 2 => Self::End,
212
213 _ => unsafe { ::core::hint::unreachable_unchecked() },
214 }
215 }
216}
217
218impl ::fidl_next::FromWire<WireSeekOrigin> for SeekOrigin {
219 #[inline]
220 fn from_wire(wire: WireSeekOrigin) -> Self {
221 Self::from(wire)
222 }
223}
224
225impl ::fidl_next::IntoNatural for WireSeekOrigin {
226 type Natural = SeekOrigin;
227}
228
229impl ::fidl_next::FromWireRef<WireSeekOrigin> for SeekOrigin {
230 #[inline]
231 fn from_wire_ref(wire: &WireSeekOrigin) -> Self {
232 Self::from(*wire)
233 }
234}
235
236#[derive(Clone, Copy, Debug, PartialEq, Eq)]
238#[repr(transparent)]
239pub struct WireSeekOrigin {
240 value: ::fidl_next::WireU32,
241}
242
243unsafe impl ::fidl_next::Wire for WireSeekOrigin {
244 type Decoded<'de> = Self;
245
246 #[inline]
247 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
248 }
250}
251
252impl WireSeekOrigin {
253 pub const START: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(0) };
254
255 pub const CURRENT: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(1) };
256
257 pub const END: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(2) };
258}
259
260unsafe impl<___D> ::fidl_next::Decode<___D> for WireSeekOrigin
261where
262 ___D: ?Sized,
263{
264 fn decode(
265 slot: ::fidl_next::Slot<'_, Self>,
266 _: &mut ___D,
267 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
268 ::fidl_next::munge!(let Self { value } = slot);
269
270 match u32::from(*value) {
271 0 | 1 | 2 => (),
272 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
273 }
274
275 Ok(())
276 }
277}
278
279impl ::core::convert::From<SeekOrigin> for WireSeekOrigin {
280 fn from(natural: SeekOrigin) -> Self {
281 match natural {
282 SeekOrigin::Start => WireSeekOrigin::START,
283
284 SeekOrigin::Current => WireSeekOrigin::CURRENT,
285
286 SeekOrigin::End => WireSeekOrigin::END,
287 }
288 }
289}
290
291#[derive(PartialEq, Clone, Debug)]
292pub struct AdvisoryLockRange {
293 pub origin: crate::SeekOrigin,
294
295 pub offset: i64,
296
297 pub length: i64,
298}
299
300impl ::fidl_next::Encodable for AdvisoryLockRange {
301 type Encoded = WireAdvisoryLockRange;
302}
303
304unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRange
305where
306 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
307{
308 #[inline]
309 fn encode(
310 self,
311 encoder_: &mut ___E,
312 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
313 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
314 ::fidl_next::munge! {
315 let Self::Encoded {
316 origin,
317 offset,
318 length,
319
320 } = out_;
321 }
322
323 ::fidl_next::Encode::encode(self.origin, encoder_, origin)?;
324
325 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
326
327 ::fidl_next::Encode::encode(self.length, encoder_, length)?;
328
329 Ok(())
330 }
331}
332
333unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRange
334where
335 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
336{
337 #[inline]
338 fn encode_ref(
339 &self,
340 encoder_: &mut ___E,
341 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
343 ::fidl_next::munge! {
344 let Self::Encoded {
345
346 origin,
347 offset,
348 length,
349
350 } = out_;
351 }
352
353 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder_, origin)?;
354
355 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder_, offset)?;
356
357 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder_, length)?;
358
359 Ok(())
360 }
361}
362
363impl ::fidl_next::EncodableOption for AdvisoryLockRange {
364 type EncodedOption = ::fidl_next::WireBox<'static, WireAdvisoryLockRange>;
365}
366
367unsafe impl<___E> ::fidl_next::EncodeOption<___E> for AdvisoryLockRange
368where
369 ___E: ::fidl_next::Encoder + ?Sized,
370 AdvisoryLockRange: ::fidl_next::Encode<___E>,
371{
372 #[inline]
373 fn encode_option(
374 this: ::core::option::Option<Self>,
375 encoder: &mut ___E,
376 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
377 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
378 if let Some(inner) = this {
379 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
380 ::fidl_next::WireBox::encode_present(out);
381 } else {
382 ::fidl_next::WireBox::encode_absent(out);
383 }
384
385 Ok(())
386 }
387}
388
389unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for AdvisoryLockRange
390where
391 ___E: ::fidl_next::Encoder + ?Sized,
392 AdvisoryLockRange: ::fidl_next::EncodeRef<___E>,
393{
394 #[inline]
395 fn encode_option_ref(
396 this: ::core::option::Option<&Self>,
397 encoder: &mut ___E,
398 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
400 if let Some(inner) = this {
401 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
402 ::fidl_next::WireBox::encode_present(out);
403 } else {
404 ::fidl_next::WireBox::encode_absent(out);
405 }
406
407 Ok(())
408 }
409}
410
411impl ::fidl_next::FromWire<WireAdvisoryLockRange> for AdvisoryLockRange {
412 #[inline]
413 fn from_wire(wire: WireAdvisoryLockRange) -> Self {
414 Self {
415 origin: ::fidl_next::FromWire::from_wire(wire.origin),
416
417 offset: ::fidl_next::FromWire::from_wire(wire.offset),
418
419 length: ::fidl_next::FromWire::from_wire(wire.length),
420 }
421 }
422}
423
424impl ::fidl_next::IntoNatural for WireAdvisoryLockRange {
425 type Natural = AdvisoryLockRange;
426}
427
428impl ::fidl_next::FromWireRef<WireAdvisoryLockRange> for AdvisoryLockRange {
429 #[inline]
430 fn from_wire_ref(wire: &WireAdvisoryLockRange) -> Self {
431 Self {
432 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
433
434 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
435
436 length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length),
437 }
438 }
439}
440
441#[derive(Clone, Debug)]
443#[repr(C)]
444pub struct WireAdvisoryLockRange {
445 pub origin: crate::WireSeekOrigin,
446
447 pub offset: ::fidl_next::WireI64,
448
449 pub length: ::fidl_next::WireI64,
450}
451static_assertions::const_assert_eq!(std::mem::size_of::<WireAdvisoryLockRange>(), 24);
452static_assertions::const_assert_eq!(std::mem::align_of::<WireAdvisoryLockRange>(), 8);
453
454static_assertions::const_assert_eq!(std::mem::offset_of!(WireAdvisoryLockRange, origin), 0);
455
456static_assertions::const_assert_eq!(std::mem::offset_of!(WireAdvisoryLockRange, offset), 8);
457
458static_assertions::const_assert_eq!(std::mem::offset_of!(WireAdvisoryLockRange, length), 16);
459
460unsafe impl ::fidl_next::Wire for WireAdvisoryLockRange {
461 type Decoded<'de> = WireAdvisoryLockRange;
462
463 #[inline]
464 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
465 ::fidl_next::munge! {
466 let Self {
467
468 origin,
469 offset,
470 length,
471
472 } = &mut *out_;
473 }
474
475 ::fidl_next::Wire::zero_padding(origin);
476
477 ::fidl_next::Wire::zero_padding(offset);
478
479 ::fidl_next::Wire::zero_padding(length);
480
481 unsafe {
482 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
483 }
484 }
485}
486
487unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRange
488where
489 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
490{
491 fn decode(
492 slot_: ::fidl_next::Slot<'_, Self>,
493 decoder_: &mut ___D,
494 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
495 ::fidl_next::munge! {
496 let Self {
497
498 mut origin,
499 mut offset,
500 mut length,
501
502 } = slot_;
503 }
504
505 ::fidl_next::Decode::decode(origin.as_mut(), decoder_)?;
506
507 ::fidl_next::Decode::decode(offset.as_mut(), decoder_)?;
508
509 ::fidl_next::Decode::decode(length.as_mut(), decoder_)?;
510
511 Ok(())
512 }
513}
514
515#[derive(Clone, Copy, Debug, PartialEq, Eq)]
516#[repr(u32)]
517pub enum AdvisoryLockType {
518 Read = 1,
519 Write = 2,
520 Unlock = 3,
521}
522
523impl ::fidl_next::Encodable for AdvisoryLockType {
524 type Encoded = WireAdvisoryLockType;
525}
526impl ::core::convert::TryFrom<u32> for AdvisoryLockType {
527 type Error = ::fidl_next::UnknownStrictEnumMemberError;
528 fn try_from(
529 value: u32,
530 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
531 match value {
532 1 => Ok(Self::Read),
533 2 => Ok(Self::Write),
534 3 => Ok(Self::Unlock),
535
536 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
537 }
538 }
539}
540
541unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockType
542where
543 ___E: ?Sized,
544{
545 #[inline]
546 fn encode(
547 self,
548 encoder: &mut ___E,
549 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
551 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
552 }
553}
554
555unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockType
556where
557 ___E: ?Sized,
558{
559 #[inline]
560 fn encode_ref(
561 &self,
562 encoder: &mut ___E,
563 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
564 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
565 ::fidl_next::munge!(let WireAdvisoryLockType { value } = out);
566 let _ = value.write(::fidl_next::WireU32::from(match *self {
567 Self::Read => 1,
568
569 Self::Write => 2,
570
571 Self::Unlock => 3,
572 }));
573
574 Ok(())
575 }
576}
577
578impl ::core::convert::From<WireAdvisoryLockType> for AdvisoryLockType {
579 fn from(wire: WireAdvisoryLockType) -> Self {
580 match u32::from(wire.value) {
581 1 => Self::Read,
582
583 2 => Self::Write,
584
585 3 => Self::Unlock,
586
587 _ => unsafe { ::core::hint::unreachable_unchecked() },
588 }
589 }
590}
591
592impl ::fidl_next::FromWire<WireAdvisoryLockType> for AdvisoryLockType {
593 #[inline]
594 fn from_wire(wire: WireAdvisoryLockType) -> Self {
595 Self::from(wire)
596 }
597}
598
599impl ::fidl_next::IntoNatural for WireAdvisoryLockType {
600 type Natural = AdvisoryLockType;
601}
602
603impl ::fidl_next::FromWireRef<WireAdvisoryLockType> for AdvisoryLockType {
604 #[inline]
605 fn from_wire_ref(wire: &WireAdvisoryLockType) -> Self {
606 Self::from(*wire)
607 }
608}
609
610#[derive(Clone, Copy, Debug, PartialEq, Eq)]
612#[repr(transparent)]
613pub struct WireAdvisoryLockType {
614 value: ::fidl_next::WireU32,
615}
616
617unsafe impl ::fidl_next::Wire for WireAdvisoryLockType {
618 type Decoded<'de> = Self;
619
620 #[inline]
621 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
622 }
624}
625
626impl WireAdvisoryLockType {
627 pub const READ: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(1) };
628
629 pub const WRITE: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(2) };
630
631 pub const UNLOCK: WireAdvisoryLockType =
632 WireAdvisoryLockType { value: ::fidl_next::WireU32(3) };
633}
634
635unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockType
636where
637 ___D: ?Sized,
638{
639 fn decode(
640 slot: ::fidl_next::Slot<'_, Self>,
641 _: &mut ___D,
642 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
643 ::fidl_next::munge!(let Self { value } = slot);
644
645 match u32::from(*value) {
646 1 | 2 | 3 => (),
647 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
648 }
649
650 Ok(())
651 }
652}
653
654impl ::core::convert::From<AdvisoryLockType> for WireAdvisoryLockType {
655 fn from(natural: AdvisoryLockType) -> Self {
656 match natural {
657 AdvisoryLockType::Read => WireAdvisoryLockType::READ,
658
659 AdvisoryLockType::Write => WireAdvisoryLockType::WRITE,
660
661 AdvisoryLockType::Unlock => WireAdvisoryLockType::UNLOCK,
662 }
663 }
664}
665
666#[derive(PartialEq, Clone, Debug, Default)]
667pub struct AdvisoryLockRequest {
668 pub type_: ::core::option::Option<crate::AdvisoryLockType>,
669
670 pub range: ::core::option::Option<crate::AdvisoryLockRange>,
671
672 pub wait: ::core::option::Option<bool>,
673}
674
675impl AdvisoryLockRequest {
676 fn __max_ordinal(&self) -> usize {
677 if self.wait.is_some() {
678 return 3;
679 }
680
681 if self.range.is_some() {
682 return 2;
683 }
684
685 if self.type_.is_some() {
686 return 1;
687 }
688
689 0
690 }
691}
692
693impl ::fidl_next::Encodable for AdvisoryLockRequest {
694 type Encoded = WireAdvisoryLockRequest<'static>;
695}
696
697unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRequest
698where
699 ___E: ::fidl_next::Encoder + ?Sized,
700{
701 #[inline]
702 fn encode(
703 mut self,
704 encoder: &mut ___E,
705 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
706 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
707 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
708
709 let max_ord = self.__max_ordinal();
710
711 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
712 ::fidl_next::Wire::zero_padding(&mut out);
713
714 let mut preallocated =
715 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
716
717 for i in 1..=max_ord {
718 match i {
719 3 => {
720 if let Some(value) = self.wait.take() {
721 ::fidl_next::WireEnvelope::encode_value(
722 value,
723 preallocated.encoder,
724 &mut out,
725 )?;
726 } else {
727 ::fidl_next::WireEnvelope::encode_zero(&mut out)
728 }
729 }
730
731 2 => {
732 if let Some(value) = self.range.take() {
733 ::fidl_next::WireEnvelope::encode_value(
734 value,
735 preallocated.encoder,
736 &mut out,
737 )?;
738 } else {
739 ::fidl_next::WireEnvelope::encode_zero(&mut out)
740 }
741 }
742
743 1 => {
744 if let Some(value) = self.type_.take() {
745 ::fidl_next::WireEnvelope::encode_value(
746 value,
747 preallocated.encoder,
748 &mut out,
749 )?;
750 } else {
751 ::fidl_next::WireEnvelope::encode_zero(&mut out)
752 }
753 }
754
755 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
756 }
757 unsafe {
758 preallocated.write_next(out.assume_init_ref());
759 }
760 }
761
762 ::fidl_next::WireTable::encode_len(table, max_ord);
763
764 Ok(())
765 }
766}
767
768unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRequest
769where
770 ___E: ::fidl_next::Encoder + ?Sized,
771{
772 #[inline]
773 fn encode_ref(
774 &self,
775 encoder: &mut ___E,
776 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
777 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
778 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
779
780 let max_ord = self.__max_ordinal();
781
782 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
783 ::fidl_next::Wire::zero_padding(&mut out);
784
785 let mut preallocated =
786 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
787
788 for i in 1..=max_ord {
789 match i {
790 3 => {
791 if let Some(value) = &self.wait {
792 ::fidl_next::WireEnvelope::encode_value(
793 value,
794 preallocated.encoder,
795 &mut out,
796 )?;
797 } else {
798 ::fidl_next::WireEnvelope::encode_zero(&mut out)
799 }
800 }
801
802 2 => {
803 if let Some(value) = &self.range {
804 ::fidl_next::WireEnvelope::encode_value(
805 value,
806 preallocated.encoder,
807 &mut out,
808 )?;
809 } else {
810 ::fidl_next::WireEnvelope::encode_zero(&mut out)
811 }
812 }
813
814 1 => {
815 if let Some(value) = &self.type_ {
816 ::fidl_next::WireEnvelope::encode_value(
817 value,
818 preallocated.encoder,
819 &mut out,
820 )?;
821 } else {
822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
823 }
824 }
825
826 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
827 }
828 unsafe {
829 preallocated.write_next(out.assume_init_ref());
830 }
831 }
832
833 ::fidl_next::WireTable::encode_len(table, max_ord);
834
835 Ok(())
836 }
837}
838
839impl<'de> ::fidl_next::FromWire<WireAdvisoryLockRequest<'de>> for AdvisoryLockRequest {
840 #[inline]
841 fn from_wire(wire_: WireAdvisoryLockRequest<'de>) -> Self {
842 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
843
844 let type_ = wire_.table.get(1);
845
846 let range = wire_.table.get(2);
847
848 let wait = wire_.table.get(3);
849
850 Self {
851 type_: type_.map(|envelope| {
852 ::fidl_next::FromWire::from_wire(unsafe {
853 envelope.read_unchecked::<crate::WireAdvisoryLockType>()
854 })
855 }),
856
857 range: range.map(|envelope| {
858 ::fidl_next::FromWire::from_wire(unsafe {
859 envelope.read_unchecked::<crate::WireAdvisoryLockRange>()
860 })
861 }),
862
863 wait: wait.map(|envelope| {
864 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
865 }),
866 }
867 }
868}
869
870impl<'de> ::fidl_next::IntoNatural for WireAdvisoryLockRequest<'de> {
871 type Natural = AdvisoryLockRequest;
872}
873
874impl<'de> ::fidl_next::FromWireRef<WireAdvisoryLockRequest<'de>> for AdvisoryLockRequest {
875 #[inline]
876 fn from_wire_ref(wire: &WireAdvisoryLockRequest<'de>) -> Self {
877 Self {
878 type_: wire.table.get(1).map(|envelope| {
879 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
880 envelope.deref_unchecked::<crate::WireAdvisoryLockType>()
881 })
882 }),
883
884 range: wire.table.get(2).map(|envelope| {
885 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
886 envelope.deref_unchecked::<crate::WireAdvisoryLockRange>()
887 })
888 }),
889
890 wait: wire.table.get(3).map(|envelope| {
891 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
892 envelope.deref_unchecked::<bool>()
893 })
894 }),
895 }
896 }
897}
898
899#[repr(C)]
901pub struct WireAdvisoryLockRequest<'de> {
902 table: ::fidl_next::WireTable<'de>,
903}
904
905impl<'de> Drop for WireAdvisoryLockRequest<'de> {
906 fn drop(&mut self) {
907 let _ = self
908 .table
909 .get(1)
910 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAdvisoryLockType>() });
911
912 let _ = self
913 .table
914 .get(2)
915 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAdvisoryLockRange>() });
916
917 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
918 }
919}
920
921unsafe impl ::fidl_next::Wire for WireAdvisoryLockRequest<'static> {
922 type Decoded<'de> = WireAdvisoryLockRequest<'de>;
923
924 #[inline]
925 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
926 ::fidl_next::munge!(let Self { table } = out);
927 ::fidl_next::WireTable::zero_padding(table);
928 }
929}
930
931unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRequest<'static>
932where
933 ___D: ::fidl_next::Decoder + ?Sized,
934{
935 fn decode(
936 slot: ::fidl_next::Slot<'_, Self>,
937 decoder: &mut ___D,
938 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
939 ::fidl_next::munge!(let Self { table } = slot);
940
941 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
942 match ordinal {
943 0 => unsafe { ::core::hint::unreachable_unchecked() },
944
945 1 => {
946 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockType>(
947 slot.as_mut(),
948 decoder,
949 )?;
950
951 Ok(())
952 }
953
954 2 => {
955 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockRange>(
956 slot.as_mut(),
957 decoder,
958 )?;
959
960 Ok(())
961 }
962
963 3 => {
964 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
965
966 Ok(())
967 }
968
969 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
970 }
971 })
972 }
973}
974
975impl<'de> WireAdvisoryLockRequest<'de> {
976 pub fn type_(&self) -> ::core::option::Option<&crate::WireAdvisoryLockType> {
977 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
978 }
979
980 pub fn range(&self) -> ::core::option::Option<&crate::WireAdvisoryLockRange> {
981 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
982 }
983
984 pub fn wait(&self) -> ::core::option::Option<&bool> {
985 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
986 }
987}
988
989impl<'de> ::core::fmt::Debug for WireAdvisoryLockRequest<'de> {
990 fn fmt(
991 &self,
992 f: &mut ::core::fmt::Formatter<'_>,
993 ) -> ::core::result::Result<(), ::core::fmt::Error> {
994 f.debug_struct("AdvisoryLockRequest")
995 .field("type_", &self.type_())
996 .field("range", &self.range())
997 .field("wait", &self.wait())
998 .finish()
999 }
1000}
1001
1002#[derive(PartialEq, Clone, Debug)]
1003pub struct AdvisoryLockingAdvisoryLockRequest {
1004 pub request: crate::AdvisoryLockRequest,
1005}
1006
1007impl ::fidl_next::Encodable for AdvisoryLockingAdvisoryLockRequest {
1008 type Encoded = WireAdvisoryLockingAdvisoryLockRequest<'static>;
1009}
1010
1011unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockingAdvisoryLockRequest
1012where
1013 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1014 ___E: ::fidl_next::Encoder,
1015{
1016 #[inline]
1017 fn encode(
1018 self,
1019 encoder_: &mut ___E,
1020 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1021 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1022 ::fidl_next::munge! {
1023 let Self::Encoded {
1024 request,
1025
1026 } = out_;
1027 }
1028
1029 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
1030
1031 Ok(())
1032 }
1033}
1034
1035unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockingAdvisoryLockRequest
1036where
1037 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1038 ___E: ::fidl_next::Encoder,
1039{
1040 #[inline]
1041 fn encode_ref(
1042 &self,
1043 encoder_: &mut ___E,
1044 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1045 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1046 ::fidl_next::munge! {
1047 let Self::Encoded {
1048
1049 request,
1050
1051 } = out_;
1052 }
1053
1054 ::fidl_next::EncodeRef::encode_ref(&self.request, encoder_, request)?;
1055
1056 Ok(())
1057 }
1058}
1059
1060impl ::fidl_next::EncodableOption for AdvisoryLockingAdvisoryLockRequest {
1061 type EncodedOption =
1062 ::fidl_next::WireBox<'static, WireAdvisoryLockingAdvisoryLockRequest<'static>>;
1063}
1064
1065unsafe impl<___E> ::fidl_next::EncodeOption<___E> for AdvisoryLockingAdvisoryLockRequest
1066where
1067 ___E: ::fidl_next::Encoder + ?Sized,
1068 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::Encode<___E>,
1069{
1070 #[inline]
1071 fn encode_option(
1072 this: ::core::option::Option<Self>,
1073 encoder: &mut ___E,
1074 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1075 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1076 if let Some(inner) = this {
1077 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1078 ::fidl_next::WireBox::encode_present(out);
1079 } else {
1080 ::fidl_next::WireBox::encode_absent(out);
1081 }
1082
1083 Ok(())
1084 }
1085}
1086
1087unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for AdvisoryLockingAdvisoryLockRequest
1088where
1089 ___E: ::fidl_next::Encoder + ?Sized,
1090 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::EncodeRef<___E>,
1091{
1092 #[inline]
1093 fn encode_option_ref(
1094 this: ::core::option::Option<&Self>,
1095 encoder: &mut ___E,
1096 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1097 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1098 if let Some(inner) = this {
1099 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1100 ::fidl_next::WireBox::encode_present(out);
1101 } else {
1102 ::fidl_next::WireBox::encode_absent(out);
1103 }
1104
1105 Ok(())
1106 }
1107}
1108
1109impl<'de> ::fidl_next::FromWire<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1110 for AdvisoryLockingAdvisoryLockRequest
1111{
1112 #[inline]
1113 fn from_wire(wire: WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1114 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
1115 }
1116}
1117
1118impl<'de> ::fidl_next::IntoNatural for WireAdvisoryLockingAdvisoryLockRequest<'de> {
1119 type Natural = AdvisoryLockingAdvisoryLockRequest;
1120}
1121
1122impl<'de> ::fidl_next::FromWireRef<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1123 for AdvisoryLockingAdvisoryLockRequest
1124{
1125 #[inline]
1126 fn from_wire_ref(wire: &WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1127 Self { request: ::fidl_next::FromWireRef::from_wire_ref(&wire.request) }
1128 }
1129}
1130
1131#[derive(Debug)]
1133#[repr(C)]
1134pub struct WireAdvisoryLockingAdvisoryLockRequest<'de> {
1135 pub request: crate::WireAdvisoryLockRequest<'de>,
1136}
1137static_assertions::const_assert_eq!(
1138 std::mem::size_of::<WireAdvisoryLockingAdvisoryLockRequest<'_>>(),
1139 16
1140);
1141static_assertions::const_assert_eq!(
1142 std::mem::align_of::<WireAdvisoryLockingAdvisoryLockRequest<'_>>(),
1143 8
1144);
1145
1146static_assertions::const_assert_eq!(
1147 std::mem::offset_of!(WireAdvisoryLockingAdvisoryLockRequest<'_>, request),
1148 0
1149);
1150
1151unsafe impl ::fidl_next::Wire for WireAdvisoryLockingAdvisoryLockRequest<'static> {
1152 type Decoded<'de> = WireAdvisoryLockingAdvisoryLockRequest<'de>;
1153
1154 #[inline]
1155 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1156 ::fidl_next::munge! {
1157 let Self {
1158
1159 request,
1160
1161 } = &mut *out_;
1162 }
1163
1164 ::fidl_next::Wire::zero_padding(request);
1165 }
1166}
1167
1168unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockingAdvisoryLockRequest<'static>
1169where
1170 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1171 ___D: ::fidl_next::Decoder,
1172{
1173 fn decode(
1174 slot_: ::fidl_next::Slot<'_, Self>,
1175 decoder_: &mut ___D,
1176 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1177 ::fidl_next::munge! {
1178 let Self {
1179
1180 mut request,
1181
1182 } = slot_;
1183 }
1184
1185 ::fidl_next::Decode::decode(request.as_mut(), decoder_)?;
1186
1187 Ok(())
1188 }
1189}
1190
1191pub type AdvisoryLockingAdvisoryLockResponse = ();
1192
1193pub type WireAdvisoryLockingAdvisoryLockResponse = ();
1195
1196#[doc = " Advisory locking protocol.\n\n This protocol is intended to be composed into the |File| protocol to\n provide support for advisory locking.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n These primitives are designed to support the flock() and fcntl(),\n specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code\n running on Fuchsia expects from other operating systems.\n"]
1198#[derive(PartialEq, Debug)]
1199pub struct AdvisoryLocking;
1200
1201pub mod advisory_locking {
1202 pub mod prelude {
1203 pub use crate::{
1204 AdvisoryLocking, AdvisoryLockingClientHandler, AdvisoryLockingServerHandler,
1205 advisory_locking,
1206 };
1207
1208 pub use crate::AdvisoryLockingAdvisoryLockRequest;
1209
1210 pub use crate::AdvisoryLockingAdvisoryLockResponse;
1211 }
1212
1213 pub struct AdvisoryLock;
1214
1215 impl ::fidl_next::Method for AdvisoryLock {
1216 const ORDINAL: u64 = 7992130864415541162;
1217
1218 type Protocol = crate::AdvisoryLocking;
1219
1220 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1221
1222 type Response = ::fidl_next::WireResult<
1223 'static,
1224 crate::WireAdvisoryLockingAdvisoryLockResponse,
1225 ::fidl_next::WireI32,
1226 >;
1227 }
1228
1229 mod ___detail {
1230
1231 pub struct AdvisoryLock<T0> {
1232 request: T0,
1233 }
1234
1235 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
1236 where
1237 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
1238 {
1239 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1240 }
1241
1242 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
1243 where
1244 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1245 ___E: ::fidl_next::Encoder,
1246 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
1247 {
1248 #[inline]
1249 fn encode(
1250 self,
1251 encoder_: &mut ___E,
1252 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1253 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1254 ::fidl_next::munge! {
1255 let Self::Encoded {
1256 request,
1257
1258 } = out_;
1259 }
1260
1261 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
1262
1263 Ok(())
1264 }
1265 }
1266
1267 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::AdvisoryLocking
1268 where
1269 ___T: ::fidl_next::Transport,
1270 {
1271 type Client = AdvisoryLockingClient<___T>;
1272 type Server = AdvisoryLockingServer<___T>;
1273 }
1274
1275 #[repr(transparent)]
1277 pub struct AdvisoryLockingClient<___T: ::fidl_next::Transport> {
1278 #[allow(dead_code)]
1279 client: ::fidl_next::protocol::Client<___T>,
1280 }
1281
1282 impl<___T> AdvisoryLockingClient<___T>
1283 where
1284 ___T: ::fidl_next::Transport,
1285 {
1286 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
1287 pub fn advisory_lock(
1288 &self,
1289
1290 request: impl ::fidl_next::Encode<
1291 <___T as ::fidl_next::Transport>::SendBuffer,
1292 Encoded = crate::WireAdvisoryLockRequest<'static>,
1293 >,
1294 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
1295 where
1296 <___T as ::fidl_next::Transport>::SendBuffer:
1297 ::fidl_next::encoder::InternalHandleEncoder,
1298 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1299 {
1300 self.advisory_lock_with(AdvisoryLock { request })
1301 }
1302
1303 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
1304 pub fn advisory_lock_with<___R>(
1305 &self,
1306 request: ___R,
1307 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
1308 where
1309 ___R: ::fidl_next::Encode<
1310 <___T as ::fidl_next::Transport>::SendBuffer,
1311 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
1312 >,
1313 {
1314 ::fidl_next::TwoWayFuture::from_untyped(
1315 self.client.send_two_way(7992130864415541162, request),
1316 )
1317 }
1318 }
1319
1320 #[repr(transparent)]
1322 pub struct AdvisoryLockingServer<___T: ::fidl_next::Transport> {
1323 server: ::fidl_next::protocol::Server<___T>,
1324 }
1325
1326 impl<___T> AdvisoryLockingServer<___T> where ___T: ::fidl_next::Transport {}
1327 }
1328}
1329
1330pub trait AdvisoryLockingClientHandler<
1334 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1335 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1336>
1337{
1338}
1339
1340impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for AdvisoryLocking
1341where
1342 ___H: AdvisoryLockingClientHandler<___T> + ::core::marker::Send,
1343 ___T: ::fidl_next::Transport,
1344 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Response:
1345 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1346{
1347 async fn on_event(
1348 handler: &mut ___H,
1349 ordinal: u64,
1350 buffer: ___T::RecvBuffer,
1351 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1352 match ordinal {
1353 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1354 }
1355 }
1356}
1357
1358pub trait AdvisoryLockingServerHandler<
1362 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1363 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1364>
1365{
1366 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
1367 fn advisory_lock(
1368 &mut self,
1369
1370 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
1371
1372 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock, ___T>,
1373 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1374}
1375
1376impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for AdvisoryLocking
1377where
1378 ___H: AdvisoryLockingServerHandler<___T> + ::core::marker::Send,
1379 ___T: ::fidl_next::Transport,
1380 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Request:
1381 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1382{
1383 async fn on_one_way(
1384 handler: &mut ___H,
1385 ordinal: u64,
1386 buffer: ___T::RecvBuffer,
1387 ) -> ::core::result::Result<
1388 (),
1389 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1390 > {
1391 match ordinal {
1392 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1393 }
1394 }
1395
1396 async fn on_two_way(
1397 handler: &mut ___H,
1398 ordinal: u64,
1399 buffer: ___T::RecvBuffer,
1400 responder: ::fidl_next::protocol::Responder<___T>,
1401 ) -> ::core::result::Result<
1402 (),
1403 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1404 > {
1405 match ordinal {
1406 7992130864415541162 => {
1407 let responder = ::fidl_next::Responder::from_untyped(responder);
1408
1409 match ::fidl_next::DecoderExt::decode(buffer) {
1410 Ok(decoded) => {
1411 handler.advisory_lock(decoded, responder).await;
1412 Ok(())
1413 }
1414 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1415 ordinal: 7992130864415541162,
1416 error,
1417 }),
1418 }
1419 }
1420
1421 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1422 }
1423 }
1424}
1425
1426::fidl_next::bitflags::bitflags! {
1427 #[derive(
1428 Clone,
1429 Copy,
1430 Debug,
1431 PartialEq,
1432 Eq,
1433 Hash,
1434 )]
1435 pub struct AllocateMode: u32 {
1436 const KEEP_SIZE = 1;
1437 const UNSHARE_RANGE = 2;
1438 const PUNCH_HOLE = 4;
1439 const COLLAPSE_RANGE = 8;
1440 const ZERO_RANGE = 16;
1441 const INSERT_RANGE = 32;
1442 const _ = !0;
1443 }
1444}
1445
1446impl ::fidl_next::Encodable for AllocateMode {
1447 type Encoded = WireAllocateMode;
1448}
1449
1450unsafe impl<___E> ::fidl_next::Encode<___E> for AllocateMode
1451where
1452 ___E: ?Sized,
1453{
1454 #[inline]
1455 fn encode(
1456 self,
1457 encoder: &mut ___E,
1458 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1459 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1460 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1461 }
1462}
1463
1464unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllocateMode
1465where
1466 ___E: ?Sized,
1467{
1468 #[inline]
1469 fn encode_ref(
1470 &self,
1471 _: &mut ___E,
1472 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1473 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1474 ::fidl_next::munge!(let WireAllocateMode { value } = out);
1475
1476 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1477 Ok(())
1478 }
1479}
1480
1481impl ::core::convert::From<WireAllocateMode> for AllocateMode {
1482 fn from(wire: WireAllocateMode) -> Self {
1483 Self::from_bits_retain(u32::from(wire.value))
1484 }
1485}
1486
1487impl ::fidl_next::FromWire<WireAllocateMode> for AllocateMode {
1488 #[inline]
1489 fn from_wire(wire: WireAllocateMode) -> Self {
1490 Self::from(wire)
1491 }
1492}
1493
1494impl ::fidl_next::IntoNatural for WireAllocateMode {
1495 type Natural = AllocateMode;
1496}
1497
1498impl ::fidl_next::FromWireRef<WireAllocateMode> for AllocateMode {
1499 #[inline]
1500 fn from_wire_ref(wire: &WireAllocateMode) -> Self {
1501 Self::from(*wire)
1502 }
1503}
1504
1505#[derive(Clone, Copy, Debug)]
1507#[repr(transparent)]
1508pub struct WireAllocateMode {
1509 value: ::fidl_next::WireU32,
1510}
1511
1512unsafe impl ::fidl_next::Wire for WireAllocateMode {
1513 type Decoded<'de> = Self;
1514
1515 #[inline]
1516 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1517 }
1519}
1520
1521unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllocateMode
1522where
1523 ___D: ?Sized,
1524{
1525 fn decode(
1526 slot: ::fidl_next::Slot<'_, Self>,
1527 _: &mut ___D,
1528 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1529 Ok(())
1530 }
1531}
1532
1533impl ::core::convert::From<AllocateMode> for WireAllocateMode {
1534 fn from(natural: AllocateMode) -> Self {
1535 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1536 }
1537}
1538
1539#[doc = " Rights are properties specific to a connection. They limit which operations are allowed on a\n connection, including those which may be granted to new connections.\n\n Invoking an operation without the corresponding right results in `ZX_ERR_ACCESS_DENIED`\n even if the node does not have support for the operation.\n"]
1540pub type Rights = crate::Operations;
1541
1542pub type WireRights = crate::WireOperations;
1544
1545#[derive(PartialEq, Debug, Default)]
1546pub struct ConnectionInfo {
1547 pub rights: ::core::option::Option<crate::Operations>,
1548}
1549
1550impl ConnectionInfo {
1551 fn __max_ordinal(&self) -> usize {
1552 if self.rights.is_some() {
1553 return 1;
1554 }
1555
1556 0
1557 }
1558}
1559
1560impl ::fidl_next::Encodable for ConnectionInfo {
1561 type Encoded = WireConnectionInfo<'static>;
1562}
1563
1564unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectionInfo
1565where
1566 ___E: ::fidl_next::Encoder + ?Sized,
1567 ___E: ::fidl_next::fuchsia::HandleEncoder,
1568{
1569 #[inline]
1570 fn encode(
1571 mut self,
1572 encoder: &mut ___E,
1573 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1575 ::fidl_next::munge!(let WireConnectionInfo { table } = out);
1576
1577 let max_ord = self.__max_ordinal();
1578
1579 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1580 ::fidl_next::Wire::zero_padding(&mut out);
1581
1582 let mut preallocated =
1583 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1584
1585 for i in 1..=max_ord {
1586 match i {
1587 1 => {
1588 if let Some(value) = self.rights.take() {
1589 ::fidl_next::WireEnvelope::encode_value(
1590 value,
1591 preallocated.encoder,
1592 &mut out,
1593 )?;
1594 } else {
1595 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1596 }
1597 }
1598
1599 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1600 }
1601 unsafe {
1602 preallocated.write_next(out.assume_init_ref());
1603 }
1604 }
1605
1606 ::fidl_next::WireTable::encode_len(table, max_ord);
1607
1608 Ok(())
1609 }
1610}
1611
1612impl<'de> ::fidl_next::FromWire<WireConnectionInfo<'de>> for ConnectionInfo {
1613 #[inline]
1614 fn from_wire(wire_: WireConnectionInfo<'de>) -> Self {
1615 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1616
1617 let rights = wire_.table.get(1);
1618
1619 Self {
1620 rights: rights.map(|envelope| {
1621 ::fidl_next::FromWire::from_wire(unsafe {
1622 envelope.read_unchecked::<crate::WireOperations>()
1623 })
1624 }),
1625 }
1626 }
1627}
1628
1629impl<'de> ::fidl_next::IntoNatural for WireConnectionInfo<'de> {
1630 type Natural = ConnectionInfo;
1631}
1632
1633#[repr(C)]
1635pub struct WireConnectionInfo<'de> {
1636 table: ::fidl_next::WireTable<'de>,
1637}
1638
1639impl<'de> Drop for WireConnectionInfo<'de> {
1640 fn drop(&mut self) {
1641 let _ = self
1642 .table
1643 .get(1)
1644 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
1645 }
1646}
1647
1648unsafe impl ::fidl_next::Wire for WireConnectionInfo<'static> {
1649 type Decoded<'de> = WireConnectionInfo<'de>;
1650
1651 #[inline]
1652 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1653 ::fidl_next::munge!(let Self { table } = out);
1654 ::fidl_next::WireTable::zero_padding(table);
1655 }
1656}
1657
1658unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectionInfo<'static>
1659where
1660 ___D: ::fidl_next::Decoder + ?Sized,
1661 ___D: ::fidl_next::fuchsia::HandleDecoder,
1662{
1663 fn decode(
1664 slot: ::fidl_next::Slot<'_, Self>,
1665 decoder: &mut ___D,
1666 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1667 ::fidl_next::munge!(let Self { table } = slot);
1668
1669 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1670 match ordinal {
1671 0 => unsafe { ::core::hint::unreachable_unchecked() },
1672
1673 1 => {
1674 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
1675 slot.as_mut(),
1676 decoder,
1677 )?;
1678
1679 Ok(())
1680 }
1681
1682 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1683 }
1684 })
1685 }
1686}
1687
1688impl<'de> WireConnectionInfo<'de> {
1689 pub fn rights(&self) -> ::core::option::Option<&crate::WireOperations> {
1690 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1691 }
1692}
1693
1694impl<'de> ::core::fmt::Debug for WireConnectionInfo<'de> {
1695 fn fmt(
1696 &self,
1697 f: &mut ::core::fmt::Formatter<'_>,
1698 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1699 f.debug_struct("ConnectionInfo").field("rights", &self.rights()).finish()
1700 }
1701}
1702
1703#[doc = " The type to identify a node, if the implementation supports some notion of\n unique node ID.\n\n ## Uniqueness Guarantees\n\n A client is usually presented with a directory tree that is the result\n of composing together multiple backing implementation instances. An ID\n would be unique within the corresponding instance only.\n Their boundaries are rather implicit on Fuchsia, as a result of\n transparently-forwarding directory proxies. It could be common for a client\n to observe identical `Id`s when traversing a directory tree, when it\n encounters nodes from different backing instances. Therefore, the ID is best\n used for debugging and informational purposes.\n\n The [`fuchsia.fs/FilesystemInfo.fs_id`] field may be used to disambiguate\n IDs from different backing instances.\n"]
1704pub type Id = u64;
1705
1706pub type WireId = ::fidl_next::WireU64;
1708
1709pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
1710
1711::fidl_next::bitflags::bitflags! {
1712 #[doc = " DEPRECATED - Use Flags instead.\n"]#[derive(
1713 Clone,
1714 Copy,
1715 Debug,
1716 PartialEq,
1717 Eq,
1718 Hash,
1719 )]
1720 pub struct OpenFlags: u32 {
1721 #[doc = " Can read from target object.\n"]const RIGHT_READABLE = 1;
1722 #[doc = " Can write to target object.\n"]const RIGHT_WRITABLE = 2;
1723 #[doc = " Connection can map target object executable.\n"]const RIGHT_EXECUTABLE = 8;
1724 #[doc = " Create the object if it doesn\'t exist.\n"]const CREATE = 65536;
1725 #[doc = " (with Create) Fail if the object already exists.\n"]const CREATE_IF_ABSENT = 131072;
1726 #[doc = " Truncate the object before usage.\n"]const TRUNCATE = 262144;
1727 #[doc = " Assert that the object to be opened is a directory.\n Return an error if the target object is not a directory.\n"]const DIRECTORY = 524288;
1728 #[doc = " Seek to the end of the object before all writes.\n"]const APPEND = 1048576;
1729 #[doc = " Open a reference to the object, not the object itself.\n It is ONLY valid to pass the following flags together with `NODE_REFERENCE`:\n - `DIRECTORY`\n - `NOT_DIRECTORY`\n - `DESCRIBE`\n otherwise an error is returned.\n If an object is opened or cloned using this method, the resulting connection does not carry\n any permission flags.\n The resulting connection allows a limited set of operations: `GetAttr`, `Clone`, `Close`,\n `Describe`, and `GetFlags`. The connection will speak the `Node` protocol. Calling `SetAttr`\n or `SetFlags` will result in `ZX_ERR_BAD_HANDLE`.\n"]const NODE_REFERENCE = 4194304;
1730 #[doc = " Requests that an \"OnOpen\" event is sent to the interface request.\n\n The event will contain a non-null `NodeInfoDeprecated` if the open/clone is successful. This\n can be used to open a protocol that does not compose fuchsia.io/Node; the event is sent as\n if the protocol is fuchsia.io/Node and then the target protocol is used exclusively.\n"]const DESCRIBE = 8388608;
1731 #[doc = " Specify this flag to request POSIX-compatibility with respect to write permission handling.\n Currently, it affects permission handling specifically during Open:\n - If the target path is a directory, the rights on the new connection expand to include\n `WRITABLE` if and only if the current connection and all intermediate mount points\n are writable.\n - Otherwise, this flag is ignored. It is an access denied error to request more rights\n than those on the current connection, or any intermediate mount points.\n\n If this flag is omitted, opening always uses the requested rights, failing the operation with\n access denied error if requested rights exceeds the rights attached to the current connection.\n\n If the requesting connection is read-only and the requested rights are read-only, the flag\n may be ignored by the server, and is not forwarded downstream. This is an implementation detail,\n necessary to enforce hierarchical permissions across mount points, and should have no effect\n on the expected behavior for clients.\n"]const POSIX_WRITABLE = 134217728;
1732 #[doc = " Specify this flag to request POSIX-compatibility with respect to execute permission handling.\n Currently, it affects permission handling specifically during Open:\n - If the target path is a directory, the rights on the new connection expand to include\n `EXECUTABLE` if and only if the current connection and all intermediate mount\n points are executable.\n - Otherwise, this flag is ignored. It is an access denied error to request more rights\n than those on the current connection, or any intermediate mount points.\n\n If this flag is omitted, opening always uses the requested rights, failing the operation with\n access denied error if requested rights exceeds the rights attached to the current connection.\n\n If the requesting connection is read-only and the requested rights are read-only, the flag\n may be ignored by the server, and is not forwarded downstream. This is an implementation detail,\n necessary to enforce hierarchical permissions across mount points, and should have no effect\n on the expected behavior for clients.\n"]const POSIX_EXECUTABLE = 268435456;
1733 #[doc = " Assert that the object to be opened is not a directory.\n Return an error if the target object is a directory.\n"]const NOT_DIRECTORY = 33554432;
1734 #[doc = " When used during clone, the new connection inherits the rights on the source connection,\n regardless if it is a file or directory. Otherwise, clone attempts to use the requested rights.\n It is invalid to pass any of the `RIGHT_*` flags together with `OpenFlags.CLONE_SAME_RIGHTS`.\n"]const CLONE_SAME_RIGHTS = 67108864;
1735 #[doc = " Open the target object as a block device.\n"]const BLOCK_DEVICE = 16777216;
1736
1737 }
1738}
1739
1740impl ::fidl_next::Encodable for OpenFlags {
1741 type Encoded = WireOpenFlags;
1742}
1743
1744unsafe impl<___E> ::fidl_next::Encode<___E> for OpenFlags
1745where
1746 ___E: ?Sized,
1747{
1748 #[inline]
1749 fn encode(
1750 self,
1751 encoder: &mut ___E,
1752 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1754 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1755 }
1756}
1757
1758unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OpenFlags
1759where
1760 ___E: ?Sized,
1761{
1762 #[inline]
1763 fn encode_ref(
1764 &self,
1765 _: &mut ___E,
1766 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1767 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1768 ::fidl_next::munge!(let WireOpenFlags { value } = out);
1769
1770 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1771 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1772 }
1773
1774 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1775 Ok(())
1776 }
1777}
1778
1779impl ::core::convert::From<WireOpenFlags> for OpenFlags {
1780 fn from(wire: WireOpenFlags) -> Self {
1781 Self::from_bits_retain(u32::from(wire.value))
1782 }
1783}
1784
1785impl ::fidl_next::FromWire<WireOpenFlags> for OpenFlags {
1786 #[inline]
1787 fn from_wire(wire: WireOpenFlags) -> Self {
1788 Self::from(wire)
1789 }
1790}
1791
1792impl ::fidl_next::IntoNatural for WireOpenFlags {
1793 type Natural = OpenFlags;
1794}
1795
1796impl ::fidl_next::FromWireRef<WireOpenFlags> for OpenFlags {
1797 #[inline]
1798 fn from_wire_ref(wire: &WireOpenFlags) -> Self {
1799 Self::from(*wire)
1800 }
1801}
1802
1803#[derive(Clone, Copy, Debug)]
1805#[repr(transparent)]
1806pub struct WireOpenFlags {
1807 value: ::fidl_next::WireU32,
1808}
1809
1810unsafe impl ::fidl_next::Wire for WireOpenFlags {
1811 type Decoded<'de> = Self;
1812
1813 #[inline]
1814 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1815 }
1817}
1818
1819unsafe impl<___D> ::fidl_next::Decode<___D> for WireOpenFlags
1820where
1821 ___D: ?Sized,
1822{
1823 fn decode(
1824 slot: ::fidl_next::Slot<'_, Self>,
1825 _: &mut ___D,
1826 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1827 ::fidl_next::munge!(let Self { value } = slot);
1828 let set = u32::from(*value);
1829 if set & !OpenFlags::all().bits() != 0 {
1830 return Err(::fidl_next::DecodeError::InvalidBits {
1831 expected: OpenFlags::all().bits() as usize,
1832 actual: set as usize,
1833 });
1834 }
1835
1836 Ok(())
1837 }
1838}
1839
1840impl ::core::convert::From<OpenFlags> for WireOpenFlags {
1841 fn from(natural: OpenFlags) -> Self {
1842 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1843 }
1844}
1845
1846#[doc = " NodeAttributes defines generic information about a filesystem node.\n"]
1847#[derive(PartialEq, Clone, Debug)]
1848pub struct NodeAttributes {
1849 pub mode: u32,
1850
1851 pub id: u64,
1852
1853 pub content_size: u64,
1854
1855 pub storage_size: u64,
1856
1857 pub link_count: u64,
1858
1859 pub creation_time: u64,
1860
1861 pub modification_time: u64,
1862}
1863
1864impl ::fidl_next::Encodable for NodeAttributes {
1865 type Encoded = WireNodeAttributes;
1866}
1867
1868unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes
1869where
1870 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1871{
1872 #[inline]
1873 fn encode(
1874 self,
1875 encoder_: &mut ___E,
1876 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1878 ::fidl_next::munge! {
1879 let Self::Encoded {
1880 mode,
1881 id,
1882 content_size,
1883 storage_size,
1884 link_count,
1885 creation_time,
1886 modification_time,
1887
1888 } = out_;
1889 }
1890
1891 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
1892
1893 ::fidl_next::Encode::encode(self.id, encoder_, id)?;
1894
1895 ::fidl_next::Encode::encode(self.content_size, encoder_, content_size)?;
1896
1897 ::fidl_next::Encode::encode(self.storage_size, encoder_, storage_size)?;
1898
1899 ::fidl_next::Encode::encode(self.link_count, encoder_, link_count)?;
1900
1901 ::fidl_next::Encode::encode(self.creation_time, encoder_, creation_time)?;
1902
1903 ::fidl_next::Encode::encode(self.modification_time, encoder_, modification_time)?;
1904
1905 Ok(())
1906 }
1907}
1908
1909unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes
1910where
1911 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1912{
1913 #[inline]
1914 fn encode_ref(
1915 &self,
1916 encoder_: &mut ___E,
1917 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1918 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1919 ::fidl_next::munge! {
1920 let Self::Encoded {
1921
1922 mode,
1923 id,
1924 content_size,
1925 storage_size,
1926 link_count,
1927 creation_time,
1928 modification_time,
1929
1930 } = out_;
1931 }
1932
1933 ::fidl_next::EncodeRef::encode_ref(&self.mode, encoder_, mode)?;
1934
1935 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder_, id)?;
1936
1937 ::fidl_next::EncodeRef::encode_ref(&self.content_size, encoder_, content_size)?;
1938
1939 ::fidl_next::EncodeRef::encode_ref(&self.storage_size, encoder_, storage_size)?;
1940
1941 ::fidl_next::EncodeRef::encode_ref(&self.link_count, encoder_, link_count)?;
1942
1943 ::fidl_next::EncodeRef::encode_ref(&self.creation_time, encoder_, creation_time)?;
1944
1945 ::fidl_next::EncodeRef::encode_ref(&self.modification_time, encoder_, modification_time)?;
1946
1947 Ok(())
1948 }
1949}
1950
1951impl ::fidl_next::EncodableOption for NodeAttributes {
1952 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes>;
1953}
1954
1955unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes
1956where
1957 ___E: ::fidl_next::Encoder + ?Sized,
1958 NodeAttributes: ::fidl_next::Encode<___E>,
1959{
1960 #[inline]
1961 fn encode_option(
1962 this: ::core::option::Option<Self>,
1963 encoder: &mut ___E,
1964 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1966 if let Some(inner) = this {
1967 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1968 ::fidl_next::WireBox::encode_present(out);
1969 } else {
1970 ::fidl_next::WireBox::encode_absent(out);
1971 }
1972
1973 Ok(())
1974 }
1975}
1976
1977unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes
1978where
1979 ___E: ::fidl_next::Encoder + ?Sized,
1980 NodeAttributes: ::fidl_next::EncodeRef<___E>,
1981{
1982 #[inline]
1983 fn encode_option_ref(
1984 this: ::core::option::Option<&Self>,
1985 encoder: &mut ___E,
1986 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1987 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1988 if let Some(inner) = this {
1989 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1990 ::fidl_next::WireBox::encode_present(out);
1991 } else {
1992 ::fidl_next::WireBox::encode_absent(out);
1993 }
1994
1995 Ok(())
1996 }
1997}
1998
1999impl ::fidl_next::FromWire<WireNodeAttributes> for NodeAttributes {
2000 #[inline]
2001 fn from_wire(wire: WireNodeAttributes) -> Self {
2002 Self {
2003 mode: ::fidl_next::FromWire::from_wire(wire.mode),
2004
2005 id: ::fidl_next::FromWire::from_wire(wire.id),
2006
2007 content_size: ::fidl_next::FromWire::from_wire(wire.content_size),
2008
2009 storage_size: ::fidl_next::FromWire::from_wire(wire.storage_size),
2010
2011 link_count: ::fidl_next::FromWire::from_wire(wire.link_count),
2012
2013 creation_time: ::fidl_next::FromWire::from_wire(wire.creation_time),
2014
2015 modification_time: ::fidl_next::FromWire::from_wire(wire.modification_time),
2016 }
2017 }
2018}
2019
2020impl ::fidl_next::IntoNatural for WireNodeAttributes {
2021 type Natural = NodeAttributes;
2022}
2023
2024impl ::fidl_next::FromWireRef<WireNodeAttributes> for NodeAttributes {
2025 #[inline]
2026 fn from_wire_ref(wire: &WireNodeAttributes) -> Self {
2027 Self {
2028 mode: ::fidl_next::FromWireRef::from_wire_ref(&wire.mode),
2029
2030 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
2031
2032 content_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.content_size),
2033
2034 storage_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.storage_size),
2035
2036 link_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.link_count),
2037
2038 creation_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.creation_time),
2039
2040 modification_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.modification_time),
2041 }
2042 }
2043}
2044
2045#[derive(Clone, Debug)]
2047#[repr(C)]
2048pub struct WireNodeAttributes {
2049 pub mode: ::fidl_next::WireU32,
2050
2051 pub id: ::fidl_next::WireU64,
2052
2053 pub content_size: ::fidl_next::WireU64,
2054
2055 pub storage_size: ::fidl_next::WireU64,
2056
2057 pub link_count: ::fidl_next::WireU64,
2058
2059 pub creation_time: ::fidl_next::WireU64,
2060
2061 pub modification_time: ::fidl_next::WireU64,
2062}
2063static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeAttributes>(), 56);
2064static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeAttributes>(), 8);
2065
2066static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, mode), 0);
2067
2068static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, id), 8);
2069
2070static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, content_size), 16);
2071
2072static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, storage_size), 24);
2073
2074static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, link_count), 32);
2075
2076static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeAttributes, creation_time), 40);
2077
2078static_assertions::const_assert_eq!(
2079 std::mem::offset_of!(WireNodeAttributes, modification_time),
2080 48
2081);
2082
2083unsafe impl ::fidl_next::Wire for WireNodeAttributes {
2084 type Decoded<'de> = WireNodeAttributes;
2085
2086 #[inline]
2087 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2088 ::fidl_next::munge! {
2089 let Self {
2090
2091 mode,
2092 id,
2093 content_size,
2094 storage_size,
2095 link_count,
2096 creation_time,
2097 modification_time,
2098
2099 } = &mut *out_;
2100 }
2101
2102 ::fidl_next::Wire::zero_padding(mode);
2103
2104 ::fidl_next::Wire::zero_padding(id);
2105
2106 ::fidl_next::Wire::zero_padding(content_size);
2107
2108 ::fidl_next::Wire::zero_padding(storage_size);
2109
2110 ::fidl_next::Wire::zero_padding(link_count);
2111
2112 ::fidl_next::Wire::zero_padding(creation_time);
2113
2114 ::fidl_next::Wire::zero_padding(modification_time);
2115
2116 unsafe {
2117 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2118 }
2119 }
2120}
2121
2122unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes
2123where
2124 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2125{
2126 fn decode(
2127 slot_: ::fidl_next::Slot<'_, Self>,
2128 decoder_: &mut ___D,
2129 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2130 ::fidl_next::munge! {
2131 let Self {
2132
2133 mut mode,
2134 mut id,
2135 mut content_size,
2136 mut storage_size,
2137 mut link_count,
2138 mut creation_time,
2139 mut modification_time,
2140
2141 } = slot_;
2142 }
2143
2144 ::fidl_next::Decode::decode(mode.as_mut(), decoder_)?;
2145
2146 ::fidl_next::Decode::decode(id.as_mut(), decoder_)?;
2147
2148 ::fidl_next::Decode::decode(content_size.as_mut(), decoder_)?;
2149
2150 ::fidl_next::Decode::decode(storage_size.as_mut(), decoder_)?;
2151
2152 ::fidl_next::Decode::decode(link_count.as_mut(), decoder_)?;
2153
2154 ::fidl_next::Decode::decode(creation_time.as_mut(), decoder_)?;
2155
2156 ::fidl_next::Decode::decode(modification_time.as_mut(), decoder_)?;
2157
2158 Ok(())
2159 }
2160}
2161
2162::fidl_next::bitflags::bitflags! {
2163 #[doc = " The fields of \'attributes\' which are used to update the Node are indicated\n by the \'flags\' argument.\n"]#[derive(
2164 Clone,
2165 Copy,
2166 Debug,
2167 PartialEq,
2168 Eq,
2169 Hash,
2170 )]
2171 pub struct NodeAttributeFlags: u32 {
2172 const CREATION_TIME = 1;
2173 const MODIFICATION_TIME = 2;
2174
2175 }
2176}
2177
2178impl ::fidl_next::Encodable for NodeAttributeFlags {
2179 type Encoded = WireNodeAttributeFlags;
2180}
2181
2182unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributeFlags
2183where
2184 ___E: ?Sized,
2185{
2186 #[inline]
2187 fn encode(
2188 self,
2189 encoder: &mut ___E,
2190 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2191 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2192 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2193 }
2194}
2195
2196unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributeFlags
2197where
2198 ___E: ?Sized,
2199{
2200 #[inline]
2201 fn encode_ref(
2202 &self,
2203 _: &mut ___E,
2204 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2205 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2206 ::fidl_next::munge!(let WireNodeAttributeFlags { value } = out);
2207
2208 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
2209 return Err(::fidl_next::EncodeError::InvalidStrictBits);
2210 }
2211
2212 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2213 Ok(())
2214 }
2215}
2216
2217impl ::core::convert::From<WireNodeAttributeFlags> for NodeAttributeFlags {
2218 fn from(wire: WireNodeAttributeFlags) -> Self {
2219 Self::from_bits_retain(u32::from(wire.value))
2220 }
2221}
2222
2223impl ::fidl_next::FromWire<WireNodeAttributeFlags> for NodeAttributeFlags {
2224 #[inline]
2225 fn from_wire(wire: WireNodeAttributeFlags) -> Self {
2226 Self::from(wire)
2227 }
2228}
2229
2230impl ::fidl_next::IntoNatural for WireNodeAttributeFlags {
2231 type Natural = NodeAttributeFlags;
2232}
2233
2234impl ::fidl_next::FromWireRef<WireNodeAttributeFlags> for NodeAttributeFlags {
2235 #[inline]
2236 fn from_wire_ref(wire: &WireNodeAttributeFlags) -> Self {
2237 Self::from(*wire)
2238 }
2239}
2240
2241#[derive(Clone, Copy, Debug)]
2243#[repr(transparent)]
2244pub struct WireNodeAttributeFlags {
2245 value: ::fidl_next::WireU32,
2246}
2247
2248unsafe impl ::fidl_next::Wire for WireNodeAttributeFlags {
2249 type Decoded<'de> = Self;
2250
2251 #[inline]
2252 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2253 }
2255}
2256
2257unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributeFlags
2258where
2259 ___D: ?Sized,
2260{
2261 fn decode(
2262 slot: ::fidl_next::Slot<'_, Self>,
2263 _: &mut ___D,
2264 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2265 ::fidl_next::munge!(let Self { value } = slot);
2266 let set = u32::from(*value);
2267 if set & !NodeAttributeFlags::all().bits() != 0 {
2268 return Err(::fidl_next::DecodeError::InvalidBits {
2269 expected: NodeAttributeFlags::all().bits() as usize,
2270 actual: set as usize,
2271 });
2272 }
2273
2274 Ok(())
2275 }
2276}
2277
2278impl ::core::convert::From<NodeAttributeFlags> for WireNodeAttributeFlags {
2279 fn from(natural: NodeAttributeFlags) -> Self {
2280 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2281 }
2282}
2283
2284#[derive(PartialEq, Clone, Debug)]
2285pub struct NodeQueryFilesystemResponse {
2286 pub s: i32,
2287
2288 pub info: ::core::option::Option<::std::boxed::Box<crate::FilesystemInfo>>,
2289}
2290
2291impl ::fidl_next::Encodable for NodeQueryFilesystemResponse {
2292 type Encoded = WireNodeQueryFilesystemResponse<'static>;
2293}
2294
2295unsafe impl<___E> ::fidl_next::Encode<___E> for NodeQueryFilesystemResponse
2296where
2297 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2298 ___E: ::fidl_next::Encoder,
2299{
2300 #[inline]
2301 fn encode(
2302 self,
2303 encoder_: &mut ___E,
2304 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2305 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2306 ::fidl_next::munge! {
2307 let Self::Encoded {
2308 s,
2309 info,
2310
2311 } = out_;
2312 }
2313
2314 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
2315
2316 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
2317
2318 Ok(())
2319 }
2320}
2321
2322unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeQueryFilesystemResponse
2323where
2324 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2325 ___E: ::fidl_next::Encoder,
2326{
2327 #[inline]
2328 fn encode_ref(
2329 &self,
2330 encoder_: &mut ___E,
2331 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2332 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2333 ::fidl_next::munge! {
2334 let Self::Encoded {
2335
2336 s,
2337 info,
2338
2339 } = out_;
2340 }
2341
2342 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
2343
2344 ::fidl_next::EncodeRef::encode_ref(&self.info, encoder_, info)?;
2345
2346 Ok(())
2347 }
2348}
2349
2350impl ::fidl_next::EncodableOption for NodeQueryFilesystemResponse {
2351 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeQueryFilesystemResponse<'static>>;
2352}
2353
2354unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeQueryFilesystemResponse
2355where
2356 ___E: ::fidl_next::Encoder + ?Sized,
2357 NodeQueryFilesystemResponse: ::fidl_next::Encode<___E>,
2358{
2359 #[inline]
2360 fn encode_option(
2361 this: ::core::option::Option<Self>,
2362 encoder: &mut ___E,
2363 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2365 if let Some(inner) = this {
2366 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2367 ::fidl_next::WireBox::encode_present(out);
2368 } else {
2369 ::fidl_next::WireBox::encode_absent(out);
2370 }
2371
2372 Ok(())
2373 }
2374}
2375
2376unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeQueryFilesystemResponse
2377where
2378 ___E: ::fidl_next::Encoder + ?Sized,
2379 NodeQueryFilesystemResponse: ::fidl_next::EncodeRef<___E>,
2380{
2381 #[inline]
2382 fn encode_option_ref(
2383 this: ::core::option::Option<&Self>,
2384 encoder: &mut ___E,
2385 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2386 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2387 if let Some(inner) = this {
2388 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2389 ::fidl_next::WireBox::encode_present(out);
2390 } else {
2391 ::fidl_next::WireBox::encode_absent(out);
2392 }
2393
2394 Ok(())
2395 }
2396}
2397
2398impl<'de> ::fidl_next::FromWire<WireNodeQueryFilesystemResponse<'de>>
2399 for NodeQueryFilesystemResponse
2400{
2401 #[inline]
2402 fn from_wire(wire: WireNodeQueryFilesystemResponse<'de>) -> Self {
2403 Self {
2404 s: ::fidl_next::FromWire::from_wire(wire.s),
2405
2406 info: ::fidl_next::FromWire::from_wire(wire.info),
2407 }
2408 }
2409}
2410
2411impl<'de> ::fidl_next::IntoNatural for WireNodeQueryFilesystemResponse<'de> {
2412 type Natural = NodeQueryFilesystemResponse;
2413}
2414
2415impl<'de> ::fidl_next::FromWireRef<WireNodeQueryFilesystemResponse<'de>>
2416 for NodeQueryFilesystemResponse
2417{
2418 #[inline]
2419 fn from_wire_ref(wire: &WireNodeQueryFilesystemResponse<'de>) -> Self {
2420 Self {
2421 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2422
2423 info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info),
2424 }
2425 }
2426}
2427
2428#[derive(Debug)]
2430#[repr(C)]
2431pub struct WireNodeQueryFilesystemResponse<'de> {
2432 pub s: ::fidl_next::WireI32,
2433
2434 pub info: ::fidl_next::WireBox<'de, crate::WireFilesystemInfo>,
2435}
2436static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeQueryFilesystemResponse<'_>>(), 16);
2437static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeQueryFilesystemResponse<'_>>(), 8);
2438
2439static_assertions::const_assert_eq!(
2440 std::mem::offset_of!(WireNodeQueryFilesystemResponse<'_>, s),
2441 0
2442);
2443
2444static_assertions::const_assert_eq!(
2445 std::mem::offset_of!(WireNodeQueryFilesystemResponse<'_>, info),
2446 8
2447);
2448
2449unsafe impl ::fidl_next::Wire for WireNodeQueryFilesystemResponse<'static> {
2450 type Decoded<'de> = WireNodeQueryFilesystemResponse<'de>;
2451
2452 #[inline]
2453 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2454 ::fidl_next::munge! {
2455 let Self {
2456
2457 s,
2458 info,
2459
2460 } = &mut *out_;
2461 }
2462
2463 ::fidl_next::Wire::zero_padding(s);
2464
2465 ::fidl_next::Wire::zero_padding(info);
2466
2467 unsafe {
2468 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2469 }
2470 }
2471}
2472
2473unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeQueryFilesystemResponse<'static>
2474where
2475 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2476 ___D: ::fidl_next::Decoder,
2477{
2478 fn decode(
2479 slot_: ::fidl_next::Slot<'_, Self>,
2480 decoder_: &mut ___D,
2481 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2482 ::fidl_next::munge! {
2483 let Self {
2484
2485 mut s,
2486 mut info,
2487
2488 } = slot_;
2489 }
2490
2491 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
2492
2493 ::fidl_next::Decode::decode(info.as_mut(), decoder_)?;
2494
2495 Ok(())
2496 }
2497}
2498
2499pub type NodeUpdateAttributesResponse = ();
2500
2501pub type WireNodeUpdateAttributesResponse = ();
2503
2504pub type NodeSyncResponse = ();
2505
2506pub type WireNodeSyncResponse = ();
2508
2509::fidl_next::bitflags::bitflags! {
2510 #[derive(
2511 Clone,
2512 Copy,
2513 Debug,
2514 PartialEq,
2515 Eq,
2516 Hash,
2517 )]
2518 pub struct ModeType: u32 {
2519 const DO_NOT_USE = 2147483648;
2520
2521 }
2522}
2523
2524impl ::fidl_next::Encodable for ModeType {
2525 type Encoded = WireModeType;
2526}
2527
2528unsafe impl<___E> ::fidl_next::Encode<___E> for ModeType
2529where
2530 ___E: ?Sized,
2531{
2532 #[inline]
2533 fn encode(
2534 self,
2535 encoder: &mut ___E,
2536 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2537 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2538 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2539 }
2540}
2541
2542unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ModeType
2543where
2544 ___E: ?Sized,
2545{
2546 #[inline]
2547 fn encode_ref(
2548 &self,
2549 _: &mut ___E,
2550 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2552 ::fidl_next::munge!(let WireModeType { value } = out);
2553
2554 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
2555 return Err(::fidl_next::EncodeError::InvalidStrictBits);
2556 }
2557
2558 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2559 Ok(())
2560 }
2561}
2562
2563impl ::core::convert::From<WireModeType> for ModeType {
2564 fn from(wire: WireModeType) -> Self {
2565 Self::from_bits_retain(u32::from(wire.value))
2566 }
2567}
2568
2569impl ::fidl_next::FromWire<WireModeType> for ModeType {
2570 #[inline]
2571 fn from_wire(wire: WireModeType) -> Self {
2572 Self::from(wire)
2573 }
2574}
2575
2576impl ::fidl_next::IntoNatural for WireModeType {
2577 type Natural = ModeType;
2578}
2579
2580impl ::fidl_next::FromWireRef<WireModeType> for ModeType {
2581 #[inline]
2582 fn from_wire_ref(wire: &WireModeType) -> Self {
2583 Self::from(*wire)
2584 }
2585}
2586
2587#[derive(Clone, Copy, Debug)]
2589#[repr(transparent)]
2590pub struct WireModeType {
2591 value: ::fidl_next::WireU32,
2592}
2593
2594unsafe impl ::fidl_next::Wire for WireModeType {
2595 type Decoded<'de> = Self;
2596
2597 #[inline]
2598 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2599 }
2601}
2602
2603unsafe impl<___D> ::fidl_next::Decode<___D> for WireModeType
2604where
2605 ___D: ?Sized,
2606{
2607 fn decode(
2608 slot: ::fidl_next::Slot<'_, Self>,
2609 _: &mut ___D,
2610 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2611 ::fidl_next::munge!(let Self { value } = slot);
2612 let set = u32::from(*value);
2613 if set & !ModeType::all().bits() != 0 {
2614 return Err(::fidl_next::DecodeError::InvalidBits {
2615 expected: ModeType::all().bits() as usize,
2616 actual: set as usize,
2617 });
2618 }
2619
2620 Ok(())
2621 }
2622}
2623
2624impl ::core::convert::From<ModeType> for WireModeType {
2625 fn from(natural: ModeType) -> Self {
2626 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2627 }
2628}
2629
2630#[doc = " The maximum length, in bytes, of a filesystem path.\n"]
2631pub const MAX_PATH_LENGTH: u64 = 4095 as u64;
2632
2633#[doc = " A path is a string of one or more components, separated by \"/\".\n E.g. `foo/bar/baz`\n\n ## Invariants\n\n A valid path must meet the following criteria:\n\n * It cannot be empty.\n * It cannot be longer than [`MAX_PATH_LENGTH`].\n * It cannot have a leading \"/\".\n * It cannot have a trailing \"/\".\n * It must be exactly \".\" OR each of its components must be a valid [`Name`].\n\n Paths should be transformed into their canonical forms at client side.\n For example, a client should convert `\"foo/bar/.././baz/\"` to `\"foo/baz\"`\n before using it as a path.\n"]
2634pub type Path = ::std::string::String;
2635
2636pub type WirePath<'de> = ::fidl_next::WireString<'de>;
2638
2639#[derive(PartialEq, Clone, Debug)]
2640#[repr(C)]
2641pub struct DirectoryReadDirentsRequest {
2642 pub max_bytes: u64,
2643}
2644
2645impl ::fidl_next::Encodable for DirectoryReadDirentsRequest {
2646 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryReadDirentsRequest> = unsafe {
2647 ::fidl_next::CopyOptimization::enable_if(
2648 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2649 )
2650 };
2651
2652 type Encoded = WireDirectoryReadDirentsRequest;
2653}
2654
2655unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsRequest
2656where
2657 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2658{
2659 #[inline]
2660 fn encode(
2661 self,
2662 encoder_: &mut ___E,
2663 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2664 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2665 ::fidl_next::munge! {
2666 let Self::Encoded {
2667 max_bytes,
2668
2669 } = out_;
2670 }
2671
2672 ::fidl_next::Encode::encode(self.max_bytes, encoder_, max_bytes)?;
2673
2674 Ok(())
2675 }
2676}
2677
2678unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsRequest
2679where
2680 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2681{
2682 #[inline]
2683 fn encode_ref(
2684 &self,
2685 encoder_: &mut ___E,
2686 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2687 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2688 ::fidl_next::munge! {
2689 let Self::Encoded {
2690
2691 max_bytes,
2692
2693 } = out_;
2694 }
2695
2696 ::fidl_next::EncodeRef::encode_ref(&self.max_bytes, encoder_, max_bytes)?;
2697
2698 Ok(())
2699 }
2700}
2701
2702impl ::fidl_next::EncodableOption for DirectoryReadDirentsRequest {
2703 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsRequest>;
2704}
2705
2706unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsRequest
2707where
2708 ___E: ::fidl_next::Encoder + ?Sized,
2709 DirectoryReadDirentsRequest: ::fidl_next::Encode<___E>,
2710{
2711 #[inline]
2712 fn encode_option(
2713 this: ::core::option::Option<Self>,
2714 encoder: &mut ___E,
2715 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2716 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2717 if let Some(inner) = this {
2718 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2719 ::fidl_next::WireBox::encode_present(out);
2720 } else {
2721 ::fidl_next::WireBox::encode_absent(out);
2722 }
2723
2724 Ok(())
2725 }
2726}
2727
2728unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsRequest
2729where
2730 ___E: ::fidl_next::Encoder + ?Sized,
2731 DirectoryReadDirentsRequest: ::fidl_next::EncodeRef<___E>,
2732{
2733 #[inline]
2734 fn encode_option_ref(
2735 this: ::core::option::Option<&Self>,
2736 encoder: &mut ___E,
2737 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2738 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2739 if let Some(inner) = this {
2740 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2741 ::fidl_next::WireBox::encode_present(out);
2742 } else {
2743 ::fidl_next::WireBox::encode_absent(out);
2744 }
2745
2746 Ok(())
2747 }
2748}
2749
2750impl ::fidl_next::FromWire<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2751 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryReadDirentsRequest, Self> = unsafe {
2752 ::fidl_next::CopyOptimization::enable_if(
2753 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2754 .is_enabled(),
2755 )
2756 };
2757
2758 #[inline]
2759 fn from_wire(wire: WireDirectoryReadDirentsRequest) -> Self {
2760 Self { max_bytes: ::fidl_next::FromWire::from_wire(wire.max_bytes) }
2761 }
2762}
2763
2764impl ::fidl_next::IntoNatural for WireDirectoryReadDirentsRequest {
2765 type Natural = DirectoryReadDirentsRequest;
2766}
2767
2768impl ::fidl_next::FromWireRef<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2769 #[inline]
2770 fn from_wire_ref(wire: &WireDirectoryReadDirentsRequest) -> Self {
2771 Self { max_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_bytes) }
2772 }
2773}
2774
2775#[derive(Clone, Debug)]
2777#[repr(C)]
2778pub struct WireDirectoryReadDirentsRequest {
2779 pub max_bytes: ::fidl_next::WireU64,
2780}
2781static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryReadDirentsRequest>(), 8);
2782static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryReadDirentsRequest>(), 8);
2783
2784static_assertions::const_assert_eq!(
2785 std::mem::offset_of!(WireDirectoryReadDirentsRequest, max_bytes),
2786 0
2787);
2788
2789unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsRequest {
2790 type Decoded<'de> = WireDirectoryReadDirentsRequest;
2791
2792 #[inline]
2793 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2794 ::fidl_next::munge! {
2795 let Self {
2796
2797 max_bytes,
2798
2799 } = &mut *out_;
2800 }
2801
2802 ::fidl_next::Wire::zero_padding(max_bytes);
2803 }
2804}
2805
2806unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsRequest
2807where
2808 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2809{
2810 fn decode(
2811 slot_: ::fidl_next::Slot<'_, Self>,
2812 decoder_: &mut ___D,
2813 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2814 ::fidl_next::munge! {
2815 let Self {
2816
2817 mut max_bytes,
2818
2819 } = slot_;
2820 }
2821
2822 ::fidl_next::Decode::decode(max_bytes.as_mut(), decoder_)?;
2823
2824 Ok(())
2825 }
2826}
2827
2828#[doc = " The maximal buffer size which can be transmitted for buffered operations.\n This capacity is currently set somewhat arbitrarily.\n"]
2829pub const MAX_BUF: u64 = 8192 as u64;
2830
2831#[derive(PartialEq, Clone, Debug)]
2832pub struct DirectoryReadDirentsResponse {
2833 pub s: i32,
2834
2835 pub dirents: ::std::vec::Vec<u8>,
2836}
2837
2838impl ::fidl_next::Encodable for DirectoryReadDirentsResponse {
2839 type Encoded = WireDirectoryReadDirentsResponse<'static>;
2840}
2841
2842unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsResponse
2843where
2844 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2845 ___E: ::fidl_next::Encoder,
2846{
2847 #[inline]
2848 fn encode(
2849 self,
2850 encoder_: &mut ___E,
2851 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2852 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2853 ::fidl_next::munge! {
2854 let Self::Encoded {
2855 s,
2856 dirents,
2857
2858 } = out_;
2859 }
2860
2861 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
2862
2863 ::fidl_next::Encode::encode(self.dirents, encoder_, dirents)?;
2864
2865 Ok(())
2866 }
2867}
2868
2869unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsResponse
2870where
2871 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2872 ___E: ::fidl_next::Encoder,
2873{
2874 #[inline]
2875 fn encode_ref(
2876 &self,
2877 encoder_: &mut ___E,
2878 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2879 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2880 ::fidl_next::munge! {
2881 let Self::Encoded {
2882
2883 s,
2884 dirents,
2885
2886 } = out_;
2887 }
2888
2889 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
2890
2891 ::fidl_next::EncodeRef::encode_ref(&self.dirents, encoder_, dirents)?;
2892
2893 Ok(())
2894 }
2895}
2896
2897impl ::fidl_next::EncodableOption for DirectoryReadDirentsResponse {
2898 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsResponse<'static>>;
2899}
2900
2901unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsResponse
2902where
2903 ___E: ::fidl_next::Encoder + ?Sized,
2904 DirectoryReadDirentsResponse: ::fidl_next::Encode<___E>,
2905{
2906 #[inline]
2907 fn encode_option(
2908 this: ::core::option::Option<Self>,
2909 encoder: &mut ___E,
2910 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2911 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2912 if let Some(inner) = this {
2913 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2914 ::fidl_next::WireBox::encode_present(out);
2915 } else {
2916 ::fidl_next::WireBox::encode_absent(out);
2917 }
2918
2919 Ok(())
2920 }
2921}
2922
2923unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsResponse
2924where
2925 ___E: ::fidl_next::Encoder + ?Sized,
2926 DirectoryReadDirentsResponse: ::fidl_next::EncodeRef<___E>,
2927{
2928 #[inline]
2929 fn encode_option_ref(
2930 this: ::core::option::Option<&Self>,
2931 encoder: &mut ___E,
2932 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2933 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2934 if let Some(inner) = this {
2935 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2936 ::fidl_next::WireBox::encode_present(out);
2937 } else {
2938 ::fidl_next::WireBox::encode_absent(out);
2939 }
2940
2941 Ok(())
2942 }
2943}
2944
2945impl<'de> ::fidl_next::FromWire<WireDirectoryReadDirentsResponse<'de>>
2946 for DirectoryReadDirentsResponse
2947{
2948 #[inline]
2949 fn from_wire(wire: WireDirectoryReadDirentsResponse<'de>) -> Self {
2950 Self {
2951 s: ::fidl_next::FromWire::from_wire(wire.s),
2952
2953 dirents: ::fidl_next::FromWire::from_wire(wire.dirents),
2954 }
2955 }
2956}
2957
2958impl<'de> ::fidl_next::IntoNatural for WireDirectoryReadDirentsResponse<'de> {
2959 type Natural = DirectoryReadDirentsResponse;
2960}
2961
2962impl<'de> ::fidl_next::FromWireRef<WireDirectoryReadDirentsResponse<'de>>
2963 for DirectoryReadDirentsResponse
2964{
2965 #[inline]
2966 fn from_wire_ref(wire: &WireDirectoryReadDirentsResponse<'de>) -> Self {
2967 Self {
2968 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2969
2970 dirents: ::fidl_next::FromWireRef::from_wire_ref(&wire.dirents),
2971 }
2972 }
2973}
2974
2975#[derive(Debug)]
2977#[repr(C)]
2978pub struct WireDirectoryReadDirentsResponse<'de> {
2979 pub s: ::fidl_next::WireI32,
2980
2981 pub dirents: ::fidl_next::WireVector<'de, u8>,
2982}
2983static_assertions::const_assert_eq!(
2984 std::mem::size_of::<WireDirectoryReadDirentsResponse<'_>>(),
2985 24
2986);
2987static_assertions::const_assert_eq!(
2988 std::mem::align_of::<WireDirectoryReadDirentsResponse<'_>>(),
2989 8
2990);
2991
2992static_assertions::const_assert_eq!(
2993 std::mem::offset_of!(WireDirectoryReadDirentsResponse<'_>, s),
2994 0
2995);
2996
2997static_assertions::const_assert_eq!(
2998 std::mem::offset_of!(WireDirectoryReadDirentsResponse<'_>, dirents),
2999 8
3000);
3001
3002unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsResponse<'static> {
3003 type Decoded<'de> = WireDirectoryReadDirentsResponse<'de>;
3004
3005 #[inline]
3006 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3007 ::fidl_next::munge! {
3008 let Self {
3009
3010 s,
3011 dirents,
3012
3013 } = &mut *out_;
3014 }
3015
3016 ::fidl_next::Wire::zero_padding(s);
3017
3018 ::fidl_next::Wire::zero_padding(dirents);
3019
3020 unsafe {
3021 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
3022 }
3023 }
3024}
3025
3026unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsResponse<'static>
3027where
3028 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3029 ___D: ::fidl_next::Decoder,
3030{
3031 fn decode(
3032 slot_: ::fidl_next::Slot<'_, Self>,
3033 decoder_: &mut ___D,
3034 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3035 ::fidl_next::munge! {
3036 let Self {
3037
3038 mut s,
3039 mut dirents,
3040
3041 } = slot_;
3042 }
3043
3044 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
3045
3046 ::fidl_next::Decode::decode(dirents.as_mut(), decoder_)?;
3047
3048 let dirents = unsafe { dirents.deref_unchecked() };
3049
3050 if dirents.len() > 8192 {
3051 return Err(::fidl_next::DecodeError::VectorTooLong {
3052 size: dirents.len() as u64,
3053 limit: 8192,
3054 });
3055 }
3056
3057 Ok(())
3058 }
3059}
3060
3061#[derive(PartialEq, Clone, Debug)]
3062#[repr(C)]
3063pub struct DirectoryRewindResponse {
3064 pub s: i32,
3065}
3066
3067impl ::fidl_next::Encodable for DirectoryRewindResponse {
3068 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryRewindResponse> = unsafe {
3069 ::fidl_next::CopyOptimization::enable_if(
3070 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3071 )
3072 };
3073
3074 type Encoded = WireDirectoryRewindResponse;
3075}
3076
3077unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRewindResponse
3078where
3079 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3080{
3081 #[inline]
3082 fn encode(
3083 self,
3084 encoder_: &mut ___E,
3085 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3086 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3087 ::fidl_next::munge! {
3088 let Self::Encoded {
3089 s,
3090
3091 } = out_;
3092 }
3093
3094 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
3095
3096 Ok(())
3097 }
3098}
3099
3100unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryRewindResponse
3101where
3102 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3103{
3104 #[inline]
3105 fn encode_ref(
3106 &self,
3107 encoder_: &mut ___E,
3108 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3109 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3110 ::fidl_next::munge! {
3111 let Self::Encoded {
3112
3113 s,
3114
3115 } = out_;
3116 }
3117
3118 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
3119
3120 Ok(())
3121 }
3122}
3123
3124impl ::fidl_next::EncodableOption for DirectoryRewindResponse {
3125 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRewindResponse>;
3126}
3127
3128unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRewindResponse
3129where
3130 ___E: ::fidl_next::Encoder + ?Sized,
3131 DirectoryRewindResponse: ::fidl_next::Encode<___E>,
3132{
3133 #[inline]
3134 fn encode_option(
3135 this: ::core::option::Option<Self>,
3136 encoder: &mut ___E,
3137 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3138 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3139 if let Some(inner) = this {
3140 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3141 ::fidl_next::WireBox::encode_present(out);
3142 } else {
3143 ::fidl_next::WireBox::encode_absent(out);
3144 }
3145
3146 Ok(())
3147 }
3148}
3149
3150unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryRewindResponse
3151where
3152 ___E: ::fidl_next::Encoder + ?Sized,
3153 DirectoryRewindResponse: ::fidl_next::EncodeRef<___E>,
3154{
3155 #[inline]
3156 fn encode_option_ref(
3157 this: ::core::option::Option<&Self>,
3158 encoder: &mut ___E,
3159 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3160 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3161 if let Some(inner) = this {
3162 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3163 ::fidl_next::WireBox::encode_present(out);
3164 } else {
3165 ::fidl_next::WireBox::encode_absent(out);
3166 }
3167
3168 Ok(())
3169 }
3170}
3171
3172impl ::fidl_next::FromWire<WireDirectoryRewindResponse> for DirectoryRewindResponse {
3173 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryRewindResponse, Self> = unsafe {
3174 ::fidl_next::CopyOptimization::enable_if(
3175 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3176 .is_enabled(),
3177 )
3178 };
3179
3180 #[inline]
3181 fn from_wire(wire: WireDirectoryRewindResponse) -> Self {
3182 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
3183 }
3184}
3185
3186impl ::fidl_next::IntoNatural for WireDirectoryRewindResponse {
3187 type Natural = DirectoryRewindResponse;
3188}
3189
3190impl ::fidl_next::FromWireRef<WireDirectoryRewindResponse> for DirectoryRewindResponse {
3191 #[inline]
3192 fn from_wire_ref(wire: &WireDirectoryRewindResponse) -> Self {
3193 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
3194 }
3195}
3196
3197#[derive(Clone, Debug)]
3199#[repr(C)]
3200pub struct WireDirectoryRewindResponse {
3201 pub s: ::fidl_next::WireI32,
3202}
3203static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryRewindResponse>(), 4);
3204static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryRewindResponse>(), 4);
3205
3206static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryRewindResponse, s), 0);
3207
3208unsafe impl ::fidl_next::Wire for WireDirectoryRewindResponse {
3209 type Decoded<'de> = WireDirectoryRewindResponse;
3210
3211 #[inline]
3212 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3213 ::fidl_next::munge! {
3214 let Self {
3215
3216 s,
3217
3218 } = &mut *out_;
3219 }
3220
3221 ::fidl_next::Wire::zero_padding(s);
3222 }
3223}
3224
3225unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRewindResponse
3226where
3227 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3228{
3229 fn decode(
3230 slot_: ::fidl_next::Slot<'_, Self>,
3231 decoder_: &mut ___D,
3232 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3233 ::fidl_next::munge! {
3234 let Self {
3235
3236 mut s,
3237
3238 } = slot_;
3239 }
3240
3241 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
3242
3243 Ok(())
3244 }
3245}
3246
3247#[derive(PartialEq, Debug)]
3248#[repr(C)]
3249pub struct DirectoryGetTokenResponse {
3250 pub s: i32,
3251
3252 pub token: ::core::option::Option<::fidl_next::fuchsia::zx::Handle>,
3253}
3254
3255impl ::fidl_next::Encodable for DirectoryGetTokenResponse {
3256 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryGetTokenResponse> = unsafe {
3257 ::fidl_next::CopyOptimization::enable_if(
3258 true
3259
3260 && <
3261 i32 as ::fidl_next::Encodable
3262 >::COPY_OPTIMIZATION.is_enabled()
3263
3264 && <
3265 ::core::option::Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
3266 >::COPY_OPTIMIZATION.is_enabled()
3267
3268 )
3269 };
3270
3271 type Encoded = WireDirectoryGetTokenResponse;
3272}
3273
3274unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryGetTokenResponse
3275where
3276 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3277 ___E: ::fidl_next::fuchsia::HandleEncoder,
3278{
3279 #[inline]
3280 fn encode(
3281 self,
3282 encoder_: &mut ___E,
3283 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3284 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3285 ::fidl_next::munge! {
3286 let Self::Encoded {
3287 s,
3288 token,
3289
3290 } = out_;
3291 }
3292
3293 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
3294
3295 ::fidl_next::Encode::encode(self.token, encoder_, token)?;
3296
3297 Ok(())
3298 }
3299}
3300
3301impl ::fidl_next::EncodableOption for DirectoryGetTokenResponse {
3302 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryGetTokenResponse>;
3303}
3304
3305unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryGetTokenResponse
3306where
3307 ___E: ::fidl_next::Encoder + ?Sized,
3308 DirectoryGetTokenResponse: ::fidl_next::Encode<___E>,
3309{
3310 #[inline]
3311 fn encode_option(
3312 this: ::core::option::Option<Self>,
3313 encoder: &mut ___E,
3314 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3315 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3316 if let Some(inner) = this {
3317 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3318 ::fidl_next::WireBox::encode_present(out);
3319 } else {
3320 ::fidl_next::WireBox::encode_absent(out);
3321 }
3322
3323 Ok(())
3324 }
3325}
3326
3327impl ::fidl_next::FromWire<WireDirectoryGetTokenResponse> for DirectoryGetTokenResponse {
3328 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryGetTokenResponse, Self> = unsafe {
3329 ::fidl_next::CopyOptimization::enable_if(
3330 true
3331
3332 && <
3333 i32 as ::fidl_next::FromWire<::fidl_next::WireI32>
3334 >::COPY_OPTIMIZATION.is_enabled()
3335
3336 && <
3337 ::core::option::Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<::fidl_next::fuchsia::WireOptionalHandle>
3338 >::COPY_OPTIMIZATION.is_enabled()
3339
3340 )
3341 };
3342
3343 #[inline]
3344 fn from_wire(wire: WireDirectoryGetTokenResponse) -> Self {
3345 Self {
3346 s: ::fidl_next::FromWire::from_wire(wire.s),
3347
3348 token: ::fidl_next::FromWire::from_wire(wire.token),
3349 }
3350 }
3351}
3352
3353impl ::fidl_next::IntoNatural for WireDirectoryGetTokenResponse {
3354 type Natural = DirectoryGetTokenResponse;
3355}
3356
3357#[derive(Debug)]
3359#[repr(C)]
3360pub struct WireDirectoryGetTokenResponse {
3361 pub s: ::fidl_next::WireI32,
3362
3363 pub token: ::fidl_next::fuchsia::WireOptionalHandle,
3364}
3365static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryGetTokenResponse>(), 8);
3366static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryGetTokenResponse>(), 4);
3367
3368static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryGetTokenResponse, s), 0);
3369
3370static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryGetTokenResponse, token), 4);
3371
3372unsafe impl ::fidl_next::Wire for WireDirectoryGetTokenResponse {
3373 type Decoded<'de> = WireDirectoryGetTokenResponse;
3374
3375 #[inline]
3376 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3377 ::fidl_next::munge! {
3378 let Self {
3379
3380 s,
3381 token,
3382
3383 } = &mut *out_;
3384 }
3385
3386 ::fidl_next::Wire::zero_padding(s);
3387
3388 ::fidl_next::Wire::zero_padding(token);
3389 }
3390}
3391
3392unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryGetTokenResponse
3393where
3394 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3395 ___D: ::fidl_next::fuchsia::HandleDecoder,
3396{
3397 fn decode(
3398 slot_: ::fidl_next::Slot<'_, Self>,
3399 decoder_: &mut ___D,
3400 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3401 ::fidl_next::munge! {
3402 let Self {
3403
3404 mut s,
3405 mut token,
3406
3407 } = slot_;
3408 }
3409
3410 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
3411
3412 ::fidl_next::Decode::decode(token.as_mut(), decoder_)?;
3413
3414 Ok(())
3415 }
3416}
3417
3418#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
3419pub const MAX_NAME_LENGTH: u64 = 255 as u64;
3420
3421#[doc = " The type for the name of a node, i.e. a single path component.\n E.g. `foo`\n\n ## Invariants\n\n A valid node name must meet the following criteria:\n\n * It cannot be longer than [`MAX_NAME_LENGTH`].\n * It cannot be empty.\n * It cannot be \"..\" (dot-dot).\n * It cannot be \".\" (single dot).\n * It cannot contain \"/\".\n * It cannot contain embedded NUL.\n"]
3422pub type Name = ::std::string::String;
3423
3424pub type WireName<'de> = ::fidl_next::WireString<'de>;
3426
3427#[derive(PartialEq, Debug)]
3428pub struct DirectoryLinkRequest {
3429 pub src: ::std::string::String,
3430
3431 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
3432
3433 pub dst: ::std::string::String,
3434}
3435
3436impl ::fidl_next::Encodable for DirectoryLinkRequest {
3437 type Encoded = WireDirectoryLinkRequest<'static>;
3438}
3439
3440unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkRequest
3441where
3442 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3443 ___E: ::fidl_next::Encoder,
3444 ___E: ::fidl_next::fuchsia::HandleEncoder,
3445{
3446 #[inline]
3447 fn encode(
3448 self,
3449 encoder_: &mut ___E,
3450 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3451 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3452 ::fidl_next::munge! {
3453 let Self::Encoded {
3454 src,
3455 dst_parent_token,
3456 dst,
3457
3458 } = out_;
3459 }
3460
3461 ::fidl_next::Encode::encode(self.src, encoder_, src)?;
3462
3463 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
3464
3465 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
3466
3467 Ok(())
3468 }
3469}
3470
3471impl ::fidl_next::EncodableOption for DirectoryLinkRequest {
3472 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkRequest<'static>>;
3473}
3474
3475unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkRequest
3476where
3477 ___E: ::fidl_next::Encoder + ?Sized,
3478 DirectoryLinkRequest: ::fidl_next::Encode<___E>,
3479{
3480 #[inline]
3481 fn encode_option(
3482 this: ::core::option::Option<Self>,
3483 encoder: &mut ___E,
3484 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3485 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3486 if let Some(inner) = this {
3487 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3488 ::fidl_next::WireBox::encode_present(out);
3489 } else {
3490 ::fidl_next::WireBox::encode_absent(out);
3491 }
3492
3493 Ok(())
3494 }
3495}
3496
3497impl<'de> ::fidl_next::FromWire<WireDirectoryLinkRequest<'de>> for DirectoryLinkRequest {
3498 #[inline]
3499 fn from_wire(wire: WireDirectoryLinkRequest<'de>) -> Self {
3500 Self {
3501 src: ::fidl_next::FromWire::from_wire(wire.src),
3502
3503 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
3504
3505 dst: ::fidl_next::FromWire::from_wire(wire.dst),
3506 }
3507 }
3508}
3509
3510impl<'de> ::fidl_next::IntoNatural for WireDirectoryLinkRequest<'de> {
3511 type Natural = DirectoryLinkRequest;
3512}
3513
3514#[derive(Debug)]
3516#[repr(C)]
3517pub struct WireDirectoryLinkRequest<'de> {
3518 pub src: ::fidl_next::WireString<'de>,
3519
3520 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
3521
3522 pub dst: ::fidl_next::WireString<'de>,
3523}
3524static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryLinkRequest<'_>>(), 40);
3525static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryLinkRequest<'_>>(), 8);
3526
3527static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryLinkRequest<'_>, src), 0);
3528
3529static_assertions::const_assert_eq!(
3530 std::mem::offset_of!(WireDirectoryLinkRequest<'_>, dst_parent_token),
3531 16
3532);
3533
3534static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryLinkRequest<'_>, dst), 24);
3535
3536unsafe impl ::fidl_next::Wire for WireDirectoryLinkRequest<'static> {
3537 type Decoded<'de> = WireDirectoryLinkRequest<'de>;
3538
3539 #[inline]
3540 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3541 ::fidl_next::munge! {
3542 let Self {
3543
3544 src,
3545 dst_parent_token,
3546 dst,
3547
3548 } = &mut *out_;
3549 }
3550
3551 ::fidl_next::Wire::zero_padding(src);
3552
3553 ::fidl_next::Wire::zero_padding(dst_parent_token);
3554
3555 ::fidl_next::Wire::zero_padding(dst);
3556
3557 unsafe {
3558 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
3559 }
3560 }
3561}
3562
3563unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkRequest<'static>
3564where
3565 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3566 ___D: ::fidl_next::Decoder,
3567 ___D: ::fidl_next::fuchsia::HandleDecoder,
3568{
3569 fn decode(
3570 slot_: ::fidl_next::Slot<'_, Self>,
3571 decoder_: &mut ___D,
3572 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3573 ::fidl_next::munge! {
3574 let Self {
3575
3576 mut src,
3577 mut dst_parent_token,
3578 mut dst,
3579
3580 } = slot_;
3581 }
3582
3583 ::fidl_next::Decode::decode(src.as_mut(), decoder_)?;
3584
3585 let src = unsafe { src.deref_unchecked() };
3586
3587 if src.len() > 255 {
3588 return Err(::fidl_next::DecodeError::VectorTooLong {
3589 size: src.len() as u64,
3590 limit: 255,
3591 });
3592 }
3593
3594 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder_)?;
3595
3596 ::fidl_next::Decode::decode(dst.as_mut(), decoder_)?;
3597
3598 let dst = unsafe { dst.deref_unchecked() };
3599
3600 if dst.len() > 255 {
3601 return Err(::fidl_next::DecodeError::VectorTooLong {
3602 size: dst.len() as u64,
3603 limit: 255,
3604 });
3605 }
3606
3607 Ok(())
3608 }
3609}
3610
3611#[derive(PartialEq, Clone, Debug)]
3612#[repr(C)]
3613pub struct DirectoryLinkResponse {
3614 pub s: i32,
3615}
3616
3617impl ::fidl_next::Encodable for DirectoryLinkResponse {
3618 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryLinkResponse> = unsafe {
3619 ::fidl_next::CopyOptimization::enable_if(
3620 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3621 )
3622 };
3623
3624 type Encoded = WireDirectoryLinkResponse;
3625}
3626
3627unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkResponse
3628where
3629 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3630{
3631 #[inline]
3632 fn encode(
3633 self,
3634 encoder_: &mut ___E,
3635 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3636 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3637 ::fidl_next::munge! {
3638 let Self::Encoded {
3639 s,
3640
3641 } = out_;
3642 }
3643
3644 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
3645
3646 Ok(())
3647 }
3648}
3649
3650unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryLinkResponse
3651where
3652 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3653{
3654 #[inline]
3655 fn encode_ref(
3656 &self,
3657 encoder_: &mut ___E,
3658 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3659 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3660 ::fidl_next::munge! {
3661 let Self::Encoded {
3662
3663 s,
3664
3665 } = out_;
3666 }
3667
3668 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
3669
3670 Ok(())
3671 }
3672}
3673
3674impl ::fidl_next::EncodableOption for DirectoryLinkResponse {
3675 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkResponse>;
3676}
3677
3678unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkResponse
3679where
3680 ___E: ::fidl_next::Encoder + ?Sized,
3681 DirectoryLinkResponse: ::fidl_next::Encode<___E>,
3682{
3683 #[inline]
3684 fn encode_option(
3685 this: ::core::option::Option<Self>,
3686 encoder: &mut ___E,
3687 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3688 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3689 if let Some(inner) = this {
3690 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3691 ::fidl_next::WireBox::encode_present(out);
3692 } else {
3693 ::fidl_next::WireBox::encode_absent(out);
3694 }
3695
3696 Ok(())
3697 }
3698}
3699
3700unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryLinkResponse
3701where
3702 ___E: ::fidl_next::Encoder + ?Sized,
3703 DirectoryLinkResponse: ::fidl_next::EncodeRef<___E>,
3704{
3705 #[inline]
3706 fn encode_option_ref(
3707 this: ::core::option::Option<&Self>,
3708 encoder: &mut ___E,
3709 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3710 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3711 if let Some(inner) = this {
3712 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3713 ::fidl_next::WireBox::encode_present(out);
3714 } else {
3715 ::fidl_next::WireBox::encode_absent(out);
3716 }
3717
3718 Ok(())
3719 }
3720}
3721
3722impl ::fidl_next::FromWire<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3723 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryLinkResponse, Self> = unsafe {
3724 ::fidl_next::CopyOptimization::enable_if(
3725 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3726 .is_enabled(),
3727 )
3728 };
3729
3730 #[inline]
3731 fn from_wire(wire: WireDirectoryLinkResponse) -> Self {
3732 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
3733 }
3734}
3735
3736impl ::fidl_next::IntoNatural for WireDirectoryLinkResponse {
3737 type Natural = DirectoryLinkResponse;
3738}
3739
3740impl ::fidl_next::FromWireRef<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3741 #[inline]
3742 fn from_wire_ref(wire: &WireDirectoryLinkResponse) -> Self {
3743 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
3744 }
3745}
3746
3747#[derive(Clone, Debug)]
3749#[repr(C)]
3750pub struct WireDirectoryLinkResponse {
3751 pub s: ::fidl_next::WireI32,
3752}
3753static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryLinkResponse>(), 4);
3754static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryLinkResponse>(), 4);
3755
3756static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryLinkResponse, s), 0);
3757
3758unsafe impl ::fidl_next::Wire for WireDirectoryLinkResponse {
3759 type Decoded<'de> = WireDirectoryLinkResponse;
3760
3761 #[inline]
3762 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3763 ::fidl_next::munge! {
3764 let Self {
3765
3766 s,
3767
3768 } = &mut *out_;
3769 }
3770
3771 ::fidl_next::Wire::zero_padding(s);
3772 }
3773}
3774
3775unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkResponse
3776where
3777 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3778{
3779 fn decode(
3780 slot_: ::fidl_next::Slot<'_, Self>,
3781 decoder_: &mut ___D,
3782 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3783 ::fidl_next::munge! {
3784 let Self {
3785
3786 mut s,
3787
3788 } = slot_;
3789 }
3790
3791 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
3792
3793 Ok(())
3794 }
3795}
3796
3797::fidl_next::bitflags::bitflags! {
3798 #[derive(
3799 Clone,
3800 Copy,
3801 Debug,
3802 PartialEq,
3803 Eq,
3804 Hash,
3805 )]
3806 pub struct UnlinkFlags: u64 {
3807 #[doc = " If set, the unlink will fail (with ZX_ERR_NOT_DIR) if the\n object is not a directory.\n"]const MUST_BE_DIRECTORY = 1;
3808 const _ = !0;
3809 }
3810}
3811
3812impl ::fidl_next::Encodable for UnlinkFlags {
3813 type Encoded = WireUnlinkFlags;
3814}
3815
3816unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkFlags
3817where
3818 ___E: ?Sized,
3819{
3820 #[inline]
3821 fn encode(
3822 self,
3823 encoder: &mut ___E,
3824 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3825 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3826 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
3827 }
3828}
3829
3830unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkFlags
3831where
3832 ___E: ?Sized,
3833{
3834 #[inline]
3835 fn encode_ref(
3836 &self,
3837 _: &mut ___E,
3838 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3840 ::fidl_next::munge!(let WireUnlinkFlags { value } = out);
3841
3842 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
3843 Ok(())
3844 }
3845}
3846
3847impl ::core::convert::From<WireUnlinkFlags> for UnlinkFlags {
3848 fn from(wire: WireUnlinkFlags) -> Self {
3849 Self::from_bits_retain(u64::from(wire.value))
3850 }
3851}
3852
3853impl ::fidl_next::FromWire<WireUnlinkFlags> for UnlinkFlags {
3854 #[inline]
3855 fn from_wire(wire: WireUnlinkFlags) -> Self {
3856 Self::from(wire)
3857 }
3858}
3859
3860impl ::fidl_next::IntoNatural for WireUnlinkFlags {
3861 type Natural = UnlinkFlags;
3862}
3863
3864impl ::fidl_next::FromWireRef<WireUnlinkFlags> for UnlinkFlags {
3865 #[inline]
3866 fn from_wire_ref(wire: &WireUnlinkFlags) -> Self {
3867 Self::from(*wire)
3868 }
3869}
3870
3871#[derive(Clone, Copy, Debug)]
3873#[repr(transparent)]
3874pub struct WireUnlinkFlags {
3875 value: ::fidl_next::WireU64,
3876}
3877
3878unsafe impl ::fidl_next::Wire for WireUnlinkFlags {
3879 type Decoded<'de> = Self;
3880
3881 #[inline]
3882 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3883 }
3885}
3886
3887unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkFlags
3888where
3889 ___D: ?Sized,
3890{
3891 fn decode(
3892 slot: ::fidl_next::Slot<'_, Self>,
3893 _: &mut ___D,
3894 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3895 Ok(())
3896 }
3897}
3898
3899impl ::core::convert::From<UnlinkFlags> for WireUnlinkFlags {
3900 fn from(natural: UnlinkFlags) -> Self {
3901 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
3902 }
3903}
3904
3905#[derive(PartialEq, Clone, Debug, Default)]
3906pub struct UnlinkOptions {
3907 pub flags: ::core::option::Option<crate::UnlinkFlags>,
3908}
3909
3910impl UnlinkOptions {
3911 fn __max_ordinal(&self) -> usize {
3912 if self.flags.is_some() {
3913 return 1;
3914 }
3915
3916 0
3917 }
3918}
3919
3920impl ::fidl_next::Encodable for UnlinkOptions {
3921 type Encoded = WireUnlinkOptions<'static>;
3922}
3923
3924unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkOptions
3925where
3926 ___E: ::fidl_next::Encoder + ?Sized,
3927{
3928 #[inline]
3929 fn encode(
3930 mut self,
3931 encoder: &mut ___E,
3932 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3933 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3934 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3935
3936 let max_ord = self.__max_ordinal();
3937
3938 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3939 ::fidl_next::Wire::zero_padding(&mut out);
3940
3941 let mut preallocated =
3942 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3943
3944 for i in 1..=max_ord {
3945 match i {
3946 1 => {
3947 if let Some(value) = self.flags.take() {
3948 ::fidl_next::WireEnvelope::encode_value(
3949 value,
3950 preallocated.encoder,
3951 &mut out,
3952 )?;
3953 } else {
3954 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3955 }
3956 }
3957
3958 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3959 }
3960 unsafe {
3961 preallocated.write_next(out.assume_init_ref());
3962 }
3963 }
3964
3965 ::fidl_next::WireTable::encode_len(table, max_ord);
3966
3967 Ok(())
3968 }
3969}
3970
3971unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkOptions
3972where
3973 ___E: ::fidl_next::Encoder + ?Sized,
3974{
3975 #[inline]
3976 fn encode_ref(
3977 &self,
3978 encoder: &mut ___E,
3979 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3980 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3981 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3982
3983 let max_ord = self.__max_ordinal();
3984
3985 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3986 ::fidl_next::Wire::zero_padding(&mut out);
3987
3988 let mut preallocated =
3989 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3990
3991 for i in 1..=max_ord {
3992 match i {
3993 1 => {
3994 if let Some(value) = &self.flags {
3995 ::fidl_next::WireEnvelope::encode_value(
3996 value,
3997 preallocated.encoder,
3998 &mut out,
3999 )?;
4000 } else {
4001 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4002 }
4003 }
4004
4005 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4006 }
4007 unsafe {
4008 preallocated.write_next(out.assume_init_ref());
4009 }
4010 }
4011
4012 ::fidl_next::WireTable::encode_len(table, max_ord);
4013
4014 Ok(())
4015 }
4016}
4017
4018impl<'de> ::fidl_next::FromWire<WireUnlinkOptions<'de>> for UnlinkOptions {
4019 #[inline]
4020 fn from_wire(wire_: WireUnlinkOptions<'de>) -> Self {
4021 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4022
4023 let flags = wire_.table.get(1);
4024
4025 Self {
4026 flags: flags.map(|envelope| {
4027 ::fidl_next::FromWire::from_wire(unsafe {
4028 envelope.read_unchecked::<crate::WireUnlinkFlags>()
4029 })
4030 }),
4031 }
4032 }
4033}
4034
4035impl<'de> ::fidl_next::IntoNatural for WireUnlinkOptions<'de> {
4036 type Natural = UnlinkOptions;
4037}
4038
4039impl<'de> ::fidl_next::FromWireRef<WireUnlinkOptions<'de>> for UnlinkOptions {
4040 #[inline]
4041 fn from_wire_ref(wire: &WireUnlinkOptions<'de>) -> Self {
4042 Self {
4043 flags: wire.table.get(1).map(|envelope| {
4044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4045 envelope.deref_unchecked::<crate::WireUnlinkFlags>()
4046 })
4047 }),
4048 }
4049 }
4050}
4051
4052#[repr(C)]
4054pub struct WireUnlinkOptions<'de> {
4055 table: ::fidl_next::WireTable<'de>,
4056}
4057
4058impl<'de> Drop for WireUnlinkOptions<'de> {
4059 fn drop(&mut self) {
4060 let _ = self
4061 .table
4062 .get(1)
4063 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireUnlinkFlags>() });
4064 }
4065}
4066
4067unsafe impl ::fidl_next::Wire for WireUnlinkOptions<'static> {
4068 type Decoded<'de> = WireUnlinkOptions<'de>;
4069
4070 #[inline]
4071 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4072 ::fidl_next::munge!(let Self { table } = out);
4073 ::fidl_next::WireTable::zero_padding(table);
4074 }
4075}
4076
4077unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkOptions<'static>
4078where
4079 ___D: ::fidl_next::Decoder + ?Sized,
4080{
4081 fn decode(
4082 slot: ::fidl_next::Slot<'_, Self>,
4083 decoder: &mut ___D,
4084 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4085 ::fidl_next::munge!(let Self { table } = slot);
4086
4087 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4088 match ordinal {
4089 0 => unsafe { ::core::hint::unreachable_unchecked() },
4090
4091 1 => {
4092 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireUnlinkFlags>(
4093 slot.as_mut(),
4094 decoder,
4095 )?;
4096
4097 Ok(())
4098 }
4099
4100 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4101 }
4102 })
4103 }
4104}
4105
4106impl<'de> WireUnlinkOptions<'de> {
4107 pub fn flags(&self) -> ::core::option::Option<&crate::WireUnlinkFlags> {
4108 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4109 }
4110}
4111
4112impl<'de> ::core::fmt::Debug for WireUnlinkOptions<'de> {
4113 fn fmt(
4114 &self,
4115 f: &mut ::core::fmt::Formatter<'_>,
4116 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4117 f.debug_struct("UnlinkOptions").field("flags", &self.flags()).finish()
4118 }
4119}
4120
4121#[derive(PartialEq, Clone, Debug)]
4122pub struct DirectoryUnlinkRequest {
4123 pub name: ::std::string::String,
4124
4125 pub options: crate::UnlinkOptions,
4126}
4127
4128impl ::fidl_next::Encodable for DirectoryUnlinkRequest {
4129 type Encoded = WireDirectoryUnlinkRequest<'static>;
4130}
4131
4132unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryUnlinkRequest
4133where
4134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4135 ___E: ::fidl_next::Encoder,
4136{
4137 #[inline]
4138 fn encode(
4139 self,
4140 encoder_: &mut ___E,
4141 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4143 ::fidl_next::munge! {
4144 let Self::Encoded {
4145 name,
4146 options,
4147
4148 } = out_;
4149 }
4150
4151 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
4152
4153 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
4154
4155 Ok(())
4156 }
4157}
4158
4159unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryUnlinkRequest
4160where
4161 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4162 ___E: ::fidl_next::Encoder,
4163{
4164 #[inline]
4165 fn encode_ref(
4166 &self,
4167 encoder_: &mut ___E,
4168 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4169 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4170 ::fidl_next::munge! {
4171 let Self::Encoded {
4172
4173 name,
4174 options,
4175
4176 } = out_;
4177 }
4178
4179 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
4180
4181 ::fidl_next::EncodeRef::encode_ref(&self.options, encoder_, options)?;
4182
4183 Ok(())
4184 }
4185}
4186
4187impl ::fidl_next::EncodableOption for DirectoryUnlinkRequest {
4188 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryUnlinkRequest<'static>>;
4189}
4190
4191unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryUnlinkRequest
4192where
4193 ___E: ::fidl_next::Encoder + ?Sized,
4194 DirectoryUnlinkRequest: ::fidl_next::Encode<___E>,
4195{
4196 #[inline]
4197 fn encode_option(
4198 this: ::core::option::Option<Self>,
4199 encoder: &mut ___E,
4200 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4201 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4202 if let Some(inner) = this {
4203 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4204 ::fidl_next::WireBox::encode_present(out);
4205 } else {
4206 ::fidl_next::WireBox::encode_absent(out);
4207 }
4208
4209 Ok(())
4210 }
4211}
4212
4213unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryUnlinkRequest
4214where
4215 ___E: ::fidl_next::Encoder + ?Sized,
4216 DirectoryUnlinkRequest: ::fidl_next::EncodeRef<___E>,
4217{
4218 #[inline]
4219 fn encode_option_ref(
4220 this: ::core::option::Option<&Self>,
4221 encoder: &mut ___E,
4222 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4223 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4224 if let Some(inner) = this {
4225 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4226 ::fidl_next::WireBox::encode_present(out);
4227 } else {
4228 ::fidl_next::WireBox::encode_absent(out);
4229 }
4230
4231 Ok(())
4232 }
4233}
4234
4235impl<'de> ::fidl_next::FromWire<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
4236 #[inline]
4237 fn from_wire(wire: WireDirectoryUnlinkRequest<'de>) -> Self {
4238 Self {
4239 name: ::fidl_next::FromWire::from_wire(wire.name),
4240
4241 options: ::fidl_next::FromWire::from_wire(wire.options),
4242 }
4243 }
4244}
4245
4246impl<'de> ::fidl_next::IntoNatural for WireDirectoryUnlinkRequest<'de> {
4247 type Natural = DirectoryUnlinkRequest;
4248}
4249
4250impl<'de> ::fidl_next::FromWireRef<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
4251 #[inline]
4252 fn from_wire_ref(wire: &WireDirectoryUnlinkRequest<'de>) -> Self {
4253 Self {
4254 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
4255
4256 options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options),
4257 }
4258 }
4259}
4260
4261#[derive(Debug)]
4263#[repr(C)]
4264pub struct WireDirectoryUnlinkRequest<'de> {
4265 pub name: ::fidl_next::WireString<'de>,
4266
4267 pub options: crate::WireUnlinkOptions<'de>,
4268}
4269static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryUnlinkRequest<'_>>(), 32);
4270static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryUnlinkRequest<'_>>(), 8);
4271
4272static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryUnlinkRequest<'_>, name), 0);
4273
4274static_assertions::const_assert_eq!(
4275 std::mem::offset_of!(WireDirectoryUnlinkRequest<'_>, options),
4276 16
4277);
4278
4279unsafe impl ::fidl_next::Wire for WireDirectoryUnlinkRequest<'static> {
4280 type Decoded<'de> = WireDirectoryUnlinkRequest<'de>;
4281
4282 #[inline]
4283 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4284 ::fidl_next::munge! {
4285 let Self {
4286
4287 name,
4288 options,
4289
4290 } = &mut *out_;
4291 }
4292
4293 ::fidl_next::Wire::zero_padding(name);
4294
4295 ::fidl_next::Wire::zero_padding(options);
4296 }
4297}
4298
4299unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryUnlinkRequest<'static>
4300where
4301 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4302 ___D: ::fidl_next::Decoder,
4303{
4304 fn decode(
4305 slot_: ::fidl_next::Slot<'_, Self>,
4306 decoder_: &mut ___D,
4307 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4308 ::fidl_next::munge! {
4309 let Self {
4310
4311 mut name,
4312 mut options,
4313
4314 } = slot_;
4315 }
4316
4317 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
4318
4319 let name = unsafe { name.deref_unchecked() };
4320
4321 if name.len() > 255 {
4322 return Err(::fidl_next::DecodeError::VectorTooLong {
4323 size: name.len() as u64,
4324 limit: 255,
4325 });
4326 }
4327
4328 ::fidl_next::Decode::decode(options.as_mut(), decoder_)?;
4329
4330 Ok(())
4331 }
4332}
4333
4334pub type DirectoryUnlinkResponse = ();
4335
4336pub type WireDirectoryUnlinkResponse = ();
4338
4339#[doc = " The type to identify a connection to a node.\n It represents a capability: a reference to a node with associated rights.\n"]
4340pub type Token = ::fidl_next::fuchsia::zx::Event;
4341
4342pub type WireToken = ::fidl_next::fuchsia::WireEvent;
4344
4345#[derive(PartialEq, Debug)]
4346pub struct DirectoryRenameRequest {
4347 pub src: ::std::string::String,
4348
4349 pub dst_parent_token: ::fidl_next::fuchsia::zx::Event,
4350
4351 pub dst: ::std::string::String,
4352}
4353
4354impl ::fidl_next::Encodable for DirectoryRenameRequest {
4355 type Encoded = WireDirectoryRenameRequest<'static>;
4356}
4357
4358unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRenameRequest
4359where
4360 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4361 ___E: ::fidl_next::Encoder,
4362 ___E: ::fidl_next::fuchsia::HandleEncoder,
4363{
4364 #[inline]
4365 fn encode(
4366 self,
4367 encoder_: &mut ___E,
4368 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4369 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4370 ::fidl_next::munge! {
4371 let Self::Encoded {
4372 src,
4373 dst_parent_token,
4374 dst,
4375
4376 } = out_;
4377 }
4378
4379 ::fidl_next::Encode::encode(self.src, encoder_, src)?;
4380
4381 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
4382
4383 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
4384
4385 Ok(())
4386 }
4387}
4388
4389impl ::fidl_next::EncodableOption for DirectoryRenameRequest {
4390 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRenameRequest<'static>>;
4391}
4392
4393unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRenameRequest
4394where
4395 ___E: ::fidl_next::Encoder + ?Sized,
4396 DirectoryRenameRequest: ::fidl_next::Encode<___E>,
4397{
4398 #[inline]
4399 fn encode_option(
4400 this: ::core::option::Option<Self>,
4401 encoder: &mut ___E,
4402 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4404 if let Some(inner) = this {
4405 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4406 ::fidl_next::WireBox::encode_present(out);
4407 } else {
4408 ::fidl_next::WireBox::encode_absent(out);
4409 }
4410
4411 Ok(())
4412 }
4413}
4414
4415impl<'de> ::fidl_next::FromWire<WireDirectoryRenameRequest<'de>> for DirectoryRenameRequest {
4416 #[inline]
4417 fn from_wire(wire: WireDirectoryRenameRequest<'de>) -> Self {
4418 Self {
4419 src: ::fidl_next::FromWire::from_wire(wire.src),
4420
4421 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
4422
4423 dst: ::fidl_next::FromWire::from_wire(wire.dst),
4424 }
4425 }
4426}
4427
4428impl<'de> ::fidl_next::IntoNatural for WireDirectoryRenameRequest<'de> {
4429 type Natural = DirectoryRenameRequest;
4430}
4431
4432#[derive(Debug)]
4434#[repr(C)]
4435pub struct WireDirectoryRenameRequest<'de> {
4436 pub src: ::fidl_next::WireString<'de>,
4437
4438 pub dst_parent_token: ::fidl_next::fuchsia::WireEvent,
4439
4440 pub dst: ::fidl_next::WireString<'de>,
4441}
4442static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryRenameRequest<'_>>(), 40);
4443static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryRenameRequest<'_>>(), 8);
4444
4445static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryRenameRequest<'_>, src), 0);
4446
4447static_assertions::const_assert_eq!(
4448 std::mem::offset_of!(WireDirectoryRenameRequest<'_>, dst_parent_token),
4449 16
4450);
4451
4452static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryRenameRequest<'_>, dst), 24);
4453
4454unsafe impl ::fidl_next::Wire for WireDirectoryRenameRequest<'static> {
4455 type Decoded<'de> = WireDirectoryRenameRequest<'de>;
4456
4457 #[inline]
4458 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4459 ::fidl_next::munge! {
4460 let Self {
4461
4462 src,
4463 dst_parent_token,
4464 dst,
4465
4466 } = &mut *out_;
4467 }
4468
4469 ::fidl_next::Wire::zero_padding(src);
4470
4471 ::fidl_next::Wire::zero_padding(dst_parent_token);
4472
4473 ::fidl_next::Wire::zero_padding(dst);
4474
4475 unsafe {
4476 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
4477 }
4478 }
4479}
4480
4481unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRenameRequest<'static>
4482where
4483 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4484 ___D: ::fidl_next::Decoder,
4485 ___D: ::fidl_next::fuchsia::HandleDecoder,
4486{
4487 fn decode(
4488 slot_: ::fidl_next::Slot<'_, Self>,
4489 decoder_: &mut ___D,
4490 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4491 ::fidl_next::munge! {
4492 let Self {
4493
4494 mut src,
4495 mut dst_parent_token,
4496 mut dst,
4497
4498 } = slot_;
4499 }
4500
4501 ::fidl_next::Decode::decode(src.as_mut(), decoder_)?;
4502
4503 let src = unsafe { src.deref_unchecked() };
4504
4505 if src.len() > 255 {
4506 return Err(::fidl_next::DecodeError::VectorTooLong {
4507 size: src.len() as u64,
4508 limit: 255,
4509 });
4510 }
4511
4512 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder_)?;
4513
4514 ::fidl_next::Decode::decode(dst.as_mut(), decoder_)?;
4515
4516 let dst = unsafe { dst.deref_unchecked() };
4517
4518 if dst.len() > 255 {
4519 return Err(::fidl_next::DecodeError::VectorTooLong {
4520 size: dst.len() as u64,
4521 limit: 255,
4522 });
4523 }
4524
4525 Ok(())
4526 }
4527}
4528
4529pub type DirectoryRenameResponse = ();
4530
4531pub type WireDirectoryRenameResponse = ();
4533
4534::fidl_next::bitflags::bitflags! {
4535 #[derive(
4536 Clone,
4537 Copy,
4538 Debug,
4539 PartialEq,
4540 Eq,
4541 Hash,
4542 )]
4543 pub struct WatchMask: u32 {
4544 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.\n"]const DELETED = 1;
4545 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.\n"]const ADDED = 2;
4546 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.\n"]const REMOVED = 4;
4547 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.\n"]const EXISTING = 8;
4548 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.\n"]const IDLE = 16;
4549
4550 }
4551}
4552
4553impl ::fidl_next::Encodable for WatchMask {
4554 type Encoded = WireWatchMask;
4555}
4556
4557unsafe impl<___E> ::fidl_next::Encode<___E> for WatchMask
4558where
4559 ___E: ?Sized,
4560{
4561 #[inline]
4562 fn encode(
4563 self,
4564 encoder: &mut ___E,
4565 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4566 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4567 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
4568 }
4569}
4570
4571unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchMask
4572where
4573 ___E: ?Sized,
4574{
4575 #[inline]
4576 fn encode_ref(
4577 &self,
4578 _: &mut ___E,
4579 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4580 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4581 ::fidl_next::munge!(let WireWatchMask { value } = out);
4582
4583 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
4584 return Err(::fidl_next::EncodeError::InvalidStrictBits);
4585 }
4586
4587 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
4588 Ok(())
4589 }
4590}
4591
4592impl ::core::convert::From<WireWatchMask> for WatchMask {
4593 fn from(wire: WireWatchMask) -> Self {
4594 Self::from_bits_retain(u32::from(wire.value))
4595 }
4596}
4597
4598impl ::fidl_next::FromWire<WireWatchMask> for WatchMask {
4599 #[inline]
4600 fn from_wire(wire: WireWatchMask) -> Self {
4601 Self::from(wire)
4602 }
4603}
4604
4605impl ::fidl_next::IntoNatural for WireWatchMask {
4606 type Natural = WatchMask;
4607}
4608
4609impl ::fidl_next::FromWireRef<WireWatchMask> for WatchMask {
4610 #[inline]
4611 fn from_wire_ref(wire: &WireWatchMask) -> Self {
4612 Self::from(*wire)
4613 }
4614}
4615
4616#[derive(Clone, Copy, Debug)]
4618#[repr(transparent)]
4619pub struct WireWatchMask {
4620 value: ::fidl_next::WireU32,
4621}
4622
4623unsafe impl ::fidl_next::Wire for WireWatchMask {
4624 type Decoded<'de> = Self;
4625
4626 #[inline]
4627 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4628 }
4630}
4631
4632unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchMask
4633where
4634 ___D: ?Sized,
4635{
4636 fn decode(
4637 slot: ::fidl_next::Slot<'_, Self>,
4638 _: &mut ___D,
4639 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4640 ::fidl_next::munge!(let Self { value } = slot);
4641 let set = u32::from(*value);
4642 if set & !WatchMask::all().bits() != 0 {
4643 return Err(::fidl_next::DecodeError::InvalidBits {
4644 expected: WatchMask::all().bits() as usize,
4645 actual: set as usize,
4646 });
4647 }
4648
4649 Ok(())
4650 }
4651}
4652
4653impl ::core::convert::From<WatchMask> for WireWatchMask {
4654 fn from(natural: WatchMask) -> Self {
4655 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
4656 }
4657}
4658
4659#[derive(PartialEq, Debug)]
4660#[repr(C)]
4661pub struct DirectoryWatchRequest {
4662 pub mask: crate::WatchMask,
4663
4664 pub options: u32,
4665
4666 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel>,
4667}
4668
4669impl ::fidl_next::Encodable for DirectoryWatchRequest {
4670 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchRequest> = unsafe {
4671 ::fidl_next::CopyOptimization::enable_if(
4672 true && <crate::WatchMask as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4673 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4674 && <::fidl_next::ServerEnd<
4675 crate::DirectoryWatcher,
4676 ::fidl_next::fuchsia::zx::Channel,
4677 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4678 .is_enabled(),
4679 )
4680 };
4681
4682 type Encoded = WireDirectoryWatchRequest;
4683}
4684
4685unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchRequest
4686where
4687 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4688 ___E: ::fidl_next::fuchsia::HandleEncoder,
4689{
4690 #[inline]
4691 fn encode(
4692 self,
4693 encoder_: &mut ___E,
4694 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4695 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4696 ::fidl_next::munge! {
4697 let Self::Encoded {
4698 mask,
4699 options,
4700 watcher,
4701
4702 } = out_;
4703 }
4704
4705 ::fidl_next::Encode::encode(self.mask, encoder_, mask)?;
4706
4707 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
4708
4709 ::fidl_next::Encode::encode(self.watcher, encoder_, watcher)?;
4710
4711 Ok(())
4712 }
4713}
4714
4715impl ::fidl_next::EncodableOption for DirectoryWatchRequest {
4716 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchRequest>;
4717}
4718
4719unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchRequest
4720where
4721 ___E: ::fidl_next::Encoder + ?Sized,
4722 DirectoryWatchRequest: ::fidl_next::Encode<___E>,
4723{
4724 #[inline]
4725 fn encode_option(
4726 this: ::core::option::Option<Self>,
4727 encoder: &mut ___E,
4728 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4729 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4730 if let Some(inner) = this {
4731 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4732 ::fidl_next::WireBox::encode_present(out);
4733 } else {
4734 ::fidl_next::WireBox::encode_absent(out);
4735 }
4736
4737 Ok(())
4738 }
4739}
4740
4741impl ::fidl_next::FromWire<WireDirectoryWatchRequest> for DirectoryWatchRequest {
4742 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchRequest, Self> = unsafe {
4743 ::fidl_next::CopyOptimization::enable_if(
4744 true
4745
4746 && <
4747 crate::WatchMask as ::fidl_next::FromWire<crate::WireWatchMask>
4748 >::COPY_OPTIMIZATION.is_enabled()
4749
4750 && <
4751 u32 as ::fidl_next::FromWire<::fidl_next::WireU32>
4752 >::COPY_OPTIMIZATION.is_enabled()
4753
4754 && <
4755 ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>>
4756 >::COPY_OPTIMIZATION.is_enabled()
4757
4758 )
4759 };
4760
4761 #[inline]
4762 fn from_wire(wire: WireDirectoryWatchRequest) -> Self {
4763 Self {
4764 mask: ::fidl_next::FromWire::from_wire(wire.mask),
4765
4766 options: ::fidl_next::FromWire::from_wire(wire.options),
4767
4768 watcher: ::fidl_next::FromWire::from_wire(wire.watcher),
4769 }
4770 }
4771}
4772
4773impl ::fidl_next::IntoNatural for WireDirectoryWatchRequest {
4774 type Natural = DirectoryWatchRequest;
4775}
4776
4777#[derive(Debug)]
4779#[repr(C)]
4780pub struct WireDirectoryWatchRequest {
4781 pub mask: crate::WireWatchMask,
4782
4783 pub options: ::fidl_next::WireU32,
4784
4785 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>,
4786}
4787static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryWatchRequest>(), 12);
4788static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryWatchRequest>(), 4);
4789
4790static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryWatchRequest, mask), 0);
4791
4792static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryWatchRequest, options), 4);
4793
4794static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryWatchRequest, watcher), 8);
4795
4796unsafe impl ::fidl_next::Wire for WireDirectoryWatchRequest {
4797 type Decoded<'de> = WireDirectoryWatchRequest;
4798
4799 #[inline]
4800 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4801 ::fidl_next::munge! {
4802 let Self {
4803
4804 mask,
4805 options,
4806 watcher,
4807
4808 } = &mut *out_;
4809 }
4810
4811 ::fidl_next::Wire::zero_padding(mask);
4812
4813 ::fidl_next::Wire::zero_padding(options);
4814
4815 ::fidl_next::Wire::zero_padding(watcher);
4816 }
4817}
4818
4819unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchRequest
4820where
4821 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4822 ___D: ::fidl_next::fuchsia::HandleDecoder,
4823{
4824 fn decode(
4825 slot_: ::fidl_next::Slot<'_, Self>,
4826 decoder_: &mut ___D,
4827 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4828 ::fidl_next::munge! {
4829 let Self {
4830
4831 mut mask,
4832 mut options,
4833 mut watcher,
4834
4835 } = slot_;
4836 }
4837
4838 ::fidl_next::Decode::decode(mask.as_mut(), decoder_)?;
4839
4840 ::fidl_next::Decode::decode(options.as_mut(), decoder_)?;
4841
4842 ::fidl_next::Decode::decode(watcher.as_mut(), decoder_)?;
4843
4844 Ok(())
4845 }
4846}
4847
4848#[derive(PartialEq, Clone, Debug)]
4849#[repr(C)]
4850pub struct DirectoryWatchResponse {
4851 pub s: i32,
4852}
4853
4854impl ::fidl_next::Encodable for DirectoryWatchResponse {
4855 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchResponse> = unsafe {
4856 ::fidl_next::CopyOptimization::enable_if(
4857 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4858 )
4859 };
4860
4861 type Encoded = WireDirectoryWatchResponse;
4862}
4863
4864unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchResponse
4865where
4866 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4867{
4868 #[inline]
4869 fn encode(
4870 self,
4871 encoder_: &mut ___E,
4872 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4873 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4874 ::fidl_next::munge! {
4875 let Self::Encoded {
4876 s,
4877
4878 } = out_;
4879 }
4880
4881 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
4882
4883 Ok(())
4884 }
4885}
4886
4887unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryWatchResponse
4888where
4889 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4890{
4891 #[inline]
4892 fn encode_ref(
4893 &self,
4894 encoder_: &mut ___E,
4895 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4896 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4897 ::fidl_next::munge! {
4898 let Self::Encoded {
4899
4900 s,
4901
4902 } = out_;
4903 }
4904
4905 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
4906
4907 Ok(())
4908 }
4909}
4910
4911impl ::fidl_next::EncodableOption for DirectoryWatchResponse {
4912 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchResponse>;
4913}
4914
4915unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchResponse
4916where
4917 ___E: ::fidl_next::Encoder + ?Sized,
4918 DirectoryWatchResponse: ::fidl_next::Encode<___E>,
4919{
4920 #[inline]
4921 fn encode_option(
4922 this: ::core::option::Option<Self>,
4923 encoder: &mut ___E,
4924 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4926 if let Some(inner) = this {
4927 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4928 ::fidl_next::WireBox::encode_present(out);
4929 } else {
4930 ::fidl_next::WireBox::encode_absent(out);
4931 }
4932
4933 Ok(())
4934 }
4935}
4936
4937unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryWatchResponse
4938where
4939 ___E: ::fidl_next::Encoder + ?Sized,
4940 DirectoryWatchResponse: ::fidl_next::EncodeRef<___E>,
4941{
4942 #[inline]
4943 fn encode_option_ref(
4944 this: ::core::option::Option<&Self>,
4945 encoder: &mut ___E,
4946 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4947 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4948 if let Some(inner) = this {
4949 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4950 ::fidl_next::WireBox::encode_present(out);
4951 } else {
4952 ::fidl_next::WireBox::encode_absent(out);
4953 }
4954
4955 Ok(())
4956 }
4957}
4958
4959impl ::fidl_next::FromWire<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4960 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchResponse, Self> = unsafe {
4961 ::fidl_next::CopyOptimization::enable_if(
4962 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
4963 .is_enabled(),
4964 )
4965 };
4966
4967 #[inline]
4968 fn from_wire(wire: WireDirectoryWatchResponse) -> Self {
4969 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
4970 }
4971}
4972
4973impl ::fidl_next::IntoNatural for WireDirectoryWatchResponse {
4974 type Natural = DirectoryWatchResponse;
4975}
4976
4977impl ::fidl_next::FromWireRef<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4978 #[inline]
4979 fn from_wire_ref(wire: &WireDirectoryWatchResponse) -> Self {
4980 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
4981 }
4982}
4983
4984#[derive(Clone, Debug)]
4986#[repr(C)]
4987pub struct WireDirectoryWatchResponse {
4988 pub s: ::fidl_next::WireI32,
4989}
4990static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryWatchResponse>(), 4);
4991static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryWatchResponse>(), 4);
4992
4993static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryWatchResponse, s), 0);
4994
4995unsafe impl ::fidl_next::Wire for WireDirectoryWatchResponse {
4996 type Decoded<'de> = WireDirectoryWatchResponse;
4997
4998 #[inline]
4999 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5000 ::fidl_next::munge! {
5001 let Self {
5002
5003 s,
5004
5005 } = &mut *out_;
5006 }
5007
5008 ::fidl_next::Wire::zero_padding(s);
5009 }
5010}
5011
5012unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchResponse
5013where
5014 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5015{
5016 fn decode(
5017 slot_: ::fidl_next::Slot<'_, Self>,
5018 decoder_: &mut ___D,
5019 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5020 ::fidl_next::munge! {
5021 let Self {
5022
5023 mut s,
5024
5025 } = slot_;
5026 }
5027
5028 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
5029
5030 Ok(())
5031 }
5032}
5033
5034#[derive(PartialEq, Debug)]
5035pub struct NodeOnOpenRequest {
5036 pub s: i32,
5037
5038 pub info: ::core::option::Option<::std::boxed::Box<crate::NodeInfoDeprecated>>,
5039}
5040
5041impl ::fidl_next::Encodable for NodeOnOpenRequest {
5042 type Encoded = WireNodeOnOpenRequest<'static>;
5043}
5044
5045unsafe impl<___E> ::fidl_next::Encode<___E> for NodeOnOpenRequest
5046where
5047 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5048 ___E: ::fidl_next::Encoder,
5049 ___E: ::fidl_next::fuchsia::HandleEncoder,
5050{
5051 #[inline]
5052 fn encode(
5053 self,
5054 encoder_: &mut ___E,
5055 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5057 ::fidl_next::munge! {
5058 let Self::Encoded {
5059 s,
5060 info,
5061
5062 } = out_;
5063 }
5064
5065 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
5066
5067 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
5068
5069 Ok(())
5070 }
5071}
5072
5073impl ::fidl_next::EncodableOption for NodeOnOpenRequest {
5074 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeOnOpenRequest<'static>>;
5075}
5076
5077unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeOnOpenRequest
5078where
5079 ___E: ::fidl_next::Encoder + ?Sized,
5080 NodeOnOpenRequest: ::fidl_next::Encode<___E>,
5081{
5082 #[inline]
5083 fn encode_option(
5084 this: ::core::option::Option<Self>,
5085 encoder: &mut ___E,
5086 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5087 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5088 if let Some(inner) = this {
5089 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5090 ::fidl_next::WireBox::encode_present(out);
5091 } else {
5092 ::fidl_next::WireBox::encode_absent(out);
5093 }
5094
5095 Ok(())
5096 }
5097}
5098
5099impl<'de> ::fidl_next::FromWire<WireNodeOnOpenRequest<'de>> for NodeOnOpenRequest {
5100 #[inline]
5101 fn from_wire(wire: WireNodeOnOpenRequest<'de>) -> Self {
5102 Self {
5103 s: ::fidl_next::FromWire::from_wire(wire.s),
5104
5105 info: ::fidl_next::FromWire::from_wire(wire.info),
5106 }
5107 }
5108}
5109
5110impl<'de> ::fidl_next::IntoNatural for WireNodeOnOpenRequest<'de> {
5111 type Natural = NodeOnOpenRequest;
5112}
5113
5114#[derive(Debug)]
5116#[repr(C)]
5117pub struct WireNodeOnOpenRequest<'de> {
5118 pub s: ::fidl_next::WireI32,
5119
5120 pub info: crate::WireOptionalNodeInfoDeprecated<'de>,
5121}
5122static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeOnOpenRequest<'_>>(), 24);
5123static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeOnOpenRequest<'_>>(), 8);
5124
5125static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeOnOpenRequest<'_>, s), 0);
5126
5127static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeOnOpenRequest<'_>, info), 8);
5128
5129unsafe impl ::fidl_next::Wire for WireNodeOnOpenRequest<'static> {
5130 type Decoded<'de> = WireNodeOnOpenRequest<'de>;
5131
5132 #[inline]
5133 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5134 ::fidl_next::munge! {
5135 let Self {
5136
5137 s,
5138 info,
5139
5140 } = &mut *out_;
5141 }
5142
5143 ::fidl_next::Wire::zero_padding(s);
5144
5145 ::fidl_next::Wire::zero_padding(info);
5146
5147 unsafe {
5148 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
5149 }
5150 }
5151}
5152
5153unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeOnOpenRequest<'static>
5154where
5155 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5156 ___D: ::fidl_next::Decoder,
5157 ___D: ::fidl_next::fuchsia::HandleDecoder,
5158{
5159 fn decode(
5160 slot_: ::fidl_next::Slot<'_, Self>,
5161 decoder_: &mut ___D,
5162 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5163 ::fidl_next::munge! {
5164 let Self {
5165
5166 mut s,
5167 mut info,
5168
5169 } = slot_;
5170 }
5171
5172 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
5173
5174 ::fidl_next::Decode::decode(info.as_mut(), decoder_)?;
5175
5176 Ok(())
5177 }
5178}
5179
5180pub type SymlinkTarget = ::std::vec::Vec<u8>;
5181
5182pub type WireSymlinkTarget<'de> = ::fidl_next::WireVector<'de, u8>;
5184
5185#[derive(PartialEq, Debug)]
5186#[repr(C)]
5187pub struct NodeListExtendedAttributesRequest {
5188 pub iterator:
5189 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::zx::Channel>,
5190}
5191
5192impl ::fidl_next::Encodable for NodeListExtendedAttributesRequest {
5193 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
5194 Self,
5195 WireNodeListExtendedAttributesRequest,
5196 > = unsafe {
5197 ::fidl_next::CopyOptimization::enable_if(
5198 true && <::fidl_next::ServerEnd<
5199 crate::ExtendedAttributeIterator,
5200 ::fidl_next::fuchsia::zx::Channel,
5201 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
5202 .is_enabled(),
5203 )
5204 };
5205
5206 type Encoded = WireNodeListExtendedAttributesRequest;
5207}
5208
5209unsafe impl<___E> ::fidl_next::Encode<___E> for NodeListExtendedAttributesRequest
5210where
5211 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5212 ___E: ::fidl_next::fuchsia::HandleEncoder,
5213{
5214 #[inline]
5215 fn encode(
5216 self,
5217 encoder_: &mut ___E,
5218 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5219 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5220 ::fidl_next::munge! {
5221 let Self::Encoded {
5222 iterator,
5223
5224 } = out_;
5225 }
5226
5227 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator)?;
5228
5229 Ok(())
5230 }
5231}
5232
5233impl ::fidl_next::EncodableOption for NodeListExtendedAttributesRequest {
5234 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeListExtendedAttributesRequest>;
5235}
5236
5237unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeListExtendedAttributesRequest
5238where
5239 ___E: ::fidl_next::Encoder + ?Sized,
5240 NodeListExtendedAttributesRequest: ::fidl_next::Encode<___E>,
5241{
5242 #[inline]
5243 fn encode_option(
5244 this: ::core::option::Option<Self>,
5245 encoder: &mut ___E,
5246 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5247 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5248 if let Some(inner) = this {
5249 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5250 ::fidl_next::WireBox::encode_present(out);
5251 } else {
5252 ::fidl_next::WireBox::encode_absent(out);
5253 }
5254
5255 Ok(())
5256 }
5257}
5258
5259impl ::fidl_next::FromWire<WireNodeListExtendedAttributesRequest>
5260 for NodeListExtendedAttributesRequest
5261{
5262 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
5263 WireNodeListExtendedAttributesRequest,
5264 Self,
5265 > = unsafe {
5266 ::fidl_next::CopyOptimization::enable_if(
5267 true && <::fidl_next::ServerEnd<
5268 crate::ExtendedAttributeIterator,
5269 ::fidl_next::fuchsia::zx::Channel,
5270 > as ::fidl_next::FromWire<
5271 ::fidl_next::ServerEnd<
5272 crate::ExtendedAttributeIterator,
5273 ::fidl_next::fuchsia::WireChannel,
5274 >,
5275 >>::COPY_OPTIMIZATION
5276 .is_enabled(),
5277 )
5278 };
5279
5280 #[inline]
5281 fn from_wire(wire: WireNodeListExtendedAttributesRequest) -> Self {
5282 Self { iterator: ::fidl_next::FromWire::from_wire(wire.iterator) }
5283 }
5284}
5285
5286impl ::fidl_next::IntoNatural for WireNodeListExtendedAttributesRequest {
5287 type Natural = NodeListExtendedAttributesRequest;
5288}
5289
5290#[derive(Debug)]
5292#[repr(C)]
5293pub struct WireNodeListExtendedAttributesRequest {
5294 pub iterator:
5295 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::WireChannel>,
5296}
5297static_assertions::const_assert_eq!(
5298 std::mem::size_of::<WireNodeListExtendedAttributesRequest>(),
5299 4
5300);
5301static_assertions::const_assert_eq!(
5302 std::mem::align_of::<WireNodeListExtendedAttributesRequest>(),
5303 4
5304);
5305
5306static_assertions::const_assert_eq!(
5307 std::mem::offset_of!(WireNodeListExtendedAttributesRequest, iterator),
5308 0
5309);
5310
5311unsafe impl ::fidl_next::Wire for WireNodeListExtendedAttributesRequest {
5312 type Decoded<'de> = WireNodeListExtendedAttributesRequest;
5313
5314 #[inline]
5315 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5316 ::fidl_next::munge! {
5317 let Self {
5318
5319 iterator,
5320
5321 } = &mut *out_;
5322 }
5323
5324 ::fidl_next::Wire::zero_padding(iterator);
5325 }
5326}
5327
5328unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeListExtendedAttributesRequest
5329where
5330 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5331 ___D: ::fidl_next::fuchsia::HandleDecoder,
5332{
5333 fn decode(
5334 slot_: ::fidl_next::Slot<'_, Self>,
5335 decoder_: &mut ___D,
5336 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5337 ::fidl_next::munge! {
5338 let Self {
5339
5340 mut iterator,
5341
5342 } = slot_;
5343 }
5344
5345 ::fidl_next::Decode::decode(iterator.as_mut(), decoder_)?;
5346
5347 Ok(())
5348 }
5349}
5350
5351#[doc = " The maximum size for an extended attribute name.\n"]
5352pub const MAX_ATTRIBUTE_NAME: u64 = 255 as u64;
5353
5354#[doc = " The name of an extended attribute. It can not contain any null bytes. Other\n than that and the maximum size, no particular structure is imposed on the\n name.\n"]
5355pub type ExtendedAttributeName = ::std::vec::Vec<u8>;
5356
5357pub type WireExtendedAttributeName<'de> = ::fidl_next::WireVector<'de, u8>;
5359
5360#[derive(PartialEq, Clone, Debug)]
5361pub struct NodeGetExtendedAttributeRequest {
5362 pub name: ::std::vec::Vec<u8>,
5363}
5364
5365impl ::fidl_next::Encodable for NodeGetExtendedAttributeRequest {
5366 type Encoded = WireNodeGetExtendedAttributeRequest<'static>;
5367}
5368
5369unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetExtendedAttributeRequest
5370where
5371 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5372 ___E: ::fidl_next::Encoder,
5373{
5374 #[inline]
5375 fn encode(
5376 self,
5377 encoder_: &mut ___E,
5378 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5379 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5380 ::fidl_next::munge! {
5381 let Self::Encoded {
5382 name,
5383
5384 } = out_;
5385 }
5386
5387 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
5388
5389 Ok(())
5390 }
5391}
5392
5393unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetExtendedAttributeRequest
5394where
5395 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5396 ___E: ::fidl_next::Encoder,
5397{
5398 #[inline]
5399 fn encode_ref(
5400 &self,
5401 encoder_: &mut ___E,
5402 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5404 ::fidl_next::munge! {
5405 let Self::Encoded {
5406
5407 name,
5408
5409 } = out_;
5410 }
5411
5412 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
5413
5414 Ok(())
5415 }
5416}
5417
5418impl ::fidl_next::EncodableOption for NodeGetExtendedAttributeRequest {
5419 type EncodedOption =
5420 ::fidl_next::WireBox<'static, WireNodeGetExtendedAttributeRequest<'static>>;
5421}
5422
5423unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetExtendedAttributeRequest
5424where
5425 ___E: ::fidl_next::Encoder + ?Sized,
5426 NodeGetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5427{
5428 #[inline]
5429 fn encode_option(
5430 this: ::core::option::Option<Self>,
5431 encoder: &mut ___E,
5432 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5433 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5434 if let Some(inner) = this {
5435 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5436 ::fidl_next::WireBox::encode_present(out);
5437 } else {
5438 ::fidl_next::WireBox::encode_absent(out);
5439 }
5440
5441 Ok(())
5442 }
5443}
5444
5445unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetExtendedAttributeRequest
5446where
5447 ___E: ::fidl_next::Encoder + ?Sized,
5448 NodeGetExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
5449{
5450 #[inline]
5451 fn encode_option_ref(
5452 this: ::core::option::Option<&Self>,
5453 encoder: &mut ___E,
5454 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5456 if let Some(inner) = this {
5457 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5458 ::fidl_next::WireBox::encode_present(out);
5459 } else {
5460 ::fidl_next::WireBox::encode_absent(out);
5461 }
5462
5463 Ok(())
5464 }
5465}
5466
5467impl<'de> ::fidl_next::FromWire<WireNodeGetExtendedAttributeRequest<'de>>
5468 for NodeGetExtendedAttributeRequest
5469{
5470 #[inline]
5471 fn from_wire(wire: WireNodeGetExtendedAttributeRequest<'de>) -> Self {
5472 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
5473 }
5474}
5475
5476impl<'de> ::fidl_next::IntoNatural for WireNodeGetExtendedAttributeRequest<'de> {
5477 type Natural = NodeGetExtendedAttributeRequest;
5478}
5479
5480impl<'de> ::fidl_next::FromWireRef<WireNodeGetExtendedAttributeRequest<'de>>
5481 for NodeGetExtendedAttributeRequest
5482{
5483 #[inline]
5484 fn from_wire_ref(wire: &WireNodeGetExtendedAttributeRequest<'de>) -> Self {
5485 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
5486 }
5487}
5488
5489#[derive(Debug)]
5491#[repr(C)]
5492pub struct WireNodeGetExtendedAttributeRequest<'de> {
5493 pub name: ::fidl_next::WireVector<'de, u8>,
5494}
5495static_assertions::const_assert_eq!(
5496 std::mem::size_of::<WireNodeGetExtendedAttributeRequest<'_>>(),
5497 16
5498);
5499static_assertions::const_assert_eq!(
5500 std::mem::align_of::<WireNodeGetExtendedAttributeRequest<'_>>(),
5501 8
5502);
5503
5504static_assertions::const_assert_eq!(
5505 std::mem::offset_of!(WireNodeGetExtendedAttributeRequest<'_>, name),
5506 0
5507);
5508
5509unsafe impl ::fidl_next::Wire for WireNodeGetExtendedAttributeRequest<'static> {
5510 type Decoded<'de> = WireNodeGetExtendedAttributeRequest<'de>;
5511
5512 #[inline]
5513 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5514 ::fidl_next::munge! {
5515 let Self {
5516
5517 name,
5518
5519 } = &mut *out_;
5520 }
5521
5522 ::fidl_next::Wire::zero_padding(name);
5523 }
5524}
5525
5526unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetExtendedAttributeRequest<'static>
5527where
5528 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5529 ___D: ::fidl_next::Decoder,
5530{
5531 fn decode(
5532 slot_: ::fidl_next::Slot<'_, Self>,
5533 decoder_: &mut ___D,
5534 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5535 ::fidl_next::munge! {
5536 let Self {
5537
5538 mut name,
5539
5540 } = slot_;
5541 }
5542
5543 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
5544
5545 let name = unsafe { name.deref_unchecked() };
5546
5547 if name.len() > 255 {
5548 return Err(::fidl_next::DecodeError::VectorTooLong {
5549 size: name.len() as u64,
5550 limit: 255,
5551 });
5552 }
5553
5554 Ok(())
5555 }
5556}
5557
5558#[doc = " The maximum size for an extended attribute value to be included inline.\n Values larger than this size are passed in a vmo.\n"]
5559pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768 as u64;
5560
5561#[doc = " The value type for an extended attribute. If the value is less than 32768\n bytes, then it is included inline. Values larger than this size are written\n into a vmo buffer.\n"]
5562#[derive(PartialEq, Debug)]
5563pub enum ExtendedAttributeValue {
5564 Bytes(::std::vec::Vec<u8>),
5565
5566 Buffer(::fidl_next::fuchsia::zx::Vmo),
5567
5568 UnknownOrdinal_(u64),
5569}
5570
5571impl ::fidl_next::Encodable for ExtendedAttributeValue {
5572 type Encoded = WireExtendedAttributeValue<'static>;
5573}
5574
5575unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeValue
5576where
5577 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5578 ___E: ::fidl_next::Encoder,
5579 ___E: ::fidl_next::fuchsia::HandleEncoder,
5580{
5581 #[inline]
5582 fn encode(
5583 self,
5584 encoder: &mut ___E,
5585 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5586 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5587 ::fidl_next::munge!(let WireExtendedAttributeValue { raw, _phantom: _ } = out);
5588
5589 match self {
5590 Self::Bytes(value) => {
5591 ::fidl_next::RawWireUnion::encode_as::<___E, ::std::vec::Vec<u8>>(
5592 value, 1, encoder, raw,
5593 )?
5594 }
5595
5596 Self::Buffer(value) => ::fidl_next::RawWireUnion::encode_as::<
5597 ___E,
5598 ::fidl_next::fuchsia::zx::Vmo,
5599 >(value, 2, encoder, raw)?,
5600
5601 Self::UnknownOrdinal_(ordinal) => {
5602 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
5603 }
5604 }
5605
5606 Ok(())
5607 }
5608}
5609
5610impl ::fidl_next::EncodableOption for ExtendedAttributeValue {
5611 type EncodedOption = WireOptionalExtendedAttributeValue<'static>;
5612}
5613
5614unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeValue
5615where
5616 ___E: ?Sized,
5617 ExtendedAttributeValue: ::fidl_next::Encode<___E>,
5618{
5619 #[inline]
5620 fn encode_option(
5621 this: ::core::option::Option<Self>,
5622 encoder: &mut ___E,
5623 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5624 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5625 ::fidl_next::munge!(let WireOptionalExtendedAttributeValue { raw, _phantom: _ } = &mut *out);
5626
5627 if let Some(inner) = this {
5628 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5629 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
5630 } else {
5631 ::fidl_next::RawWireUnion::encode_absent(raw);
5632 }
5633
5634 Ok(())
5635 }
5636}
5637
5638impl<'de> ::fidl_next::FromWire<WireExtendedAttributeValue<'de>> for ExtendedAttributeValue {
5639 #[inline]
5640 fn from_wire(wire: WireExtendedAttributeValue<'de>) -> Self {
5641 let wire = ::core::mem::ManuallyDrop::new(wire);
5642 match wire.raw.ordinal() {
5643 1 => Self::Bytes(::fidl_next::FromWire::from_wire(unsafe {
5644 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
5645 })),
5646
5647 2 => Self::Buffer(::fidl_next::FromWire::from_wire(unsafe {
5648 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireVmo>()
5649 })),
5650
5651 _ => unsafe { ::core::hint::unreachable_unchecked() },
5652 }
5653 }
5654}
5655
5656impl<'de> ::fidl_next::IntoNatural for WireExtendedAttributeValue<'de> {
5657 type Natural = ExtendedAttributeValue;
5658}
5659
5660impl<'de> ::fidl_next::FromWireOption<WireOptionalExtendedAttributeValue<'de>>
5661 for ExtendedAttributeValue
5662{
5663 #[inline]
5664 fn from_wire_option(
5665 wire: WireOptionalExtendedAttributeValue<'de>,
5666 ) -> ::core::option::Option<Self> {
5667 if let Some(inner) = wire.into_option() {
5668 Some(::fidl_next::FromWire::from_wire(inner))
5669 } else {
5670 None
5671 }
5672 }
5673}
5674
5675impl<'de> ::fidl_next::IntoNatural for WireOptionalExtendedAttributeValue<'de> {
5676 type Natural = ::core::option::Option<ExtendedAttributeValue>;
5677}
5678
5679impl<'de> ::fidl_next::FromWireOption<WireOptionalExtendedAttributeValue<'de>>
5680 for Box<ExtendedAttributeValue>
5681{
5682 #[inline]
5683 fn from_wire_option(
5684 wire: WireOptionalExtendedAttributeValue<'de>,
5685 ) -> ::core::option::Option<Self> {
5686 <ExtendedAttributeValue as ::fidl_next::FromWireOption<
5687 WireOptionalExtendedAttributeValue<'de>,
5688 >>::from_wire_option(wire)
5689 .map(Box::new)
5690 }
5691}
5692
5693#[repr(transparent)]
5695pub struct WireExtendedAttributeValue<'de> {
5696 raw: ::fidl_next::RawWireUnion,
5697 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5698}
5699
5700impl<'de> Drop for WireExtendedAttributeValue<'de> {
5701 fn drop(&mut self) {
5702 match self.raw.ordinal() {
5703 1 => {
5704 let _ =
5705 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
5706 }
5707
5708 2 => {
5709 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireVmo>() };
5710 }
5711
5712 _ => (),
5713 }
5714 }
5715}
5716
5717unsafe impl ::fidl_next::Wire for WireExtendedAttributeValue<'static> {
5718 type Decoded<'de> = WireExtendedAttributeValue<'de>;
5719
5720 #[inline]
5721 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5722 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5723 ::fidl_next::RawWireUnion::zero_padding(raw);
5724 }
5725}
5726
5727pub mod extended_attribute_value {
5728 pub enum Ref<'de> {
5729 Bytes(&'de ::fidl_next::WireVector<'de, u8>),
5730
5731 Buffer(&'de ::fidl_next::fuchsia::WireVmo),
5732
5733 UnknownOrdinal_(u64),
5734 }
5735}
5736
5737impl<'de> WireExtendedAttributeValue<'de> {
5738 pub fn as_ref(&self) -> crate::extended_attribute_value::Ref<'_> {
5739 match self.raw.ordinal() {
5740 1 => crate::extended_attribute_value::Ref::Bytes(unsafe {
5741 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
5742 }),
5743
5744 2 => crate::extended_attribute_value::Ref::Buffer(unsafe {
5745 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireVmo>()
5746 }),
5747
5748 unknown => crate::extended_attribute_value::Ref::UnknownOrdinal_(unknown),
5749 }
5750 }
5751}
5752
5753unsafe impl<___D> ::fidl_next::Decode<___D> for WireExtendedAttributeValue<'static>
5754where
5755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5756 ___D: ::fidl_next::Decoder,
5757 ___D: ::fidl_next::fuchsia::HandleDecoder,
5758{
5759 fn decode(
5760 mut slot: ::fidl_next::Slot<'_, Self>,
5761 decoder: &mut ___D,
5762 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5763 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5764 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5765 1 => {
5766 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5767 raw, decoder,
5768 )?
5769 }
5770
5771 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
5772 raw, decoder,
5773 )?,
5774
5775 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5776 }
5777
5778 Ok(())
5779 }
5780}
5781
5782impl<'de> ::core::fmt::Debug for WireExtendedAttributeValue<'de> {
5783 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5784 match self.raw.ordinal() {
5785 1 => unsafe {
5786 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
5787 },
5788 2 => unsafe {
5789 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireVmo>().fmt(f)
5790 },
5791 _ => unsafe { ::core::hint::unreachable_unchecked() },
5792 }
5793 }
5794}
5795
5796#[repr(transparent)]
5797pub struct WireOptionalExtendedAttributeValue<'de> {
5798 raw: ::fidl_next::RawWireUnion,
5799 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5800}
5801
5802unsafe impl ::fidl_next::Wire for WireOptionalExtendedAttributeValue<'static> {
5803 type Decoded<'de> = WireOptionalExtendedAttributeValue<'de>;
5804
5805 #[inline]
5806 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5807 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5808 ::fidl_next::RawWireUnion::zero_padding(raw);
5809 }
5810}
5811
5812impl<'de> WireOptionalExtendedAttributeValue<'de> {
5813 pub fn is_some(&self) -> bool {
5814 self.raw.is_some()
5815 }
5816
5817 pub fn is_none(&self) -> bool {
5818 self.raw.is_none()
5819 }
5820
5821 pub fn as_ref(&self) -> ::core::option::Option<&WireExtendedAttributeValue<'de>> {
5822 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
5823 }
5824
5825 pub fn into_option(self) -> ::core::option::Option<WireExtendedAttributeValue<'de>> {
5826 if self.is_some() {
5827 Some(WireExtendedAttributeValue {
5828 raw: self.raw,
5829 _phantom: ::core::marker::PhantomData,
5830 })
5831 } else {
5832 None
5833 }
5834 }
5835}
5836
5837unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExtendedAttributeValue<'static>
5838where
5839 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5840 ___D: ::fidl_next::Decoder,
5841 ___D: ::fidl_next::fuchsia::HandleDecoder,
5842{
5843 fn decode(
5844 mut slot: ::fidl_next::Slot<'_, Self>,
5845 decoder: &mut ___D,
5846 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5847 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5848 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5849 1 => {
5850 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5851 raw, decoder,
5852 )?
5853 }
5854
5855 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
5856 raw, decoder,
5857 )?,
5858
5859 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5860 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5861 }
5862
5863 Ok(())
5864 }
5865}
5866
5867impl<'de> ::core::fmt::Debug for WireOptionalExtendedAttributeValue<'de> {
5868 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5869 self.as_ref().fmt(f)
5870 }
5871}
5872
5873#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5874#[repr(u32)]
5875pub enum SetExtendedAttributeMode {
5876 Set = 1,
5877 Create = 2,
5878 Replace = 3,
5879}
5880
5881impl ::fidl_next::Encodable for SetExtendedAttributeMode {
5882 type Encoded = WireSetExtendedAttributeMode;
5883}
5884impl ::core::convert::TryFrom<u32> for SetExtendedAttributeMode {
5885 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5886 fn try_from(
5887 value: u32,
5888 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5889 match value {
5890 1 => Ok(Self::Set),
5891 2 => Ok(Self::Create),
5892 3 => Ok(Self::Replace),
5893
5894 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5895 }
5896 }
5897}
5898
5899unsafe impl<___E> ::fidl_next::Encode<___E> for SetExtendedAttributeMode
5900where
5901 ___E: ?Sized,
5902{
5903 #[inline]
5904 fn encode(
5905 self,
5906 encoder: &mut ___E,
5907 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5908 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5909 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5910 }
5911}
5912
5913unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SetExtendedAttributeMode
5914where
5915 ___E: ?Sized,
5916{
5917 #[inline]
5918 fn encode_ref(
5919 &self,
5920 encoder: &mut ___E,
5921 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5922 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5923 ::fidl_next::munge!(let WireSetExtendedAttributeMode { value } = out);
5924 let _ = value.write(::fidl_next::WireU32::from(match *self {
5925 Self::Set => 1,
5926
5927 Self::Create => 2,
5928
5929 Self::Replace => 3,
5930 }));
5931
5932 Ok(())
5933 }
5934}
5935
5936impl ::core::convert::From<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5937 fn from(wire: WireSetExtendedAttributeMode) -> Self {
5938 match u32::from(wire.value) {
5939 1 => Self::Set,
5940
5941 2 => Self::Create,
5942
5943 3 => Self::Replace,
5944
5945 _ => unsafe { ::core::hint::unreachable_unchecked() },
5946 }
5947 }
5948}
5949
5950impl ::fidl_next::FromWire<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5951 #[inline]
5952 fn from_wire(wire: WireSetExtendedAttributeMode) -> Self {
5953 Self::from(wire)
5954 }
5955}
5956
5957impl ::fidl_next::IntoNatural for WireSetExtendedAttributeMode {
5958 type Natural = SetExtendedAttributeMode;
5959}
5960
5961impl ::fidl_next::FromWireRef<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5962 #[inline]
5963 fn from_wire_ref(wire: &WireSetExtendedAttributeMode) -> Self {
5964 Self::from(*wire)
5965 }
5966}
5967
5968#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5970#[repr(transparent)]
5971pub struct WireSetExtendedAttributeMode {
5972 value: ::fidl_next::WireU32,
5973}
5974
5975unsafe impl ::fidl_next::Wire for WireSetExtendedAttributeMode {
5976 type Decoded<'de> = Self;
5977
5978 #[inline]
5979 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5980 }
5982}
5983
5984impl WireSetExtendedAttributeMode {
5985 pub const SET: WireSetExtendedAttributeMode =
5986 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(1) };
5987
5988 pub const CREATE: WireSetExtendedAttributeMode =
5989 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(2) };
5990
5991 pub const REPLACE: WireSetExtendedAttributeMode =
5992 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(3) };
5993}
5994
5995unsafe impl<___D> ::fidl_next::Decode<___D> for WireSetExtendedAttributeMode
5996where
5997 ___D: ?Sized,
5998{
5999 fn decode(
6000 slot: ::fidl_next::Slot<'_, Self>,
6001 _: &mut ___D,
6002 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6003 ::fidl_next::munge!(let Self { value } = slot);
6004
6005 match u32::from(*value) {
6006 1 | 2 | 3 => (),
6007 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
6008 }
6009
6010 Ok(())
6011 }
6012}
6013
6014impl ::core::convert::From<SetExtendedAttributeMode> for WireSetExtendedAttributeMode {
6015 fn from(natural: SetExtendedAttributeMode) -> Self {
6016 match natural {
6017 SetExtendedAttributeMode::Set => WireSetExtendedAttributeMode::SET,
6018
6019 SetExtendedAttributeMode::Create => WireSetExtendedAttributeMode::CREATE,
6020
6021 SetExtendedAttributeMode::Replace => WireSetExtendedAttributeMode::REPLACE,
6022 }
6023 }
6024}
6025
6026#[derive(PartialEq, Debug)]
6027pub struct NodeSetExtendedAttributeRequest {
6028 pub name: ::std::vec::Vec<u8>,
6029
6030 pub value: crate::ExtendedAttributeValue,
6031
6032 pub mode: crate::SetExtendedAttributeMode,
6033}
6034
6035impl ::fidl_next::Encodable for NodeSetExtendedAttributeRequest {
6036 type Encoded = WireNodeSetExtendedAttributeRequest<'static>;
6037}
6038
6039unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetExtendedAttributeRequest
6040where
6041 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6042 ___E: ::fidl_next::Encoder,
6043 ___E: ::fidl_next::fuchsia::HandleEncoder,
6044{
6045 #[inline]
6046 fn encode(
6047 self,
6048 encoder_: &mut ___E,
6049 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6050 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6051 ::fidl_next::munge! {
6052 let Self::Encoded {
6053 name,
6054 value,
6055 mode,
6056
6057 } = out_;
6058 }
6059
6060 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
6061
6062 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
6063
6064 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
6065
6066 Ok(())
6067 }
6068}
6069
6070impl ::fidl_next::EncodableOption for NodeSetExtendedAttributeRequest {
6071 type EncodedOption =
6072 ::fidl_next::WireBox<'static, WireNodeSetExtendedAttributeRequest<'static>>;
6073}
6074
6075unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetExtendedAttributeRequest
6076where
6077 ___E: ::fidl_next::Encoder + ?Sized,
6078 NodeSetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
6079{
6080 #[inline]
6081 fn encode_option(
6082 this: ::core::option::Option<Self>,
6083 encoder: &mut ___E,
6084 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6085 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6086 if let Some(inner) = this {
6087 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6088 ::fidl_next::WireBox::encode_present(out);
6089 } else {
6090 ::fidl_next::WireBox::encode_absent(out);
6091 }
6092
6093 Ok(())
6094 }
6095}
6096
6097impl<'de> ::fidl_next::FromWire<WireNodeSetExtendedAttributeRequest<'de>>
6098 for NodeSetExtendedAttributeRequest
6099{
6100 #[inline]
6101 fn from_wire(wire: WireNodeSetExtendedAttributeRequest<'de>) -> Self {
6102 Self {
6103 name: ::fidl_next::FromWire::from_wire(wire.name),
6104
6105 value: ::fidl_next::FromWire::from_wire(wire.value),
6106
6107 mode: ::fidl_next::FromWire::from_wire(wire.mode),
6108 }
6109 }
6110}
6111
6112impl<'de> ::fidl_next::IntoNatural for WireNodeSetExtendedAttributeRequest<'de> {
6113 type Natural = NodeSetExtendedAttributeRequest;
6114}
6115
6116#[derive(Debug)]
6118#[repr(C)]
6119pub struct WireNodeSetExtendedAttributeRequest<'de> {
6120 pub name: ::fidl_next::WireVector<'de, u8>,
6121
6122 pub value: crate::WireExtendedAttributeValue<'de>,
6123
6124 pub mode: crate::WireSetExtendedAttributeMode,
6125}
6126static_assertions::const_assert_eq!(
6127 std::mem::size_of::<WireNodeSetExtendedAttributeRequest<'_>>(),
6128 40
6129);
6130static_assertions::const_assert_eq!(
6131 std::mem::align_of::<WireNodeSetExtendedAttributeRequest<'_>>(),
6132 8
6133);
6134
6135static_assertions::const_assert_eq!(
6136 std::mem::offset_of!(WireNodeSetExtendedAttributeRequest<'_>, name),
6137 0
6138);
6139
6140static_assertions::const_assert_eq!(
6141 std::mem::offset_of!(WireNodeSetExtendedAttributeRequest<'_>, value),
6142 16
6143);
6144
6145static_assertions::const_assert_eq!(
6146 std::mem::offset_of!(WireNodeSetExtendedAttributeRequest<'_>, mode),
6147 32
6148);
6149
6150unsafe impl ::fidl_next::Wire for WireNodeSetExtendedAttributeRequest<'static> {
6151 type Decoded<'de> = WireNodeSetExtendedAttributeRequest<'de>;
6152
6153 #[inline]
6154 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6155 ::fidl_next::munge! {
6156 let Self {
6157
6158 name,
6159 value,
6160 mode,
6161
6162 } = &mut *out_;
6163 }
6164
6165 ::fidl_next::Wire::zero_padding(name);
6166
6167 ::fidl_next::Wire::zero_padding(value);
6168
6169 ::fidl_next::Wire::zero_padding(mode);
6170
6171 unsafe {
6172 out_.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
6173 }
6174 }
6175}
6176
6177unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetExtendedAttributeRequest<'static>
6178where
6179 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6180 ___D: ::fidl_next::Decoder,
6181 ___D: ::fidl_next::fuchsia::HandleDecoder,
6182{
6183 fn decode(
6184 slot_: ::fidl_next::Slot<'_, Self>,
6185 decoder_: &mut ___D,
6186 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6187 ::fidl_next::munge! {
6188 let Self {
6189
6190 mut name,
6191 mut value,
6192 mut mode,
6193
6194 } = slot_;
6195 }
6196
6197 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
6198
6199 let name = unsafe { name.deref_unchecked() };
6200
6201 if name.len() > 255 {
6202 return Err(::fidl_next::DecodeError::VectorTooLong {
6203 size: name.len() as u64,
6204 limit: 255,
6205 });
6206 }
6207
6208 ::fidl_next::Decode::decode(value.as_mut(), decoder_)?;
6209
6210 ::fidl_next::Decode::decode(mode.as_mut(), decoder_)?;
6211
6212 Ok(())
6213 }
6214}
6215
6216pub type NodeSetExtendedAttributeResponse = ();
6217
6218pub type WireNodeSetExtendedAttributeResponse = ();
6220
6221#[derive(PartialEq, Clone, Debug)]
6222pub struct NodeRemoveExtendedAttributeRequest {
6223 pub name: ::std::vec::Vec<u8>,
6224}
6225
6226impl ::fidl_next::Encodable for NodeRemoveExtendedAttributeRequest {
6227 type Encoded = WireNodeRemoveExtendedAttributeRequest<'static>;
6228}
6229
6230unsafe impl<___E> ::fidl_next::Encode<___E> for NodeRemoveExtendedAttributeRequest
6231where
6232 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6233 ___E: ::fidl_next::Encoder,
6234{
6235 #[inline]
6236 fn encode(
6237 self,
6238 encoder_: &mut ___E,
6239 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6240 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6241 ::fidl_next::munge! {
6242 let Self::Encoded {
6243 name,
6244
6245 } = out_;
6246 }
6247
6248 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
6249
6250 Ok(())
6251 }
6252}
6253
6254unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeRemoveExtendedAttributeRequest
6255where
6256 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6257 ___E: ::fidl_next::Encoder,
6258{
6259 #[inline]
6260 fn encode_ref(
6261 &self,
6262 encoder_: &mut ___E,
6263 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6264 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6265 ::fidl_next::munge! {
6266 let Self::Encoded {
6267
6268 name,
6269
6270 } = out_;
6271 }
6272
6273 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
6274
6275 Ok(())
6276 }
6277}
6278
6279impl ::fidl_next::EncodableOption for NodeRemoveExtendedAttributeRequest {
6280 type EncodedOption =
6281 ::fidl_next::WireBox<'static, WireNodeRemoveExtendedAttributeRequest<'static>>;
6282}
6283
6284unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeRemoveExtendedAttributeRequest
6285where
6286 ___E: ::fidl_next::Encoder + ?Sized,
6287 NodeRemoveExtendedAttributeRequest: ::fidl_next::Encode<___E>,
6288{
6289 #[inline]
6290 fn encode_option(
6291 this: ::core::option::Option<Self>,
6292 encoder: &mut ___E,
6293 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6294 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6295 if let Some(inner) = this {
6296 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6297 ::fidl_next::WireBox::encode_present(out);
6298 } else {
6299 ::fidl_next::WireBox::encode_absent(out);
6300 }
6301
6302 Ok(())
6303 }
6304}
6305
6306unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeRemoveExtendedAttributeRequest
6307where
6308 ___E: ::fidl_next::Encoder + ?Sized,
6309 NodeRemoveExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
6310{
6311 #[inline]
6312 fn encode_option_ref(
6313 this: ::core::option::Option<&Self>,
6314 encoder: &mut ___E,
6315 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6316 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6317 if let Some(inner) = this {
6318 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6319 ::fidl_next::WireBox::encode_present(out);
6320 } else {
6321 ::fidl_next::WireBox::encode_absent(out);
6322 }
6323
6324 Ok(())
6325 }
6326}
6327
6328impl<'de> ::fidl_next::FromWire<WireNodeRemoveExtendedAttributeRequest<'de>>
6329 for NodeRemoveExtendedAttributeRequest
6330{
6331 #[inline]
6332 fn from_wire(wire: WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
6333 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
6334 }
6335}
6336
6337impl<'de> ::fidl_next::IntoNatural for WireNodeRemoveExtendedAttributeRequest<'de> {
6338 type Natural = NodeRemoveExtendedAttributeRequest;
6339}
6340
6341impl<'de> ::fidl_next::FromWireRef<WireNodeRemoveExtendedAttributeRequest<'de>>
6342 for NodeRemoveExtendedAttributeRequest
6343{
6344 #[inline]
6345 fn from_wire_ref(wire: &WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
6346 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
6347 }
6348}
6349
6350#[derive(Debug)]
6352#[repr(C)]
6353pub struct WireNodeRemoveExtendedAttributeRequest<'de> {
6354 pub name: ::fidl_next::WireVector<'de, u8>,
6355}
6356static_assertions::const_assert_eq!(
6357 std::mem::size_of::<WireNodeRemoveExtendedAttributeRequest<'_>>(),
6358 16
6359);
6360static_assertions::const_assert_eq!(
6361 std::mem::align_of::<WireNodeRemoveExtendedAttributeRequest<'_>>(),
6362 8
6363);
6364
6365static_assertions::const_assert_eq!(
6366 std::mem::offset_of!(WireNodeRemoveExtendedAttributeRequest<'_>, name),
6367 0
6368);
6369
6370unsafe impl ::fidl_next::Wire for WireNodeRemoveExtendedAttributeRequest<'static> {
6371 type Decoded<'de> = WireNodeRemoveExtendedAttributeRequest<'de>;
6372
6373 #[inline]
6374 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6375 ::fidl_next::munge! {
6376 let Self {
6377
6378 name,
6379
6380 } = &mut *out_;
6381 }
6382
6383 ::fidl_next::Wire::zero_padding(name);
6384 }
6385}
6386
6387unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeRemoveExtendedAttributeRequest<'static>
6388where
6389 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6390 ___D: ::fidl_next::Decoder,
6391{
6392 fn decode(
6393 slot_: ::fidl_next::Slot<'_, Self>,
6394 decoder_: &mut ___D,
6395 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6396 ::fidl_next::munge! {
6397 let Self {
6398
6399 mut name,
6400
6401 } = slot_;
6402 }
6403
6404 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
6405
6406 let name = unsafe { name.deref_unchecked() };
6407
6408 if name.len() > 255 {
6409 return Err(::fidl_next::DecodeError::VectorTooLong {
6410 size: name.len() as u64,
6411 limit: 255,
6412 });
6413 }
6414
6415 Ok(())
6416 }
6417}
6418
6419pub type NodeRemoveExtendedAttributeResponse = ();
6420
6421pub type WireNodeRemoveExtendedAttributeResponse = ();
6423
6424pub type DirectoryCreateSymlinkResponse = ();
6425
6426pub type WireDirectoryCreateSymlinkResponse = ();
6428
6429pub type NodeSetFlagsResponse = ();
6430
6431pub type WireNodeSetFlagsResponse = ();
6433
6434#[derive(PartialEq, Clone, Debug)]
6435pub struct NodeDeprecatedGetAttrResponse {
6436 pub s: i32,
6437
6438 pub attributes: crate::NodeAttributes,
6439}
6440
6441impl ::fidl_next::Encodable for NodeDeprecatedGetAttrResponse {
6442 type Encoded = WireNodeDeprecatedGetAttrResponse;
6443}
6444
6445unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetAttrResponse
6446where
6447 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6448{
6449 #[inline]
6450 fn encode(
6451 self,
6452 encoder_: &mut ___E,
6453 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6454 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6455 ::fidl_next::munge! {
6456 let Self::Encoded {
6457 s,
6458 attributes,
6459
6460 } = out_;
6461 }
6462
6463 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
6464
6465 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
6466
6467 Ok(())
6468 }
6469}
6470
6471unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetAttrResponse
6472where
6473 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6474{
6475 #[inline]
6476 fn encode_ref(
6477 &self,
6478 encoder_: &mut ___E,
6479 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6480 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6481 ::fidl_next::munge! {
6482 let Self::Encoded {
6483
6484 s,
6485 attributes,
6486
6487 } = out_;
6488 }
6489
6490 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
6491
6492 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder_, attributes)?;
6493
6494 Ok(())
6495 }
6496}
6497
6498impl ::fidl_next::EncodableOption for NodeDeprecatedGetAttrResponse {
6499 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetAttrResponse>;
6500}
6501
6502unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetAttrResponse
6503where
6504 ___E: ::fidl_next::Encoder + ?Sized,
6505 NodeDeprecatedGetAttrResponse: ::fidl_next::Encode<___E>,
6506{
6507 #[inline]
6508 fn encode_option(
6509 this: ::core::option::Option<Self>,
6510 encoder: &mut ___E,
6511 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6512 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6513 if let Some(inner) = this {
6514 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6515 ::fidl_next::WireBox::encode_present(out);
6516 } else {
6517 ::fidl_next::WireBox::encode_absent(out);
6518 }
6519
6520 Ok(())
6521 }
6522}
6523
6524unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetAttrResponse
6525where
6526 ___E: ::fidl_next::Encoder + ?Sized,
6527 NodeDeprecatedGetAttrResponse: ::fidl_next::EncodeRef<___E>,
6528{
6529 #[inline]
6530 fn encode_option_ref(
6531 this: ::core::option::Option<&Self>,
6532 encoder: &mut ___E,
6533 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6534 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6535 if let Some(inner) = this {
6536 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6537 ::fidl_next::WireBox::encode_present(out);
6538 } else {
6539 ::fidl_next::WireBox::encode_absent(out);
6540 }
6541
6542 Ok(())
6543 }
6544}
6545
6546impl ::fidl_next::FromWire<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
6547 #[inline]
6548 fn from_wire(wire: WireNodeDeprecatedGetAttrResponse) -> Self {
6549 Self {
6550 s: ::fidl_next::FromWire::from_wire(wire.s),
6551
6552 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
6553 }
6554 }
6555}
6556
6557impl ::fidl_next::IntoNatural for WireNodeDeprecatedGetAttrResponse {
6558 type Natural = NodeDeprecatedGetAttrResponse;
6559}
6560
6561impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
6562 #[inline]
6563 fn from_wire_ref(wire: &WireNodeDeprecatedGetAttrResponse) -> Self {
6564 Self {
6565 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
6566
6567 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
6568 }
6569 }
6570}
6571
6572#[derive(Clone, Debug)]
6574#[repr(C)]
6575pub struct WireNodeDeprecatedGetAttrResponse {
6576 pub s: ::fidl_next::WireI32,
6577
6578 pub attributes: crate::WireNodeAttributes,
6579}
6580static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedGetAttrResponse>(), 64);
6581static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedGetAttrResponse>(), 8);
6582
6583static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeDeprecatedGetAttrResponse, s), 0);
6584
6585static_assertions::const_assert_eq!(
6586 std::mem::offset_of!(WireNodeDeprecatedGetAttrResponse, attributes),
6587 8
6588);
6589
6590unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetAttrResponse {
6591 type Decoded<'de> = WireNodeDeprecatedGetAttrResponse;
6592
6593 #[inline]
6594 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6595 ::fidl_next::munge! {
6596 let Self {
6597
6598 s,
6599 attributes,
6600
6601 } = &mut *out_;
6602 }
6603
6604 ::fidl_next::Wire::zero_padding(s);
6605
6606 ::fidl_next::Wire::zero_padding(attributes);
6607
6608 unsafe {
6609 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
6610 }
6611 }
6612}
6613
6614unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetAttrResponse
6615where
6616 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6617{
6618 fn decode(
6619 slot_: ::fidl_next::Slot<'_, Self>,
6620 decoder_: &mut ___D,
6621 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6622 ::fidl_next::munge! {
6623 let Self {
6624
6625 mut s,
6626 mut attributes,
6627
6628 } = slot_;
6629 }
6630
6631 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
6632
6633 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_)?;
6634
6635 Ok(())
6636 }
6637}
6638
6639#[derive(PartialEq, Clone, Debug)]
6640pub struct NodeDeprecatedSetAttrRequest {
6641 pub flags: crate::NodeAttributeFlags,
6642
6643 pub attributes: crate::NodeAttributes,
6644}
6645
6646impl ::fidl_next::Encodable for NodeDeprecatedSetAttrRequest {
6647 type Encoded = WireNodeDeprecatedSetAttrRequest;
6648}
6649
6650unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrRequest
6651where
6652 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6653{
6654 #[inline]
6655 fn encode(
6656 self,
6657 encoder_: &mut ___E,
6658 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6659 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6660 ::fidl_next::munge! {
6661 let Self::Encoded {
6662 flags,
6663 attributes,
6664
6665 } = out_;
6666 }
6667
6668 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
6669
6670 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
6671
6672 Ok(())
6673 }
6674}
6675
6676unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrRequest
6677where
6678 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6679{
6680 #[inline]
6681 fn encode_ref(
6682 &self,
6683 encoder_: &mut ___E,
6684 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6686 ::fidl_next::munge! {
6687 let Self::Encoded {
6688
6689 flags,
6690 attributes,
6691
6692 } = out_;
6693 }
6694
6695 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
6696
6697 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder_, attributes)?;
6698
6699 Ok(())
6700 }
6701}
6702
6703impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrRequest {
6704 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrRequest>;
6705}
6706
6707unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrRequest
6708where
6709 ___E: ::fidl_next::Encoder + ?Sized,
6710 NodeDeprecatedSetAttrRequest: ::fidl_next::Encode<___E>,
6711{
6712 #[inline]
6713 fn encode_option(
6714 this: ::core::option::Option<Self>,
6715 encoder: &mut ___E,
6716 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6717 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6718 if let Some(inner) = this {
6719 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6720 ::fidl_next::WireBox::encode_present(out);
6721 } else {
6722 ::fidl_next::WireBox::encode_absent(out);
6723 }
6724
6725 Ok(())
6726 }
6727}
6728
6729unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrRequest
6730where
6731 ___E: ::fidl_next::Encoder + ?Sized,
6732 NodeDeprecatedSetAttrRequest: ::fidl_next::EncodeRef<___E>,
6733{
6734 #[inline]
6735 fn encode_option_ref(
6736 this: ::core::option::Option<&Self>,
6737 encoder: &mut ___E,
6738 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6739 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6740 if let Some(inner) = this {
6741 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6742 ::fidl_next::WireBox::encode_present(out);
6743 } else {
6744 ::fidl_next::WireBox::encode_absent(out);
6745 }
6746
6747 Ok(())
6748 }
6749}
6750
6751impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6752 #[inline]
6753 fn from_wire(wire: WireNodeDeprecatedSetAttrRequest) -> Self {
6754 Self {
6755 flags: ::fidl_next::FromWire::from_wire(wire.flags),
6756
6757 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
6758 }
6759 }
6760}
6761
6762impl ::fidl_next::IntoNatural for WireNodeDeprecatedSetAttrRequest {
6763 type Natural = NodeDeprecatedSetAttrRequest;
6764}
6765
6766impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6767 #[inline]
6768 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrRequest) -> Self {
6769 Self {
6770 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
6771
6772 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
6773 }
6774 }
6775}
6776
6777#[derive(Clone, Debug)]
6779#[repr(C)]
6780pub struct WireNodeDeprecatedSetAttrRequest {
6781 pub flags: crate::WireNodeAttributeFlags,
6782
6783 pub attributes: crate::WireNodeAttributes,
6784}
6785static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedSetAttrRequest>(), 64);
6786static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedSetAttrRequest>(), 8);
6787
6788static_assertions::const_assert_eq!(
6789 std::mem::offset_of!(WireNodeDeprecatedSetAttrRequest, flags),
6790 0
6791);
6792
6793static_assertions::const_assert_eq!(
6794 std::mem::offset_of!(WireNodeDeprecatedSetAttrRequest, attributes),
6795 8
6796);
6797
6798unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrRequest {
6799 type Decoded<'de> = WireNodeDeprecatedSetAttrRequest;
6800
6801 #[inline]
6802 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6803 ::fidl_next::munge! {
6804 let Self {
6805
6806 flags,
6807 attributes,
6808
6809 } = &mut *out_;
6810 }
6811
6812 ::fidl_next::Wire::zero_padding(flags);
6813
6814 ::fidl_next::Wire::zero_padding(attributes);
6815
6816 unsafe {
6817 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
6818 }
6819 }
6820}
6821
6822unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrRequest
6823where
6824 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6825{
6826 fn decode(
6827 slot_: ::fidl_next::Slot<'_, Self>,
6828 decoder_: &mut ___D,
6829 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6830 ::fidl_next::munge! {
6831 let Self {
6832
6833 mut flags,
6834 mut attributes,
6835
6836 } = slot_;
6837 }
6838
6839 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
6840
6841 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_)?;
6842
6843 Ok(())
6844 }
6845}
6846
6847#[derive(PartialEq, Clone, Debug)]
6848#[repr(C)]
6849pub struct NodeDeprecatedSetAttrResponse {
6850 pub s: i32,
6851}
6852
6853impl ::fidl_next::Encodable for NodeDeprecatedSetAttrResponse {
6854 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6855 Self,
6856 WireNodeDeprecatedSetAttrResponse,
6857 > = unsafe {
6858 ::fidl_next::CopyOptimization::enable_if(
6859 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6860 )
6861 };
6862
6863 type Encoded = WireNodeDeprecatedSetAttrResponse;
6864}
6865
6866unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrResponse
6867where
6868 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6869{
6870 #[inline]
6871 fn encode(
6872 self,
6873 encoder_: &mut ___E,
6874 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6875 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6876 ::fidl_next::munge! {
6877 let Self::Encoded {
6878 s,
6879
6880 } = out_;
6881 }
6882
6883 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
6884
6885 Ok(())
6886 }
6887}
6888
6889unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrResponse
6890where
6891 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6892{
6893 #[inline]
6894 fn encode_ref(
6895 &self,
6896 encoder_: &mut ___E,
6897 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6898 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6899 ::fidl_next::munge! {
6900 let Self::Encoded {
6901
6902 s,
6903
6904 } = out_;
6905 }
6906
6907 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
6908
6909 Ok(())
6910 }
6911}
6912
6913impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrResponse {
6914 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrResponse>;
6915}
6916
6917unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrResponse
6918where
6919 ___E: ::fidl_next::Encoder + ?Sized,
6920 NodeDeprecatedSetAttrResponse: ::fidl_next::Encode<___E>,
6921{
6922 #[inline]
6923 fn encode_option(
6924 this: ::core::option::Option<Self>,
6925 encoder: &mut ___E,
6926 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6927 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6928 if let Some(inner) = this {
6929 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6930 ::fidl_next::WireBox::encode_present(out);
6931 } else {
6932 ::fidl_next::WireBox::encode_absent(out);
6933 }
6934
6935 Ok(())
6936 }
6937}
6938
6939unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrResponse
6940where
6941 ___E: ::fidl_next::Encoder + ?Sized,
6942 NodeDeprecatedSetAttrResponse: ::fidl_next::EncodeRef<___E>,
6943{
6944 #[inline]
6945 fn encode_option_ref(
6946 this: ::core::option::Option<&Self>,
6947 encoder: &mut ___E,
6948 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6949 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6950 if let Some(inner) = this {
6951 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6952 ::fidl_next::WireBox::encode_present(out);
6953 } else {
6954 ::fidl_next::WireBox::encode_absent(out);
6955 }
6956
6957 Ok(())
6958 }
6959}
6960
6961impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6962 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6963 WireNodeDeprecatedSetAttrResponse,
6964 Self,
6965 > = unsafe {
6966 ::fidl_next::CopyOptimization::enable_if(
6967 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
6968 .is_enabled(),
6969 )
6970 };
6971
6972 #[inline]
6973 fn from_wire(wire: WireNodeDeprecatedSetAttrResponse) -> Self {
6974 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
6975 }
6976}
6977
6978impl ::fidl_next::IntoNatural for WireNodeDeprecatedSetAttrResponse {
6979 type Natural = NodeDeprecatedSetAttrResponse;
6980}
6981
6982impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6983 #[inline]
6984 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrResponse) -> Self {
6985 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
6986 }
6987}
6988
6989#[derive(Clone, Debug)]
6991#[repr(C)]
6992pub struct WireNodeDeprecatedSetAttrResponse {
6993 pub s: ::fidl_next::WireI32,
6994}
6995static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedSetAttrResponse>(), 4);
6996static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedSetAttrResponse>(), 4);
6997
6998static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeDeprecatedSetAttrResponse, s), 0);
6999
7000unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrResponse {
7001 type Decoded<'de> = WireNodeDeprecatedSetAttrResponse;
7002
7003 #[inline]
7004 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7005 ::fidl_next::munge! {
7006 let Self {
7007
7008 s,
7009
7010 } = &mut *out_;
7011 }
7012
7013 ::fidl_next::Wire::zero_padding(s);
7014 }
7015}
7016
7017unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrResponse
7018where
7019 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7020{
7021 fn decode(
7022 slot_: ::fidl_next::Slot<'_, Self>,
7023 decoder_: &mut ___D,
7024 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7025 ::fidl_next::munge! {
7026 let Self {
7027
7028 mut s,
7029
7030 } = slot_;
7031 }
7032
7033 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
7034
7035 Ok(())
7036 }
7037}
7038
7039#[derive(PartialEq, Clone, Debug)]
7040#[repr(C)]
7041pub struct NodeDeprecatedGetFlagsResponse {
7042 pub s: i32,
7043
7044 pub flags: crate::OpenFlags,
7045}
7046
7047impl ::fidl_next::Encodable for NodeDeprecatedGetFlagsResponse {
7048 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7049 Self,
7050 WireNodeDeprecatedGetFlagsResponse,
7051 > = unsafe {
7052 ::fidl_next::CopyOptimization::enable_if(
7053 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
7054 && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7055 )
7056 };
7057
7058 type Encoded = WireNodeDeprecatedGetFlagsResponse;
7059}
7060
7061unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetFlagsResponse
7062where
7063 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7064{
7065 #[inline]
7066 fn encode(
7067 self,
7068 encoder_: &mut ___E,
7069 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7070 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7071 ::fidl_next::munge! {
7072 let Self::Encoded {
7073 s,
7074 flags,
7075
7076 } = out_;
7077 }
7078
7079 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
7080
7081 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
7082
7083 Ok(())
7084 }
7085}
7086
7087unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetFlagsResponse
7088where
7089 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7090{
7091 #[inline]
7092 fn encode_ref(
7093 &self,
7094 encoder_: &mut ___E,
7095 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7096 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7097 ::fidl_next::munge! {
7098 let Self::Encoded {
7099
7100 s,
7101 flags,
7102
7103 } = out_;
7104 }
7105
7106 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
7107
7108 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
7109
7110 Ok(())
7111 }
7112}
7113
7114impl ::fidl_next::EncodableOption for NodeDeprecatedGetFlagsResponse {
7115 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetFlagsResponse>;
7116}
7117
7118unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetFlagsResponse
7119where
7120 ___E: ::fidl_next::Encoder + ?Sized,
7121 NodeDeprecatedGetFlagsResponse: ::fidl_next::Encode<___E>,
7122{
7123 #[inline]
7124 fn encode_option(
7125 this: ::core::option::Option<Self>,
7126 encoder: &mut ___E,
7127 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7128 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7129 if let Some(inner) = this {
7130 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7131 ::fidl_next::WireBox::encode_present(out);
7132 } else {
7133 ::fidl_next::WireBox::encode_absent(out);
7134 }
7135
7136 Ok(())
7137 }
7138}
7139
7140unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetFlagsResponse
7141where
7142 ___E: ::fidl_next::Encoder + ?Sized,
7143 NodeDeprecatedGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
7144{
7145 #[inline]
7146 fn encode_option_ref(
7147 this: ::core::option::Option<&Self>,
7148 encoder: &mut ___E,
7149 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7150 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7151 if let Some(inner) = this {
7152 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7153 ::fidl_next::WireBox::encode_present(out);
7154 } else {
7155 ::fidl_next::WireBox::encode_absent(out);
7156 }
7157
7158 Ok(())
7159 }
7160}
7161
7162impl ::fidl_next::FromWire<WireNodeDeprecatedGetFlagsResponse> for NodeDeprecatedGetFlagsResponse {
7163 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7164 WireNodeDeprecatedGetFlagsResponse,
7165 Self,
7166 > = unsafe {
7167 ::fidl_next::CopyOptimization::enable_if(
7168 true
7169
7170 && <
7171 i32 as ::fidl_next::FromWire<::fidl_next::WireI32>
7172 >::COPY_OPTIMIZATION.is_enabled()
7173
7174 && <
7175 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
7176 >::COPY_OPTIMIZATION.is_enabled()
7177
7178 )
7179 };
7180
7181 #[inline]
7182 fn from_wire(wire: WireNodeDeprecatedGetFlagsResponse) -> Self {
7183 Self {
7184 s: ::fidl_next::FromWire::from_wire(wire.s),
7185
7186 flags: ::fidl_next::FromWire::from_wire(wire.flags),
7187 }
7188 }
7189}
7190
7191impl ::fidl_next::IntoNatural for WireNodeDeprecatedGetFlagsResponse {
7192 type Natural = NodeDeprecatedGetFlagsResponse;
7193}
7194
7195impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetFlagsResponse>
7196 for NodeDeprecatedGetFlagsResponse
7197{
7198 #[inline]
7199 fn from_wire_ref(wire: &WireNodeDeprecatedGetFlagsResponse) -> Self {
7200 Self {
7201 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
7202
7203 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
7204 }
7205 }
7206}
7207
7208#[derive(Clone, Debug)]
7210#[repr(C)]
7211pub struct WireNodeDeprecatedGetFlagsResponse {
7212 pub s: ::fidl_next::WireI32,
7213
7214 pub flags: crate::WireOpenFlags,
7215}
7216static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedGetFlagsResponse>(), 8);
7217static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedGetFlagsResponse>(), 4);
7218
7219static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeDeprecatedGetFlagsResponse, s), 0);
7220
7221static_assertions::const_assert_eq!(
7222 std::mem::offset_of!(WireNodeDeprecatedGetFlagsResponse, flags),
7223 4
7224);
7225
7226unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetFlagsResponse {
7227 type Decoded<'de> = WireNodeDeprecatedGetFlagsResponse;
7228
7229 #[inline]
7230 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7231 ::fidl_next::munge! {
7232 let Self {
7233
7234 s,
7235 flags,
7236
7237 } = &mut *out_;
7238 }
7239
7240 ::fidl_next::Wire::zero_padding(s);
7241
7242 ::fidl_next::Wire::zero_padding(flags);
7243 }
7244}
7245
7246unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetFlagsResponse
7247where
7248 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7249{
7250 fn decode(
7251 slot_: ::fidl_next::Slot<'_, Self>,
7252 decoder_: &mut ___D,
7253 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7254 ::fidl_next::munge! {
7255 let Self {
7256
7257 mut s,
7258 mut flags,
7259
7260 } = slot_;
7261 }
7262
7263 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
7264
7265 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
7266
7267 Ok(())
7268 }
7269}
7270
7271#[derive(PartialEq, Clone, Debug)]
7272#[repr(C)]
7273pub struct NodeDeprecatedSetFlagsRequest {
7274 pub flags: crate::OpenFlags,
7275}
7276
7277impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsRequest {
7278 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7279 Self,
7280 WireNodeDeprecatedSetFlagsRequest,
7281 > = unsafe {
7282 ::fidl_next::CopyOptimization::enable_if(
7283 true && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7284 )
7285 };
7286
7287 type Encoded = WireNodeDeprecatedSetFlagsRequest;
7288}
7289
7290unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsRequest
7291where
7292 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7293{
7294 #[inline]
7295 fn encode(
7296 self,
7297 encoder_: &mut ___E,
7298 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7299 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7300 ::fidl_next::munge! {
7301 let Self::Encoded {
7302 flags,
7303
7304 } = out_;
7305 }
7306
7307 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
7308
7309 Ok(())
7310 }
7311}
7312
7313unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsRequest
7314where
7315 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7316{
7317 #[inline]
7318 fn encode_ref(
7319 &self,
7320 encoder_: &mut ___E,
7321 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7323 ::fidl_next::munge! {
7324 let Self::Encoded {
7325
7326 flags,
7327
7328 } = out_;
7329 }
7330
7331 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
7332
7333 Ok(())
7334 }
7335}
7336
7337impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsRequest {
7338 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsRequest>;
7339}
7340
7341unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsRequest
7342where
7343 ___E: ::fidl_next::Encoder + ?Sized,
7344 NodeDeprecatedSetFlagsRequest: ::fidl_next::Encode<___E>,
7345{
7346 #[inline]
7347 fn encode_option(
7348 this: ::core::option::Option<Self>,
7349 encoder: &mut ___E,
7350 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7352 if let Some(inner) = this {
7353 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7354 ::fidl_next::WireBox::encode_present(out);
7355 } else {
7356 ::fidl_next::WireBox::encode_absent(out);
7357 }
7358
7359 Ok(())
7360 }
7361}
7362
7363unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsRequest
7364where
7365 ___E: ::fidl_next::Encoder + ?Sized,
7366 NodeDeprecatedSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
7367{
7368 #[inline]
7369 fn encode_option_ref(
7370 this: ::core::option::Option<&Self>,
7371 encoder: &mut ___E,
7372 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7373 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7374 if let Some(inner) = this {
7375 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7376 ::fidl_next::WireBox::encode_present(out);
7377 } else {
7378 ::fidl_next::WireBox::encode_absent(out);
7379 }
7380
7381 Ok(())
7382 }
7383}
7384
7385impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
7386 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7387 WireNodeDeprecatedSetFlagsRequest,
7388 Self,
7389 > = unsafe {
7390 ::fidl_next::CopyOptimization::enable_if(
7391 true
7392
7393 && <
7394 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
7395 >::COPY_OPTIMIZATION.is_enabled()
7396
7397 )
7398 };
7399
7400 #[inline]
7401 fn from_wire(wire: WireNodeDeprecatedSetFlagsRequest) -> Self {
7402 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7403 }
7404}
7405
7406impl ::fidl_next::IntoNatural for WireNodeDeprecatedSetFlagsRequest {
7407 type Natural = NodeDeprecatedSetFlagsRequest;
7408}
7409
7410impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
7411 #[inline]
7412 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsRequest) -> Self {
7413 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7414 }
7415}
7416
7417#[derive(Clone, Debug)]
7419#[repr(C)]
7420pub struct WireNodeDeprecatedSetFlagsRequest {
7421 pub flags: crate::WireOpenFlags,
7422}
7423static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedSetFlagsRequest>(), 4);
7424static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedSetFlagsRequest>(), 4);
7425
7426static_assertions::const_assert_eq!(
7427 std::mem::offset_of!(WireNodeDeprecatedSetFlagsRequest, flags),
7428 0
7429);
7430
7431unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsRequest {
7432 type Decoded<'de> = WireNodeDeprecatedSetFlagsRequest;
7433
7434 #[inline]
7435 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7436 ::fidl_next::munge! {
7437 let Self {
7438
7439 flags,
7440
7441 } = &mut *out_;
7442 }
7443
7444 ::fidl_next::Wire::zero_padding(flags);
7445 }
7446}
7447
7448unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsRequest
7449where
7450 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7451{
7452 fn decode(
7453 slot_: ::fidl_next::Slot<'_, Self>,
7454 decoder_: &mut ___D,
7455 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7456 ::fidl_next::munge! {
7457 let Self {
7458
7459 mut flags,
7460
7461 } = slot_;
7462 }
7463
7464 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
7465
7466 Ok(())
7467 }
7468}
7469
7470#[derive(PartialEq, Clone, Debug)]
7471#[repr(C)]
7472pub struct NodeDeprecatedSetFlagsResponse {
7473 pub s: i32,
7474}
7475
7476impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsResponse {
7477 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7478 Self,
7479 WireNodeDeprecatedSetFlagsResponse,
7480 > = unsafe {
7481 ::fidl_next::CopyOptimization::enable_if(
7482 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7483 )
7484 };
7485
7486 type Encoded = WireNodeDeprecatedSetFlagsResponse;
7487}
7488
7489unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsResponse
7490where
7491 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7492{
7493 #[inline]
7494 fn encode(
7495 self,
7496 encoder_: &mut ___E,
7497 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7498 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7499 ::fidl_next::munge! {
7500 let Self::Encoded {
7501 s,
7502
7503 } = out_;
7504 }
7505
7506 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
7507
7508 Ok(())
7509 }
7510}
7511
7512unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsResponse
7513where
7514 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7515{
7516 #[inline]
7517 fn encode_ref(
7518 &self,
7519 encoder_: &mut ___E,
7520 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7521 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7522 ::fidl_next::munge! {
7523 let Self::Encoded {
7524
7525 s,
7526
7527 } = out_;
7528 }
7529
7530 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder_, s)?;
7531
7532 Ok(())
7533 }
7534}
7535
7536impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsResponse {
7537 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsResponse>;
7538}
7539
7540unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsResponse
7541where
7542 ___E: ::fidl_next::Encoder + ?Sized,
7543 NodeDeprecatedSetFlagsResponse: ::fidl_next::Encode<___E>,
7544{
7545 #[inline]
7546 fn encode_option(
7547 this: ::core::option::Option<Self>,
7548 encoder: &mut ___E,
7549 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7551 if let Some(inner) = this {
7552 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7553 ::fidl_next::WireBox::encode_present(out);
7554 } else {
7555 ::fidl_next::WireBox::encode_absent(out);
7556 }
7557
7558 Ok(())
7559 }
7560}
7561
7562unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsResponse
7563where
7564 ___E: ::fidl_next::Encoder + ?Sized,
7565 NodeDeprecatedSetFlagsResponse: ::fidl_next::EncodeRef<___E>,
7566{
7567 #[inline]
7568 fn encode_option_ref(
7569 this: ::core::option::Option<&Self>,
7570 encoder: &mut ___E,
7571 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7572 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7573 if let Some(inner) = this {
7574 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7575 ::fidl_next::WireBox::encode_present(out);
7576 } else {
7577 ::fidl_next::WireBox::encode_absent(out);
7578 }
7579
7580 Ok(())
7581 }
7582}
7583
7584impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsResponse> for NodeDeprecatedSetFlagsResponse {
7585 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7586 WireNodeDeprecatedSetFlagsResponse,
7587 Self,
7588 > = unsafe {
7589 ::fidl_next::CopyOptimization::enable_if(
7590 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
7591 .is_enabled(),
7592 )
7593 };
7594
7595 #[inline]
7596 fn from_wire(wire: WireNodeDeprecatedSetFlagsResponse) -> Self {
7597 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
7598 }
7599}
7600
7601impl ::fidl_next::IntoNatural for WireNodeDeprecatedSetFlagsResponse {
7602 type Natural = NodeDeprecatedSetFlagsResponse;
7603}
7604
7605impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsResponse>
7606 for NodeDeprecatedSetFlagsResponse
7607{
7608 #[inline]
7609 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsResponse) -> Self {
7610 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
7611 }
7612}
7613
7614#[derive(Clone, Debug)]
7616#[repr(C)]
7617pub struct WireNodeDeprecatedSetFlagsResponse {
7618 pub s: ::fidl_next::WireI32,
7619}
7620static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedSetFlagsResponse>(), 4);
7621static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedSetFlagsResponse>(), 4);
7622
7623static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeDeprecatedSetFlagsResponse, s), 0);
7624
7625unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsResponse {
7626 type Decoded<'de> = WireNodeDeprecatedSetFlagsResponse;
7627
7628 #[inline]
7629 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7630 ::fidl_next::munge! {
7631 let Self {
7632
7633 s,
7634
7635 } = &mut *out_;
7636 }
7637
7638 ::fidl_next::Wire::zero_padding(s);
7639 }
7640}
7641
7642unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsResponse
7643where
7644 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7645{
7646 fn decode(
7647 slot_: ::fidl_next::Slot<'_, Self>,
7648 decoder_: &mut ___D,
7649 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7650 ::fidl_next::munge! {
7651 let Self {
7652
7653 mut s,
7654
7655 } = slot_;
7656 }
7657
7658 ::fidl_next::Decode::decode(s.as_mut(), decoder_)?;
7659
7660 Ok(())
7661 }
7662}
7663
7664::fidl_next::bitflags::bitflags! {
7665 #[doc = " Flags used to specify how a node should be opened. Note that ranges of bits are reserved\n for specific use cases:\n * Bits 1-16: Permission flags `PERM_*` (e.g. [`Flags.PERM_READ_BYTES`]).\n * Bits 17-32: POSIX compatibile `O_*` flags (e.g. [`Flags.FILE_TRUNCATE`] or `O_TRUNC`).\n * Bits 33-64: Fuchsia-specific flags.\n"]#[derive(
7666 Clone,
7667 Copy,
7668 Debug,
7669 PartialEq,
7670 Eq,
7671 Hash,
7672 )]
7673 pub struct Flags: u64 {
7674 #[doc = " Allows opening child nodes with [`PROTOCOL_SERVICE`].\n"]const PERM_CONNECT = 1;
7675 #[doc = " Read byte contents of a file.\n"]const PERM_READ_BYTES = 2;
7676 #[doc = " Write byte contents to a file.\n"]const PERM_WRITE_BYTES = 4;
7677 #[doc = " Execute byte contents of a file.\n"]const PERM_EXECUTE = 8;
7678 #[doc = " Get/query attributes of a node.\n"]const PERM_GET_ATTRIBUTES = 16;
7679 #[doc = " Set/update attributes of a node.\n"]const PERM_UPDATE_ATTRIBUTES = 32;
7680 #[doc = " Enumerate (list) directory entries.\n"]const PERM_ENUMERATE = 64;
7681 #[doc = " Allow opening a child node with a node protocol. Must be specified with PERM_ENUMERATE\n otherwise requests will fail with `ZX_ERR_INVALID_ARGS`.\n"]const PERM_TRAVERSE = 128;
7682 #[doc = " Modify directory entries (create/rename/link/unlink). Must be specified with\n PERM_ENUMERATE otherwise requests will fail with `ZX_ERR_INVALID_ARGS`.\n"]const PERM_MODIFY_DIRECTORY = 256;
7683 #[doc = " Inherit write permissions when available (PERM_WRITE_BYTES, PERM_UPDATE_ATTRIBUTES,\n PERM_MODIFY_DIRECTORY, /// PERM_ENUMERATE). Servers must ensure this flag is removed\n if the parent connection lacks any of these rights. See [`INHERITED_WRITE_PERMISSIONS`]\n for the exact set of permissions that will be inherited.\n"]const PERM_INHERIT_WRITE = 8192;
7684 #[doc = " Inherit execute permission when available (PERM_EXECUTE).\n Servers must ensure this flag is removed if the parent connection lacks PERM_EXECUTE.\n"]const PERM_INHERIT_EXECUTE = 16384;
7685 #[doc = " Connect to the underlying protocol if this is a service node. The caller must determine the\n correct protocol to use (e.g. based on path). Unless used with [`PROTOCOL_NODE`], specifying\n other flags with the request will fail with `ZX_ERR_INVALID_ARGS`.\n"]const PROTOCOL_SERVICE = 4294967296;
7686 #[doc = " Connect to the underlying node. Takes precedence over other protocols. If other `PROTOCOL_*`\n are specified, they will be used to validate the target node type. Requests will fail with\n `ZX_ERR_INVALID_ARGS` if flags other than `PROTOCOL_*` and [`FLAG_SEND_REPRESENTATION`] are\n specified. Equivalent to POSIX `O_PATH`.\n"]const PROTOCOL_NODE = 4194304;
7687 #[doc = " Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.\n"]const PROTOCOL_DIRECTORY = 524288;
7688 #[doc = " Caller accepts [`fuchsia.io/File`] protocol.\n"]const PROTOCOL_FILE = 8589934592;
7689 #[doc = " Caller accepts [`fuchsia.io/Symlink`] protocol.\n"]const PROTOCOL_SYMLINK = 17179869184;
7690 #[doc = " Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.\n"]const FLAG_SEND_REPRESENTATION = 1099511627776;
7691 #[doc = " Create a new object if one doesn\'t exist, otherwise open an existing object. If set, a\n single `PROTOCOL_*` flag must be set indicating the type of object to create. Equivalent\n to POSIX `O_CREAT`.\n"]const FLAG_MAYBE_CREATE = 65536;
7692 #[doc = " Create a new object if one doesn\'t exist, otherwise fail the request with\n `ZX_ERR_ALREADY_EXISTS`. If set, a single `PROTOCOL_*` flag must be set indicating the type\n of object to create. Takes precedence over [`FLAG_MAYBE_CREATE`]. Equivalent to POSIX\n `O_EXCL`.\n"]const FLAG_MUST_CREATE = 131072;
7693 #[doc = " Create a new unnamed temporary object. The object is temporary until it is linked to the\n filesystem. If specified with `FLAG_TEMPORARY_AS_NOT_LINKABLE`, then the created object is\n not linkable. If this flag is set:\n * `path` specified in [`fuchsia.io/Directory.Open`] refers to the path of the directory\n which the new object will be created in,\n * A `PROTOCOL_*` flag is set to indicate the type of object to be created. Currently, this\n is only supported when specified with `PROTOCOL_FILE`, in which case, it is equivalent\n to Linux `O_TMPFILE`.\n * `FLAG_MAYBE_CREATE` will be ignored.\n"]const FLAG_CREATE_AS_UNNAMED_TEMPORARY = 34359738368;
7694 #[doc = " Open the file in append mode. The seek pointer will be moved to end-of-file (EOF)\n before all writes. Equivalent to POSIX `O_APPEND`.\n"]const FILE_APPEND = 1048576;
7695 #[doc = " Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.\n"]const FILE_TRUNCATE = 262144;
7696 const _ = !0;
7697 }
7698}
7699
7700impl ::fidl_next::Encodable for Flags {
7701 type Encoded = WireFlags;
7702}
7703
7704unsafe impl<___E> ::fidl_next::Encode<___E> for Flags
7705where
7706 ___E: ?Sized,
7707{
7708 #[inline]
7709 fn encode(
7710 self,
7711 encoder: &mut ___E,
7712 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7713 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7714 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
7715 }
7716}
7717
7718unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Flags
7719where
7720 ___E: ?Sized,
7721{
7722 #[inline]
7723 fn encode_ref(
7724 &self,
7725 _: &mut ___E,
7726 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7727 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7728 ::fidl_next::munge!(let WireFlags { value } = out);
7729
7730 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
7731 Ok(())
7732 }
7733}
7734
7735impl ::core::convert::From<WireFlags> for Flags {
7736 fn from(wire: WireFlags) -> Self {
7737 Self::from_bits_retain(u64::from(wire.value))
7738 }
7739}
7740
7741impl ::fidl_next::FromWire<WireFlags> for Flags {
7742 #[inline]
7743 fn from_wire(wire: WireFlags) -> Self {
7744 Self::from(wire)
7745 }
7746}
7747
7748impl ::fidl_next::IntoNatural for WireFlags {
7749 type Natural = Flags;
7750}
7751
7752impl ::fidl_next::FromWireRef<WireFlags> for Flags {
7753 #[inline]
7754 fn from_wire_ref(wire: &WireFlags) -> Self {
7755 Self::from(*wire)
7756 }
7757}
7758
7759#[derive(Clone, Copy, Debug)]
7761#[repr(transparent)]
7762pub struct WireFlags {
7763 value: ::fidl_next::WireU64,
7764}
7765
7766unsafe impl ::fidl_next::Wire for WireFlags {
7767 type Decoded<'de> = Self;
7768
7769 #[inline]
7770 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7771 }
7773}
7774
7775unsafe impl<___D> ::fidl_next::Decode<___D> for WireFlags
7776where
7777 ___D: ?Sized,
7778{
7779 fn decode(
7780 slot: ::fidl_next::Slot<'_, Self>,
7781 _: &mut ___D,
7782 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7783 Ok(())
7784 }
7785}
7786
7787impl ::core::convert::From<Flags> for WireFlags {
7788 fn from(natural: Flags) -> Self {
7789 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
7790 }
7791}
7792
7793#[derive(PartialEq, Clone, Debug)]
7794#[repr(C)]
7795pub struct NodeGetFlagsResponse {
7796 pub flags: crate::Flags,
7797}
7798
7799impl ::fidl_next::Encodable for NodeGetFlagsResponse {
7800 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetFlagsResponse> = unsafe {
7801 ::fidl_next::CopyOptimization::enable_if(
7802 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7803 )
7804 };
7805
7806 type Encoded = WireNodeGetFlagsResponse;
7807}
7808
7809unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetFlagsResponse
7810where
7811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7812{
7813 #[inline]
7814 fn encode(
7815 self,
7816 encoder_: &mut ___E,
7817 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7819 ::fidl_next::munge! {
7820 let Self::Encoded {
7821 flags,
7822
7823 } = out_;
7824 }
7825
7826 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
7827
7828 Ok(())
7829 }
7830}
7831
7832unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetFlagsResponse
7833where
7834 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7835{
7836 #[inline]
7837 fn encode_ref(
7838 &self,
7839 encoder_: &mut ___E,
7840 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7841 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7842 ::fidl_next::munge! {
7843 let Self::Encoded {
7844
7845 flags,
7846
7847 } = out_;
7848 }
7849
7850 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
7851
7852 Ok(())
7853 }
7854}
7855
7856impl ::fidl_next::EncodableOption for NodeGetFlagsResponse {
7857 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetFlagsResponse>;
7858}
7859
7860unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetFlagsResponse
7861where
7862 ___E: ::fidl_next::Encoder + ?Sized,
7863 NodeGetFlagsResponse: ::fidl_next::Encode<___E>,
7864{
7865 #[inline]
7866 fn encode_option(
7867 this: ::core::option::Option<Self>,
7868 encoder: &mut ___E,
7869 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7871 if let Some(inner) = this {
7872 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7873 ::fidl_next::WireBox::encode_present(out);
7874 } else {
7875 ::fidl_next::WireBox::encode_absent(out);
7876 }
7877
7878 Ok(())
7879 }
7880}
7881
7882unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetFlagsResponse
7883where
7884 ___E: ::fidl_next::Encoder + ?Sized,
7885 NodeGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
7886{
7887 #[inline]
7888 fn encode_option_ref(
7889 this: ::core::option::Option<&Self>,
7890 encoder: &mut ___E,
7891 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7892 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7893 if let Some(inner) = this {
7894 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7895 ::fidl_next::WireBox::encode_present(out);
7896 } else {
7897 ::fidl_next::WireBox::encode_absent(out);
7898 }
7899
7900 Ok(())
7901 }
7902}
7903
7904impl ::fidl_next::FromWire<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7905 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetFlagsResponse, Self> = unsafe {
7906 ::fidl_next::CopyOptimization::enable_if(
7907 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
7908 .is_enabled(),
7909 )
7910 };
7911
7912 #[inline]
7913 fn from_wire(wire: WireNodeGetFlagsResponse) -> Self {
7914 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7915 }
7916}
7917
7918impl ::fidl_next::IntoNatural for WireNodeGetFlagsResponse {
7919 type Natural = NodeGetFlagsResponse;
7920}
7921
7922impl ::fidl_next::FromWireRef<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7923 #[inline]
7924 fn from_wire_ref(wire: &WireNodeGetFlagsResponse) -> Self {
7925 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7926 }
7927}
7928
7929#[derive(Clone, Debug)]
7931#[repr(C)]
7932pub struct WireNodeGetFlagsResponse {
7933 pub flags: crate::WireFlags,
7934}
7935static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeGetFlagsResponse>(), 8);
7936static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeGetFlagsResponse>(), 8);
7937
7938static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeGetFlagsResponse, flags), 0);
7939
7940unsafe impl ::fidl_next::Wire for WireNodeGetFlagsResponse {
7941 type Decoded<'de> = WireNodeGetFlagsResponse;
7942
7943 #[inline]
7944 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
7945 ::fidl_next::munge! {
7946 let Self {
7947
7948 flags,
7949
7950 } = &mut *out_;
7951 }
7952
7953 ::fidl_next::Wire::zero_padding(flags);
7954 }
7955}
7956
7957unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetFlagsResponse
7958where
7959 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7960{
7961 fn decode(
7962 slot_: ::fidl_next::Slot<'_, Self>,
7963 decoder_: &mut ___D,
7964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7965 ::fidl_next::munge! {
7966 let Self {
7967
7968 mut flags,
7969
7970 } = slot_;
7971 }
7972
7973 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
7974
7975 Ok(())
7976 }
7977}
7978
7979#[derive(PartialEq, Clone, Debug)]
7980#[repr(C)]
7981pub struct NodeSetFlagsRequest {
7982 pub flags: crate::Flags,
7983}
7984
7985impl ::fidl_next::Encodable for NodeSetFlagsRequest {
7986 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeSetFlagsRequest> = unsafe {
7987 ::fidl_next::CopyOptimization::enable_if(
7988 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7989 )
7990 };
7991
7992 type Encoded = WireNodeSetFlagsRequest;
7993}
7994
7995unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetFlagsRequest
7996where
7997 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7998{
7999 #[inline]
8000 fn encode(
8001 self,
8002 encoder_: &mut ___E,
8003 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8004 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8005 ::fidl_next::munge! {
8006 let Self::Encoded {
8007 flags,
8008
8009 } = out_;
8010 }
8011
8012 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
8013
8014 Ok(())
8015 }
8016}
8017
8018unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetFlagsRequest
8019where
8020 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8021{
8022 #[inline]
8023 fn encode_ref(
8024 &self,
8025 encoder_: &mut ___E,
8026 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8027 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8028 ::fidl_next::munge! {
8029 let Self::Encoded {
8030
8031 flags,
8032
8033 } = out_;
8034 }
8035
8036 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
8037
8038 Ok(())
8039 }
8040}
8041
8042impl ::fidl_next::EncodableOption for NodeSetFlagsRequest {
8043 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeSetFlagsRequest>;
8044}
8045
8046unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetFlagsRequest
8047where
8048 ___E: ::fidl_next::Encoder + ?Sized,
8049 NodeSetFlagsRequest: ::fidl_next::Encode<___E>,
8050{
8051 #[inline]
8052 fn encode_option(
8053 this: ::core::option::Option<Self>,
8054 encoder: &mut ___E,
8055 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8057 if let Some(inner) = this {
8058 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8059 ::fidl_next::WireBox::encode_present(out);
8060 } else {
8061 ::fidl_next::WireBox::encode_absent(out);
8062 }
8063
8064 Ok(())
8065 }
8066}
8067
8068unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeSetFlagsRequest
8069where
8070 ___E: ::fidl_next::Encoder + ?Sized,
8071 NodeSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
8072{
8073 #[inline]
8074 fn encode_option_ref(
8075 this: ::core::option::Option<&Self>,
8076 encoder: &mut ___E,
8077 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8078 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8079 if let Some(inner) = this {
8080 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8081 ::fidl_next::WireBox::encode_present(out);
8082 } else {
8083 ::fidl_next::WireBox::encode_absent(out);
8084 }
8085
8086 Ok(())
8087 }
8088}
8089
8090impl ::fidl_next::FromWire<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
8091 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeSetFlagsRequest, Self> = unsafe {
8092 ::fidl_next::CopyOptimization::enable_if(
8093 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
8094 .is_enabled(),
8095 )
8096 };
8097
8098 #[inline]
8099 fn from_wire(wire: WireNodeSetFlagsRequest) -> Self {
8100 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
8101 }
8102}
8103
8104impl ::fidl_next::IntoNatural for WireNodeSetFlagsRequest {
8105 type Natural = NodeSetFlagsRequest;
8106}
8107
8108impl ::fidl_next::FromWireRef<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
8109 #[inline]
8110 fn from_wire_ref(wire: &WireNodeSetFlagsRequest) -> Self {
8111 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
8112 }
8113}
8114
8115#[derive(Clone, Debug)]
8117#[repr(C)]
8118pub struct WireNodeSetFlagsRequest {
8119 pub flags: crate::WireFlags,
8120}
8121static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeSetFlagsRequest>(), 8);
8122static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeSetFlagsRequest>(), 8);
8123
8124static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeSetFlagsRequest, flags), 0);
8125
8126unsafe impl ::fidl_next::Wire for WireNodeSetFlagsRequest {
8127 type Decoded<'de> = WireNodeSetFlagsRequest;
8128
8129 #[inline]
8130 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
8131 ::fidl_next::munge! {
8132 let Self {
8133
8134 flags,
8135
8136 } = &mut *out_;
8137 }
8138
8139 ::fidl_next::Wire::zero_padding(flags);
8140 }
8141}
8142
8143unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetFlagsRequest
8144where
8145 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8146{
8147 fn decode(
8148 slot_: ::fidl_next::Slot<'_, Self>,
8149 decoder_: &mut ___D,
8150 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8151 ::fidl_next::munge! {
8152 let Self {
8153
8154 mut flags,
8155
8156 } = slot_;
8157 }
8158
8159 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
8160
8161 Ok(())
8162 }
8163}
8164
8165#[doc = " The maximum size for passing the SELinux context as an attribute.\n"]
8166pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256 as u64;
8167
8168#[doc = " Used in places where empty structs are needed, such as empty union members, to avoid creating\n new struct types.\n"]
8169#[derive(PartialEq, Clone, Debug)]
8170#[repr(C)]
8171pub struct EmptyStruct {}
8172
8173impl ::fidl_next::Encodable for EmptyStruct {
8174 type Encoded = WireEmptyStruct;
8175}
8176
8177unsafe impl<___E> ::fidl_next::Encode<___E> for EmptyStruct
8178where
8179 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8180{
8181 #[inline]
8182 fn encode(
8183 self,
8184 encoder_: &mut ___E,
8185 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8186 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8187 *out_ = ::core::mem::MaybeUninit::zeroed();
8188
8189 Ok(())
8190 }
8191}
8192
8193unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EmptyStruct
8194where
8195 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8196{
8197 #[inline]
8198 fn encode_ref(
8199 &self,
8200 encoder_: &mut ___E,
8201 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8203 ::fidl_next::munge! {
8204 let Self::Encoded {
8205
8206 _empty,
8207
8208
8209 } = out_;
8210 }
8211
8212 Ok(())
8213 }
8214}
8215
8216impl ::fidl_next::EncodableOption for EmptyStruct {
8217 type EncodedOption = ::fidl_next::WireBox<'static, WireEmptyStruct>;
8218}
8219
8220unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EmptyStruct
8221where
8222 ___E: ::fidl_next::Encoder + ?Sized,
8223 EmptyStruct: ::fidl_next::Encode<___E>,
8224{
8225 #[inline]
8226 fn encode_option(
8227 this: ::core::option::Option<Self>,
8228 encoder: &mut ___E,
8229 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8230 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8231 if let Some(inner) = this {
8232 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8233 ::fidl_next::WireBox::encode_present(out);
8234 } else {
8235 ::fidl_next::WireBox::encode_absent(out);
8236 }
8237
8238 Ok(())
8239 }
8240}
8241
8242unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for EmptyStruct
8243where
8244 ___E: ::fidl_next::Encoder + ?Sized,
8245 EmptyStruct: ::fidl_next::EncodeRef<___E>,
8246{
8247 #[inline]
8248 fn encode_option_ref(
8249 this: ::core::option::Option<&Self>,
8250 encoder: &mut ___E,
8251 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8252 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8253 if let Some(inner) = this {
8254 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8255 ::fidl_next::WireBox::encode_present(out);
8256 } else {
8257 ::fidl_next::WireBox::encode_absent(out);
8258 }
8259
8260 Ok(())
8261 }
8262}
8263
8264impl ::fidl_next::FromWire<WireEmptyStruct> for EmptyStruct {
8265 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireEmptyStruct, Self> =
8266 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
8267
8268 #[inline]
8269 fn from_wire(wire: WireEmptyStruct) -> Self {
8270 Self {}
8271 }
8272}
8273
8274impl ::fidl_next::IntoNatural for WireEmptyStruct {
8275 type Natural = EmptyStruct;
8276}
8277
8278impl ::fidl_next::FromWireRef<WireEmptyStruct> for EmptyStruct {
8279 #[inline]
8280 fn from_wire_ref(wire: &WireEmptyStruct) -> Self {
8281 Self {}
8282 }
8283}
8284
8285#[derive(Clone, Debug)]
8287#[repr(C)]
8288pub struct WireEmptyStruct {
8289 _empty: fidl_next::WireEmptyStructPlaceholder,
8290}
8291static_assertions::const_assert_eq!(std::mem::size_of::<WireEmptyStruct>(), 1);
8292static_assertions::const_assert_eq!(std::mem::align_of::<WireEmptyStruct>(), 1);
8293
8294unsafe impl ::fidl_next::Wire for WireEmptyStruct {
8295 type Decoded<'de> = WireEmptyStruct;
8296
8297 #[inline]
8298 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
8299 ::fidl_next::munge! {
8300 let Self {
8301
8302 _empty,
8303
8304
8305 } = &mut *out_;
8306 }
8307 }
8308}
8309
8310unsafe impl<___D> ::fidl_next::Decode<___D> for WireEmptyStruct
8311where
8312 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8313{
8314 fn decode(
8315 slot_: ::fidl_next::Slot<'_, Self>,
8316 decoder_: &mut ___D,
8317 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8318 ::fidl_next::munge! {
8319 let Self {
8320
8321 mut _empty,
8322
8323
8324 } = slot_;
8325 }
8326
8327 if _empty.as_bytes() != &[0u8] {
8328 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
8329 }
8330
8331 Ok(())
8332 }
8333}
8334
8335#[derive(PartialEq, Clone, Debug)]
8336pub enum SelinuxContext {
8337 Data(::std::vec::Vec<u8>),
8338
8339 UseExtendedAttributes(crate::EmptyStruct),
8340
8341 UnknownOrdinal_(u64),
8342}
8343
8344impl ::fidl_next::Encodable for SelinuxContext {
8345 type Encoded = WireSelinuxContext<'static>;
8346}
8347
8348unsafe impl<___E> ::fidl_next::Encode<___E> for SelinuxContext
8349where
8350 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8351 ___E: ::fidl_next::Encoder,
8352{
8353 #[inline]
8354 fn encode(
8355 self,
8356 encoder: &mut ___E,
8357 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8358 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8359 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
8360
8361 match self {
8362 Self::Data(value) => ::fidl_next::RawWireUnion::encode_as::<___E, ::std::vec::Vec<u8>>(
8363 value, 1, encoder, raw,
8364 )?,
8365
8366 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
8367 ___E,
8368 crate::EmptyStruct,
8369 >(value, 2, encoder, raw)?,
8370
8371 Self::UnknownOrdinal_(ordinal) => {
8372 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
8373 }
8374 }
8375
8376 Ok(())
8377 }
8378}
8379
8380unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelinuxContext
8381where
8382 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8383 ___E: ::fidl_next::Encoder,
8384{
8385 #[inline]
8386 fn encode_ref(
8387 &self,
8388 encoder: &mut ___E,
8389 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8390 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8391 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
8392
8393 match self {
8394 Self::Data(value) => {
8395 ::fidl_next::RawWireUnion::encode_as::<___E, &::std::vec::Vec<u8>>(
8396 value, 1, encoder, raw,
8397 )?
8398 }
8399
8400 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
8401 ___E,
8402 &crate::EmptyStruct,
8403 >(value, 2, encoder, raw)?,
8404
8405 Self::UnknownOrdinal_(ordinal) => {
8406 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
8407 }
8408 }
8409
8410 Ok(())
8411 }
8412}
8413
8414impl ::fidl_next::EncodableOption for SelinuxContext {
8415 type EncodedOption = WireOptionalSelinuxContext<'static>;
8416}
8417
8418unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SelinuxContext
8419where
8420 ___E: ?Sized,
8421 SelinuxContext: ::fidl_next::Encode<___E>,
8422{
8423 #[inline]
8424 fn encode_option(
8425 this: ::core::option::Option<Self>,
8426 encoder: &mut ___E,
8427 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8428 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8429 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
8430
8431 if let Some(inner) = this {
8432 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
8433 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
8434 } else {
8435 ::fidl_next::RawWireUnion::encode_absent(raw);
8436 }
8437
8438 Ok(())
8439 }
8440}
8441
8442unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SelinuxContext
8443where
8444 ___E: ?Sized,
8445 SelinuxContext: ::fidl_next::EncodeRef<___E>,
8446{
8447 #[inline]
8448 fn encode_option_ref(
8449 this: ::core::option::Option<&Self>,
8450 encoder: &mut ___E,
8451 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8452 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8453 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
8454
8455 if let Some(inner) = this {
8456 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
8457 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
8458 } else {
8459 ::fidl_next::RawWireUnion::encode_absent(raw);
8460 }
8461
8462 Ok(())
8463 }
8464}
8465
8466impl<'de> ::fidl_next::FromWire<WireSelinuxContext<'de>> for SelinuxContext {
8467 #[inline]
8468 fn from_wire(wire: WireSelinuxContext<'de>) -> Self {
8469 let wire = ::core::mem::ManuallyDrop::new(wire);
8470 match wire.raw.ordinal() {
8471 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
8472 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
8473 })),
8474
8475 2 => Self::UseExtendedAttributes(::fidl_next::FromWire::from_wire(unsafe {
8476 wire.raw.get().read_unchecked::<crate::WireEmptyStruct>()
8477 })),
8478
8479 _ => unsafe { ::core::hint::unreachable_unchecked() },
8480 }
8481 }
8482}
8483
8484impl<'de> ::fidl_next::IntoNatural for WireSelinuxContext<'de> {
8485 type Natural = SelinuxContext;
8486}
8487
8488impl<'de> ::fidl_next::FromWireRef<WireSelinuxContext<'de>> for SelinuxContext {
8489 #[inline]
8490 fn from_wire_ref(wire: &WireSelinuxContext<'de>) -> Self {
8491 match wire.raw.ordinal() {
8492 1 => Self::Data(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8493 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
8494 })),
8495
8496 2 => Self::UseExtendedAttributes(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8497 wire.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
8498 })),
8499
8500 _ => unsafe { ::core::hint::unreachable_unchecked() },
8501 }
8502 }
8503}
8504
8505impl<'de> ::fidl_next::FromWireOption<WireOptionalSelinuxContext<'de>> for SelinuxContext {
8506 #[inline]
8507 fn from_wire_option(wire: WireOptionalSelinuxContext<'de>) -> ::core::option::Option<Self> {
8508 if let Some(inner) = wire.into_option() {
8509 Some(::fidl_next::FromWire::from_wire(inner))
8510 } else {
8511 None
8512 }
8513 }
8514}
8515
8516impl<'de> ::fidl_next::IntoNatural for WireOptionalSelinuxContext<'de> {
8517 type Natural = ::core::option::Option<SelinuxContext>;
8518}
8519
8520impl<'de> ::fidl_next::FromWireOption<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
8521 #[inline]
8522 fn from_wire_option(wire: WireOptionalSelinuxContext<'de>) -> ::core::option::Option<Self> {
8523 <
8524 SelinuxContext as ::fidl_next::FromWireOption<WireOptionalSelinuxContext<'de>>
8525 >::from_wire_option(wire).map(Box::new)
8526 }
8527}
8528
8529impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
8530 #[inline]
8531 fn from_wire_option_ref(
8532 wire: &WireOptionalSelinuxContext<'de>,
8533 ) -> ::core::option::Option<Self> {
8534 if let Some(inner) = wire.as_ref() {
8535 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
8536 } else {
8537 None
8538 }
8539 }
8540}
8541
8542#[repr(transparent)]
8544pub struct WireSelinuxContext<'de> {
8545 raw: ::fidl_next::RawWireUnion,
8546 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8547}
8548
8549impl<'de> Drop for WireSelinuxContext<'de> {
8550 fn drop(&mut self) {
8551 match self.raw.ordinal() {
8552 1 => {
8553 let _ =
8554 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
8555 }
8556
8557 2 => {
8558 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEmptyStruct>() };
8559 }
8560
8561 _ => (),
8562 }
8563 }
8564}
8565
8566unsafe impl ::fidl_next::Wire for WireSelinuxContext<'static> {
8567 type Decoded<'de> = WireSelinuxContext<'de>;
8568
8569 #[inline]
8570 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8571 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8572 ::fidl_next::RawWireUnion::zero_padding(raw);
8573 }
8574}
8575
8576pub mod selinux_context {
8577 pub enum Ref<'de> {
8578 Data(&'de ::fidl_next::WireVector<'de, u8>),
8579
8580 UseExtendedAttributes(&'de crate::WireEmptyStruct),
8581
8582 UnknownOrdinal_(u64),
8583 }
8584}
8585
8586impl<'de> WireSelinuxContext<'de> {
8587 pub fn as_ref(&self) -> crate::selinux_context::Ref<'_> {
8588 match self.raw.ordinal() {
8589 1 => crate::selinux_context::Ref::Data(unsafe {
8590 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
8591 }),
8592
8593 2 => crate::selinux_context::Ref::UseExtendedAttributes(unsafe {
8594 self.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
8595 }),
8596
8597 unknown => crate::selinux_context::Ref::UnknownOrdinal_(unknown),
8598 }
8599 }
8600}
8601
8602unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelinuxContext<'static>
8603where
8604 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8605 ___D: ::fidl_next::Decoder,
8606{
8607 fn decode(
8608 mut slot: ::fidl_next::Slot<'_, Self>,
8609 decoder: &mut ___D,
8610 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8611 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8612 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8613 1 => {
8614 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
8615 raw, decoder,
8616 )?
8617 }
8618
8619 2 => {
8620 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
8621 }
8622
8623 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8624 }
8625
8626 Ok(())
8627 }
8628}
8629
8630impl<'de> ::core::fmt::Debug for WireSelinuxContext<'de> {
8631 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8632 match self.raw.ordinal() {
8633 1 => unsafe {
8634 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
8635 },
8636 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireEmptyStruct>().fmt(f) },
8637 _ => unsafe { ::core::hint::unreachable_unchecked() },
8638 }
8639 }
8640}
8641
8642#[repr(transparent)]
8643pub struct WireOptionalSelinuxContext<'de> {
8644 raw: ::fidl_next::RawWireUnion,
8645 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8646}
8647
8648unsafe impl ::fidl_next::Wire for WireOptionalSelinuxContext<'static> {
8649 type Decoded<'de> = WireOptionalSelinuxContext<'de>;
8650
8651 #[inline]
8652 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8653 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8654 ::fidl_next::RawWireUnion::zero_padding(raw);
8655 }
8656}
8657
8658impl<'de> WireOptionalSelinuxContext<'de> {
8659 pub fn is_some(&self) -> bool {
8660 self.raw.is_some()
8661 }
8662
8663 pub fn is_none(&self) -> bool {
8664 self.raw.is_none()
8665 }
8666
8667 pub fn as_ref(&self) -> ::core::option::Option<&WireSelinuxContext<'de>> {
8668 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
8669 }
8670
8671 pub fn into_option(self) -> ::core::option::Option<WireSelinuxContext<'de>> {
8672 if self.is_some() {
8673 Some(WireSelinuxContext { raw: self.raw, _phantom: ::core::marker::PhantomData })
8674 } else {
8675 None
8676 }
8677 }
8678}
8679
8680unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalSelinuxContext<'static>
8681where
8682 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8683 ___D: ::fidl_next::Decoder,
8684{
8685 fn decode(
8686 mut slot: ::fidl_next::Slot<'_, Self>,
8687 decoder: &mut ___D,
8688 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8689 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8690 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8691 1 => {
8692 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
8693 raw, decoder,
8694 )?
8695 }
8696
8697 2 => {
8698 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
8699 }
8700
8701 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8702 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8703 }
8704
8705 Ok(())
8706 }
8707}
8708
8709impl<'de> ::core::fmt::Debug for WireOptionalSelinuxContext<'de> {
8710 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8711 self.as_ref().fmt(f)
8712 }
8713}
8714
8715#[derive(PartialEq, Clone, Debug, Default)]
8716pub struct MutableNodeAttributes {
8717 pub creation_time: ::core::option::Option<u64>,
8718
8719 pub modification_time: ::core::option::Option<u64>,
8720
8721 pub mode: ::core::option::Option<u32>,
8722
8723 pub uid: ::core::option::Option<u32>,
8724
8725 pub gid: ::core::option::Option<u32>,
8726
8727 pub rdev: ::core::option::Option<u64>,
8728
8729 pub access_time: ::core::option::Option<u64>,
8730
8731 pub casefold: ::core::option::Option<bool>,
8732
8733 pub selinux_context: ::core::option::Option<crate::SelinuxContext>,
8734
8735 pub wrapping_key_id: ::core::option::Option<[u8; 16]>,
8736}
8737
8738impl MutableNodeAttributes {
8739 fn __max_ordinal(&self) -> usize {
8740 if self.wrapping_key_id.is_some() {
8741 return 10;
8742 }
8743
8744 if self.selinux_context.is_some() {
8745 return 9;
8746 }
8747
8748 if self.casefold.is_some() {
8749 return 8;
8750 }
8751
8752 if self.access_time.is_some() {
8753 return 7;
8754 }
8755
8756 if self.rdev.is_some() {
8757 return 6;
8758 }
8759
8760 if self.gid.is_some() {
8761 return 5;
8762 }
8763
8764 if self.uid.is_some() {
8765 return 4;
8766 }
8767
8768 if self.mode.is_some() {
8769 return 3;
8770 }
8771
8772 if self.modification_time.is_some() {
8773 return 2;
8774 }
8775
8776 if self.creation_time.is_some() {
8777 return 1;
8778 }
8779
8780 0
8781 }
8782}
8783
8784impl ::fidl_next::Encodable for MutableNodeAttributes {
8785 type Encoded = WireMutableNodeAttributes<'static>;
8786}
8787
8788unsafe impl<___E> ::fidl_next::Encode<___E> for MutableNodeAttributes
8789where
8790 ___E: ::fidl_next::Encoder + ?Sized,
8791{
8792 #[inline]
8793 fn encode(
8794 mut self,
8795 encoder: &mut ___E,
8796 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8797 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8798 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
8799
8800 let max_ord = self.__max_ordinal();
8801
8802 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8803 ::fidl_next::Wire::zero_padding(&mut out);
8804
8805 let mut preallocated =
8806 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8807
8808 for i in 1..=max_ord {
8809 match i {
8810 10 => {
8811 if let Some(value) = self.wrapping_key_id.take() {
8812 ::fidl_next::WireEnvelope::encode_value(
8813 value,
8814 preallocated.encoder,
8815 &mut out,
8816 )?;
8817 } else {
8818 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8819 }
8820 }
8821
8822 9 => {
8823 if let Some(value) = self.selinux_context.take() {
8824 ::fidl_next::WireEnvelope::encode_value(
8825 value,
8826 preallocated.encoder,
8827 &mut out,
8828 )?;
8829 } else {
8830 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8831 }
8832 }
8833
8834 8 => {
8835 if let Some(value) = self.casefold.take() {
8836 ::fidl_next::WireEnvelope::encode_value(
8837 value,
8838 preallocated.encoder,
8839 &mut out,
8840 )?;
8841 } else {
8842 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8843 }
8844 }
8845
8846 7 => {
8847 if let Some(value) = self.access_time.take() {
8848 ::fidl_next::WireEnvelope::encode_value(
8849 value,
8850 preallocated.encoder,
8851 &mut out,
8852 )?;
8853 } else {
8854 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8855 }
8856 }
8857
8858 6 => {
8859 if let Some(value) = self.rdev.take() {
8860 ::fidl_next::WireEnvelope::encode_value(
8861 value,
8862 preallocated.encoder,
8863 &mut out,
8864 )?;
8865 } else {
8866 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8867 }
8868 }
8869
8870 5 => {
8871 if let Some(value) = self.gid.take() {
8872 ::fidl_next::WireEnvelope::encode_value(
8873 value,
8874 preallocated.encoder,
8875 &mut out,
8876 )?;
8877 } else {
8878 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8879 }
8880 }
8881
8882 4 => {
8883 if let Some(value) = self.uid.take() {
8884 ::fidl_next::WireEnvelope::encode_value(
8885 value,
8886 preallocated.encoder,
8887 &mut out,
8888 )?;
8889 } else {
8890 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8891 }
8892 }
8893
8894 3 => {
8895 if let Some(value) = self.mode.take() {
8896 ::fidl_next::WireEnvelope::encode_value(
8897 value,
8898 preallocated.encoder,
8899 &mut out,
8900 )?;
8901 } else {
8902 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8903 }
8904 }
8905
8906 2 => {
8907 if let Some(value) = self.modification_time.take() {
8908 ::fidl_next::WireEnvelope::encode_value(
8909 value,
8910 preallocated.encoder,
8911 &mut out,
8912 )?;
8913 } else {
8914 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8915 }
8916 }
8917
8918 1 => {
8919 if let Some(value) = self.creation_time.take() {
8920 ::fidl_next::WireEnvelope::encode_value(
8921 value,
8922 preallocated.encoder,
8923 &mut out,
8924 )?;
8925 } else {
8926 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8927 }
8928 }
8929
8930 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8931 }
8932 unsafe {
8933 preallocated.write_next(out.assume_init_ref());
8934 }
8935 }
8936
8937 ::fidl_next::WireTable::encode_len(table, max_ord);
8938
8939 Ok(())
8940 }
8941}
8942
8943unsafe impl<___E> ::fidl_next::EncodeRef<___E> for MutableNodeAttributes
8944where
8945 ___E: ::fidl_next::Encoder + ?Sized,
8946{
8947 #[inline]
8948 fn encode_ref(
8949 &self,
8950 encoder: &mut ___E,
8951 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8952 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8953 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
8954
8955 let max_ord = self.__max_ordinal();
8956
8957 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8958 ::fidl_next::Wire::zero_padding(&mut out);
8959
8960 let mut preallocated =
8961 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8962
8963 for i in 1..=max_ord {
8964 match i {
8965 10 => {
8966 if let Some(value) = &self.wrapping_key_id {
8967 ::fidl_next::WireEnvelope::encode_value(
8968 value,
8969 preallocated.encoder,
8970 &mut out,
8971 )?;
8972 } else {
8973 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8974 }
8975 }
8976
8977 9 => {
8978 if let Some(value) = &self.selinux_context {
8979 ::fidl_next::WireEnvelope::encode_value(
8980 value,
8981 preallocated.encoder,
8982 &mut out,
8983 )?;
8984 } else {
8985 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8986 }
8987 }
8988
8989 8 => {
8990 if let Some(value) = &self.casefold {
8991 ::fidl_next::WireEnvelope::encode_value(
8992 value,
8993 preallocated.encoder,
8994 &mut out,
8995 )?;
8996 } else {
8997 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8998 }
8999 }
9000
9001 7 => {
9002 if let Some(value) = &self.access_time {
9003 ::fidl_next::WireEnvelope::encode_value(
9004 value,
9005 preallocated.encoder,
9006 &mut out,
9007 )?;
9008 } else {
9009 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9010 }
9011 }
9012
9013 6 => {
9014 if let Some(value) = &self.rdev {
9015 ::fidl_next::WireEnvelope::encode_value(
9016 value,
9017 preallocated.encoder,
9018 &mut out,
9019 )?;
9020 } else {
9021 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9022 }
9023 }
9024
9025 5 => {
9026 if let Some(value) = &self.gid {
9027 ::fidl_next::WireEnvelope::encode_value(
9028 value,
9029 preallocated.encoder,
9030 &mut out,
9031 )?;
9032 } else {
9033 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9034 }
9035 }
9036
9037 4 => {
9038 if let Some(value) = &self.uid {
9039 ::fidl_next::WireEnvelope::encode_value(
9040 value,
9041 preallocated.encoder,
9042 &mut out,
9043 )?;
9044 } else {
9045 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9046 }
9047 }
9048
9049 3 => {
9050 if let Some(value) = &self.mode {
9051 ::fidl_next::WireEnvelope::encode_value(
9052 value,
9053 preallocated.encoder,
9054 &mut out,
9055 )?;
9056 } else {
9057 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9058 }
9059 }
9060
9061 2 => {
9062 if let Some(value) = &self.modification_time {
9063 ::fidl_next::WireEnvelope::encode_value(
9064 value,
9065 preallocated.encoder,
9066 &mut out,
9067 )?;
9068 } else {
9069 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9070 }
9071 }
9072
9073 1 => {
9074 if let Some(value) = &self.creation_time {
9075 ::fidl_next::WireEnvelope::encode_value(
9076 value,
9077 preallocated.encoder,
9078 &mut out,
9079 )?;
9080 } else {
9081 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9082 }
9083 }
9084
9085 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9086 }
9087 unsafe {
9088 preallocated.write_next(out.assume_init_ref());
9089 }
9090 }
9091
9092 ::fidl_next::WireTable::encode_len(table, max_ord);
9093
9094 Ok(())
9095 }
9096}
9097
9098impl<'de> ::fidl_next::FromWire<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
9099 #[inline]
9100 fn from_wire(wire_: WireMutableNodeAttributes<'de>) -> Self {
9101 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9102
9103 let creation_time = wire_.table.get(1);
9104
9105 let modification_time = wire_.table.get(2);
9106
9107 let mode = wire_.table.get(3);
9108
9109 let uid = wire_.table.get(4);
9110
9111 let gid = wire_.table.get(5);
9112
9113 let rdev = wire_.table.get(6);
9114
9115 let access_time = wire_.table.get(7);
9116
9117 let casefold = wire_.table.get(8);
9118
9119 let selinux_context = wire_.table.get(9);
9120
9121 let wrapping_key_id = wire_.table.get(10);
9122
9123 Self {
9124 creation_time: creation_time.map(|envelope| {
9125 ::fidl_next::FromWire::from_wire(unsafe {
9126 envelope.read_unchecked::<::fidl_next::WireU64>()
9127 })
9128 }),
9129
9130 modification_time: modification_time.map(|envelope| {
9131 ::fidl_next::FromWire::from_wire(unsafe {
9132 envelope.read_unchecked::<::fidl_next::WireU64>()
9133 })
9134 }),
9135
9136 mode: mode.map(|envelope| {
9137 ::fidl_next::FromWire::from_wire(unsafe {
9138 envelope.read_unchecked::<::fidl_next::WireU32>()
9139 })
9140 }),
9141
9142 uid: uid.map(|envelope| {
9143 ::fidl_next::FromWire::from_wire(unsafe {
9144 envelope.read_unchecked::<::fidl_next::WireU32>()
9145 })
9146 }),
9147
9148 gid: gid.map(|envelope| {
9149 ::fidl_next::FromWire::from_wire(unsafe {
9150 envelope.read_unchecked::<::fidl_next::WireU32>()
9151 })
9152 }),
9153
9154 rdev: rdev.map(|envelope| {
9155 ::fidl_next::FromWire::from_wire(unsafe {
9156 envelope.read_unchecked::<::fidl_next::WireU64>()
9157 })
9158 }),
9159
9160 access_time: access_time.map(|envelope| {
9161 ::fidl_next::FromWire::from_wire(unsafe {
9162 envelope.read_unchecked::<::fidl_next::WireU64>()
9163 })
9164 }),
9165
9166 casefold: casefold.map(|envelope| {
9167 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
9168 }),
9169
9170 selinux_context: selinux_context.map(|envelope| {
9171 ::fidl_next::FromWire::from_wire(unsafe {
9172 envelope.read_unchecked::<crate::WireSelinuxContext<'de>>()
9173 })
9174 }),
9175
9176 wrapping_key_id: wrapping_key_id.map(|envelope| {
9177 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<[u8; 16]>() })
9178 }),
9179 }
9180 }
9181}
9182
9183impl<'de> ::fidl_next::IntoNatural for WireMutableNodeAttributes<'de> {
9184 type Natural = MutableNodeAttributes;
9185}
9186
9187impl<'de> ::fidl_next::FromWireRef<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
9188 #[inline]
9189 fn from_wire_ref(wire: &WireMutableNodeAttributes<'de>) -> Self {
9190 Self {
9191 creation_time: wire.table.get(1).map(|envelope| {
9192 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9193 envelope.deref_unchecked::<::fidl_next::WireU64>()
9194 })
9195 }),
9196
9197 modification_time: wire.table.get(2).map(|envelope| {
9198 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9199 envelope.deref_unchecked::<::fidl_next::WireU64>()
9200 })
9201 }),
9202
9203 mode: wire.table.get(3).map(|envelope| {
9204 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9205 envelope.deref_unchecked::<::fidl_next::WireU32>()
9206 })
9207 }),
9208
9209 uid: wire.table.get(4).map(|envelope| {
9210 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9211 envelope.deref_unchecked::<::fidl_next::WireU32>()
9212 })
9213 }),
9214
9215 gid: wire.table.get(5).map(|envelope| {
9216 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9217 envelope.deref_unchecked::<::fidl_next::WireU32>()
9218 })
9219 }),
9220
9221 rdev: wire.table.get(6).map(|envelope| {
9222 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9223 envelope.deref_unchecked::<::fidl_next::WireU64>()
9224 })
9225 }),
9226
9227 access_time: wire.table.get(7).map(|envelope| {
9228 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9229 envelope.deref_unchecked::<::fidl_next::WireU64>()
9230 })
9231 }),
9232
9233 casefold: wire.table.get(8).map(|envelope| {
9234 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9235 envelope.deref_unchecked::<bool>()
9236 })
9237 }),
9238
9239 selinux_context: wire.table.get(9).map(|envelope| {
9240 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9241 envelope.deref_unchecked::<crate::WireSelinuxContext<'de>>()
9242 })
9243 }),
9244
9245 wrapping_key_id: wire.table.get(10).map(|envelope| {
9246 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9247 envelope.deref_unchecked::<[u8; 16]>()
9248 })
9249 }),
9250 }
9251 }
9252}
9253
9254#[repr(C)]
9256pub struct WireMutableNodeAttributes<'de> {
9257 table: ::fidl_next::WireTable<'de>,
9258}
9259
9260impl<'de> Drop for WireMutableNodeAttributes<'de> {
9261 fn drop(&mut self) {
9262 let _ = self
9263 .table
9264 .get(1)
9265 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9266
9267 let _ = self
9268 .table
9269 .get(2)
9270 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9271
9272 let _ = self
9273 .table
9274 .get(3)
9275 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
9276
9277 let _ = self
9278 .table
9279 .get(4)
9280 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
9281
9282 let _ = self
9283 .table
9284 .get(5)
9285 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
9286
9287 let _ = self
9288 .table
9289 .get(6)
9290 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9291
9292 let _ = self
9293 .table
9294 .get(7)
9295 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9296
9297 let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9298
9299 let _ = self
9300 .table
9301 .get(9)
9302 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireSelinuxContext<'de>>() });
9303
9304 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<[u8; 16]>() });
9305 }
9306}
9307
9308unsafe impl ::fidl_next::Wire for WireMutableNodeAttributes<'static> {
9309 type Decoded<'de> = WireMutableNodeAttributes<'de>;
9310
9311 #[inline]
9312 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9313 ::fidl_next::munge!(let Self { table } = out);
9314 ::fidl_next::WireTable::zero_padding(table);
9315 }
9316}
9317
9318unsafe impl<___D> ::fidl_next::Decode<___D> for WireMutableNodeAttributes<'static>
9319where
9320 ___D: ::fidl_next::Decoder + ?Sized,
9321{
9322 fn decode(
9323 slot: ::fidl_next::Slot<'_, Self>,
9324 decoder: &mut ___D,
9325 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9326 ::fidl_next::munge!(let Self { table } = slot);
9327
9328 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9329 match ordinal {
9330 0 => unsafe { ::core::hint::unreachable_unchecked() },
9331
9332 1 => {
9333 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9334 slot.as_mut(),
9335 decoder,
9336 )?;
9337
9338 Ok(())
9339 }
9340
9341 2 => {
9342 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9343 slot.as_mut(),
9344 decoder,
9345 )?;
9346
9347 Ok(())
9348 }
9349
9350 3 => {
9351 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
9352 slot.as_mut(),
9353 decoder,
9354 )?;
9355
9356 Ok(())
9357 }
9358
9359 4 => {
9360 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
9361 slot.as_mut(),
9362 decoder,
9363 )?;
9364
9365 Ok(())
9366 }
9367
9368 5 => {
9369 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
9370 slot.as_mut(),
9371 decoder,
9372 )?;
9373
9374 Ok(())
9375 }
9376
9377 6 => {
9378 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9379 slot.as_mut(),
9380 decoder,
9381 )?;
9382
9383 Ok(())
9384 }
9385
9386 7 => {
9387 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9388 slot.as_mut(),
9389 decoder,
9390 )?;
9391
9392 Ok(())
9393 }
9394
9395 8 => {
9396 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9397
9398 Ok(())
9399 }
9400
9401 9 => {
9402 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireSelinuxContext<'static>>(
9403 slot.as_mut(),
9404 decoder,
9405 )?;
9406
9407 Ok(())
9408 }
9409
9410 10 => {
9411 ::fidl_next::WireEnvelope::decode_as::<___D, [u8; 16]>(slot.as_mut(), decoder)?;
9412
9413 Ok(())
9414 }
9415
9416 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9417 }
9418 })
9419 }
9420}
9421
9422impl<'de> WireMutableNodeAttributes<'de> {
9423 pub fn creation_time(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
9424 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9425 }
9426
9427 pub fn modification_time(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
9428 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9429 }
9430
9431 pub fn mode(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
9432 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9433 }
9434
9435 pub fn uid(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
9436 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9437 }
9438
9439 pub fn gid(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
9440 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9441 }
9442
9443 pub fn rdev(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
9444 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9445 }
9446
9447 pub fn access_time(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
9448 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9449 }
9450
9451 pub fn casefold(&self) -> ::core::option::Option<&bool> {
9452 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9453 }
9454
9455 pub fn selinux_context(&self) -> ::core::option::Option<&crate::WireSelinuxContext<'de>> {
9456 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
9457 }
9458
9459 pub fn wrapping_key_id(&self) -> ::core::option::Option<&[u8; 16]> {
9460 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
9461 }
9462}
9463
9464impl<'de> ::core::fmt::Debug for WireMutableNodeAttributes<'de> {
9465 fn fmt(
9466 &self,
9467 f: &mut ::core::fmt::Formatter<'_>,
9468 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9469 f.debug_struct("MutableNodeAttributes")
9470 .field("creation_time", &self.creation_time())
9471 .field("modification_time", &self.modification_time())
9472 .field("mode", &self.mode())
9473 .field("uid", &self.uid())
9474 .field("gid", &self.gid())
9475 .field("rdev", &self.rdev())
9476 .field("access_time", &self.access_time())
9477 .field("casefold", &self.casefold())
9478 .field("selinux_context", &self.selinux_context())
9479 .field("wrapping_key_id", &self.wrapping_key_id())
9480 .finish()
9481 }
9482}
9483
9484::fidl_next::bitflags::bitflags! {
9485 #[doc = " A node may have multiple supported representations when opening, even though\n it may have a fixed underlying identity.\n\n Today, a file is accessed via the [`File`] protocol, and sends a\n [`Representation.FileInfo`] when opened with `GET_REPRESENTATION`. However,\n in the future we might introduce a more sophisticated `FileV2` protocol, or\n a more efficient `SuperFastFile` backed by a specialized kernel object. New\n clients can request the more advanced representations by specifying the\n corresponding bits in [`NodeProtocolKinds`], whereas existing clients would\n continue to talk to the node via the old representation.\n\n [`NodeProtocolKinds`] enables forward-compatibility through a form of protocol\n negotiation.\n\n The elements have one-to-one correspondence with the members of\n [`Representation`].\n"]#[derive(
9486 Clone,
9487 Copy,
9488 Debug,
9489 PartialEq,
9490 Eq,
9491 Hash,
9492 )]
9493 pub struct NodeProtocolKinds: u64 {
9494 #[doc = " The connector representation of a node.\n\n The connection will speak either [`Node`] or the target protocol,\n depending on the flags used during opening.\n"]const CONNECTOR = 1;
9495 #[doc = " The directory representation of a node.\n\n The connection will speak the [`Directory`] protocol.\n"]const DIRECTORY = 2;
9496 #[doc = " The file representation of a node.\n\n The connection will speak the [`File`] protocol.\n"]const FILE = 4;
9497 #[doc = " The symlink representation of a node.\n\n The connection will speak the [`Symlink`] protocol.\n"]const SYMLINK = 8;
9498 const _ = !0;
9499 }
9500}
9501
9502impl ::fidl_next::Encodable for NodeProtocolKinds {
9503 type Encoded = WireNodeProtocolKinds;
9504}
9505
9506unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProtocolKinds
9507where
9508 ___E: ?Sized,
9509{
9510 #[inline]
9511 fn encode(
9512 self,
9513 encoder: &mut ___E,
9514 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9515 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9516 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9517 }
9518}
9519
9520unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProtocolKinds
9521where
9522 ___E: ?Sized,
9523{
9524 #[inline]
9525 fn encode_ref(
9526 &self,
9527 _: &mut ___E,
9528 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9529 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9530 ::fidl_next::munge!(let WireNodeProtocolKinds { value } = out);
9531
9532 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
9533 Ok(())
9534 }
9535}
9536
9537impl ::core::convert::From<WireNodeProtocolKinds> for NodeProtocolKinds {
9538 fn from(wire: WireNodeProtocolKinds) -> Self {
9539 Self::from_bits_retain(u64::from(wire.value))
9540 }
9541}
9542
9543impl ::fidl_next::FromWire<WireNodeProtocolKinds> for NodeProtocolKinds {
9544 #[inline]
9545 fn from_wire(wire: WireNodeProtocolKinds) -> Self {
9546 Self::from(wire)
9547 }
9548}
9549
9550impl ::fidl_next::IntoNatural for WireNodeProtocolKinds {
9551 type Natural = NodeProtocolKinds;
9552}
9553
9554impl ::fidl_next::FromWireRef<WireNodeProtocolKinds> for NodeProtocolKinds {
9555 #[inline]
9556 fn from_wire_ref(wire: &WireNodeProtocolKinds) -> Self {
9557 Self::from(*wire)
9558 }
9559}
9560
9561#[derive(Clone, Copy, Debug)]
9563#[repr(transparent)]
9564pub struct WireNodeProtocolKinds {
9565 value: ::fidl_next::WireU64,
9566}
9567
9568unsafe impl ::fidl_next::Wire for WireNodeProtocolKinds {
9569 type Decoded<'de> = Self;
9570
9571 #[inline]
9572 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9573 }
9575}
9576
9577unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProtocolKinds
9578where
9579 ___D: ?Sized,
9580{
9581 fn decode(
9582 slot: ::fidl_next::Slot<'_, Self>,
9583 _: &mut ___D,
9584 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9585 Ok(())
9586 }
9587}
9588
9589impl ::core::convert::From<NodeProtocolKinds> for WireNodeProtocolKinds {
9590 fn from(natural: NodeProtocolKinds) -> Self {
9591 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
9592 }
9593}
9594
9595#[doc = " Denotes which hash algorithm is used to build the merkle tree for\n fsverity-enabled files.\n"]
9596#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9597#[repr(u8)]
9598pub enum HashAlgorithm {
9599 Sha256 = 1,
9600 Sha512 = 2,
9601 UnknownOrdinal_(u8) = 3,
9602}
9603
9604impl ::fidl_next::Encodable for HashAlgorithm {
9605 type Encoded = WireHashAlgorithm;
9606}
9607impl ::std::convert::From<u8> for HashAlgorithm {
9608 fn from(value: u8) -> Self {
9609 match value {
9610 1 => Self::Sha256,
9611 2 => Self::Sha512,
9612
9613 _ => Self::UnknownOrdinal_(value),
9614 }
9615 }
9616}
9617
9618unsafe impl<___E> ::fidl_next::Encode<___E> for HashAlgorithm
9619where
9620 ___E: ?Sized,
9621{
9622 #[inline]
9623 fn encode(
9624 self,
9625 encoder: &mut ___E,
9626 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9627 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9628 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9629 }
9630}
9631
9632unsafe impl<___E> ::fidl_next::EncodeRef<___E> for HashAlgorithm
9633where
9634 ___E: ?Sized,
9635{
9636 #[inline]
9637 fn encode_ref(
9638 &self,
9639 encoder: &mut ___E,
9640 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9641 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9642 ::fidl_next::munge!(let WireHashAlgorithm { value } = out);
9643 let _ = value.write(u8::from(match *self {
9644 Self::Sha256 => 1,
9645
9646 Self::Sha512 => 2,
9647
9648 Self::UnknownOrdinal_(value) => value,
9649 }));
9650
9651 Ok(())
9652 }
9653}
9654
9655impl ::core::convert::From<WireHashAlgorithm> for HashAlgorithm {
9656 fn from(wire: WireHashAlgorithm) -> Self {
9657 match u8::from(wire.value) {
9658 1 => Self::Sha256,
9659
9660 2 => Self::Sha512,
9661
9662 value => Self::UnknownOrdinal_(value),
9663 }
9664 }
9665}
9666
9667impl ::fidl_next::FromWire<WireHashAlgorithm> for HashAlgorithm {
9668 #[inline]
9669 fn from_wire(wire: WireHashAlgorithm) -> Self {
9670 Self::from(wire)
9671 }
9672}
9673
9674impl ::fidl_next::IntoNatural for WireHashAlgorithm {
9675 type Natural = HashAlgorithm;
9676}
9677
9678impl ::fidl_next::FromWireRef<WireHashAlgorithm> for HashAlgorithm {
9679 #[inline]
9680 fn from_wire_ref(wire: &WireHashAlgorithm) -> Self {
9681 Self::from(*wire)
9682 }
9683}
9684
9685#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9687#[repr(transparent)]
9688pub struct WireHashAlgorithm {
9689 value: u8,
9690}
9691
9692unsafe impl ::fidl_next::Wire for WireHashAlgorithm {
9693 type Decoded<'de> = Self;
9694
9695 #[inline]
9696 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9697 }
9699}
9700
9701impl WireHashAlgorithm {
9702 pub const SHA256: WireHashAlgorithm = WireHashAlgorithm { value: 1 };
9703
9704 pub const SHA512: WireHashAlgorithm = WireHashAlgorithm { value: 2 };
9705}
9706
9707unsafe impl<___D> ::fidl_next::Decode<___D> for WireHashAlgorithm
9708where
9709 ___D: ?Sized,
9710{
9711 fn decode(
9712 slot: ::fidl_next::Slot<'_, Self>,
9713 _: &mut ___D,
9714 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9715 Ok(())
9716 }
9717}
9718
9719impl ::core::convert::From<HashAlgorithm> for WireHashAlgorithm {
9720 fn from(natural: HashAlgorithm) -> Self {
9721 match natural {
9722 HashAlgorithm::Sha256 => WireHashAlgorithm::SHA256,
9723
9724 HashAlgorithm::Sha512 => WireHashAlgorithm::SHA512,
9725
9726 HashAlgorithm::UnknownOrdinal_(value) => WireHashAlgorithm { value: u8::from(value) },
9727 }
9728 }
9729}
9730
9731#[doc = " Set of options used to enable verity on a file.\n"]
9732#[derive(PartialEq, Clone, Debug, Default)]
9733pub struct VerificationOptions {
9734 pub hash_algorithm: ::core::option::Option<crate::HashAlgorithm>,
9735
9736 pub salt: ::core::option::Option<::std::vec::Vec<u8>>,
9737}
9738
9739impl VerificationOptions {
9740 fn __max_ordinal(&self) -> usize {
9741 if self.salt.is_some() {
9742 return 2;
9743 }
9744
9745 if self.hash_algorithm.is_some() {
9746 return 1;
9747 }
9748
9749 0
9750 }
9751}
9752
9753impl ::fidl_next::Encodable for VerificationOptions {
9754 type Encoded = WireVerificationOptions<'static>;
9755}
9756
9757unsafe impl<___E> ::fidl_next::Encode<___E> for VerificationOptions
9758where
9759 ___E: ::fidl_next::Encoder + ?Sized,
9760{
9761 #[inline]
9762 fn encode(
9763 mut self,
9764 encoder: &mut ___E,
9765 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9766 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9767 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
9768
9769 let max_ord = self.__max_ordinal();
9770
9771 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9772 ::fidl_next::Wire::zero_padding(&mut out);
9773
9774 let mut preallocated =
9775 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9776
9777 for i in 1..=max_ord {
9778 match i {
9779 2 => {
9780 if let Some(value) = self.salt.take() {
9781 ::fidl_next::WireEnvelope::encode_value(
9782 value,
9783 preallocated.encoder,
9784 &mut out,
9785 )?;
9786 } else {
9787 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9788 }
9789 }
9790
9791 1 => {
9792 if let Some(value) = self.hash_algorithm.take() {
9793 ::fidl_next::WireEnvelope::encode_value(
9794 value,
9795 preallocated.encoder,
9796 &mut out,
9797 )?;
9798 } else {
9799 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9800 }
9801 }
9802
9803 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9804 }
9805 unsafe {
9806 preallocated.write_next(out.assume_init_ref());
9807 }
9808 }
9809
9810 ::fidl_next::WireTable::encode_len(table, max_ord);
9811
9812 Ok(())
9813 }
9814}
9815
9816unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VerificationOptions
9817where
9818 ___E: ::fidl_next::Encoder + ?Sized,
9819{
9820 #[inline]
9821 fn encode_ref(
9822 &self,
9823 encoder: &mut ___E,
9824 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9825 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9826 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
9827
9828 let max_ord = self.__max_ordinal();
9829
9830 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9831 ::fidl_next::Wire::zero_padding(&mut out);
9832
9833 let mut preallocated =
9834 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9835
9836 for i in 1..=max_ord {
9837 match i {
9838 2 => {
9839 if let Some(value) = &self.salt {
9840 ::fidl_next::WireEnvelope::encode_value(
9841 value,
9842 preallocated.encoder,
9843 &mut out,
9844 )?;
9845 } else {
9846 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9847 }
9848 }
9849
9850 1 => {
9851 if let Some(value) = &self.hash_algorithm {
9852 ::fidl_next::WireEnvelope::encode_value(
9853 value,
9854 preallocated.encoder,
9855 &mut out,
9856 )?;
9857 } else {
9858 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9859 }
9860 }
9861
9862 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9863 }
9864 unsafe {
9865 preallocated.write_next(out.assume_init_ref());
9866 }
9867 }
9868
9869 ::fidl_next::WireTable::encode_len(table, max_ord);
9870
9871 Ok(())
9872 }
9873}
9874
9875impl<'de> ::fidl_next::FromWire<WireVerificationOptions<'de>> for VerificationOptions {
9876 #[inline]
9877 fn from_wire(wire_: WireVerificationOptions<'de>) -> Self {
9878 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9879
9880 let hash_algorithm = wire_.table.get(1);
9881
9882 let salt = wire_.table.get(2);
9883
9884 Self {
9885 hash_algorithm: hash_algorithm.map(|envelope| {
9886 ::fidl_next::FromWire::from_wire(unsafe {
9887 envelope.read_unchecked::<crate::WireHashAlgorithm>()
9888 })
9889 }),
9890
9891 salt: salt.map(|envelope| {
9892 ::fidl_next::FromWire::from_wire(unsafe {
9893 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9894 })
9895 }),
9896 }
9897 }
9898}
9899
9900impl<'de> ::fidl_next::IntoNatural for WireVerificationOptions<'de> {
9901 type Natural = VerificationOptions;
9902}
9903
9904impl<'de> ::fidl_next::FromWireRef<WireVerificationOptions<'de>> for VerificationOptions {
9905 #[inline]
9906 fn from_wire_ref(wire: &WireVerificationOptions<'de>) -> Self {
9907 Self {
9908 hash_algorithm: wire.table.get(1).map(|envelope| {
9909 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9910 envelope.deref_unchecked::<crate::WireHashAlgorithm>()
9911 })
9912 }),
9913
9914 salt: wire.table.get(2).map(|envelope| {
9915 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9916 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
9917 })
9918 }),
9919 }
9920 }
9921}
9922
9923#[repr(C)]
9925pub struct WireVerificationOptions<'de> {
9926 table: ::fidl_next::WireTable<'de>,
9927}
9928
9929impl<'de> Drop for WireVerificationOptions<'de> {
9930 fn drop(&mut self) {
9931 let _ = self
9932 .table
9933 .get(1)
9934 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireHashAlgorithm>() });
9935
9936 let _ = self.table.get(2).map(|envelope| unsafe {
9937 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9938 });
9939 }
9940}
9941
9942unsafe impl ::fidl_next::Wire for WireVerificationOptions<'static> {
9943 type Decoded<'de> = WireVerificationOptions<'de>;
9944
9945 #[inline]
9946 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9947 ::fidl_next::munge!(let Self { table } = out);
9948 ::fidl_next::WireTable::zero_padding(table);
9949 }
9950}
9951
9952unsafe impl<___D> ::fidl_next::Decode<___D> for WireVerificationOptions<'static>
9953where
9954 ___D: ::fidl_next::Decoder + ?Sized,
9955{
9956 fn decode(
9957 slot: ::fidl_next::Slot<'_, Self>,
9958 decoder: &mut ___D,
9959 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9960 ::fidl_next::munge!(let Self { table } = slot);
9961
9962 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9963 match ordinal {
9964 0 => unsafe { ::core::hint::unreachable_unchecked() },
9965
9966 1 => {
9967 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireHashAlgorithm>(
9968 slot.as_mut(),
9969 decoder,
9970 )?;
9971
9972 Ok(())
9973 }
9974
9975 2 => {
9976 ::fidl_next::WireEnvelope::decode_as::<
9977 ___D,
9978 ::fidl_next::WireVector<'static, u8>,
9979 >(slot.as_mut(), decoder)?;
9980
9981 let value = unsafe {
9982 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
9983 };
9984
9985 if value.len() > 32 {
9986 return Err(::fidl_next::DecodeError::VectorTooLong {
9987 size: value.len() as u64,
9988 limit: 32,
9989 });
9990 }
9991
9992 Ok(())
9993 }
9994
9995 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9996 }
9997 })
9998 }
9999}
10000
10001impl<'de> WireVerificationOptions<'de> {
10002 pub fn hash_algorithm(&self) -> ::core::option::Option<&crate::WireHashAlgorithm> {
10003 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10004 }
10005
10006 pub fn salt(&self) -> ::core::option::Option<&::fidl_next::WireVector<'de, u8>> {
10007 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10008 }
10009}
10010
10011impl<'de> ::core::fmt::Debug for WireVerificationOptions<'de> {
10012 fn fmt(
10013 &self,
10014 f: &mut ::core::fmt::Formatter<'_>,
10015 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10016 f.debug_struct("VerificationOptions")
10017 .field("hash_algorithm", &self.hash_algorithm())
10018 .field("salt", &self.salt())
10019 .finish()
10020 }
10021}
10022
10023#[derive(PartialEq, Clone, Debug, Default)]
10024pub struct ImmutableNodeAttributes {
10025 pub protocols: ::core::option::Option<crate::NodeProtocolKinds>,
10026
10027 pub abilities: ::core::option::Option<crate::Operations>,
10028
10029 pub content_size: ::core::option::Option<u64>,
10030
10031 pub storage_size: ::core::option::Option<u64>,
10032
10033 pub link_count: ::core::option::Option<u64>,
10034
10035 pub id: ::core::option::Option<u64>,
10036
10037 pub change_time: ::core::option::Option<u64>,
10038
10039 pub options: ::core::option::Option<crate::VerificationOptions>,
10040
10041 pub root_hash: ::core::option::Option<::std::vec::Vec<u8>>,
10042
10043 pub verity_enabled: ::core::option::Option<bool>,
10044}
10045
10046impl ImmutableNodeAttributes {
10047 fn __max_ordinal(&self) -> usize {
10048 if self.verity_enabled.is_some() {
10049 return 10;
10050 }
10051
10052 if self.root_hash.is_some() {
10053 return 9;
10054 }
10055
10056 if self.options.is_some() {
10057 return 8;
10058 }
10059
10060 if self.change_time.is_some() {
10061 return 7;
10062 }
10063
10064 if self.id.is_some() {
10065 return 6;
10066 }
10067
10068 if self.link_count.is_some() {
10069 return 5;
10070 }
10071
10072 if self.storage_size.is_some() {
10073 return 4;
10074 }
10075
10076 if self.content_size.is_some() {
10077 return 3;
10078 }
10079
10080 if self.abilities.is_some() {
10081 return 2;
10082 }
10083
10084 if self.protocols.is_some() {
10085 return 1;
10086 }
10087
10088 0
10089 }
10090}
10091
10092impl ::fidl_next::Encodable for ImmutableNodeAttributes {
10093 type Encoded = WireImmutableNodeAttributes<'static>;
10094}
10095
10096unsafe impl<___E> ::fidl_next::Encode<___E> for ImmutableNodeAttributes
10097where
10098 ___E: ::fidl_next::Encoder + ?Sized,
10099{
10100 #[inline]
10101 fn encode(
10102 mut self,
10103 encoder: &mut ___E,
10104 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10105 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10106 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
10107
10108 let max_ord = self.__max_ordinal();
10109
10110 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10111 ::fidl_next::Wire::zero_padding(&mut out);
10112
10113 let mut preallocated =
10114 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10115
10116 for i in 1..=max_ord {
10117 match i {
10118 10 => {
10119 if let Some(value) = self.verity_enabled.take() {
10120 ::fidl_next::WireEnvelope::encode_value(
10121 value,
10122 preallocated.encoder,
10123 &mut out,
10124 )?;
10125 } else {
10126 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10127 }
10128 }
10129
10130 9 => {
10131 if let Some(value) = self.root_hash.take() {
10132 ::fidl_next::WireEnvelope::encode_value(
10133 value,
10134 preallocated.encoder,
10135 &mut out,
10136 )?;
10137 } else {
10138 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10139 }
10140 }
10141
10142 8 => {
10143 if let Some(value) = self.options.take() {
10144 ::fidl_next::WireEnvelope::encode_value(
10145 value,
10146 preallocated.encoder,
10147 &mut out,
10148 )?;
10149 } else {
10150 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10151 }
10152 }
10153
10154 7 => {
10155 if let Some(value) = self.change_time.take() {
10156 ::fidl_next::WireEnvelope::encode_value(
10157 value,
10158 preallocated.encoder,
10159 &mut out,
10160 )?;
10161 } else {
10162 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10163 }
10164 }
10165
10166 6 => {
10167 if let Some(value) = self.id.take() {
10168 ::fidl_next::WireEnvelope::encode_value(
10169 value,
10170 preallocated.encoder,
10171 &mut out,
10172 )?;
10173 } else {
10174 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10175 }
10176 }
10177
10178 5 => {
10179 if let Some(value) = self.link_count.take() {
10180 ::fidl_next::WireEnvelope::encode_value(
10181 value,
10182 preallocated.encoder,
10183 &mut out,
10184 )?;
10185 } else {
10186 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10187 }
10188 }
10189
10190 4 => {
10191 if let Some(value) = self.storage_size.take() {
10192 ::fidl_next::WireEnvelope::encode_value(
10193 value,
10194 preallocated.encoder,
10195 &mut out,
10196 )?;
10197 } else {
10198 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10199 }
10200 }
10201
10202 3 => {
10203 if let Some(value) = self.content_size.take() {
10204 ::fidl_next::WireEnvelope::encode_value(
10205 value,
10206 preallocated.encoder,
10207 &mut out,
10208 )?;
10209 } else {
10210 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10211 }
10212 }
10213
10214 2 => {
10215 if let Some(value) = self.abilities.take() {
10216 ::fidl_next::WireEnvelope::encode_value(
10217 value,
10218 preallocated.encoder,
10219 &mut out,
10220 )?;
10221 } else {
10222 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10223 }
10224 }
10225
10226 1 => {
10227 if let Some(value) = self.protocols.take() {
10228 ::fidl_next::WireEnvelope::encode_value(
10229 value,
10230 preallocated.encoder,
10231 &mut out,
10232 )?;
10233 } else {
10234 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10235 }
10236 }
10237
10238 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10239 }
10240 unsafe {
10241 preallocated.write_next(out.assume_init_ref());
10242 }
10243 }
10244
10245 ::fidl_next::WireTable::encode_len(table, max_ord);
10246
10247 Ok(())
10248 }
10249}
10250
10251unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ImmutableNodeAttributes
10252where
10253 ___E: ::fidl_next::Encoder + ?Sized,
10254{
10255 #[inline]
10256 fn encode_ref(
10257 &self,
10258 encoder: &mut ___E,
10259 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10260 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10261 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
10262
10263 let max_ord = self.__max_ordinal();
10264
10265 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10266 ::fidl_next::Wire::zero_padding(&mut out);
10267
10268 let mut preallocated =
10269 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10270
10271 for i in 1..=max_ord {
10272 match i {
10273 10 => {
10274 if let Some(value) = &self.verity_enabled {
10275 ::fidl_next::WireEnvelope::encode_value(
10276 value,
10277 preallocated.encoder,
10278 &mut out,
10279 )?;
10280 } else {
10281 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10282 }
10283 }
10284
10285 9 => {
10286 if let Some(value) = &self.root_hash {
10287 ::fidl_next::WireEnvelope::encode_value(
10288 value,
10289 preallocated.encoder,
10290 &mut out,
10291 )?;
10292 } else {
10293 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10294 }
10295 }
10296
10297 8 => {
10298 if let Some(value) = &self.options {
10299 ::fidl_next::WireEnvelope::encode_value(
10300 value,
10301 preallocated.encoder,
10302 &mut out,
10303 )?;
10304 } else {
10305 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10306 }
10307 }
10308
10309 7 => {
10310 if let Some(value) = &self.change_time {
10311 ::fidl_next::WireEnvelope::encode_value(
10312 value,
10313 preallocated.encoder,
10314 &mut out,
10315 )?;
10316 } else {
10317 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10318 }
10319 }
10320
10321 6 => {
10322 if let Some(value) = &self.id {
10323 ::fidl_next::WireEnvelope::encode_value(
10324 value,
10325 preallocated.encoder,
10326 &mut out,
10327 )?;
10328 } else {
10329 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10330 }
10331 }
10332
10333 5 => {
10334 if let Some(value) = &self.link_count {
10335 ::fidl_next::WireEnvelope::encode_value(
10336 value,
10337 preallocated.encoder,
10338 &mut out,
10339 )?;
10340 } else {
10341 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10342 }
10343 }
10344
10345 4 => {
10346 if let Some(value) = &self.storage_size {
10347 ::fidl_next::WireEnvelope::encode_value(
10348 value,
10349 preallocated.encoder,
10350 &mut out,
10351 )?;
10352 } else {
10353 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10354 }
10355 }
10356
10357 3 => {
10358 if let Some(value) = &self.content_size {
10359 ::fidl_next::WireEnvelope::encode_value(
10360 value,
10361 preallocated.encoder,
10362 &mut out,
10363 )?;
10364 } else {
10365 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10366 }
10367 }
10368
10369 2 => {
10370 if let Some(value) = &self.abilities {
10371 ::fidl_next::WireEnvelope::encode_value(
10372 value,
10373 preallocated.encoder,
10374 &mut out,
10375 )?;
10376 } else {
10377 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10378 }
10379 }
10380
10381 1 => {
10382 if let Some(value) = &self.protocols {
10383 ::fidl_next::WireEnvelope::encode_value(
10384 value,
10385 preallocated.encoder,
10386 &mut out,
10387 )?;
10388 } else {
10389 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10390 }
10391 }
10392
10393 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10394 }
10395 unsafe {
10396 preallocated.write_next(out.assume_init_ref());
10397 }
10398 }
10399
10400 ::fidl_next::WireTable::encode_len(table, max_ord);
10401
10402 Ok(())
10403 }
10404}
10405
10406impl<'de> ::fidl_next::FromWire<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
10407 #[inline]
10408 fn from_wire(wire_: WireImmutableNodeAttributes<'de>) -> Self {
10409 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10410
10411 let protocols = wire_.table.get(1);
10412
10413 let abilities = wire_.table.get(2);
10414
10415 let content_size = wire_.table.get(3);
10416
10417 let storage_size = wire_.table.get(4);
10418
10419 let link_count = wire_.table.get(5);
10420
10421 let id = wire_.table.get(6);
10422
10423 let change_time = wire_.table.get(7);
10424
10425 let options = wire_.table.get(8);
10426
10427 let root_hash = wire_.table.get(9);
10428
10429 let verity_enabled = wire_.table.get(10);
10430
10431 Self {
10432 protocols: protocols.map(|envelope| {
10433 ::fidl_next::FromWire::from_wire(unsafe {
10434 envelope.read_unchecked::<crate::WireNodeProtocolKinds>()
10435 })
10436 }),
10437
10438 abilities: abilities.map(|envelope| {
10439 ::fidl_next::FromWire::from_wire(unsafe {
10440 envelope.read_unchecked::<crate::WireOperations>()
10441 })
10442 }),
10443
10444 content_size: content_size.map(|envelope| {
10445 ::fidl_next::FromWire::from_wire(unsafe {
10446 envelope.read_unchecked::<::fidl_next::WireU64>()
10447 })
10448 }),
10449
10450 storage_size: storage_size.map(|envelope| {
10451 ::fidl_next::FromWire::from_wire(unsafe {
10452 envelope.read_unchecked::<::fidl_next::WireU64>()
10453 })
10454 }),
10455
10456 link_count: link_count.map(|envelope| {
10457 ::fidl_next::FromWire::from_wire(unsafe {
10458 envelope.read_unchecked::<::fidl_next::WireU64>()
10459 })
10460 }),
10461
10462 id: id.map(|envelope| {
10463 ::fidl_next::FromWire::from_wire(unsafe {
10464 envelope.read_unchecked::<::fidl_next::WireU64>()
10465 })
10466 }),
10467
10468 change_time: change_time.map(|envelope| {
10469 ::fidl_next::FromWire::from_wire(unsafe {
10470 envelope.read_unchecked::<::fidl_next::WireU64>()
10471 })
10472 }),
10473
10474 options: options.map(|envelope| {
10475 ::fidl_next::FromWire::from_wire(unsafe {
10476 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
10477 })
10478 }),
10479
10480 root_hash: root_hash.map(|envelope| {
10481 ::fidl_next::FromWire::from_wire(unsafe {
10482 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
10483 })
10484 }),
10485
10486 verity_enabled: verity_enabled.map(|envelope| {
10487 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10488 }),
10489 }
10490 }
10491}
10492
10493impl<'de> ::fidl_next::IntoNatural for WireImmutableNodeAttributes<'de> {
10494 type Natural = ImmutableNodeAttributes;
10495}
10496
10497impl<'de> ::fidl_next::FromWireRef<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
10498 #[inline]
10499 fn from_wire_ref(wire: &WireImmutableNodeAttributes<'de>) -> Self {
10500 Self {
10501 protocols: wire.table.get(1).map(|envelope| {
10502 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10503 envelope.deref_unchecked::<crate::WireNodeProtocolKinds>()
10504 })
10505 }),
10506
10507 abilities: wire.table.get(2).map(|envelope| {
10508 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10509 envelope.deref_unchecked::<crate::WireOperations>()
10510 })
10511 }),
10512
10513 content_size: wire.table.get(3).map(|envelope| {
10514 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10515 envelope.deref_unchecked::<::fidl_next::WireU64>()
10516 })
10517 }),
10518
10519 storage_size: wire.table.get(4).map(|envelope| {
10520 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10521 envelope.deref_unchecked::<::fidl_next::WireU64>()
10522 })
10523 }),
10524
10525 link_count: wire.table.get(5).map(|envelope| {
10526 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10527 envelope.deref_unchecked::<::fidl_next::WireU64>()
10528 })
10529 }),
10530
10531 id: wire.table.get(6).map(|envelope| {
10532 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10533 envelope.deref_unchecked::<::fidl_next::WireU64>()
10534 })
10535 }),
10536
10537 change_time: wire.table.get(7).map(|envelope| {
10538 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10539 envelope.deref_unchecked::<::fidl_next::WireU64>()
10540 })
10541 }),
10542
10543 options: wire.table.get(8).map(|envelope| {
10544 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10545 envelope.deref_unchecked::<crate::WireVerificationOptions<'de>>()
10546 })
10547 }),
10548
10549 root_hash: wire.table.get(9).map(|envelope| {
10550 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10551 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
10552 })
10553 }),
10554
10555 verity_enabled: wire.table.get(10).map(|envelope| {
10556 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10557 envelope.deref_unchecked::<bool>()
10558 })
10559 }),
10560 }
10561 }
10562}
10563
10564#[repr(C)]
10566pub struct WireImmutableNodeAttributes<'de> {
10567 table: ::fidl_next::WireTable<'de>,
10568}
10569
10570impl<'de> Drop for WireImmutableNodeAttributes<'de> {
10571 fn drop(&mut self) {
10572 let _ = self
10573 .table
10574 .get(1)
10575 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeProtocolKinds>() });
10576
10577 let _ = self
10578 .table
10579 .get(2)
10580 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
10581
10582 let _ = self
10583 .table
10584 .get(3)
10585 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
10586
10587 let _ = self
10588 .table
10589 .get(4)
10590 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
10591
10592 let _ = self
10593 .table
10594 .get(5)
10595 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
10596
10597 let _ = self
10598 .table
10599 .get(6)
10600 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
10601
10602 let _ = self
10603 .table
10604 .get(7)
10605 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
10606
10607 let _ = self.table.get(8).map(|envelope| unsafe {
10608 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
10609 });
10610
10611 let _ = self.table.get(9).map(|envelope| unsafe {
10612 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
10613 });
10614
10615 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10616 }
10617}
10618
10619unsafe impl ::fidl_next::Wire for WireImmutableNodeAttributes<'static> {
10620 type Decoded<'de> = WireImmutableNodeAttributes<'de>;
10621
10622 #[inline]
10623 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10624 ::fidl_next::munge!(let Self { table } = out);
10625 ::fidl_next::WireTable::zero_padding(table);
10626 }
10627}
10628
10629unsafe impl<___D> ::fidl_next::Decode<___D> for WireImmutableNodeAttributes<'static>
10630where
10631 ___D: ::fidl_next::Decoder + ?Sized,
10632{
10633 fn decode(
10634 slot: ::fidl_next::Slot<'_, Self>,
10635 decoder: &mut ___D,
10636 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10637 ::fidl_next::munge!(let Self { table } = slot);
10638
10639 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10640 match ordinal {
10641 0 => unsafe { ::core::hint::unreachable_unchecked() },
10642
10643 1 => {
10644 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeProtocolKinds>(
10645 slot.as_mut(),
10646 decoder,
10647 )?;
10648
10649 Ok(())
10650 }
10651
10652 2 => {
10653 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
10654 slot.as_mut(),
10655 decoder,
10656 )?;
10657
10658 Ok(())
10659 }
10660
10661 3 => {
10662 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
10663 slot.as_mut(),
10664 decoder,
10665 )?;
10666
10667 Ok(())
10668 }
10669
10670 4 => {
10671 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
10672 slot.as_mut(),
10673 decoder,
10674 )?;
10675
10676 Ok(())
10677 }
10678
10679 5 => {
10680 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
10681 slot.as_mut(),
10682 decoder,
10683 )?;
10684
10685 Ok(())
10686 }
10687
10688 6 => {
10689 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
10690 slot.as_mut(),
10691 decoder,
10692 )?;
10693
10694 Ok(())
10695 }
10696
10697 7 => {
10698 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
10699 slot.as_mut(),
10700 decoder,
10701 )?;
10702
10703 Ok(())
10704 }
10705
10706 8 => {
10707 ::fidl_next::WireEnvelope::decode_as::<
10708 ___D,
10709 crate::WireVerificationOptions<'static>,
10710 >(slot.as_mut(), decoder)?;
10711
10712 Ok(())
10713 }
10714
10715 9 => {
10716 ::fidl_next::WireEnvelope::decode_as::<
10717 ___D,
10718 ::fidl_next::WireVector<'static, u8>,
10719 >(slot.as_mut(), decoder)?;
10720
10721 let value = unsafe {
10722 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
10723 };
10724
10725 if value.len() > 64 {
10726 return Err(::fidl_next::DecodeError::VectorTooLong {
10727 size: value.len() as u64,
10728 limit: 64,
10729 });
10730 }
10731
10732 Ok(())
10733 }
10734
10735 10 => {
10736 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10737
10738 Ok(())
10739 }
10740
10741 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10742 }
10743 })
10744 }
10745}
10746
10747impl<'de> WireImmutableNodeAttributes<'de> {
10748 pub fn protocols(&self) -> ::core::option::Option<&crate::WireNodeProtocolKinds> {
10749 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10750 }
10751
10752 pub fn abilities(&self) -> ::core::option::Option<&crate::WireOperations> {
10753 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10754 }
10755
10756 pub fn content_size(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
10757 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10758 }
10759
10760 pub fn storage_size(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
10761 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10762 }
10763
10764 pub fn link_count(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
10765 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10766 }
10767
10768 pub fn id(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
10769 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10770 }
10771
10772 pub fn change_time(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
10773 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10774 }
10775
10776 pub fn options(&self) -> ::core::option::Option<&crate::WireVerificationOptions<'de>> {
10777 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10778 }
10779
10780 pub fn root_hash(&self) -> ::core::option::Option<&::fidl_next::WireVector<'de, u8>> {
10781 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
10782 }
10783
10784 pub fn verity_enabled(&self) -> ::core::option::Option<&bool> {
10785 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
10786 }
10787}
10788
10789impl<'de> ::core::fmt::Debug for WireImmutableNodeAttributes<'de> {
10790 fn fmt(
10791 &self,
10792 f: &mut ::core::fmt::Formatter<'_>,
10793 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10794 f.debug_struct("ImmutableNodeAttributes")
10795 .field("protocols", &self.protocols())
10796 .field("abilities", &self.abilities())
10797 .field("content_size", &self.content_size())
10798 .field("storage_size", &self.storage_size())
10799 .field("link_count", &self.link_count())
10800 .field("id", &self.id())
10801 .field("change_time", &self.change_time())
10802 .field("options", &self.options())
10803 .field("root_hash", &self.root_hash())
10804 .field("verity_enabled", &self.verity_enabled())
10805 .finish()
10806 }
10807}
10808
10809#[derive(PartialEq, Clone, Debug)]
10810pub struct NodeAttributes2 {
10811 pub mutable_attributes: crate::MutableNodeAttributes,
10812
10813 pub immutable_attributes: crate::ImmutableNodeAttributes,
10814}
10815
10816impl ::fidl_next::Encodable for NodeAttributes2 {
10817 type Encoded = WireNodeAttributes2<'static>;
10818}
10819
10820unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes2
10821where
10822 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10823 ___E: ::fidl_next::Encoder,
10824{
10825 #[inline]
10826 fn encode(
10827 self,
10828 encoder_: &mut ___E,
10829 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10830 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10831 ::fidl_next::munge! {
10832 let Self::Encoded {
10833 mutable_attributes,
10834 immutable_attributes,
10835
10836 } = out_;
10837 }
10838
10839 ::fidl_next::Encode::encode(self.mutable_attributes, encoder_, mutable_attributes)?;
10840
10841 ::fidl_next::Encode::encode(self.immutable_attributes, encoder_, immutable_attributes)?;
10842
10843 Ok(())
10844 }
10845}
10846
10847unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes2
10848where
10849 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10850 ___E: ::fidl_next::Encoder,
10851{
10852 #[inline]
10853 fn encode_ref(
10854 &self,
10855 encoder_: &mut ___E,
10856 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10857 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10858 ::fidl_next::munge! {
10859 let Self::Encoded {
10860
10861 mutable_attributes,
10862 immutable_attributes,
10863
10864 } = out_;
10865 }
10866
10867 ::fidl_next::EncodeRef::encode_ref(&self.mutable_attributes, encoder_, mutable_attributes)?;
10868
10869 ::fidl_next::EncodeRef::encode_ref(
10870 &self.immutable_attributes,
10871 encoder_,
10872 immutable_attributes,
10873 )?;
10874
10875 Ok(())
10876 }
10877}
10878
10879impl ::fidl_next::EncodableOption for NodeAttributes2 {
10880 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes2<'static>>;
10881}
10882
10883unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes2
10884where
10885 ___E: ::fidl_next::Encoder + ?Sized,
10886 NodeAttributes2: ::fidl_next::Encode<___E>,
10887{
10888 #[inline]
10889 fn encode_option(
10890 this: ::core::option::Option<Self>,
10891 encoder: &mut ___E,
10892 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10893 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10894 if let Some(inner) = this {
10895 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10896 ::fidl_next::WireBox::encode_present(out);
10897 } else {
10898 ::fidl_next::WireBox::encode_absent(out);
10899 }
10900
10901 Ok(())
10902 }
10903}
10904
10905unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes2
10906where
10907 ___E: ::fidl_next::Encoder + ?Sized,
10908 NodeAttributes2: ::fidl_next::EncodeRef<___E>,
10909{
10910 #[inline]
10911 fn encode_option_ref(
10912 this: ::core::option::Option<&Self>,
10913 encoder: &mut ___E,
10914 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10915 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10916 if let Some(inner) = this {
10917 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10918 ::fidl_next::WireBox::encode_present(out);
10919 } else {
10920 ::fidl_next::WireBox::encode_absent(out);
10921 }
10922
10923 Ok(())
10924 }
10925}
10926
10927impl<'de> ::fidl_next::FromWire<WireNodeAttributes2<'de>> for NodeAttributes2 {
10928 #[inline]
10929 fn from_wire(wire: WireNodeAttributes2<'de>) -> Self {
10930 Self {
10931 mutable_attributes: ::fidl_next::FromWire::from_wire(wire.mutable_attributes),
10932
10933 immutable_attributes: ::fidl_next::FromWire::from_wire(wire.immutable_attributes),
10934 }
10935 }
10936}
10937
10938impl<'de> ::fidl_next::IntoNatural for WireNodeAttributes2<'de> {
10939 type Natural = NodeAttributes2;
10940}
10941
10942impl<'de> ::fidl_next::FromWireRef<WireNodeAttributes2<'de>> for NodeAttributes2 {
10943 #[inline]
10944 fn from_wire_ref(wire: &WireNodeAttributes2<'de>) -> Self {
10945 Self {
10946 mutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.mutable_attributes),
10947
10948 immutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(
10949 &wire.immutable_attributes,
10950 ),
10951 }
10952 }
10953}
10954
10955#[derive(Debug)]
10957#[repr(C)]
10958pub struct WireNodeAttributes2<'de> {
10959 pub mutable_attributes: crate::WireMutableNodeAttributes<'de>,
10960
10961 pub immutable_attributes: crate::WireImmutableNodeAttributes<'de>,
10962}
10963static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeAttributes2<'_>>(), 32);
10964static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeAttributes2<'_>>(), 8);
10965
10966static_assertions::const_assert_eq!(
10967 std::mem::offset_of!(WireNodeAttributes2<'_>, mutable_attributes),
10968 0
10969);
10970
10971static_assertions::const_assert_eq!(
10972 std::mem::offset_of!(WireNodeAttributes2<'_>, immutable_attributes),
10973 16
10974);
10975
10976unsafe impl ::fidl_next::Wire for WireNodeAttributes2<'static> {
10977 type Decoded<'de> = WireNodeAttributes2<'de>;
10978
10979 #[inline]
10980 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
10981 ::fidl_next::munge! {
10982 let Self {
10983
10984 mutable_attributes,
10985 immutable_attributes,
10986
10987 } = &mut *out_;
10988 }
10989
10990 ::fidl_next::Wire::zero_padding(mutable_attributes);
10991
10992 ::fidl_next::Wire::zero_padding(immutable_attributes);
10993 }
10994}
10995
10996unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes2<'static>
10997where
10998 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10999 ___D: ::fidl_next::Decoder,
11000{
11001 fn decode(
11002 slot_: ::fidl_next::Slot<'_, Self>,
11003 decoder_: &mut ___D,
11004 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11005 ::fidl_next::munge! {
11006 let Self {
11007
11008 mut mutable_attributes,
11009 mut immutable_attributes,
11010
11011 } = slot_;
11012 }
11013
11014 ::fidl_next::Decode::decode(mutable_attributes.as_mut(), decoder_)?;
11015
11016 ::fidl_next::Decode::decode(immutable_attributes.as_mut(), decoder_)?;
11017
11018 Ok(())
11019 }
11020}
11021
11022#[doc = " Information that describes the target node.\n"]
11023#[derive(PartialEq, Clone, Debug, Default)]
11024pub struct NodeInfo {
11025 pub attributes: ::core::option::Option<crate::NodeAttributes2>,
11026}
11027
11028impl NodeInfo {
11029 fn __max_ordinal(&self) -> usize {
11030 if self.attributes.is_some() {
11031 return 1;
11032 }
11033
11034 0
11035 }
11036}
11037
11038impl ::fidl_next::Encodable for NodeInfo {
11039 type Encoded = WireNodeInfo<'static>;
11040}
11041
11042unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfo
11043where
11044 ___E: ::fidl_next::Encoder + ?Sized,
11045{
11046 #[inline]
11047 fn encode(
11048 mut self,
11049 encoder: &mut ___E,
11050 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11051 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11052 ::fidl_next::munge!(let WireNodeInfo { table } = out);
11053
11054 let max_ord = self.__max_ordinal();
11055
11056 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11057 ::fidl_next::Wire::zero_padding(&mut out);
11058
11059 let mut preallocated =
11060 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11061
11062 for i in 1..=max_ord {
11063 match i {
11064 1 => {
11065 if let Some(value) = self.attributes.take() {
11066 ::fidl_next::WireEnvelope::encode_value(
11067 value,
11068 preallocated.encoder,
11069 &mut out,
11070 )?;
11071 } else {
11072 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11073 }
11074 }
11075
11076 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11077 }
11078 unsafe {
11079 preallocated.write_next(out.assume_init_ref());
11080 }
11081 }
11082
11083 ::fidl_next::WireTable::encode_len(table, max_ord);
11084
11085 Ok(())
11086 }
11087}
11088
11089unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeInfo
11090where
11091 ___E: ::fidl_next::Encoder + ?Sized,
11092{
11093 #[inline]
11094 fn encode_ref(
11095 &self,
11096 encoder: &mut ___E,
11097 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11099 ::fidl_next::munge!(let WireNodeInfo { table } = out);
11100
11101 let max_ord = self.__max_ordinal();
11102
11103 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11104 ::fidl_next::Wire::zero_padding(&mut out);
11105
11106 let mut preallocated =
11107 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11108
11109 for i in 1..=max_ord {
11110 match i {
11111 1 => {
11112 if let Some(value) = &self.attributes {
11113 ::fidl_next::WireEnvelope::encode_value(
11114 value,
11115 preallocated.encoder,
11116 &mut out,
11117 )?;
11118 } else {
11119 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11120 }
11121 }
11122
11123 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11124 }
11125 unsafe {
11126 preallocated.write_next(out.assume_init_ref());
11127 }
11128 }
11129
11130 ::fidl_next::WireTable::encode_len(table, max_ord);
11131
11132 Ok(())
11133 }
11134}
11135
11136impl<'de> ::fidl_next::FromWire<WireNodeInfo<'de>> for NodeInfo {
11137 #[inline]
11138 fn from_wire(wire_: WireNodeInfo<'de>) -> Self {
11139 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11140
11141 let attributes = wire_.table.get(1);
11142
11143 Self {
11144 attributes: attributes.map(|envelope| {
11145 ::fidl_next::FromWire::from_wire(unsafe {
11146 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11147 })
11148 }),
11149 }
11150 }
11151}
11152
11153impl<'de> ::fidl_next::IntoNatural for WireNodeInfo<'de> {
11154 type Natural = NodeInfo;
11155}
11156
11157impl<'de> ::fidl_next::FromWireRef<WireNodeInfo<'de>> for NodeInfo {
11158 #[inline]
11159 fn from_wire_ref(wire: &WireNodeInfo<'de>) -> Self {
11160 Self {
11161 attributes: wire.table.get(1).map(|envelope| {
11162 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11163 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
11164 })
11165 }),
11166 }
11167 }
11168}
11169
11170#[repr(C)]
11172pub struct WireNodeInfo<'de> {
11173 table: ::fidl_next::WireTable<'de>,
11174}
11175
11176impl<'de> Drop for WireNodeInfo<'de> {
11177 fn drop(&mut self) {
11178 let _ = self.table.get(1).map(|envelope| unsafe {
11179 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11180 });
11181 }
11182}
11183
11184unsafe impl ::fidl_next::Wire for WireNodeInfo<'static> {
11185 type Decoded<'de> = WireNodeInfo<'de>;
11186
11187 #[inline]
11188 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11189 ::fidl_next::munge!(let Self { table } = out);
11190 ::fidl_next::WireTable::zero_padding(table);
11191 }
11192}
11193
11194unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfo<'static>
11195where
11196 ___D: ::fidl_next::Decoder + ?Sized,
11197{
11198 fn decode(
11199 slot: ::fidl_next::Slot<'_, Self>,
11200 decoder: &mut ___D,
11201 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11202 ::fidl_next::munge!(let Self { table } = slot);
11203
11204 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11205 match ordinal {
11206 0 => unsafe { ::core::hint::unreachable_unchecked() },
11207
11208 1 => {
11209 ::fidl_next::WireEnvelope::decode_as::<
11210 ___D,
11211 crate::WireNodeAttributes2<'static>,
11212 >(slot.as_mut(), decoder)?;
11213
11214 Ok(())
11215 }
11216
11217 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11218 }
11219 })
11220 }
11221}
11222
11223impl<'de> WireNodeInfo<'de> {
11224 pub fn attributes(&self) -> ::core::option::Option<&crate::WireNodeAttributes2<'de>> {
11225 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11226 }
11227}
11228
11229impl<'de> ::core::fmt::Debug for WireNodeInfo<'de> {
11230 fn fmt(
11231 &self,
11232 f: &mut ::core::fmt::Formatter<'_>,
11233 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11234 f.debug_struct("NodeInfo").field("attributes", &self.attributes()).finish()
11235 }
11236}
11237
11238#[derive(PartialEq, Clone, Debug, Default)]
11239pub struct DirectoryInfo {
11240 pub attributes: ::core::option::Option<crate::NodeAttributes2>,
11241}
11242
11243impl DirectoryInfo {
11244 fn __max_ordinal(&self) -> usize {
11245 if self.attributes.is_some() {
11246 return 1;
11247 }
11248
11249 0
11250 }
11251}
11252
11253impl ::fidl_next::Encodable for DirectoryInfo {
11254 type Encoded = WireDirectoryInfo<'static>;
11255}
11256
11257unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryInfo
11258where
11259 ___E: ::fidl_next::Encoder + ?Sized,
11260{
11261 #[inline]
11262 fn encode(
11263 mut self,
11264 encoder: &mut ___E,
11265 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11267 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
11268
11269 let max_ord = self.__max_ordinal();
11270
11271 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11272 ::fidl_next::Wire::zero_padding(&mut out);
11273
11274 let mut preallocated =
11275 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11276
11277 for i in 1..=max_ord {
11278 match i {
11279 1 => {
11280 if let Some(value) = self.attributes.take() {
11281 ::fidl_next::WireEnvelope::encode_value(
11282 value,
11283 preallocated.encoder,
11284 &mut out,
11285 )?;
11286 } else {
11287 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11288 }
11289 }
11290
11291 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11292 }
11293 unsafe {
11294 preallocated.write_next(out.assume_init_ref());
11295 }
11296 }
11297
11298 ::fidl_next::WireTable::encode_len(table, max_ord);
11299
11300 Ok(())
11301 }
11302}
11303
11304unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryInfo
11305where
11306 ___E: ::fidl_next::Encoder + ?Sized,
11307{
11308 #[inline]
11309 fn encode_ref(
11310 &self,
11311 encoder: &mut ___E,
11312 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11313 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11314 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
11315
11316 let max_ord = self.__max_ordinal();
11317
11318 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11319 ::fidl_next::Wire::zero_padding(&mut out);
11320
11321 let mut preallocated =
11322 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11323
11324 for i in 1..=max_ord {
11325 match i {
11326 1 => {
11327 if let Some(value) = &self.attributes {
11328 ::fidl_next::WireEnvelope::encode_value(
11329 value,
11330 preallocated.encoder,
11331 &mut out,
11332 )?;
11333 } else {
11334 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11335 }
11336 }
11337
11338 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11339 }
11340 unsafe {
11341 preallocated.write_next(out.assume_init_ref());
11342 }
11343 }
11344
11345 ::fidl_next::WireTable::encode_len(table, max_ord);
11346
11347 Ok(())
11348 }
11349}
11350
11351impl<'de> ::fidl_next::FromWire<WireDirectoryInfo<'de>> for DirectoryInfo {
11352 #[inline]
11353 fn from_wire(wire_: WireDirectoryInfo<'de>) -> Self {
11354 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11355
11356 let attributes = wire_.table.get(1);
11357
11358 Self {
11359 attributes: attributes.map(|envelope| {
11360 ::fidl_next::FromWire::from_wire(unsafe {
11361 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11362 })
11363 }),
11364 }
11365 }
11366}
11367
11368impl<'de> ::fidl_next::IntoNatural for WireDirectoryInfo<'de> {
11369 type Natural = DirectoryInfo;
11370}
11371
11372impl<'de> ::fidl_next::FromWireRef<WireDirectoryInfo<'de>> for DirectoryInfo {
11373 #[inline]
11374 fn from_wire_ref(wire: &WireDirectoryInfo<'de>) -> Self {
11375 Self {
11376 attributes: wire.table.get(1).map(|envelope| {
11377 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11378 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
11379 })
11380 }),
11381 }
11382 }
11383}
11384
11385#[repr(C)]
11387pub struct WireDirectoryInfo<'de> {
11388 table: ::fidl_next::WireTable<'de>,
11389}
11390
11391impl<'de> Drop for WireDirectoryInfo<'de> {
11392 fn drop(&mut self) {
11393 let _ = self.table.get(1).map(|envelope| unsafe {
11394 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11395 });
11396 }
11397}
11398
11399unsafe impl ::fidl_next::Wire for WireDirectoryInfo<'static> {
11400 type Decoded<'de> = WireDirectoryInfo<'de>;
11401
11402 #[inline]
11403 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11404 ::fidl_next::munge!(let Self { table } = out);
11405 ::fidl_next::WireTable::zero_padding(table);
11406 }
11407}
11408
11409unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryInfo<'static>
11410where
11411 ___D: ::fidl_next::Decoder + ?Sized,
11412{
11413 fn decode(
11414 slot: ::fidl_next::Slot<'_, Self>,
11415 decoder: &mut ___D,
11416 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11417 ::fidl_next::munge!(let Self { table } = slot);
11418
11419 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11420 match ordinal {
11421 0 => unsafe { ::core::hint::unreachable_unchecked() },
11422
11423 1 => {
11424 ::fidl_next::WireEnvelope::decode_as::<
11425 ___D,
11426 crate::WireNodeAttributes2<'static>,
11427 >(slot.as_mut(), decoder)?;
11428
11429 Ok(())
11430 }
11431
11432 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11433 }
11434 })
11435 }
11436}
11437
11438impl<'de> WireDirectoryInfo<'de> {
11439 pub fn attributes(&self) -> ::core::option::Option<&crate::WireNodeAttributes2<'de>> {
11440 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11441 }
11442}
11443
11444impl<'de> ::core::fmt::Debug for WireDirectoryInfo<'de> {
11445 fn fmt(
11446 &self,
11447 f: &mut ::core::fmt::Formatter<'_>,
11448 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11449 f.debug_struct("DirectoryInfo").field("attributes", &self.attributes()).finish()
11450 }
11451}
11452
11453#[doc = " Auxiliary data for the file representation of a node.\n"]
11454#[derive(PartialEq, Debug, Default)]
11455pub struct FileInfo {
11456 pub is_append: ::core::option::Option<bool>,
11457
11458 pub observer: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
11459
11460 pub stream: ::core::option::Option<::fidl_next::fuchsia::zx::Stream>,
11461
11462 pub attributes: ::core::option::Option<crate::NodeAttributes2>,
11463}
11464
11465impl FileInfo {
11466 fn __max_ordinal(&self) -> usize {
11467 if self.attributes.is_some() {
11468 return 4;
11469 }
11470
11471 if self.stream.is_some() {
11472 return 3;
11473 }
11474
11475 if self.observer.is_some() {
11476 return 2;
11477 }
11478
11479 if self.is_append.is_some() {
11480 return 1;
11481 }
11482
11483 0
11484 }
11485}
11486
11487impl ::fidl_next::Encodable for FileInfo {
11488 type Encoded = WireFileInfo<'static>;
11489}
11490
11491unsafe impl<___E> ::fidl_next::Encode<___E> for FileInfo
11492where
11493 ___E: ::fidl_next::Encoder + ?Sized,
11494 ___E: ::fidl_next::fuchsia::HandleEncoder,
11495{
11496 #[inline]
11497 fn encode(
11498 mut self,
11499 encoder: &mut ___E,
11500 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11501 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11502 ::fidl_next::munge!(let WireFileInfo { table } = out);
11503
11504 let max_ord = self.__max_ordinal();
11505
11506 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11507 ::fidl_next::Wire::zero_padding(&mut out);
11508
11509 let mut preallocated =
11510 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11511
11512 for i in 1..=max_ord {
11513 match i {
11514 4 => {
11515 if let Some(value) = self.attributes.take() {
11516 ::fidl_next::WireEnvelope::encode_value(
11517 value,
11518 preallocated.encoder,
11519 &mut out,
11520 )?;
11521 } else {
11522 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11523 }
11524 }
11525
11526 3 => {
11527 if let Some(value) = self.stream.take() {
11528 ::fidl_next::WireEnvelope::encode_value(
11529 value,
11530 preallocated.encoder,
11531 &mut out,
11532 )?;
11533 } else {
11534 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11535 }
11536 }
11537
11538 2 => {
11539 if let Some(value) = self.observer.take() {
11540 ::fidl_next::WireEnvelope::encode_value(
11541 value,
11542 preallocated.encoder,
11543 &mut out,
11544 )?;
11545 } else {
11546 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11547 }
11548 }
11549
11550 1 => {
11551 if let Some(value) = self.is_append.take() {
11552 ::fidl_next::WireEnvelope::encode_value(
11553 value,
11554 preallocated.encoder,
11555 &mut out,
11556 )?;
11557 } else {
11558 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11559 }
11560 }
11561
11562 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11563 }
11564 unsafe {
11565 preallocated.write_next(out.assume_init_ref());
11566 }
11567 }
11568
11569 ::fidl_next::WireTable::encode_len(table, max_ord);
11570
11571 Ok(())
11572 }
11573}
11574
11575impl<'de> ::fidl_next::FromWire<WireFileInfo<'de>> for FileInfo {
11576 #[inline]
11577 fn from_wire(wire_: WireFileInfo<'de>) -> Self {
11578 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11579
11580 let is_append = wire_.table.get(1);
11581
11582 let observer = wire_.table.get(2);
11583
11584 let stream = wire_.table.get(3);
11585
11586 let attributes = wire_.table.get(4);
11587
11588 Self {
11589 is_append: is_append.map(|envelope| {
11590 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
11591 }),
11592
11593 observer: observer.map(|envelope| {
11594 ::fidl_next::FromWire::from_wire(unsafe {
11595 envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
11596 })
11597 }),
11598
11599 stream: stream.map(|envelope| {
11600 ::fidl_next::FromWire::from_wire(unsafe {
11601 envelope.read_unchecked::<::fidl_next::fuchsia::WireStream>()
11602 })
11603 }),
11604
11605 attributes: attributes.map(|envelope| {
11606 ::fidl_next::FromWire::from_wire(unsafe {
11607 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11608 })
11609 }),
11610 }
11611 }
11612}
11613
11614impl<'de> ::fidl_next::IntoNatural for WireFileInfo<'de> {
11615 type Natural = FileInfo;
11616}
11617
11618#[repr(C)]
11620pub struct WireFileInfo<'de> {
11621 table: ::fidl_next::WireTable<'de>,
11622}
11623
11624impl<'de> Drop for WireFileInfo<'de> {
11625 fn drop(&mut self) {
11626 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
11627
11628 let _ = self.table.get(2).map(|envelope| unsafe {
11629 envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
11630 });
11631
11632 let _ = self.table.get(3).map(|envelope| unsafe {
11633 envelope.read_unchecked::<::fidl_next::fuchsia::WireStream>()
11634 });
11635
11636 let _ = self.table.get(4).map(|envelope| unsafe {
11637 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11638 });
11639 }
11640}
11641
11642unsafe impl ::fidl_next::Wire for WireFileInfo<'static> {
11643 type Decoded<'de> = WireFileInfo<'de>;
11644
11645 #[inline]
11646 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11647 ::fidl_next::munge!(let Self { table } = out);
11648 ::fidl_next::WireTable::zero_padding(table);
11649 }
11650}
11651
11652unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileInfo<'static>
11653where
11654 ___D: ::fidl_next::Decoder + ?Sized,
11655 ___D: ::fidl_next::fuchsia::HandleDecoder,
11656{
11657 fn decode(
11658 slot: ::fidl_next::Slot<'_, Self>,
11659 decoder: &mut ___D,
11660 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11661 ::fidl_next::munge!(let Self { table } = slot);
11662
11663 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11664 match ordinal {
11665 0 => unsafe { ::core::hint::unreachable_unchecked() },
11666
11667 1 => {
11668 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
11669
11670 Ok(())
11671 }
11672
11673 2 => {
11674 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
11675 slot.as_mut(),
11676 decoder,
11677 )?;
11678
11679 Ok(())
11680 }
11681
11682 3 => {
11683 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireStream>(
11684 slot.as_mut(),
11685 decoder,
11686 )?;
11687
11688 Ok(())
11689 }
11690
11691 4 => {
11692 ::fidl_next::WireEnvelope::decode_as::<
11693 ___D,
11694 crate::WireNodeAttributes2<'static>,
11695 >(slot.as_mut(), decoder)?;
11696
11697 Ok(())
11698 }
11699
11700 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11701 }
11702 })
11703 }
11704}
11705
11706impl<'de> WireFileInfo<'de> {
11707 pub fn is_append(&self) -> ::core::option::Option<&bool> {
11708 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11709 }
11710
11711 pub fn observer(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireEvent> {
11712 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11713 }
11714
11715 pub fn stream(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireStream> {
11716 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11717 }
11718
11719 pub fn attributes(&self) -> ::core::option::Option<&crate::WireNodeAttributes2<'de>> {
11720 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
11721 }
11722}
11723
11724impl<'de> ::core::fmt::Debug for WireFileInfo<'de> {
11725 fn fmt(
11726 &self,
11727 f: &mut ::core::fmt::Formatter<'_>,
11728 ) -> ::core::result::Result<(), ::core::fmt::Error> {
11729 f.debug_struct("FileInfo")
11730 .field("is_append", &self.is_append())
11731 .field("observer", &self.observer())
11732 .field("stream", &self.stream())
11733 .field("attributes", &self.attributes())
11734 .finish()
11735 }
11736}
11737
11738#[derive(PartialEq, Clone, Debug, Default)]
11739pub struct SymlinkInfo {
11740 pub target: ::core::option::Option<::std::vec::Vec<u8>>,
11741
11742 pub attributes: ::core::option::Option<crate::NodeAttributes2>,
11743}
11744
11745impl SymlinkInfo {
11746 fn __max_ordinal(&self) -> usize {
11747 if self.attributes.is_some() {
11748 return 2;
11749 }
11750
11751 if self.target.is_some() {
11752 return 1;
11753 }
11754
11755 0
11756 }
11757}
11758
11759impl ::fidl_next::Encodable for SymlinkInfo {
11760 type Encoded = WireSymlinkInfo<'static>;
11761}
11762
11763unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkInfo
11764where
11765 ___E: ::fidl_next::Encoder + ?Sized,
11766{
11767 #[inline]
11768 fn encode(
11769 mut self,
11770 encoder: &mut ___E,
11771 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11772 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11773 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
11774
11775 let max_ord = self.__max_ordinal();
11776
11777 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11778 ::fidl_next::Wire::zero_padding(&mut out);
11779
11780 let mut preallocated =
11781 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11782
11783 for i in 1..=max_ord {
11784 match i {
11785 2 => {
11786 if let Some(value) = self.attributes.take() {
11787 ::fidl_next::WireEnvelope::encode_value(
11788 value,
11789 preallocated.encoder,
11790 &mut out,
11791 )?;
11792 } else {
11793 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11794 }
11795 }
11796
11797 1 => {
11798 if let Some(value) = self.target.take() {
11799 ::fidl_next::WireEnvelope::encode_value(
11800 value,
11801 preallocated.encoder,
11802 &mut out,
11803 )?;
11804 } else {
11805 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11806 }
11807 }
11808
11809 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11810 }
11811 unsafe {
11812 preallocated.write_next(out.assume_init_ref());
11813 }
11814 }
11815
11816 ::fidl_next::WireTable::encode_len(table, max_ord);
11817
11818 Ok(())
11819 }
11820}
11821
11822unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkInfo
11823where
11824 ___E: ::fidl_next::Encoder + ?Sized,
11825{
11826 #[inline]
11827 fn encode_ref(
11828 &self,
11829 encoder: &mut ___E,
11830 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11831 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11832 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
11833
11834 let max_ord = self.__max_ordinal();
11835
11836 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11837 ::fidl_next::Wire::zero_padding(&mut out);
11838
11839 let mut preallocated =
11840 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11841
11842 for i in 1..=max_ord {
11843 match i {
11844 2 => {
11845 if let Some(value) = &self.attributes {
11846 ::fidl_next::WireEnvelope::encode_value(
11847 value,
11848 preallocated.encoder,
11849 &mut out,
11850 )?;
11851 } else {
11852 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11853 }
11854 }
11855
11856 1 => {
11857 if let Some(value) = &self.target {
11858 ::fidl_next::WireEnvelope::encode_value(
11859 value,
11860 preallocated.encoder,
11861 &mut out,
11862 )?;
11863 } else {
11864 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11865 }
11866 }
11867
11868 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11869 }
11870 unsafe {
11871 preallocated.write_next(out.assume_init_ref());
11872 }
11873 }
11874
11875 ::fidl_next::WireTable::encode_len(table, max_ord);
11876
11877 Ok(())
11878 }
11879}
11880
11881impl<'de> ::fidl_next::FromWire<WireSymlinkInfo<'de>> for SymlinkInfo {
11882 #[inline]
11883 fn from_wire(wire_: WireSymlinkInfo<'de>) -> Self {
11884 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11885
11886 let target = wire_.table.get(1);
11887
11888 let attributes = wire_.table.get(2);
11889
11890 Self {
11891 target: target.map(|envelope| {
11892 ::fidl_next::FromWire::from_wire(unsafe {
11893 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
11894 })
11895 }),
11896
11897 attributes: attributes.map(|envelope| {
11898 ::fidl_next::FromWire::from_wire(unsafe {
11899 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11900 })
11901 }),
11902 }
11903 }
11904}
11905
11906impl<'de> ::fidl_next::IntoNatural for WireSymlinkInfo<'de> {
11907 type Natural = SymlinkInfo;
11908}
11909
11910impl<'de> ::fidl_next::FromWireRef<WireSymlinkInfo<'de>> for SymlinkInfo {
11911 #[inline]
11912 fn from_wire_ref(wire: &WireSymlinkInfo<'de>) -> Self {
11913 Self {
11914 target: wire.table.get(1).map(|envelope| {
11915 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11916 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
11917 })
11918 }),
11919
11920 attributes: wire.table.get(2).map(|envelope| {
11921 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11922 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
11923 })
11924 }),
11925 }
11926 }
11927}
11928
11929#[repr(C)]
11931pub struct WireSymlinkInfo<'de> {
11932 table: ::fidl_next::WireTable<'de>,
11933}
11934
11935impl<'de> Drop for WireSymlinkInfo<'de> {
11936 fn drop(&mut self) {
11937 let _ = self.table.get(1).map(|envelope| unsafe {
11938 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
11939 });
11940
11941 let _ = self.table.get(2).map(|envelope| unsafe {
11942 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11943 });
11944 }
11945}
11946
11947unsafe impl ::fidl_next::Wire for WireSymlinkInfo<'static> {
11948 type Decoded<'de> = WireSymlinkInfo<'de>;
11949
11950 #[inline]
11951 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11952 ::fidl_next::munge!(let Self { table } = out);
11953 ::fidl_next::WireTable::zero_padding(table);
11954 }
11955}
11956
11957unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkInfo<'static>
11958where
11959 ___D: ::fidl_next::Decoder + ?Sized,
11960{
11961 fn decode(
11962 slot: ::fidl_next::Slot<'_, Self>,
11963 decoder: &mut ___D,
11964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11965 ::fidl_next::munge!(let Self { table } = slot);
11966
11967 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11968 match ordinal {
11969 0 => unsafe { ::core::hint::unreachable_unchecked() },
11970
11971 1 => {
11972 ::fidl_next::WireEnvelope::decode_as::<
11973 ___D,
11974 ::fidl_next::WireVector<'static, u8>,
11975 >(slot.as_mut(), decoder)?;
11976
11977 let value = unsafe {
11978 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
11979 };
11980
11981 if value.len() > 4095 {
11982 return Err(::fidl_next::DecodeError::VectorTooLong {
11983 size: value.len() as u64,
11984 limit: 4095,
11985 });
11986 }
11987
11988 Ok(())
11989 }
11990
11991 2 => {
11992 ::fidl_next::WireEnvelope::decode_as::<
11993 ___D,
11994 crate::WireNodeAttributes2<'static>,
11995 >(slot.as_mut(), decoder)?;
11996
11997 Ok(())
11998 }
11999
12000 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12001 }
12002 })
12003 }
12004}
12005
12006impl<'de> WireSymlinkInfo<'de> {
12007 pub fn target(&self) -> ::core::option::Option<&::fidl_next::WireVector<'de, u8>> {
12008 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12009 }
12010
12011 pub fn attributes(&self) -> ::core::option::Option<&crate::WireNodeAttributes2<'de>> {
12012 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12013 }
12014}
12015
12016impl<'de> ::core::fmt::Debug for WireSymlinkInfo<'de> {
12017 fn fmt(
12018 &self,
12019 f: &mut ::core::fmt::Formatter<'_>,
12020 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12021 f.debug_struct("SymlinkInfo")
12022 .field("target", &self.target())
12023 .field("attributes", &self.attributes())
12024 .finish()
12025 }
12026}
12027
12028#[derive(PartialEq, Debug)]
12029pub enum Representation {
12030 Node(crate::NodeInfo),
12031
12032 Directory(crate::DirectoryInfo),
12033
12034 File(crate::FileInfo),
12035
12036 Symlink(crate::SymlinkInfo),
12037
12038 UnknownOrdinal_(u64),
12039}
12040
12041impl ::fidl_next::Encodable for Representation {
12042 type Encoded = WireRepresentation<'static>;
12043}
12044
12045unsafe impl<___E> ::fidl_next::Encode<___E> for Representation
12046where
12047 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12048 ___E: ::fidl_next::Encoder,
12049 ___E: ::fidl_next::fuchsia::HandleEncoder,
12050{
12051 #[inline]
12052 fn encode(
12053 self,
12054 encoder: &mut ___E,
12055 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12057 ::fidl_next::munge!(let WireRepresentation { raw, _phantom: _ } = out);
12058
12059 match self {
12060 Self::Node(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::NodeInfo>(
12061 value, 1, encoder, raw,
12062 )?,
12063
12064 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
12065 ___E,
12066 crate::DirectoryInfo,
12067 >(value, 2, encoder, raw)?,
12068
12069 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileInfo>(
12070 value, 3, encoder, raw,
12071 )?,
12072
12073 Self::Symlink(value) => {
12074 ::fidl_next::RawWireUnion::encode_as::<___E, crate::SymlinkInfo>(
12075 value, 4, encoder, raw,
12076 )?
12077 }
12078
12079 Self::UnknownOrdinal_(ordinal) => {
12080 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
12081 }
12082 }
12083
12084 Ok(())
12085 }
12086}
12087
12088impl ::fidl_next::EncodableOption for Representation {
12089 type EncodedOption = WireOptionalRepresentation<'static>;
12090}
12091
12092unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Representation
12093where
12094 ___E: ?Sized,
12095 Representation: ::fidl_next::Encode<___E>,
12096{
12097 #[inline]
12098 fn encode_option(
12099 this: ::core::option::Option<Self>,
12100 encoder: &mut ___E,
12101 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12102 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12103 ::fidl_next::munge!(let WireOptionalRepresentation { raw, _phantom: _ } = &mut *out);
12104
12105 if let Some(inner) = this {
12106 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
12107 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
12108 } else {
12109 ::fidl_next::RawWireUnion::encode_absent(raw);
12110 }
12111
12112 Ok(())
12113 }
12114}
12115
12116impl<'de> ::fidl_next::FromWire<WireRepresentation<'de>> for Representation {
12117 #[inline]
12118 fn from_wire(wire: WireRepresentation<'de>) -> Self {
12119 let wire = ::core::mem::ManuallyDrop::new(wire);
12120 match wire.raw.ordinal() {
12121 1 => Self::Node(::fidl_next::FromWire::from_wire(unsafe {
12122 wire.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>()
12123 })),
12124
12125 2 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
12126 wire.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>()
12127 })),
12128
12129 3 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
12130 wire.raw.get().read_unchecked::<crate::WireFileInfo<'de>>()
12131 })),
12132
12133 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
12134 wire.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>()
12135 })),
12136
12137 _ => unsafe { ::core::hint::unreachable_unchecked() },
12138 }
12139 }
12140}
12141
12142impl<'de> ::fidl_next::IntoNatural for WireRepresentation<'de> {
12143 type Natural = Representation;
12144}
12145
12146impl<'de> ::fidl_next::FromWireOption<WireOptionalRepresentation<'de>> for Representation {
12147 #[inline]
12148 fn from_wire_option(wire: WireOptionalRepresentation<'de>) -> ::core::option::Option<Self> {
12149 if let Some(inner) = wire.into_option() {
12150 Some(::fidl_next::FromWire::from_wire(inner))
12151 } else {
12152 None
12153 }
12154 }
12155}
12156
12157impl<'de> ::fidl_next::IntoNatural for WireOptionalRepresentation<'de> {
12158 type Natural = ::core::option::Option<Representation>;
12159}
12160
12161impl<'de> ::fidl_next::FromWireOption<WireOptionalRepresentation<'de>> for Box<Representation> {
12162 #[inline]
12163 fn from_wire_option(wire: WireOptionalRepresentation<'de>) -> ::core::option::Option<Self> {
12164 <
12165 Representation as ::fidl_next::FromWireOption<WireOptionalRepresentation<'de>>
12166 >::from_wire_option(wire).map(Box::new)
12167 }
12168}
12169
12170#[repr(transparent)]
12172pub struct WireRepresentation<'de> {
12173 raw: ::fidl_next::RawWireUnion,
12174 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
12175}
12176
12177impl<'de> Drop for WireRepresentation<'de> {
12178 fn drop(&mut self) {
12179 match self.raw.ordinal() {
12180 1 => {
12181 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>() };
12182 }
12183
12184 2 => {
12185 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>() };
12186 }
12187
12188 3 => {
12189 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileInfo<'de>>() };
12190 }
12191
12192 4 => {
12193 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>() };
12194 }
12195
12196 _ => (),
12197 }
12198 }
12199}
12200
12201unsafe impl ::fidl_next::Wire for WireRepresentation<'static> {
12202 type Decoded<'de> = WireRepresentation<'de>;
12203
12204 #[inline]
12205 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12206 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12207 ::fidl_next::RawWireUnion::zero_padding(raw);
12208 }
12209}
12210
12211pub mod representation {
12212 pub enum Ref<'de> {
12213 Node(&'de crate::WireNodeInfo<'de>),
12214
12215 Directory(&'de crate::WireDirectoryInfo<'de>),
12216
12217 File(&'de crate::WireFileInfo<'de>),
12218
12219 Symlink(&'de crate::WireSymlinkInfo<'de>),
12220
12221 UnknownOrdinal_(u64),
12222 }
12223}
12224
12225impl<'de> WireRepresentation<'de> {
12226 pub fn as_ref(&self) -> crate::representation::Ref<'_> {
12227 match self.raw.ordinal() {
12228 1 => crate::representation::Ref::Node(unsafe {
12229 self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>()
12230 }),
12231
12232 2 => crate::representation::Ref::Directory(unsafe {
12233 self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>()
12234 }),
12235
12236 3 => crate::representation::Ref::File(unsafe {
12237 self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>()
12238 }),
12239
12240 4 => crate::representation::Ref::Symlink(unsafe {
12241 self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>()
12242 }),
12243
12244 unknown => crate::representation::Ref::UnknownOrdinal_(unknown),
12245 }
12246 }
12247}
12248
12249unsafe impl<___D> ::fidl_next::Decode<___D> for WireRepresentation<'static>
12250where
12251 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12252 ___D: ::fidl_next::Decoder,
12253 ___D: ::fidl_next::fuchsia::HandleDecoder,
12254{
12255 fn decode(
12256 mut slot: ::fidl_next::Slot<'_, Self>,
12257 decoder: &mut ___D,
12258 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12259 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12260 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12261 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
12262 raw, decoder,
12263 )?,
12264
12265 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
12266 raw, decoder,
12267 )?,
12268
12269 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
12270 raw, decoder,
12271 )?,
12272
12273 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
12274 raw, decoder,
12275 )?,
12276
12277 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
12278 }
12279
12280 Ok(())
12281 }
12282}
12283
12284impl<'de> ::core::fmt::Debug for WireRepresentation<'de> {
12285 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12286 match self.raw.ordinal() {
12287 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>().fmt(f) },
12288 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>().fmt(f) },
12289 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>().fmt(f) },
12290 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>().fmt(f) },
12291 _ => unsafe { ::core::hint::unreachable_unchecked() },
12292 }
12293 }
12294}
12295
12296#[repr(transparent)]
12297pub struct WireOptionalRepresentation<'de> {
12298 raw: ::fidl_next::RawWireUnion,
12299 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
12300}
12301
12302unsafe impl ::fidl_next::Wire for WireOptionalRepresentation<'static> {
12303 type Decoded<'de> = WireOptionalRepresentation<'de>;
12304
12305 #[inline]
12306 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12307 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12308 ::fidl_next::RawWireUnion::zero_padding(raw);
12309 }
12310}
12311
12312impl<'de> WireOptionalRepresentation<'de> {
12313 pub fn is_some(&self) -> bool {
12314 self.raw.is_some()
12315 }
12316
12317 pub fn is_none(&self) -> bool {
12318 self.raw.is_none()
12319 }
12320
12321 pub fn as_ref(&self) -> ::core::option::Option<&WireRepresentation<'de>> {
12322 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
12323 }
12324
12325 pub fn into_option(self) -> ::core::option::Option<WireRepresentation<'de>> {
12326 if self.is_some() {
12327 Some(WireRepresentation { raw: self.raw, _phantom: ::core::marker::PhantomData })
12328 } else {
12329 None
12330 }
12331 }
12332}
12333
12334unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRepresentation<'static>
12335where
12336 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12337 ___D: ::fidl_next::Decoder,
12338 ___D: ::fidl_next::fuchsia::HandleDecoder,
12339{
12340 fn decode(
12341 mut slot: ::fidl_next::Slot<'_, Self>,
12342 decoder: &mut ___D,
12343 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12344 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12345 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12346 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
12347 raw, decoder,
12348 )?,
12349
12350 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
12351 raw, decoder,
12352 )?,
12353
12354 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
12355 raw, decoder,
12356 )?,
12357
12358 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
12359 raw, decoder,
12360 )?,
12361
12362 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
12363 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
12364 }
12365
12366 Ok(())
12367 }
12368}
12369
12370impl<'de> ::core::fmt::Debug for WireOptionalRepresentation<'de> {
12371 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12372 self.as_ref().fmt(f)
12373 }
12374}
12375
12376::fidl_next::bitflags::bitflags! {
12377 #[derive(
12378 Clone,
12379 Copy,
12380 Debug,
12381 PartialEq,
12382 Eq,
12383 Hash,
12384 )]
12385 pub struct NodeAttributesQuery: u64 {
12386 #[doc = " Requests [`NodeAttributes.protocols`].\n"]const PROTOCOLS = 1;
12387 #[doc = " Requests [`NodeAttributes.abilities`].\n"]const ABILITIES = 2;
12388 #[doc = " Requests [`NodeAttributes.content_size`].\n"]const CONTENT_SIZE = 4;
12389 #[doc = " Requests [`NodeAttributes.storage_size`].\n"]const STORAGE_SIZE = 8;
12390 #[doc = " Requests [`NodeAttributes.link_count`].\n"]const LINK_COUNT = 16;
12391 #[doc = " Requests [`NodeAttributes.id`].\n"]const ID = 32;
12392 #[doc = " Requests [`NodeAttributes.creation_time`].\n"]const CREATION_TIME = 64;
12393 #[doc = " Requests [`NodeAttributes.modification_time`].\n"]const MODIFICATION_TIME = 128;
12394 #[doc = " Posix attributes.\n"]const MODE = 256;
12395 const UID = 512;
12396 const GID = 1024;
12397 const RDEV = 2048;
12398 const ACCESS_TIME = 4096;
12399 const CHANGE_TIME = 8192;
12400 #[doc = " Verity attributes.\n"]const OPTIONS = 16384;
12401 const ROOT_HASH = 32768;
12402 const VERITY_ENABLED = 65536;
12403 #[doc = " Casefold (case-insensitive filename) support.\n When true, file lookups will be case-insensitive but case-preserving. i.e. \"Foo\" will\n be stored verbatim but can be opened as \"foo\", \"fOO\", etc. Casefolding is done in\n accordance to the Unicode 12 NFD normalization and casefolding standard.\n"]const CASEFOLD = 131072;
12404 #[doc = " Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.\n"]const SELINUX_CONTEXT = 262144;
12405 #[doc = " fscrypt attribute.\n"]const WRAPPING_KEY_ID = 524288;
12406 #[doc = " When this is queried in [`fuchsia.io/Node.GetAttributes`], it indicates to the filesystem\n that this node has been accessed and is pending an access time update given that any one of\n the following conditions are met:\n * current_access_time <= current_modification_time\n * current_access_time <= current_change_time\n * current_access_time < current_time - duration(1 day)\n\n If any of the above conditions are met, `access_time` is updated to the current time before\n any queried node attributes are returned.\n\n This is compatible with Linux relatime mount.\n\n The rationale behind adding this `NodeAttributesQuery` is that some filesystems, e.g. Fxfs,\n are unable to identify when a file access has occured and thus update the access time. We\n allow for clients to communicate to the underlying filesystem that a file access has\n occurred and that it awaits for an update to access time.\n\n WARNING: If this is queried without a prior file access, as long as the above conditions\n are met, the node\'s access time will be updated. Not all filesystems will support this. The\n query will be ignored if the filesystem does not support this.\n"]const PENDING_ACCESS_TIME_UPDATE = 1048576;
12407 const _ = !0;
12408 }
12409}
12410
12411impl ::fidl_next::Encodable for NodeAttributesQuery {
12412 type Encoded = WireNodeAttributesQuery;
12413}
12414
12415unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributesQuery
12416where
12417 ___E: ?Sized,
12418{
12419 #[inline]
12420 fn encode(
12421 self,
12422 encoder: &mut ___E,
12423 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12424 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12425 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
12426 }
12427}
12428
12429unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributesQuery
12430where
12431 ___E: ?Sized,
12432{
12433 #[inline]
12434 fn encode_ref(
12435 &self,
12436 _: &mut ___E,
12437 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12438 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12439 ::fidl_next::munge!(let WireNodeAttributesQuery { value } = out);
12440
12441 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
12442 Ok(())
12443 }
12444}
12445
12446impl ::core::convert::From<WireNodeAttributesQuery> for NodeAttributesQuery {
12447 fn from(wire: WireNodeAttributesQuery) -> Self {
12448 Self::from_bits_retain(u64::from(wire.value))
12449 }
12450}
12451
12452impl ::fidl_next::FromWire<WireNodeAttributesQuery> for NodeAttributesQuery {
12453 #[inline]
12454 fn from_wire(wire: WireNodeAttributesQuery) -> Self {
12455 Self::from(wire)
12456 }
12457}
12458
12459impl ::fidl_next::IntoNatural for WireNodeAttributesQuery {
12460 type Natural = NodeAttributesQuery;
12461}
12462
12463impl ::fidl_next::FromWireRef<WireNodeAttributesQuery> for NodeAttributesQuery {
12464 #[inline]
12465 fn from_wire_ref(wire: &WireNodeAttributesQuery) -> Self {
12466 Self::from(*wire)
12467 }
12468}
12469
12470#[derive(Clone, Copy, Debug)]
12472#[repr(transparent)]
12473pub struct WireNodeAttributesQuery {
12474 value: ::fidl_next::WireU64,
12475}
12476
12477unsafe impl ::fidl_next::Wire for WireNodeAttributesQuery {
12478 type Decoded<'de> = Self;
12479
12480 #[inline]
12481 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
12482 }
12484}
12485
12486unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributesQuery
12487where
12488 ___D: ?Sized,
12489{
12490 fn decode(
12491 slot: ::fidl_next::Slot<'_, Self>,
12492 _: &mut ___D,
12493 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12494 Ok(())
12495 }
12496}
12497
12498impl ::core::convert::From<NodeAttributesQuery> for WireNodeAttributesQuery {
12499 fn from(natural: NodeAttributesQuery) -> Self {
12500 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
12501 }
12502}
12503
12504#[derive(PartialEq, Clone, Debug)]
12505#[repr(C)]
12506pub struct NodeGetAttributesRequest {
12507 pub query: crate::NodeAttributesQuery,
12508}
12509
12510impl ::fidl_next::Encodable for NodeGetAttributesRequest {
12511 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetAttributesRequest> = unsafe {
12512 ::fidl_next::CopyOptimization::enable_if(
12513 true && <crate::NodeAttributesQuery as ::fidl_next::Encodable>::COPY_OPTIMIZATION
12514 .is_enabled(),
12515 )
12516 };
12517
12518 type Encoded = WireNodeGetAttributesRequest;
12519}
12520
12521unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetAttributesRequest
12522where
12523 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12524{
12525 #[inline]
12526 fn encode(
12527 self,
12528 encoder_: &mut ___E,
12529 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12530 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12531 ::fidl_next::munge! {
12532 let Self::Encoded {
12533 query,
12534
12535 } = out_;
12536 }
12537
12538 ::fidl_next::Encode::encode(self.query, encoder_, query)?;
12539
12540 Ok(())
12541 }
12542}
12543
12544unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetAttributesRequest
12545where
12546 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12547{
12548 #[inline]
12549 fn encode_ref(
12550 &self,
12551 encoder_: &mut ___E,
12552 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12553 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12554 ::fidl_next::munge! {
12555 let Self::Encoded {
12556
12557 query,
12558
12559 } = out_;
12560 }
12561
12562 ::fidl_next::EncodeRef::encode_ref(&self.query, encoder_, query)?;
12563
12564 Ok(())
12565 }
12566}
12567
12568impl ::fidl_next::EncodableOption for NodeGetAttributesRequest {
12569 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetAttributesRequest>;
12570}
12571
12572unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetAttributesRequest
12573where
12574 ___E: ::fidl_next::Encoder + ?Sized,
12575 NodeGetAttributesRequest: ::fidl_next::Encode<___E>,
12576{
12577 #[inline]
12578 fn encode_option(
12579 this: ::core::option::Option<Self>,
12580 encoder: &mut ___E,
12581 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12582 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12583 if let Some(inner) = this {
12584 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12585 ::fidl_next::WireBox::encode_present(out);
12586 } else {
12587 ::fidl_next::WireBox::encode_absent(out);
12588 }
12589
12590 Ok(())
12591 }
12592}
12593
12594unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetAttributesRequest
12595where
12596 ___E: ::fidl_next::Encoder + ?Sized,
12597 NodeGetAttributesRequest: ::fidl_next::EncodeRef<___E>,
12598{
12599 #[inline]
12600 fn encode_option_ref(
12601 this: ::core::option::Option<&Self>,
12602 encoder: &mut ___E,
12603 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12604 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12605 if let Some(inner) = this {
12606 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12607 ::fidl_next::WireBox::encode_present(out);
12608 } else {
12609 ::fidl_next::WireBox::encode_absent(out);
12610 }
12611
12612 Ok(())
12613 }
12614}
12615
12616impl ::fidl_next::FromWire<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
12617 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetAttributesRequest, Self> = unsafe {
12618 ::fidl_next::CopyOptimization::enable_if(
12619 true && <crate::NodeAttributesQuery as ::fidl_next::FromWire<
12620 crate::WireNodeAttributesQuery,
12621 >>::COPY_OPTIMIZATION
12622 .is_enabled(),
12623 )
12624 };
12625
12626 #[inline]
12627 fn from_wire(wire: WireNodeGetAttributesRequest) -> Self {
12628 Self { query: ::fidl_next::FromWire::from_wire(wire.query) }
12629 }
12630}
12631
12632impl ::fidl_next::IntoNatural for WireNodeGetAttributesRequest {
12633 type Natural = NodeGetAttributesRequest;
12634}
12635
12636impl ::fidl_next::FromWireRef<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
12637 #[inline]
12638 fn from_wire_ref(wire: &WireNodeGetAttributesRequest) -> Self {
12639 Self { query: ::fidl_next::FromWireRef::from_wire_ref(&wire.query) }
12640 }
12641}
12642
12643#[derive(Clone, Debug)]
12645#[repr(C)]
12646pub struct WireNodeGetAttributesRequest {
12647 pub query: crate::WireNodeAttributesQuery,
12648}
12649static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeGetAttributesRequest>(), 8);
12650static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeGetAttributesRequest>(), 8);
12651
12652static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeGetAttributesRequest, query), 0);
12653
12654unsafe impl ::fidl_next::Wire for WireNodeGetAttributesRequest {
12655 type Decoded<'de> = WireNodeGetAttributesRequest;
12656
12657 #[inline]
12658 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12659 ::fidl_next::munge! {
12660 let Self {
12661
12662 query,
12663
12664 } = &mut *out_;
12665 }
12666
12667 ::fidl_next::Wire::zero_padding(query);
12668 }
12669}
12670
12671unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetAttributesRequest
12672where
12673 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12674{
12675 fn decode(
12676 slot_: ::fidl_next::Slot<'_, Self>,
12677 decoder_: &mut ___D,
12678 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12679 ::fidl_next::munge! {
12680 let Self {
12681
12682 mut query,
12683
12684 } = slot_;
12685 }
12686
12687 ::fidl_next::Decode::decode(query.as_mut(), decoder_)?;
12688
12689 Ok(())
12690 }
12691}
12692
12693#[doc = " Options which can be used when opening nodes. Unlike [`Flags`], these options are designed for\n specific use cases (e.g. to reduce round-trip latency when requesting attributes).\n"]
12694#[derive(PartialEq, Clone, Debug, Default)]
12695pub struct Options {
12696 pub attributes: ::core::option::Option<crate::NodeAttributesQuery>,
12697
12698 pub create_attributes: ::core::option::Option<crate::MutableNodeAttributes>,
12699}
12700
12701impl Options {
12702 fn __max_ordinal(&self) -> usize {
12703 if self.create_attributes.is_some() {
12704 return 2;
12705 }
12706
12707 if self.attributes.is_some() {
12708 return 1;
12709 }
12710
12711 0
12712 }
12713}
12714
12715impl ::fidl_next::Encodable for Options {
12716 type Encoded = WireOptions<'static>;
12717}
12718
12719unsafe impl<___E> ::fidl_next::Encode<___E> for Options
12720where
12721 ___E: ::fidl_next::Encoder + ?Sized,
12722{
12723 #[inline]
12724 fn encode(
12725 mut self,
12726 encoder: &mut ___E,
12727 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12728 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12729 ::fidl_next::munge!(let WireOptions { table } = out);
12730
12731 let max_ord = self.__max_ordinal();
12732
12733 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12734 ::fidl_next::Wire::zero_padding(&mut out);
12735
12736 let mut preallocated =
12737 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12738
12739 for i in 1..=max_ord {
12740 match i {
12741 2 => {
12742 if let Some(value) = self.create_attributes.take() {
12743 ::fidl_next::WireEnvelope::encode_value(
12744 value,
12745 preallocated.encoder,
12746 &mut out,
12747 )?;
12748 } else {
12749 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12750 }
12751 }
12752
12753 1 => {
12754 if let Some(value) = self.attributes.take() {
12755 ::fidl_next::WireEnvelope::encode_value(
12756 value,
12757 preallocated.encoder,
12758 &mut out,
12759 )?;
12760 } else {
12761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12762 }
12763 }
12764
12765 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12766 }
12767 unsafe {
12768 preallocated.write_next(out.assume_init_ref());
12769 }
12770 }
12771
12772 ::fidl_next::WireTable::encode_len(table, max_ord);
12773
12774 Ok(())
12775 }
12776}
12777
12778unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Options
12779where
12780 ___E: ::fidl_next::Encoder + ?Sized,
12781{
12782 #[inline]
12783 fn encode_ref(
12784 &self,
12785 encoder: &mut ___E,
12786 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12787 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12788 ::fidl_next::munge!(let WireOptions { table } = out);
12789
12790 let max_ord = self.__max_ordinal();
12791
12792 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12793 ::fidl_next::Wire::zero_padding(&mut out);
12794
12795 let mut preallocated =
12796 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12797
12798 for i in 1..=max_ord {
12799 match i {
12800 2 => {
12801 if let Some(value) = &self.create_attributes {
12802 ::fidl_next::WireEnvelope::encode_value(
12803 value,
12804 preallocated.encoder,
12805 &mut out,
12806 )?;
12807 } else {
12808 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12809 }
12810 }
12811
12812 1 => {
12813 if let Some(value) = &self.attributes {
12814 ::fidl_next::WireEnvelope::encode_value(
12815 value,
12816 preallocated.encoder,
12817 &mut out,
12818 )?;
12819 } else {
12820 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12821 }
12822 }
12823
12824 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12825 }
12826 unsafe {
12827 preallocated.write_next(out.assume_init_ref());
12828 }
12829 }
12830
12831 ::fidl_next::WireTable::encode_len(table, max_ord);
12832
12833 Ok(())
12834 }
12835}
12836
12837impl<'de> ::fidl_next::FromWire<WireOptions<'de>> for Options {
12838 #[inline]
12839 fn from_wire(wire_: WireOptions<'de>) -> Self {
12840 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12841
12842 let attributes = wire_.table.get(1);
12843
12844 let create_attributes = wire_.table.get(2);
12845
12846 Self {
12847 attributes: attributes.map(|envelope| {
12848 ::fidl_next::FromWire::from_wire(unsafe {
12849 envelope.read_unchecked::<crate::WireNodeAttributesQuery>()
12850 })
12851 }),
12852
12853 create_attributes: create_attributes.map(|envelope| {
12854 ::fidl_next::FromWire::from_wire(unsafe {
12855 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
12856 })
12857 }),
12858 }
12859 }
12860}
12861
12862impl<'de> ::fidl_next::IntoNatural for WireOptions<'de> {
12863 type Natural = Options;
12864}
12865
12866impl<'de> ::fidl_next::FromWireRef<WireOptions<'de>> for Options {
12867 #[inline]
12868 fn from_wire_ref(wire: &WireOptions<'de>) -> Self {
12869 Self {
12870 attributes: wire.table.get(1).map(|envelope| {
12871 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12872 envelope.deref_unchecked::<crate::WireNodeAttributesQuery>()
12873 })
12874 }),
12875
12876 create_attributes: wire.table.get(2).map(|envelope| {
12877 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12878 envelope.deref_unchecked::<crate::WireMutableNodeAttributes<'de>>()
12879 })
12880 }),
12881 }
12882 }
12883}
12884
12885#[repr(C)]
12887pub struct WireOptions<'de> {
12888 table: ::fidl_next::WireTable<'de>,
12889}
12890
12891impl<'de> Drop for WireOptions<'de> {
12892 fn drop(&mut self) {
12893 let _ = self
12894 .table
12895 .get(1)
12896 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeAttributesQuery>() });
12897
12898 let _ = self.table.get(2).map(|envelope| unsafe {
12899 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
12900 });
12901 }
12902}
12903
12904unsafe impl ::fidl_next::Wire for WireOptions<'static> {
12905 type Decoded<'de> = WireOptions<'de>;
12906
12907 #[inline]
12908 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12909 ::fidl_next::munge!(let Self { table } = out);
12910 ::fidl_next::WireTable::zero_padding(table);
12911 }
12912}
12913
12914unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptions<'static>
12915where
12916 ___D: ::fidl_next::Decoder + ?Sized,
12917{
12918 fn decode(
12919 slot: ::fidl_next::Slot<'_, Self>,
12920 decoder: &mut ___D,
12921 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12922 ::fidl_next::munge!(let Self { table } = slot);
12923
12924 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12925 match ordinal {
12926 0 => unsafe { ::core::hint::unreachable_unchecked() },
12927
12928 1 => {
12929 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributesQuery>(
12930 slot.as_mut(),
12931 decoder,
12932 )?;
12933
12934 Ok(())
12935 }
12936
12937 2 => {
12938 ::fidl_next::WireEnvelope::decode_as::<
12939 ___D,
12940 crate::WireMutableNodeAttributes<'static>,
12941 >(slot.as_mut(), decoder)?;
12942
12943 Ok(())
12944 }
12945
12946 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12947 }
12948 })
12949 }
12950}
12951
12952impl<'de> WireOptions<'de> {
12953 pub fn attributes(&self) -> ::core::option::Option<&crate::WireNodeAttributesQuery> {
12954 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12955 }
12956
12957 pub fn create_attributes(
12958 &self,
12959 ) -> ::core::option::Option<&crate::WireMutableNodeAttributes<'de>> {
12960 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12961 }
12962}
12963
12964impl<'de> ::core::fmt::Debug for WireOptions<'de> {
12965 fn fmt(
12966 &self,
12967 f: &mut ::core::fmt::Formatter<'_>,
12968 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12969 f.debug_struct("Options")
12970 .field("attributes", &self.attributes())
12971 .field("create_attributes", &self.create_attributes())
12972 .finish()
12973 }
12974}
12975
12976#[derive(PartialEq, Debug)]
12977pub struct DirectoryOpenRequest {
12978 pub path: ::std::string::String,
12979
12980 pub flags: crate::Flags,
12981
12982 pub options: crate::Options,
12983
12984 pub object: ::fidl_next::fuchsia::zx::Channel,
12985}
12986
12987impl ::fidl_next::Encodable for DirectoryOpenRequest {
12988 type Encoded = WireDirectoryOpenRequest<'static>;
12989}
12990
12991unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryOpenRequest
12992where
12993 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12994 ___E: ::fidl_next::Encoder,
12995 ___E: ::fidl_next::fuchsia::HandleEncoder,
12996{
12997 #[inline]
12998 fn encode(
12999 self,
13000 encoder_: &mut ___E,
13001 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13002 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13003 ::fidl_next::munge! {
13004 let Self::Encoded {
13005 path,
13006 flags,
13007 options,
13008 object,
13009
13010 } = out_;
13011 }
13012
13013 ::fidl_next::Encode::encode(self.path, encoder_, path)?;
13014
13015 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13016
13017 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
13018
13019 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
13020
13021 Ok(())
13022 }
13023}
13024
13025impl ::fidl_next::EncodableOption for DirectoryOpenRequest {
13026 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryOpenRequest<'static>>;
13027}
13028
13029unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryOpenRequest
13030where
13031 ___E: ::fidl_next::Encoder + ?Sized,
13032 DirectoryOpenRequest: ::fidl_next::Encode<___E>,
13033{
13034 #[inline]
13035 fn encode_option(
13036 this: ::core::option::Option<Self>,
13037 encoder: &mut ___E,
13038 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13039 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13040 if let Some(inner) = this {
13041 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
13042 ::fidl_next::WireBox::encode_present(out);
13043 } else {
13044 ::fidl_next::WireBox::encode_absent(out);
13045 }
13046
13047 Ok(())
13048 }
13049}
13050
13051impl<'de> ::fidl_next::FromWire<WireDirectoryOpenRequest<'de>> for DirectoryOpenRequest {
13052 #[inline]
13053 fn from_wire(wire: WireDirectoryOpenRequest<'de>) -> Self {
13054 Self {
13055 path: ::fidl_next::FromWire::from_wire(wire.path),
13056
13057 flags: ::fidl_next::FromWire::from_wire(wire.flags),
13058
13059 options: ::fidl_next::FromWire::from_wire(wire.options),
13060
13061 object: ::fidl_next::FromWire::from_wire(wire.object),
13062 }
13063 }
13064}
13065
13066impl<'de> ::fidl_next::IntoNatural for WireDirectoryOpenRequest<'de> {
13067 type Natural = DirectoryOpenRequest;
13068}
13069
13070#[derive(Debug)]
13072#[repr(C)]
13073pub struct WireDirectoryOpenRequest<'de> {
13074 pub path: ::fidl_next::WireString<'de>,
13075
13076 pub flags: crate::WireFlags,
13077
13078 pub options: crate::WireOptions<'de>,
13079
13080 pub object: ::fidl_next::fuchsia::WireChannel,
13081}
13082static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryOpenRequest<'_>>(), 48);
13083static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryOpenRequest<'_>>(), 8);
13084
13085static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryOpenRequest<'_>, path), 0);
13086
13087static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryOpenRequest<'_>, flags), 16);
13088
13089static_assertions::const_assert_eq!(
13090 std::mem::offset_of!(WireDirectoryOpenRequest<'_>, options),
13091 24
13092);
13093
13094static_assertions::const_assert_eq!(std::mem::offset_of!(WireDirectoryOpenRequest<'_>, object), 40);
13095
13096unsafe impl ::fidl_next::Wire for WireDirectoryOpenRequest<'static> {
13097 type Decoded<'de> = WireDirectoryOpenRequest<'de>;
13098
13099 #[inline]
13100 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
13101 ::fidl_next::munge! {
13102 let Self {
13103
13104 path,
13105 flags,
13106 options,
13107 object,
13108
13109 } = &mut *out_;
13110 }
13111
13112 ::fidl_next::Wire::zero_padding(path);
13113
13114 ::fidl_next::Wire::zero_padding(flags);
13115
13116 ::fidl_next::Wire::zero_padding(options);
13117
13118 ::fidl_next::Wire::zero_padding(object);
13119
13120 unsafe {
13121 out_.as_mut_ptr().cast::<u8>().add(44).write_bytes(0, 4);
13122 }
13123 }
13124}
13125
13126unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryOpenRequest<'static>
13127where
13128 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13129 ___D: ::fidl_next::Decoder,
13130 ___D: ::fidl_next::fuchsia::HandleDecoder,
13131{
13132 fn decode(
13133 slot_: ::fidl_next::Slot<'_, Self>,
13134 decoder_: &mut ___D,
13135 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13136 ::fidl_next::munge! {
13137 let Self {
13138
13139 mut path,
13140 mut flags,
13141 mut options,
13142 mut object,
13143
13144 } = slot_;
13145 }
13146
13147 ::fidl_next::Decode::decode(path.as_mut(), decoder_)?;
13148
13149 let path = unsafe { path.deref_unchecked() };
13150
13151 if path.len() > 4095 {
13152 return Err(::fidl_next::DecodeError::VectorTooLong {
13153 size: path.len() as u64,
13154 limit: 4095,
13155 });
13156 }
13157
13158 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
13159
13160 ::fidl_next::Decode::decode(options.as_mut(), decoder_)?;
13161
13162 ::fidl_next::Decode::decode(object.as_mut(), decoder_)?;
13163
13164 Ok(())
13165 }
13166}
13167
13168#[derive(PartialEq, Debug)]
13169#[repr(C)]
13170pub struct NodeDeprecatedCloneRequest {
13171 pub flags: crate::OpenFlags,
13172
13173 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
13174}
13175
13176impl ::fidl_next::Encodable for NodeDeprecatedCloneRequest {
13177 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeDeprecatedCloneRequest> = unsafe {
13178 ::fidl_next::CopyOptimization::enable_if(
13179 true
13180
13181 && <
13182 crate::OpenFlags as ::fidl_next::Encodable
13183 >::COPY_OPTIMIZATION.is_enabled()
13184
13185 && <
13186 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
13187 >::COPY_OPTIMIZATION.is_enabled()
13188
13189 )
13190 };
13191
13192 type Encoded = WireNodeDeprecatedCloneRequest;
13193}
13194
13195unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedCloneRequest
13196where
13197 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13198 ___E: ::fidl_next::fuchsia::HandleEncoder,
13199{
13200 #[inline]
13201 fn encode(
13202 self,
13203 encoder_: &mut ___E,
13204 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13205 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13206 ::fidl_next::munge! {
13207 let Self::Encoded {
13208 flags,
13209 object,
13210
13211 } = out_;
13212 }
13213
13214 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13215
13216 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
13217
13218 Ok(())
13219 }
13220}
13221
13222impl ::fidl_next::EncodableOption for NodeDeprecatedCloneRequest {
13223 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedCloneRequest>;
13224}
13225
13226unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedCloneRequest
13227where
13228 ___E: ::fidl_next::Encoder + ?Sized,
13229 NodeDeprecatedCloneRequest: ::fidl_next::Encode<___E>,
13230{
13231 #[inline]
13232 fn encode_option(
13233 this: ::core::option::Option<Self>,
13234 encoder: &mut ___E,
13235 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13236 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13237 if let Some(inner) = this {
13238 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
13239 ::fidl_next::WireBox::encode_present(out);
13240 } else {
13241 ::fidl_next::WireBox::encode_absent(out);
13242 }
13243
13244 Ok(())
13245 }
13246}
13247
13248impl ::fidl_next::FromWire<WireNodeDeprecatedCloneRequest> for NodeDeprecatedCloneRequest {
13249 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeDeprecatedCloneRequest, Self> = unsafe {
13250 ::fidl_next::CopyOptimization::enable_if(
13251 true
13252
13253 && <
13254 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
13255 >::COPY_OPTIMIZATION.is_enabled()
13256
13257 && <
13258 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>
13259 >::COPY_OPTIMIZATION.is_enabled()
13260
13261 )
13262 };
13263
13264 #[inline]
13265 fn from_wire(wire: WireNodeDeprecatedCloneRequest) -> Self {
13266 Self {
13267 flags: ::fidl_next::FromWire::from_wire(wire.flags),
13268
13269 object: ::fidl_next::FromWire::from_wire(wire.object),
13270 }
13271 }
13272}
13273
13274impl ::fidl_next::IntoNatural for WireNodeDeprecatedCloneRequest {
13275 type Natural = NodeDeprecatedCloneRequest;
13276}
13277
13278#[derive(Debug)]
13280#[repr(C)]
13281pub struct WireNodeDeprecatedCloneRequest {
13282 pub flags: crate::WireOpenFlags,
13283
13284 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
13285}
13286static_assertions::const_assert_eq!(std::mem::size_of::<WireNodeDeprecatedCloneRequest>(), 8);
13287static_assertions::const_assert_eq!(std::mem::align_of::<WireNodeDeprecatedCloneRequest>(), 4);
13288
13289static_assertions::const_assert_eq!(std::mem::offset_of!(WireNodeDeprecatedCloneRequest, flags), 0);
13290
13291static_assertions::const_assert_eq!(
13292 std::mem::offset_of!(WireNodeDeprecatedCloneRequest, object),
13293 4
13294);
13295
13296unsafe impl ::fidl_next::Wire for WireNodeDeprecatedCloneRequest {
13297 type Decoded<'de> = WireNodeDeprecatedCloneRequest;
13298
13299 #[inline]
13300 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
13301 ::fidl_next::munge! {
13302 let Self {
13303
13304 flags,
13305 object,
13306
13307 } = &mut *out_;
13308 }
13309
13310 ::fidl_next::Wire::zero_padding(flags);
13311
13312 ::fidl_next::Wire::zero_padding(object);
13313 }
13314}
13315
13316unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedCloneRequest
13317where
13318 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13319 ___D: ::fidl_next::fuchsia::HandleDecoder,
13320{
13321 fn decode(
13322 slot_: ::fidl_next::Slot<'_, Self>,
13323 decoder_: &mut ___D,
13324 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13325 ::fidl_next::munge! {
13326 let Self {
13327
13328 mut flags,
13329 mut object,
13330
13331 } = slot_;
13332 }
13333
13334 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
13335
13336 ::fidl_next::Decode::decode(object.as_mut(), decoder_)?;
13337
13338 Ok(())
13339 }
13340}
13341
13342#[doc = " Node defines the minimal interface for entities which can be accessed in a filesystem.\n"]
13344#[derive(PartialEq, Debug)]
13345pub struct Node;
13346
13347impl ::fidl_next::Discoverable for Node {
13348 const PROTOCOL_NAME: &'static str = "fuchsia.io.Node";
13349}
13350
13351pub mod node {
13352 pub mod prelude {
13353 pub use crate::{Node, NodeClientHandler, NodeServerHandler, node};
13354
13355 pub use crate::ExtendedAttributeValue;
13356
13357 pub use crate::MutableNodeAttributes;
13358
13359 pub use crate::NodeAttributes2;
13360
13361 pub use crate::NodeDeprecatedCloneRequest;
13362
13363 pub use crate::NodeDeprecatedGetAttrResponse;
13364
13365 pub use crate::NodeDeprecatedGetFlagsResponse;
13366
13367 pub use crate::NodeDeprecatedSetAttrRequest;
13368
13369 pub use crate::NodeDeprecatedSetAttrResponse;
13370
13371 pub use crate::NodeDeprecatedSetFlagsRequest;
13372
13373 pub use crate::NodeDeprecatedSetFlagsResponse;
13374
13375 pub use crate::NodeGetAttributesRequest;
13376
13377 pub use crate::NodeGetExtendedAttributeRequest;
13378
13379 pub use crate::NodeListExtendedAttributesRequest;
13380
13381 pub use crate::NodeOnOpenRequest;
13382
13383 pub use crate::NodeQueryFilesystemResponse;
13384
13385 pub use crate::NodeRemoveExtendedAttributeRequest;
13386
13387 pub use crate::NodeSetExtendedAttributeRequest;
13388
13389 pub use crate::NodeSetFlagsRequest;
13390
13391 pub use crate::NodeGetFlagsResponse;
13392
13393 pub use crate::NodeRemoveExtendedAttributeResponse;
13394
13395 pub use crate::NodeSetExtendedAttributeResponse;
13396
13397 pub use crate::NodeSetFlagsResponse;
13398
13399 pub use crate::NodeSyncResponse;
13400
13401 pub use crate::NodeUpdateAttributesResponse;
13402
13403 pub use crate::Representation;
13404
13405 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
13406
13407 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
13408
13409 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
13410 }
13411
13412 pub struct Clone;
13413
13414 impl ::fidl_next::Method for Clone {
13415 const ORDINAL: u64 = 2366825959783828089;
13416
13417 type Protocol = crate::Node;
13418
13419 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
13420
13421 type Response = ::fidl_next::Never;
13422 }
13423
13424 pub struct Close;
13425
13426 impl ::fidl_next::Method for Close {
13427 const ORDINAL: u64 = 6540867515453498750;
13428
13429 type Protocol = crate::Node;
13430
13431 type Request = ();
13432
13433 type Response = ::fidl_next::WireResult<
13434 'static,
13435 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
13436 ::fidl_next::WireI32,
13437 >;
13438 }
13439
13440 pub struct Query;
13441
13442 impl ::fidl_next::Method for Query {
13443 const ORDINAL: u64 = 2763219980499352582;
13444
13445 type Protocol = crate::Node;
13446
13447 type Request = ();
13448
13449 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
13450 }
13451
13452 pub struct DeprecatedClone;
13453
13454 impl ::fidl_next::Method for DeprecatedClone {
13455 const ORDINAL: u64 = 6512600400724287855;
13456
13457 type Protocol = crate::Node;
13458
13459 type Request = crate::WireNodeDeprecatedCloneRequest;
13460
13461 type Response = ::fidl_next::Never;
13462 }
13463
13464 pub struct OnOpen;
13465
13466 impl ::fidl_next::Method for OnOpen {
13467 const ORDINAL: u64 = 9207534335756671346;
13468
13469 type Protocol = crate::Node;
13470
13471 type Request = ::fidl_next::Never;
13472
13473 type Response = crate::WireNodeOnOpenRequest<'static>;
13474 }
13475
13476 pub struct DeprecatedGetAttr;
13477
13478 impl ::fidl_next::Method for DeprecatedGetAttr {
13479 const ORDINAL: u64 = 8689798978500614909;
13480
13481 type Protocol = crate::Node;
13482
13483 type Request = ();
13484
13485 type Response = crate::WireNodeDeprecatedGetAttrResponse;
13486 }
13487
13488 pub struct DeprecatedSetAttr;
13489
13490 impl ::fidl_next::Method for DeprecatedSetAttr {
13491 const ORDINAL: u64 = 4721673413776871238;
13492
13493 type Protocol = crate::Node;
13494
13495 type Request = crate::WireNodeDeprecatedSetAttrRequest;
13496
13497 type Response = crate::WireNodeDeprecatedSetAttrResponse;
13498 }
13499
13500 pub struct DeprecatedGetFlags;
13501
13502 impl ::fidl_next::Method for DeprecatedGetFlags {
13503 const ORDINAL: u64 = 6595803110182632097;
13504
13505 type Protocol = crate::Node;
13506
13507 type Request = ();
13508
13509 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
13510 }
13511
13512 pub struct DeprecatedSetFlags;
13513
13514 impl ::fidl_next::Method for DeprecatedSetFlags {
13515 const ORDINAL: u64 = 5950864159036794675;
13516
13517 type Protocol = crate::Node;
13518
13519 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
13520
13521 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
13522 }
13523
13524 pub struct GetFlags;
13525
13526 impl ::fidl_next::Method for GetFlags {
13527 const ORDINAL: u64 = 105530239381466147;
13528
13529 type Protocol = crate::Node;
13530
13531 type Request = ();
13532
13533 type Response = ::fidl_next::WireFlexibleResult<
13534 'static,
13535 crate::WireNodeGetFlagsResponse,
13536 ::fidl_next::WireI32,
13537 >;
13538 }
13539
13540 pub struct SetFlags;
13541
13542 impl ::fidl_next::Method for SetFlags {
13543 const ORDINAL: u64 = 6172186066099445416;
13544
13545 type Protocol = crate::Node;
13546
13547 type Request = crate::WireNodeSetFlagsRequest;
13548
13549 type Response = ::fidl_next::WireFlexibleResult<
13550 'static,
13551 crate::WireNodeSetFlagsResponse,
13552 ::fidl_next::WireI32,
13553 >;
13554 }
13555
13556 pub struct QueryFilesystem;
13557
13558 impl ::fidl_next::Method for QueryFilesystem {
13559 const ORDINAL: u64 = 8013111122914313744;
13560
13561 type Protocol = crate::Node;
13562
13563 type Request = ();
13564
13565 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
13566 }
13567
13568 pub struct OnRepresentation;
13569
13570 impl ::fidl_next::Method for OnRepresentation {
13571 const ORDINAL: u64 = 6679970090861613324;
13572
13573 type Protocol = crate::Node;
13574
13575 type Request = ::fidl_next::Never;
13576
13577 type Response = crate::WireRepresentation<'static>;
13578 }
13579
13580 pub struct GetAttributes;
13581
13582 impl ::fidl_next::Method for GetAttributes {
13583 const ORDINAL: u64 = 4414537700416816443;
13584
13585 type Protocol = crate::Node;
13586
13587 type Request = crate::WireNodeGetAttributesRequest;
13588
13589 type Response = ::fidl_next::WireResult<
13590 'static,
13591 crate::WireNodeAttributes2<'static>,
13592 ::fidl_next::WireI32,
13593 >;
13594 }
13595
13596 pub struct UpdateAttributes;
13597
13598 impl ::fidl_next::Method for UpdateAttributes {
13599 const ORDINAL: u64 = 3677402239314018056;
13600
13601 type Protocol = crate::Node;
13602
13603 type Request = crate::WireMutableNodeAttributes<'static>;
13604
13605 type Response = ::fidl_next::WireResult<
13606 'static,
13607 crate::WireNodeUpdateAttributesResponse,
13608 ::fidl_next::WireI32,
13609 >;
13610 }
13611
13612 pub struct Sync;
13613
13614 impl ::fidl_next::Method for Sync {
13615 const ORDINAL: u64 = 3196473584242777161;
13616
13617 type Protocol = crate::Node;
13618
13619 type Request = ();
13620
13621 type Response =
13622 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
13623 }
13624
13625 pub struct ListExtendedAttributes;
13626
13627 impl ::fidl_next::Method for ListExtendedAttributes {
13628 const ORDINAL: u64 = 5431626189872037072;
13629
13630 type Protocol = crate::Node;
13631
13632 type Request = crate::WireNodeListExtendedAttributesRequest;
13633
13634 type Response = ::fidl_next::Never;
13635 }
13636
13637 pub struct GetExtendedAttribute;
13638
13639 impl ::fidl_next::Method for GetExtendedAttribute {
13640 const ORDINAL: u64 = 5043930208506967771;
13641
13642 type Protocol = crate::Node;
13643
13644 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
13645
13646 type Response = ::fidl_next::WireResult<
13647 'static,
13648 crate::WireExtendedAttributeValue<'static>,
13649 ::fidl_next::WireI32,
13650 >;
13651 }
13652
13653 pub struct SetExtendedAttribute;
13654
13655 impl ::fidl_next::Method for SetExtendedAttribute {
13656 const ORDINAL: u64 = 5374223046099989052;
13657
13658 type Protocol = crate::Node;
13659
13660 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
13661
13662 type Response = ::fidl_next::WireResult<
13663 'static,
13664 crate::WireNodeSetExtendedAttributeResponse,
13665 ::fidl_next::WireI32,
13666 >;
13667 }
13668
13669 pub struct RemoveExtendedAttribute;
13670
13671 impl ::fidl_next::Method for RemoveExtendedAttribute {
13672 const ORDINAL: u64 = 8794297771444732717;
13673
13674 type Protocol = crate::Node;
13675
13676 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
13677
13678 type Response = ::fidl_next::WireResult<
13679 'static,
13680 crate::WireNodeRemoveExtendedAttributeResponse,
13681 ::fidl_next::WireI32,
13682 >;
13683 }
13684
13685 mod ___detail {
13686
13687 pub struct Clone<T0> {
13688 request: T0,
13689 }
13690
13691 impl<T0> ::fidl_next::Encodable for Clone<T0>
13692 where
13693 T0: ::fidl_next::Encodable<
13694 Encoded = ::fidl_next::ServerEnd<
13695 ::fidl_next_fuchsia_unknown::Cloneable,
13696 ::fidl_next::fuchsia::WireChannel,
13697 >,
13698 >,
13699 {
13700 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
13701 }
13702
13703 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
13704 where
13705 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13706 ___E: ::fidl_next::fuchsia::HandleEncoder,
13707 T0: ::fidl_next::Encode<
13708 ___E,
13709 Encoded = ::fidl_next::ServerEnd<
13710 ::fidl_next_fuchsia_unknown::Cloneable,
13711 ::fidl_next::fuchsia::WireChannel,
13712 >,
13713 >,
13714 {
13715 #[inline]
13716 fn encode(
13717 self,
13718 encoder_: &mut ___E,
13719 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13720 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13721 ::fidl_next::munge! {
13722 let Self::Encoded {
13723 request,
13724
13725 } = out_;
13726 }
13727
13728 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
13729
13730 Ok(())
13731 }
13732 }
13733
13734 pub struct DeprecatedClone<T0, T1> {
13735 flags: T0,
13736
13737 object: T1,
13738 }
13739
13740 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
13741 where
13742 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
13743 T1: ::fidl_next::Encodable<
13744 Encoded = ::fidl_next::ServerEnd<
13745 crate::Node,
13746 ::fidl_next::fuchsia::WireChannel,
13747 >,
13748 >,
13749 {
13750 type Encoded = crate::WireNodeDeprecatedCloneRequest;
13751 }
13752
13753 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
13754 where
13755 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13756 ___E: ::fidl_next::fuchsia::HandleEncoder,
13757 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
13758 T1: ::fidl_next::Encode<
13759 ___E,
13760 Encoded = ::fidl_next::ServerEnd<
13761 crate::Node,
13762 ::fidl_next::fuchsia::WireChannel,
13763 >,
13764 >,
13765 {
13766 #[inline]
13767 fn encode(
13768 self,
13769 encoder_: &mut ___E,
13770 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13771 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13772 ::fidl_next::munge! {
13773 let Self::Encoded {
13774 flags,
13775 object,
13776
13777 } = out_;
13778 }
13779
13780 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13781
13782 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
13783
13784 Ok(())
13785 }
13786 }
13787
13788 pub struct OnOpen<T0, T1> {
13789 s: T0,
13790
13791 info: T1,
13792 }
13793
13794 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
13795 where
13796 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
13797 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
13798 {
13799 type Encoded = crate::WireNodeOnOpenRequest<'static>;
13800 }
13801
13802 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
13803 where
13804 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13805 ___E: ::fidl_next::Encoder,
13806 ___E: ::fidl_next::fuchsia::HandleEncoder,
13807 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
13808 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
13809 {
13810 #[inline]
13811 fn encode(
13812 self,
13813 encoder_: &mut ___E,
13814 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13815 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13816 ::fidl_next::munge! {
13817 let Self::Encoded {
13818 s,
13819 info,
13820
13821 } = out_;
13822 }
13823
13824 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
13825
13826 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
13827
13828 Ok(())
13829 }
13830 }
13831
13832 pub struct DeprecatedSetAttr<T0, T1> {
13833 flags: T0,
13834
13835 attributes: T1,
13836 }
13837
13838 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
13839 where
13840 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
13841 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
13842 {
13843 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
13844 }
13845
13846 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
13847 where
13848 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13849 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
13850 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
13851 {
13852 #[inline]
13853 fn encode(
13854 self,
13855 encoder_: &mut ___E,
13856 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13857 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13858 ::fidl_next::munge! {
13859 let Self::Encoded {
13860 flags,
13861 attributes,
13862
13863 } = out_;
13864 }
13865
13866 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13867
13868 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
13869
13870 Ok(())
13871 }
13872 }
13873
13874 pub struct DeprecatedSetFlags<T0> {
13875 flags: T0,
13876 }
13877
13878 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
13879 where
13880 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
13881 {
13882 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
13883 }
13884
13885 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
13886 where
13887 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13888 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
13889 {
13890 #[inline]
13891 fn encode(
13892 self,
13893 encoder_: &mut ___E,
13894 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13895 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13896 ::fidl_next::munge! {
13897 let Self::Encoded {
13898 flags,
13899
13900 } = out_;
13901 }
13902
13903 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13904
13905 Ok(())
13906 }
13907 }
13908
13909 pub struct SetFlags<T0> {
13910 flags: T0,
13911 }
13912
13913 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
13914 where
13915 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
13916 {
13917 type Encoded = crate::WireNodeSetFlagsRequest;
13918 }
13919
13920 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
13921 where
13922 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13923 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
13924 {
13925 #[inline]
13926 fn encode(
13927 self,
13928 encoder_: &mut ___E,
13929 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13930 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13931 ::fidl_next::munge! {
13932 let Self::Encoded {
13933 flags,
13934
13935 } = out_;
13936 }
13937
13938 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
13939
13940 Ok(())
13941 }
13942 }
13943
13944 pub struct GetAttributes<T0> {
13945 query: T0,
13946 }
13947
13948 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
13949 where
13950 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
13951 {
13952 type Encoded = crate::WireNodeGetAttributesRequest;
13953 }
13954
13955 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
13956 where
13957 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13958 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
13959 {
13960 #[inline]
13961 fn encode(
13962 self,
13963 encoder_: &mut ___E,
13964 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13966 ::fidl_next::munge! {
13967 let Self::Encoded {
13968 query,
13969
13970 } = out_;
13971 }
13972
13973 ::fidl_next::Encode::encode(self.query, encoder_, query)?;
13974
13975 Ok(())
13976 }
13977 }
13978
13979 pub struct ListExtendedAttributes<T0> {
13980 iterator: T0,
13981 }
13982
13983 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
13984 where
13985 T0: ::fidl_next::Encodable<
13986 Encoded = ::fidl_next::ServerEnd<
13987 crate::ExtendedAttributeIterator,
13988 ::fidl_next::fuchsia::WireChannel,
13989 >,
13990 >,
13991 {
13992 type Encoded = crate::WireNodeListExtendedAttributesRequest;
13993 }
13994
13995 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
13996 where
13997 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13998 ___E: ::fidl_next::fuchsia::HandleEncoder,
13999 T0: ::fidl_next::Encode<
14000 ___E,
14001 Encoded = ::fidl_next::ServerEnd<
14002 crate::ExtendedAttributeIterator,
14003 ::fidl_next::fuchsia::WireChannel,
14004 >,
14005 >,
14006 {
14007 #[inline]
14008 fn encode(
14009 self,
14010 encoder_: &mut ___E,
14011 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14012 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14013 ::fidl_next::munge! {
14014 let Self::Encoded {
14015 iterator,
14016
14017 } = out_;
14018 }
14019
14020 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator)?;
14021
14022 Ok(())
14023 }
14024 }
14025
14026 pub struct GetExtendedAttribute<T0> {
14027 name: T0,
14028 }
14029
14030 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
14031 where
14032 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
14033 {
14034 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
14035 }
14036
14037 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
14038 where
14039 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14040 ___E: ::fidl_next::Encoder,
14041 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
14042 {
14043 #[inline]
14044 fn encode(
14045 self,
14046 encoder_: &mut ___E,
14047 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14048 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14049 ::fidl_next::munge! {
14050 let Self::Encoded {
14051 name,
14052
14053 } = out_;
14054 }
14055
14056 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
14057
14058 Ok(())
14059 }
14060 }
14061
14062 pub struct SetExtendedAttribute<T0, T1, T2> {
14063 name: T0,
14064
14065 value: T1,
14066
14067 mode: T2,
14068 }
14069
14070 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
14071 where
14072 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
14073 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
14074 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
14075 {
14076 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
14077 }
14078
14079 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
14080 where
14081 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14082 ___E: ::fidl_next::Encoder,
14083 ___E: ::fidl_next::fuchsia::HandleEncoder,
14084 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
14085 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
14086 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
14087 {
14088 #[inline]
14089 fn encode(
14090 self,
14091 encoder_: &mut ___E,
14092 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14093 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14094 ::fidl_next::munge! {
14095 let Self::Encoded {
14096 name,
14097 value,
14098 mode,
14099
14100 } = out_;
14101 }
14102
14103 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
14104
14105 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
14106
14107 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
14108
14109 Ok(())
14110 }
14111 }
14112
14113 pub struct RemoveExtendedAttribute<T0> {
14114 name: T0,
14115 }
14116
14117 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
14118 where
14119 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
14120 {
14121 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
14122 }
14123
14124 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
14125 where
14126 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14127 ___E: ::fidl_next::Encoder,
14128 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
14129 {
14130 #[inline]
14131 fn encode(
14132 self,
14133 encoder_: &mut ___E,
14134 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14135 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14136 ::fidl_next::munge! {
14137 let Self::Encoded {
14138 name,
14139
14140 } = out_;
14141 }
14142
14143 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
14144
14145 Ok(())
14146 }
14147 }
14148
14149 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Node
14150 where
14151 ___T: ::fidl_next::Transport,
14152 {
14153 type Client = NodeClient<___T>;
14154 type Server = NodeServer<___T>;
14155 }
14156
14157 #[repr(transparent)]
14159 pub struct NodeClient<___T: ::fidl_next::Transport> {
14160 #[allow(dead_code)]
14161 client: ::fidl_next::protocol::Client<___T>,
14162 }
14163
14164 impl<___T> NodeClient<___T>
14165 where
14166 ___T: ::fidl_next::Transport,
14167 {
14168 pub fn clone(
14169 &self,
14170
14171 request: impl ::fidl_next::Encode<
14172 <___T as ::fidl_next::Transport>::SendBuffer,
14173 Encoded = ::fidl_next::ServerEnd<
14174 ::fidl_next_fuchsia_unknown::Cloneable,
14175 ::fidl_next::fuchsia::WireChannel,
14176 >,
14177 >,
14178 ) -> ::fidl_next::SendFuture<'_, ___T>
14179 where
14180 <___T as ::fidl_next::Transport>::SendBuffer:
14181 ::fidl_next::encoder::InternalHandleEncoder,
14182 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
14183 {
14184 self.clone_with(Clone { request })
14185 }
14186
14187 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
14188 where
14189 ___R: ::fidl_next::Encode<
14190 <___T as ::fidl_next::Transport>::SendBuffer,
14191 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
14192 >,
14193 {
14194 ::fidl_next::SendFuture::from_untyped(
14195 self.client.send_one_way(2366825959783828089, request),
14196 )
14197 }
14198
14199 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
14200 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
14201 ::fidl_next::TwoWayFuture::from_untyped(
14202 self.client.send_two_way(6540867515453498750, ()),
14203 )
14204 }
14205
14206 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
14207 ::fidl_next::TwoWayFuture::from_untyped(
14208 self.client.send_two_way(2763219980499352582, ()),
14209 )
14210 }
14211
14212 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
14213 pub fn deprecated_clone(
14214 &self,
14215
14216 flags: impl ::fidl_next::Encode<
14217 <___T as ::fidl_next::Transport>::SendBuffer,
14218 Encoded = crate::WireOpenFlags,
14219 >,
14220
14221 object: impl ::fidl_next::Encode<
14222 <___T as ::fidl_next::Transport>::SendBuffer,
14223 Encoded = ::fidl_next::ServerEnd<
14224 crate::Node,
14225 ::fidl_next::fuchsia::WireChannel,
14226 >,
14227 >,
14228 ) -> ::fidl_next::SendFuture<'_, ___T>
14229 where
14230 <___T as ::fidl_next::Transport>::SendBuffer:
14231 ::fidl_next::encoder::InternalHandleEncoder,
14232 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
14233 {
14234 self.deprecated_clone_with(DeprecatedClone { flags, object })
14235 }
14236
14237 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
14238 pub fn deprecated_clone_with<___R>(
14239 &self,
14240 request: ___R,
14241 ) -> ::fidl_next::SendFuture<'_, ___T>
14242 where
14243 ___R: ::fidl_next::Encode<
14244 <___T as ::fidl_next::Transport>::SendBuffer,
14245 Encoded = crate::WireNodeDeprecatedCloneRequest,
14246 >,
14247 {
14248 ::fidl_next::SendFuture::from_untyped(
14249 self.client.send_one_way(6512600400724287855, request),
14250 )
14251 }
14252
14253 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
14254 pub fn deprecated_get_attr(
14255 &self,
14256 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
14257 ::fidl_next::TwoWayFuture::from_untyped(
14258 self.client.send_two_way(8689798978500614909, ()),
14259 )
14260 }
14261
14262 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
14263 pub fn deprecated_set_attr(
14264 &self,
14265
14266 flags: impl ::fidl_next::Encode<
14267 <___T as ::fidl_next::Transport>::SendBuffer,
14268 Encoded = crate::WireNodeAttributeFlags,
14269 >,
14270
14271 attributes: impl ::fidl_next::Encode<
14272 <___T as ::fidl_next::Transport>::SendBuffer,
14273 Encoded = crate::WireNodeAttributes,
14274 >,
14275 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
14276 where
14277 <___T as ::fidl_next::Transport>::SendBuffer:
14278 ::fidl_next::encoder::InternalHandleEncoder,
14279 {
14280 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
14281 }
14282
14283 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
14284 pub fn deprecated_set_attr_with<___R>(
14285 &self,
14286 request: ___R,
14287 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
14288 where
14289 ___R: ::fidl_next::Encode<
14290 <___T as ::fidl_next::Transport>::SendBuffer,
14291 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
14292 >,
14293 {
14294 ::fidl_next::TwoWayFuture::from_untyped(
14295 self.client.send_two_way(4721673413776871238, request),
14296 )
14297 }
14298
14299 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
14300 pub fn deprecated_get_flags(
14301 &self,
14302 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
14303 ::fidl_next::TwoWayFuture::from_untyped(
14304 self.client.send_two_way(6595803110182632097, ()),
14305 )
14306 }
14307
14308 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
14309 pub fn deprecated_set_flags(
14310 &self,
14311
14312 flags: impl ::fidl_next::Encode<
14313 <___T as ::fidl_next::Transport>::SendBuffer,
14314 Encoded = crate::WireOpenFlags,
14315 >,
14316 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
14317 where
14318 <___T as ::fidl_next::Transport>::SendBuffer:
14319 ::fidl_next::encoder::InternalHandleEncoder,
14320 {
14321 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
14322 }
14323
14324 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
14325 pub fn deprecated_set_flags_with<___R>(
14326 &self,
14327 request: ___R,
14328 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
14329 where
14330 ___R: ::fidl_next::Encode<
14331 <___T as ::fidl_next::Transport>::SendBuffer,
14332 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
14333 >,
14334 {
14335 ::fidl_next::TwoWayFuture::from_untyped(
14336 self.client.send_two_way(5950864159036794675, request),
14337 )
14338 }
14339
14340 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
14341 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
14342 ::fidl_next::TwoWayFuture::from_untyped(
14343 self.client.send_two_way(105530239381466147, ()),
14344 )
14345 }
14346
14347 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
14348 pub fn set_flags(
14349 &self,
14350
14351 flags: impl ::fidl_next::Encode<
14352 <___T as ::fidl_next::Transport>::SendBuffer,
14353 Encoded = crate::WireFlags,
14354 >,
14355 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
14356 where
14357 <___T as ::fidl_next::Transport>::SendBuffer:
14358 ::fidl_next::encoder::InternalHandleEncoder,
14359 {
14360 self.set_flags_with(SetFlags { flags })
14361 }
14362
14363 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
14364 pub fn set_flags_with<___R>(
14365 &self,
14366 request: ___R,
14367 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
14368 where
14369 ___R: ::fidl_next::Encode<
14370 <___T as ::fidl_next::Transport>::SendBuffer,
14371 Encoded = crate::WireNodeSetFlagsRequest,
14372 >,
14373 {
14374 ::fidl_next::TwoWayFuture::from_untyped(
14375 self.client.send_two_way(6172186066099445416, request),
14376 )
14377 }
14378
14379 #[doc = " Query the filesystem for filesystem-specific information.\n"]
14380 pub fn query_filesystem(
14381 &self,
14382 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
14383 ::fidl_next::TwoWayFuture::from_untyped(
14384 self.client.send_two_way(8013111122914313744, ()),
14385 )
14386 }
14387
14388 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14389 pub fn get_attributes(
14390 &self,
14391
14392 query: impl ::fidl_next::Encode<
14393 <___T as ::fidl_next::Transport>::SendBuffer,
14394 Encoded = crate::WireNodeAttributesQuery,
14395 >,
14396 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
14397 where
14398 <___T as ::fidl_next::Transport>::SendBuffer:
14399 ::fidl_next::encoder::InternalHandleEncoder,
14400 {
14401 self.get_attributes_with(GetAttributes { query })
14402 }
14403
14404 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14405 pub fn get_attributes_with<___R>(
14406 &self,
14407 request: ___R,
14408 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
14409 where
14410 ___R: ::fidl_next::Encode<
14411 <___T as ::fidl_next::Transport>::SendBuffer,
14412 Encoded = crate::WireNodeGetAttributesRequest,
14413 >,
14414 {
14415 ::fidl_next::TwoWayFuture::from_untyped(
14416 self.client.send_two_way(4414537700416816443, request),
14417 )
14418 }
14419
14420 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14421 pub fn update_attributes_with<___R>(
14422 &self,
14423 request: ___R,
14424 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
14425 where
14426 ___R: ::fidl_next::Encode<
14427 <___T as ::fidl_next::Transport>::SendBuffer,
14428 Encoded = crate::WireMutableNodeAttributes<'static>,
14429 >,
14430 {
14431 ::fidl_next::TwoWayFuture::from_untyped(
14432 self.client.send_two_way(3677402239314018056, request),
14433 )
14434 }
14435
14436 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
14437 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
14438 ::fidl_next::TwoWayFuture::from_untyped(
14439 self.client.send_two_way(3196473584242777161, ()),
14440 )
14441 }
14442
14443 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14444 pub fn list_extended_attributes(
14445 &self,
14446
14447 iterator: impl ::fidl_next::Encode<
14448 <___T as ::fidl_next::Transport>::SendBuffer,
14449 Encoded = ::fidl_next::ServerEnd<
14450 crate::ExtendedAttributeIterator,
14451 ::fidl_next::fuchsia::WireChannel,
14452 >,
14453 >,
14454 ) -> ::fidl_next::SendFuture<'_, ___T>
14455 where
14456 <___T as ::fidl_next::Transport>::SendBuffer:
14457 ::fidl_next::encoder::InternalHandleEncoder,
14458 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
14459 {
14460 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
14461 }
14462
14463 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14464 pub fn list_extended_attributes_with<___R>(
14465 &self,
14466 request: ___R,
14467 ) -> ::fidl_next::SendFuture<'_, ___T>
14468 where
14469 ___R: ::fidl_next::Encode<
14470 <___T as ::fidl_next::Transport>::SendBuffer,
14471 Encoded = crate::WireNodeListExtendedAttributesRequest,
14472 >,
14473 {
14474 ::fidl_next::SendFuture::from_untyped(
14475 self.client.send_one_way(5431626189872037072, request),
14476 )
14477 }
14478
14479 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14480 pub fn get_extended_attribute(
14481 &self,
14482
14483 name: impl ::fidl_next::Encode<
14484 <___T as ::fidl_next::Transport>::SendBuffer,
14485 Encoded = ::fidl_next::WireVector<'static, u8>,
14486 >,
14487 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
14488 where
14489 <___T as ::fidl_next::Transport>::SendBuffer:
14490 ::fidl_next::encoder::InternalHandleEncoder,
14491 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
14492 {
14493 self.get_extended_attribute_with(GetExtendedAttribute { name })
14494 }
14495
14496 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14497 pub fn get_extended_attribute_with<___R>(
14498 &self,
14499 request: ___R,
14500 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
14501 where
14502 ___R: ::fidl_next::Encode<
14503 <___T as ::fidl_next::Transport>::SendBuffer,
14504 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
14505 >,
14506 {
14507 ::fidl_next::TwoWayFuture::from_untyped(
14508 self.client.send_two_way(5043930208506967771, request),
14509 )
14510 }
14511
14512 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14513 pub fn set_extended_attribute(
14514 &self,
14515
14516 name: impl ::fidl_next::Encode<
14517 <___T as ::fidl_next::Transport>::SendBuffer,
14518 Encoded = ::fidl_next::WireVector<'static, u8>,
14519 >,
14520
14521 value: impl ::fidl_next::Encode<
14522 <___T as ::fidl_next::Transport>::SendBuffer,
14523 Encoded = crate::WireExtendedAttributeValue<'static>,
14524 >,
14525
14526 mode: impl ::fidl_next::Encode<
14527 <___T as ::fidl_next::Transport>::SendBuffer,
14528 Encoded = crate::WireSetExtendedAttributeMode,
14529 >,
14530 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
14531 where
14532 <___T as ::fidl_next::Transport>::SendBuffer:
14533 ::fidl_next::encoder::InternalHandleEncoder,
14534 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
14535 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
14536 {
14537 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
14538 }
14539
14540 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14541 pub fn set_extended_attribute_with<___R>(
14542 &self,
14543 request: ___R,
14544 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
14545 where
14546 ___R: ::fidl_next::Encode<
14547 <___T as ::fidl_next::Transport>::SendBuffer,
14548 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
14549 >,
14550 {
14551 ::fidl_next::TwoWayFuture::from_untyped(
14552 self.client.send_two_way(5374223046099989052, request),
14553 )
14554 }
14555
14556 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14557 pub fn remove_extended_attribute(
14558 &self,
14559
14560 name: impl ::fidl_next::Encode<
14561 <___T as ::fidl_next::Transport>::SendBuffer,
14562 Encoded = ::fidl_next::WireVector<'static, u8>,
14563 >,
14564 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
14565 where
14566 <___T as ::fidl_next::Transport>::SendBuffer:
14567 ::fidl_next::encoder::InternalHandleEncoder,
14568 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
14569 {
14570 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
14571 }
14572
14573 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14574 pub fn remove_extended_attribute_with<___R>(
14575 &self,
14576 request: ___R,
14577 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
14578 where
14579 ___R: ::fidl_next::Encode<
14580 <___T as ::fidl_next::Transport>::SendBuffer,
14581 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
14582 >,
14583 {
14584 ::fidl_next::TwoWayFuture::from_untyped(
14585 self.client.send_two_way(8794297771444732717, request),
14586 )
14587 }
14588 }
14589
14590 #[repr(transparent)]
14592 pub struct NodeServer<___T: ::fidl_next::Transport> {
14593 server: ::fidl_next::protocol::Server<___T>,
14594 }
14595
14596 impl<___T> NodeServer<___T>
14597 where
14598 ___T: ::fidl_next::Transport,
14599 {
14600 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
14601 pub fn on_open(
14602 &self,
14603
14604 s: impl ::fidl_next::Encode<
14605 <___T as ::fidl_next::Transport>::SendBuffer,
14606 Encoded = ::fidl_next::WireI32,
14607 >,
14608
14609 info: impl ::fidl_next::Encode<
14610 <___T as ::fidl_next::Transport>::SendBuffer,
14611 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
14612 >,
14613 ) -> ::fidl_next::SendFuture<'_, ___T>
14614 where
14615 <___T as ::fidl_next::Transport>::SendBuffer:
14616 ::fidl_next::encoder::InternalHandleEncoder,
14617 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
14618 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
14619 {
14620 self.on_open_with(OnOpen { s, info })
14621 }
14622
14623 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
14624
14625 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
14626 where
14627 ___R: ::fidl_next::Encode<
14628 <___T as ::fidl_next::Transport>::SendBuffer,
14629 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
14630 >,
14631 {
14632 ::fidl_next::SendFuture::from_untyped(
14633 self.server.send_event(9207534335756671346, request),
14634 )
14635 }
14636
14637 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
14638
14639 pub fn on_representation_with<___R>(
14640 &self,
14641 request: ___R,
14642 ) -> ::fidl_next::SendFuture<'_, ___T>
14643 where
14644 ___R: ::fidl_next::Encode<
14645 <___T as ::fidl_next::Transport>::SendBuffer,
14646 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
14647 >,
14648 {
14649 ::fidl_next::SendFuture::from_untyped(
14650 self.server.send_event(6679970090861613324, request),
14651 )
14652 }
14653 }
14654 }
14655}
14656
14657pub trait NodeClientHandler<
14661 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
14662 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14663>
14664{
14665 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
14666 fn on_open(
14667 &mut self,
14668
14669 event: ::fidl_next::Response<node::OnOpen, ___T>,
14670 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14671
14672 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
14673 fn on_representation(
14674 &mut self,
14675
14676 event: ::fidl_next::Response<node::OnRepresentation, ___T>,
14677 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14678
14679 fn on_unknown_interaction(
14680 &mut self,
14681 ordinal: u64,
14682 ) -> impl ::core::future::Future<
14683 Output = ::core::result::Result<
14684 (),
14685 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14686 >,
14687 > + ::core::marker::Send {
14688 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
14689 }
14690}
14691
14692impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Node
14693where
14694 ___H: NodeClientHandler<___T> + ::core::marker::Send,
14695 ___T: ::fidl_next::Transport,
14696 <node::Close as ::fidl_next::Method>::Response:
14697 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14698 <node::Query as ::fidl_next::Method>::Response:
14699 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14700 <node::OnOpen as ::fidl_next::Method>::Response:
14701 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14702 <node::DeprecatedGetAttr as ::fidl_next::Method>::Response:
14703 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14704 <node::DeprecatedSetAttr as ::fidl_next::Method>::Response:
14705 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14706 <node::DeprecatedGetFlags as ::fidl_next::Method>::Response:
14707 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14708 <node::DeprecatedSetFlags as ::fidl_next::Method>::Response:
14709 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14710 <node::GetFlags as ::fidl_next::Method>::Response:
14711 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14712 <node::SetFlags as ::fidl_next::Method>::Response:
14713 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14714 <node::QueryFilesystem as ::fidl_next::Method>::Response:
14715 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14716 <node::OnRepresentation as ::fidl_next::Method>::Response:
14717 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14718 <node::GetAttributes as ::fidl_next::Method>::Response:
14719 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14720 <node::UpdateAttributes as ::fidl_next::Method>::Response:
14721 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14722 <node::Sync as ::fidl_next::Method>::Response:
14723 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14724 <node::GetExtendedAttribute as ::fidl_next::Method>::Response:
14725 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14726 <node::SetExtendedAttribute as ::fidl_next::Method>::Response:
14727 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14728 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
14729 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14730{
14731 async fn on_event(
14732 handler: &mut ___H,
14733 ordinal: u64,
14734 buffer: ___T::RecvBuffer,
14735 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
14736 match ordinal {
14737 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
14738 Ok(decoded) => {
14739 handler.on_open(decoded).await;
14740 Ok(())
14741 }
14742 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14743 ordinal: 9207534335756671346,
14744 error,
14745 }),
14746 },
14747
14748 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
14749 Ok(decoded) => {
14750 handler.on_representation(decoded).await;
14751 Ok(())
14752 }
14753 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14754 ordinal: 6679970090861613324,
14755 error,
14756 }),
14757 },
14758
14759 ordinal => handler.on_unknown_interaction(ordinal).await,
14760 }
14761 }
14762}
14763
14764pub trait NodeServerHandler<
14768 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
14769 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
14770>
14771{
14772 fn clone(
14773 &mut self,
14774
14775 request: ::fidl_next::Request<node::Clone, ___T>,
14776 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14777
14778 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
14779 fn close(
14780 &mut self,
14781
14782 responder: ::fidl_next::Responder<node::Close, ___T>,
14783 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14784
14785 fn query(
14786 &mut self,
14787
14788 responder: ::fidl_next::Responder<node::Query, ___T>,
14789 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14790
14791 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
14792 fn deprecated_clone(
14793 &mut self,
14794
14795 request: ::fidl_next::Request<node::DeprecatedClone, ___T>,
14796 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14797
14798 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
14799 fn deprecated_get_attr(
14800 &mut self,
14801
14802 responder: ::fidl_next::Responder<node::DeprecatedGetAttr, ___T>,
14803 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14804
14805 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
14806 fn deprecated_set_attr(
14807 &mut self,
14808
14809 request: ::fidl_next::Request<node::DeprecatedSetAttr, ___T>,
14810
14811 responder: ::fidl_next::Responder<node::DeprecatedSetAttr, ___T>,
14812 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14813
14814 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
14815 fn deprecated_get_flags(
14816 &mut self,
14817
14818 responder: ::fidl_next::Responder<node::DeprecatedGetFlags, ___T>,
14819 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14820
14821 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
14822 fn deprecated_set_flags(
14823 &mut self,
14824
14825 request: ::fidl_next::Request<node::DeprecatedSetFlags, ___T>,
14826
14827 responder: ::fidl_next::Responder<node::DeprecatedSetFlags, ___T>,
14828 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14829
14830 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
14831 fn get_flags(
14832 &mut self,
14833
14834 responder: ::fidl_next::Responder<node::GetFlags, ___T>,
14835 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14836
14837 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
14838 fn set_flags(
14839 &mut self,
14840
14841 request: ::fidl_next::Request<node::SetFlags, ___T>,
14842
14843 responder: ::fidl_next::Responder<node::SetFlags, ___T>,
14844 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14845
14846 #[doc = " Query the filesystem for filesystem-specific information.\n"]
14847 fn query_filesystem(
14848 &mut self,
14849
14850 responder: ::fidl_next::Responder<node::QueryFilesystem, ___T>,
14851 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14852
14853 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14854 fn get_attributes(
14855 &mut self,
14856
14857 request: ::fidl_next::Request<node::GetAttributes, ___T>,
14858
14859 responder: ::fidl_next::Responder<node::GetAttributes, ___T>,
14860 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14861
14862 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14863 fn update_attributes(
14864 &mut self,
14865
14866 request: ::fidl_next::Request<node::UpdateAttributes, ___T>,
14867
14868 responder: ::fidl_next::Responder<node::UpdateAttributes, ___T>,
14869 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14870
14871 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
14872 fn sync(
14873 &mut self,
14874
14875 responder: ::fidl_next::Responder<node::Sync, ___T>,
14876 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14877
14878 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14879 fn list_extended_attributes(
14880 &mut self,
14881
14882 request: ::fidl_next::Request<node::ListExtendedAttributes, ___T>,
14883 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14884
14885 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14886 fn get_extended_attribute(
14887 &mut self,
14888
14889 request: ::fidl_next::Request<node::GetExtendedAttribute, ___T>,
14890
14891 responder: ::fidl_next::Responder<node::GetExtendedAttribute, ___T>,
14892 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14893
14894 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14895 fn set_extended_attribute(
14896 &mut self,
14897
14898 request: ::fidl_next::Request<node::SetExtendedAttribute, ___T>,
14899
14900 responder: ::fidl_next::Responder<node::SetExtendedAttribute, ___T>,
14901 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14902
14903 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14904 fn remove_extended_attribute(
14905 &mut self,
14906
14907 request: ::fidl_next::Request<node::RemoveExtendedAttribute, ___T>,
14908
14909 responder: ::fidl_next::Responder<node::RemoveExtendedAttribute, ___T>,
14910 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
14911
14912 fn on_unknown_interaction(
14913 &mut self,
14914 ordinal: u64,
14915 ) -> impl ::core::future::Future<
14916 Output = ::core::result::Result<
14917 (),
14918 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14919 >,
14920 > + ::core::marker::Send {
14921 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
14922 }
14923}
14924
14925impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Node
14926where
14927 ___H: NodeServerHandler<___T> + ::core::marker::Send,
14928 ___T: ::fidl_next::Transport,
14929 <node::Clone as ::fidl_next::Method>::Request:
14930 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14931 <node::DeprecatedClone as ::fidl_next::Method>::Request:
14932 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14933 <node::DeprecatedSetAttr as ::fidl_next::Method>::Request:
14934 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14935 <node::DeprecatedSetFlags as ::fidl_next::Method>::Request:
14936 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14937 <node::SetFlags as ::fidl_next::Method>::Request:
14938 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14939 <node::GetAttributes as ::fidl_next::Method>::Request:
14940 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14941 <node::UpdateAttributes as ::fidl_next::Method>::Request:
14942 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14943 <node::ListExtendedAttributes as ::fidl_next::Method>::Request:
14944 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14945 <node::GetExtendedAttribute as ::fidl_next::Method>::Request:
14946 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14947 <node::SetExtendedAttribute as ::fidl_next::Method>::Request:
14948 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14949 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
14950 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14951{
14952 async fn on_one_way(
14953 handler: &mut ___H,
14954 ordinal: u64,
14955 buffer: ___T::RecvBuffer,
14956 ) -> ::core::result::Result<
14957 (),
14958 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
14959 > {
14960 match ordinal {
14961 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
14962 Ok(decoded) => {
14963 handler.clone(decoded).await;
14964 Ok(())
14965 }
14966 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14967 ordinal: 2366825959783828089,
14968 error,
14969 }),
14970 },
14971
14972 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
14973 Ok(decoded) => {
14974 handler.deprecated_clone(decoded).await;
14975 Ok(())
14976 }
14977 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14978 ordinal: 6512600400724287855,
14979 error,
14980 }),
14981 },
14982
14983 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
14984 Ok(decoded) => {
14985 handler.list_extended_attributes(decoded).await;
14986 Ok(())
14987 }
14988 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
14989 ordinal: 5431626189872037072,
14990 error,
14991 }),
14992 },
14993
14994 ordinal => handler.on_unknown_interaction(ordinal).await,
14995 }
14996 }
14997
14998 async fn on_two_way(
14999 handler: &mut ___H,
15000 ordinal: u64,
15001 buffer: ___T::RecvBuffer,
15002 responder: ::fidl_next::protocol::Responder<___T>,
15003 ) -> ::core::result::Result<
15004 (),
15005 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
15006 > {
15007 match ordinal {
15008 6540867515453498750 => {
15009 let responder = ::fidl_next::Responder::from_untyped(responder);
15010
15011 handler.close(responder).await;
15012 Ok(())
15013 }
15014
15015 2763219980499352582 => {
15016 let responder = ::fidl_next::Responder::from_untyped(responder);
15017
15018 handler.query(responder).await;
15019 Ok(())
15020 }
15021
15022 8689798978500614909 => {
15023 let responder = ::fidl_next::Responder::from_untyped(responder);
15024
15025 handler.deprecated_get_attr(responder).await;
15026 Ok(())
15027 }
15028
15029 4721673413776871238 => {
15030 let responder = ::fidl_next::Responder::from_untyped(responder);
15031
15032 match ::fidl_next::DecoderExt::decode(buffer) {
15033 Ok(decoded) => {
15034 handler.deprecated_set_attr(decoded, responder).await;
15035 Ok(())
15036 }
15037 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15038 ordinal: 4721673413776871238,
15039 error,
15040 }),
15041 }
15042 }
15043
15044 6595803110182632097 => {
15045 let responder = ::fidl_next::Responder::from_untyped(responder);
15046
15047 handler.deprecated_get_flags(responder).await;
15048 Ok(())
15049 }
15050
15051 5950864159036794675 => {
15052 let responder = ::fidl_next::Responder::from_untyped(responder);
15053
15054 match ::fidl_next::DecoderExt::decode(buffer) {
15055 Ok(decoded) => {
15056 handler.deprecated_set_flags(decoded, responder).await;
15057 Ok(())
15058 }
15059 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15060 ordinal: 5950864159036794675,
15061 error,
15062 }),
15063 }
15064 }
15065
15066 105530239381466147 => {
15067 let responder = ::fidl_next::Responder::from_untyped(responder);
15068
15069 handler.get_flags(responder).await;
15070 Ok(())
15071 }
15072
15073 6172186066099445416 => {
15074 let responder = ::fidl_next::Responder::from_untyped(responder);
15075
15076 match ::fidl_next::DecoderExt::decode(buffer) {
15077 Ok(decoded) => {
15078 handler.set_flags(decoded, responder).await;
15079 Ok(())
15080 }
15081 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15082 ordinal: 6172186066099445416,
15083 error,
15084 }),
15085 }
15086 }
15087
15088 8013111122914313744 => {
15089 let responder = ::fidl_next::Responder::from_untyped(responder);
15090
15091 handler.query_filesystem(responder).await;
15092 Ok(())
15093 }
15094
15095 4414537700416816443 => {
15096 let responder = ::fidl_next::Responder::from_untyped(responder);
15097
15098 match ::fidl_next::DecoderExt::decode(buffer) {
15099 Ok(decoded) => {
15100 handler.get_attributes(decoded, responder).await;
15101 Ok(())
15102 }
15103 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15104 ordinal: 4414537700416816443,
15105 error,
15106 }),
15107 }
15108 }
15109
15110 3677402239314018056 => {
15111 let responder = ::fidl_next::Responder::from_untyped(responder);
15112
15113 match ::fidl_next::DecoderExt::decode(buffer) {
15114 Ok(decoded) => {
15115 handler.update_attributes(decoded, responder).await;
15116 Ok(())
15117 }
15118 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15119 ordinal: 3677402239314018056,
15120 error,
15121 }),
15122 }
15123 }
15124
15125 3196473584242777161 => {
15126 let responder = ::fidl_next::Responder::from_untyped(responder);
15127
15128 handler.sync(responder).await;
15129 Ok(())
15130 }
15131
15132 5043930208506967771 => {
15133 let responder = ::fidl_next::Responder::from_untyped(responder);
15134
15135 match ::fidl_next::DecoderExt::decode(buffer) {
15136 Ok(decoded) => {
15137 handler.get_extended_attribute(decoded, responder).await;
15138 Ok(())
15139 }
15140 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15141 ordinal: 5043930208506967771,
15142 error,
15143 }),
15144 }
15145 }
15146
15147 5374223046099989052 => {
15148 let responder = ::fidl_next::Responder::from_untyped(responder);
15149
15150 match ::fidl_next::DecoderExt::decode(buffer) {
15151 Ok(decoded) => {
15152 handler.set_extended_attribute(decoded, responder).await;
15153 Ok(())
15154 }
15155 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15156 ordinal: 5374223046099989052,
15157 error,
15158 }),
15159 }
15160 }
15161
15162 8794297771444732717 => {
15163 let responder = ::fidl_next::Responder::from_untyped(responder);
15164
15165 match ::fidl_next::DecoderExt::decode(buffer) {
15166 Ok(decoded) => {
15167 handler.remove_extended_attribute(decoded, responder).await;
15168 Ok(())
15169 }
15170 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
15171 ordinal: 8794297771444732717,
15172 error,
15173 }),
15174 }
15175 }
15176
15177 ordinal => handler.on_unknown_interaction(ordinal).await,
15178 }
15179 }
15180}
15181
15182#[derive(PartialEq, Debug)]
15183pub struct DirectoryDeprecatedOpenRequest {
15184 pub flags: crate::OpenFlags,
15185
15186 pub mode: crate::ModeType,
15187
15188 pub path: ::std::string::String,
15189
15190 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
15191}
15192
15193impl ::fidl_next::Encodable for DirectoryDeprecatedOpenRequest {
15194 type Encoded = WireDirectoryDeprecatedOpenRequest<'static>;
15195}
15196
15197unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryDeprecatedOpenRequest
15198where
15199 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15200 ___E: ::fidl_next::Encoder,
15201 ___E: ::fidl_next::fuchsia::HandleEncoder,
15202{
15203 #[inline]
15204 fn encode(
15205 self,
15206 encoder_: &mut ___E,
15207 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15208 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15209 ::fidl_next::munge! {
15210 let Self::Encoded {
15211 flags,
15212 mode,
15213 path,
15214 object,
15215
15216 } = out_;
15217 }
15218
15219 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
15220
15221 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
15222
15223 ::fidl_next::Encode::encode(self.path, encoder_, path)?;
15224
15225 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
15226
15227 Ok(())
15228 }
15229}
15230
15231impl ::fidl_next::EncodableOption for DirectoryDeprecatedOpenRequest {
15232 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryDeprecatedOpenRequest<'static>>;
15233}
15234
15235unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryDeprecatedOpenRequest
15236where
15237 ___E: ::fidl_next::Encoder + ?Sized,
15238 DirectoryDeprecatedOpenRequest: ::fidl_next::Encode<___E>,
15239{
15240 #[inline]
15241 fn encode_option(
15242 this: ::core::option::Option<Self>,
15243 encoder: &mut ___E,
15244 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15245 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15246 if let Some(inner) = this {
15247 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
15248 ::fidl_next::WireBox::encode_present(out);
15249 } else {
15250 ::fidl_next::WireBox::encode_absent(out);
15251 }
15252
15253 Ok(())
15254 }
15255}
15256
15257impl<'de> ::fidl_next::FromWire<WireDirectoryDeprecatedOpenRequest<'de>>
15258 for DirectoryDeprecatedOpenRequest
15259{
15260 #[inline]
15261 fn from_wire(wire: WireDirectoryDeprecatedOpenRequest<'de>) -> Self {
15262 Self {
15263 flags: ::fidl_next::FromWire::from_wire(wire.flags),
15264
15265 mode: ::fidl_next::FromWire::from_wire(wire.mode),
15266
15267 path: ::fidl_next::FromWire::from_wire(wire.path),
15268
15269 object: ::fidl_next::FromWire::from_wire(wire.object),
15270 }
15271 }
15272}
15273
15274impl<'de> ::fidl_next::IntoNatural for WireDirectoryDeprecatedOpenRequest<'de> {
15275 type Natural = DirectoryDeprecatedOpenRequest;
15276}
15277
15278#[derive(Debug)]
15280#[repr(C)]
15281pub struct WireDirectoryDeprecatedOpenRequest<'de> {
15282 pub flags: crate::WireOpenFlags,
15283
15284 pub mode: crate::WireModeType,
15285
15286 pub path: ::fidl_next::WireString<'de>,
15287
15288 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
15289}
15290static_assertions::const_assert_eq!(
15291 std::mem::size_of::<WireDirectoryDeprecatedOpenRequest<'_>>(),
15292 32
15293);
15294static_assertions::const_assert_eq!(
15295 std::mem::align_of::<WireDirectoryDeprecatedOpenRequest<'_>>(),
15296 8
15297);
15298
15299static_assertions::const_assert_eq!(
15300 std::mem::offset_of!(WireDirectoryDeprecatedOpenRequest<'_>, flags),
15301 0
15302);
15303
15304static_assertions::const_assert_eq!(
15305 std::mem::offset_of!(WireDirectoryDeprecatedOpenRequest<'_>, mode),
15306 4
15307);
15308
15309static_assertions::const_assert_eq!(
15310 std::mem::offset_of!(WireDirectoryDeprecatedOpenRequest<'_>, path),
15311 8
15312);
15313
15314static_assertions::const_assert_eq!(
15315 std::mem::offset_of!(WireDirectoryDeprecatedOpenRequest<'_>, object),
15316 24
15317);
15318
15319unsafe impl ::fidl_next::Wire for WireDirectoryDeprecatedOpenRequest<'static> {
15320 type Decoded<'de> = WireDirectoryDeprecatedOpenRequest<'de>;
15321
15322 #[inline]
15323 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15324 ::fidl_next::munge! {
15325 let Self {
15326
15327 flags,
15328 mode,
15329 path,
15330 object,
15331
15332 } = &mut *out_;
15333 }
15334
15335 ::fidl_next::Wire::zero_padding(flags);
15336
15337 ::fidl_next::Wire::zero_padding(mode);
15338
15339 ::fidl_next::Wire::zero_padding(path);
15340
15341 ::fidl_next::Wire::zero_padding(object);
15342
15343 unsafe {
15344 out_.as_mut_ptr().cast::<u8>().add(28).write_bytes(0, 4);
15345 }
15346 }
15347}
15348
15349unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryDeprecatedOpenRequest<'static>
15350where
15351 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15352 ___D: ::fidl_next::Decoder,
15353 ___D: ::fidl_next::fuchsia::HandleDecoder,
15354{
15355 fn decode(
15356 slot_: ::fidl_next::Slot<'_, Self>,
15357 decoder_: &mut ___D,
15358 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15359 ::fidl_next::munge! {
15360 let Self {
15361
15362 mut flags,
15363 mut mode,
15364 mut path,
15365 mut object,
15366
15367 } = slot_;
15368 }
15369
15370 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
15371
15372 ::fidl_next::Decode::decode(mode.as_mut(), decoder_)?;
15373
15374 ::fidl_next::Decode::decode(path.as_mut(), decoder_)?;
15375
15376 let path = unsafe { path.deref_unchecked() };
15377
15378 if path.len() > 4095 {
15379 return Err(::fidl_next::DecodeError::VectorTooLong {
15380 size: path.len() as u64,
15381 limit: 4095,
15382 });
15383 }
15384
15385 ::fidl_next::Decode::decode(object.as_mut(), decoder_)?;
15386
15387 Ok(())
15388 }
15389}
15390
15391#[derive(PartialEq, Debug)]
15392pub struct DirectoryCreateSymlinkRequest {
15393 pub name: ::std::string::String,
15394
15395 pub target: ::std::vec::Vec<u8>,
15396
15397 pub connection: ::core::option::Option<
15398 ::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::zx::Channel>,
15399 >,
15400}
15401
15402impl ::fidl_next::Encodable for DirectoryCreateSymlinkRequest {
15403 type Encoded = WireDirectoryCreateSymlinkRequest<'static>;
15404}
15405
15406unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryCreateSymlinkRequest
15407where
15408 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15409 ___E: ::fidl_next::Encoder,
15410 ___E: ::fidl_next::fuchsia::HandleEncoder,
15411{
15412 #[inline]
15413 fn encode(
15414 self,
15415 encoder_: &mut ___E,
15416 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15417 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15418 ::fidl_next::munge! {
15419 let Self::Encoded {
15420 name,
15421 target,
15422 connection,
15423
15424 } = out_;
15425 }
15426
15427 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
15428
15429 ::fidl_next::Encode::encode(self.target, encoder_, target)?;
15430
15431 ::fidl_next::Encode::encode(self.connection, encoder_, connection)?;
15432
15433 Ok(())
15434 }
15435}
15436
15437impl ::fidl_next::EncodableOption for DirectoryCreateSymlinkRequest {
15438 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryCreateSymlinkRequest<'static>>;
15439}
15440
15441unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryCreateSymlinkRequest
15442where
15443 ___E: ::fidl_next::Encoder + ?Sized,
15444 DirectoryCreateSymlinkRequest: ::fidl_next::Encode<___E>,
15445{
15446 #[inline]
15447 fn encode_option(
15448 this: ::core::option::Option<Self>,
15449 encoder: &mut ___E,
15450 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15451 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15452 if let Some(inner) = this {
15453 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
15454 ::fidl_next::WireBox::encode_present(out);
15455 } else {
15456 ::fidl_next::WireBox::encode_absent(out);
15457 }
15458
15459 Ok(())
15460 }
15461}
15462
15463impl<'de> ::fidl_next::FromWire<WireDirectoryCreateSymlinkRequest<'de>>
15464 for DirectoryCreateSymlinkRequest
15465{
15466 #[inline]
15467 fn from_wire(wire: WireDirectoryCreateSymlinkRequest<'de>) -> Self {
15468 Self {
15469 name: ::fidl_next::FromWire::from_wire(wire.name),
15470
15471 target: ::fidl_next::FromWire::from_wire(wire.target),
15472
15473 connection: ::fidl_next::FromWire::from_wire(wire.connection),
15474 }
15475 }
15476}
15477
15478impl<'de> ::fidl_next::IntoNatural for WireDirectoryCreateSymlinkRequest<'de> {
15479 type Natural = DirectoryCreateSymlinkRequest;
15480}
15481
15482#[derive(Debug)]
15484#[repr(C)]
15485pub struct WireDirectoryCreateSymlinkRequest<'de> {
15486 pub name: ::fidl_next::WireString<'de>,
15487
15488 pub target: ::fidl_next::WireVector<'de, u8>,
15489
15490 pub connection:
15491 ::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::WireOptionalChannel>,
15492}
15493static_assertions::const_assert_eq!(
15494 std::mem::size_of::<WireDirectoryCreateSymlinkRequest<'_>>(),
15495 40
15496);
15497static_assertions::const_assert_eq!(
15498 std::mem::align_of::<WireDirectoryCreateSymlinkRequest<'_>>(),
15499 8
15500);
15501
15502static_assertions::const_assert_eq!(
15503 std::mem::offset_of!(WireDirectoryCreateSymlinkRequest<'_>, name),
15504 0
15505);
15506
15507static_assertions::const_assert_eq!(
15508 std::mem::offset_of!(WireDirectoryCreateSymlinkRequest<'_>, target),
15509 16
15510);
15511
15512static_assertions::const_assert_eq!(
15513 std::mem::offset_of!(WireDirectoryCreateSymlinkRequest<'_>, connection),
15514 32
15515);
15516
15517unsafe impl ::fidl_next::Wire for WireDirectoryCreateSymlinkRequest<'static> {
15518 type Decoded<'de> = WireDirectoryCreateSymlinkRequest<'de>;
15519
15520 #[inline]
15521 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15522 ::fidl_next::munge! {
15523 let Self {
15524
15525 name,
15526 target,
15527 connection,
15528
15529 } = &mut *out_;
15530 }
15531
15532 ::fidl_next::Wire::zero_padding(name);
15533
15534 ::fidl_next::Wire::zero_padding(target);
15535
15536 ::fidl_next::Wire::zero_padding(connection);
15537
15538 unsafe {
15539 out_.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
15540 }
15541 }
15542}
15543
15544unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryCreateSymlinkRequest<'static>
15545where
15546 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15547 ___D: ::fidl_next::Decoder,
15548 ___D: ::fidl_next::fuchsia::HandleDecoder,
15549{
15550 fn decode(
15551 slot_: ::fidl_next::Slot<'_, Self>,
15552 decoder_: &mut ___D,
15553 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15554 ::fidl_next::munge! {
15555 let Self {
15556
15557 mut name,
15558 mut target,
15559 mut connection,
15560
15561 } = slot_;
15562 }
15563
15564 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
15565
15566 let name = unsafe { name.deref_unchecked() };
15567
15568 if name.len() > 255 {
15569 return Err(::fidl_next::DecodeError::VectorTooLong {
15570 size: name.len() as u64,
15571 limit: 255,
15572 });
15573 }
15574
15575 ::fidl_next::Decode::decode(target.as_mut(), decoder_)?;
15576
15577 let target = unsafe { target.deref_unchecked() };
15578
15579 if target.len() > 4095 {
15580 return Err(::fidl_next::DecodeError::VectorTooLong {
15581 size: target.len() as u64,
15582 limit: 4095,
15583 });
15584 }
15585
15586 ::fidl_next::Decode::decode(connection.as_mut(), decoder_)?;
15587
15588 Ok(())
15589 }
15590}
15591
15592#[doc = " Directory defines a node which is capable of containing other Objects.\n"]
15594#[derive(PartialEq, Debug)]
15595pub struct Directory;
15596
15597impl ::fidl_next::Discoverable for Directory {
15598 const PROTOCOL_NAME: &'static str = "fuchsia.io.Directory";
15599}
15600
15601pub mod directory {
15602 pub mod prelude {
15603 pub use crate::{Directory, DirectoryClientHandler, DirectoryServerHandler, directory};
15604
15605 pub use crate::AdvisoryLockingAdvisoryLockRequest;
15606
15607 pub use crate::AdvisoryLockingAdvisoryLockResponse;
15608
15609 pub use crate::DirectoryCreateSymlinkRequest;
15610
15611 pub use crate::DirectoryDeprecatedOpenRequest;
15612
15613 pub use crate::DirectoryGetTokenResponse;
15614
15615 pub use crate::DirectoryLinkRequest;
15616
15617 pub use crate::DirectoryLinkResponse;
15618
15619 pub use crate::DirectoryOpenRequest;
15620
15621 pub use crate::DirectoryReadDirentsRequest;
15622
15623 pub use crate::DirectoryReadDirentsResponse;
15624
15625 pub use crate::DirectoryRenameRequest;
15626
15627 pub use crate::DirectoryRewindResponse;
15628
15629 pub use crate::DirectoryUnlinkRequest;
15630
15631 pub use crate::DirectoryWatchRequest;
15632
15633 pub use crate::DirectoryWatchResponse;
15634
15635 pub use crate::DirectoryCreateSymlinkResponse;
15636
15637 pub use crate::DirectoryRenameResponse;
15638
15639 pub use crate::DirectoryUnlinkResponse;
15640
15641 pub use crate::ExtendedAttributeValue;
15642
15643 pub use crate::MutableNodeAttributes;
15644
15645 pub use crate::NodeAttributes2;
15646
15647 pub use crate::NodeDeprecatedCloneRequest;
15648
15649 pub use crate::NodeDeprecatedGetAttrResponse;
15650
15651 pub use crate::NodeDeprecatedGetFlagsResponse;
15652
15653 pub use crate::NodeDeprecatedSetAttrRequest;
15654
15655 pub use crate::NodeDeprecatedSetAttrResponse;
15656
15657 pub use crate::NodeDeprecatedSetFlagsRequest;
15658
15659 pub use crate::NodeDeprecatedSetFlagsResponse;
15660
15661 pub use crate::NodeGetAttributesRequest;
15662
15663 pub use crate::NodeGetExtendedAttributeRequest;
15664
15665 pub use crate::NodeListExtendedAttributesRequest;
15666
15667 pub use crate::NodeOnOpenRequest;
15668
15669 pub use crate::NodeQueryFilesystemResponse;
15670
15671 pub use crate::NodeRemoveExtendedAttributeRequest;
15672
15673 pub use crate::NodeSetExtendedAttributeRequest;
15674
15675 pub use crate::NodeSetFlagsRequest;
15676
15677 pub use crate::NodeGetFlagsResponse;
15678
15679 pub use crate::NodeRemoveExtendedAttributeResponse;
15680
15681 pub use crate::NodeSetExtendedAttributeResponse;
15682
15683 pub use crate::NodeSetFlagsResponse;
15684
15685 pub use crate::NodeSyncResponse;
15686
15687 pub use crate::NodeUpdateAttributesResponse;
15688
15689 pub use crate::Representation;
15690
15691 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
15692
15693 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
15694
15695 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
15696 }
15697
15698 pub struct AdvisoryLock;
15699
15700 impl ::fidl_next::Method for AdvisoryLock {
15701 const ORDINAL: u64 = 7992130864415541162;
15702
15703 type Protocol = crate::Directory;
15704
15705 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
15706
15707 type Response = ::fidl_next::WireResult<
15708 'static,
15709 crate::WireAdvisoryLockingAdvisoryLockResponse,
15710 ::fidl_next::WireI32,
15711 >;
15712 }
15713
15714 pub struct Clone;
15715
15716 impl ::fidl_next::Method for Clone {
15717 const ORDINAL: u64 = 2366825959783828089;
15718
15719 type Protocol = crate::Directory;
15720
15721 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
15722
15723 type Response = ::fidl_next::Never;
15724 }
15725
15726 pub struct Close;
15727
15728 impl ::fidl_next::Method for Close {
15729 const ORDINAL: u64 = 6540867515453498750;
15730
15731 type Protocol = crate::Directory;
15732
15733 type Request = ();
15734
15735 type Response = ::fidl_next::WireResult<
15736 'static,
15737 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
15738 ::fidl_next::WireI32,
15739 >;
15740 }
15741
15742 pub struct Query;
15743
15744 impl ::fidl_next::Method for Query {
15745 const ORDINAL: u64 = 2763219980499352582;
15746
15747 type Protocol = crate::Directory;
15748
15749 type Request = ();
15750
15751 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
15752 }
15753
15754 pub struct DeprecatedClone;
15755
15756 impl ::fidl_next::Method for DeprecatedClone {
15757 const ORDINAL: u64 = 6512600400724287855;
15758
15759 type Protocol = crate::Directory;
15760
15761 type Request = crate::WireNodeDeprecatedCloneRequest;
15762
15763 type Response = ::fidl_next::Never;
15764 }
15765
15766 pub struct OnOpen;
15767
15768 impl ::fidl_next::Method for OnOpen {
15769 const ORDINAL: u64 = 9207534335756671346;
15770
15771 type Protocol = crate::Directory;
15772
15773 type Request = ::fidl_next::Never;
15774
15775 type Response = crate::WireNodeOnOpenRequest<'static>;
15776 }
15777
15778 pub struct DeprecatedGetAttr;
15779
15780 impl ::fidl_next::Method for DeprecatedGetAttr {
15781 const ORDINAL: u64 = 8689798978500614909;
15782
15783 type Protocol = crate::Directory;
15784
15785 type Request = ();
15786
15787 type Response = crate::WireNodeDeprecatedGetAttrResponse;
15788 }
15789
15790 pub struct DeprecatedSetAttr;
15791
15792 impl ::fidl_next::Method for DeprecatedSetAttr {
15793 const ORDINAL: u64 = 4721673413776871238;
15794
15795 type Protocol = crate::Directory;
15796
15797 type Request = crate::WireNodeDeprecatedSetAttrRequest;
15798
15799 type Response = crate::WireNodeDeprecatedSetAttrResponse;
15800 }
15801
15802 pub struct DeprecatedGetFlags;
15803
15804 impl ::fidl_next::Method for DeprecatedGetFlags {
15805 const ORDINAL: u64 = 6595803110182632097;
15806
15807 type Protocol = crate::Directory;
15808
15809 type Request = ();
15810
15811 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
15812 }
15813
15814 pub struct DeprecatedSetFlags;
15815
15816 impl ::fidl_next::Method for DeprecatedSetFlags {
15817 const ORDINAL: u64 = 5950864159036794675;
15818
15819 type Protocol = crate::Directory;
15820
15821 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
15822
15823 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
15824 }
15825
15826 pub struct GetFlags;
15827
15828 impl ::fidl_next::Method for GetFlags {
15829 const ORDINAL: u64 = 105530239381466147;
15830
15831 type Protocol = crate::Directory;
15832
15833 type Request = ();
15834
15835 type Response = ::fidl_next::WireFlexibleResult<
15836 'static,
15837 crate::WireNodeGetFlagsResponse,
15838 ::fidl_next::WireI32,
15839 >;
15840 }
15841
15842 pub struct SetFlags;
15843
15844 impl ::fidl_next::Method for SetFlags {
15845 const ORDINAL: u64 = 6172186066099445416;
15846
15847 type Protocol = crate::Directory;
15848
15849 type Request = crate::WireNodeSetFlagsRequest;
15850
15851 type Response = ::fidl_next::WireFlexibleResult<
15852 'static,
15853 crate::WireNodeSetFlagsResponse,
15854 ::fidl_next::WireI32,
15855 >;
15856 }
15857
15858 pub struct QueryFilesystem;
15859
15860 impl ::fidl_next::Method for QueryFilesystem {
15861 const ORDINAL: u64 = 8013111122914313744;
15862
15863 type Protocol = crate::Directory;
15864
15865 type Request = ();
15866
15867 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
15868 }
15869
15870 pub struct OnRepresentation;
15871
15872 impl ::fidl_next::Method for OnRepresentation {
15873 const ORDINAL: u64 = 6679970090861613324;
15874
15875 type Protocol = crate::Directory;
15876
15877 type Request = ::fidl_next::Never;
15878
15879 type Response = crate::WireRepresentation<'static>;
15880 }
15881
15882 pub struct GetAttributes;
15883
15884 impl ::fidl_next::Method for GetAttributes {
15885 const ORDINAL: u64 = 4414537700416816443;
15886
15887 type Protocol = crate::Directory;
15888
15889 type Request = crate::WireNodeGetAttributesRequest;
15890
15891 type Response = ::fidl_next::WireResult<
15892 'static,
15893 crate::WireNodeAttributes2<'static>,
15894 ::fidl_next::WireI32,
15895 >;
15896 }
15897
15898 pub struct UpdateAttributes;
15899
15900 impl ::fidl_next::Method for UpdateAttributes {
15901 const ORDINAL: u64 = 3677402239314018056;
15902
15903 type Protocol = crate::Directory;
15904
15905 type Request = crate::WireMutableNodeAttributes<'static>;
15906
15907 type Response = ::fidl_next::WireResult<
15908 'static,
15909 crate::WireNodeUpdateAttributesResponse,
15910 ::fidl_next::WireI32,
15911 >;
15912 }
15913
15914 pub struct Sync;
15915
15916 impl ::fidl_next::Method for Sync {
15917 const ORDINAL: u64 = 3196473584242777161;
15918
15919 type Protocol = crate::Directory;
15920
15921 type Request = ();
15922
15923 type Response =
15924 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
15925 }
15926
15927 pub struct ListExtendedAttributes;
15928
15929 impl ::fidl_next::Method for ListExtendedAttributes {
15930 const ORDINAL: u64 = 5431626189872037072;
15931
15932 type Protocol = crate::Directory;
15933
15934 type Request = crate::WireNodeListExtendedAttributesRequest;
15935
15936 type Response = ::fidl_next::Never;
15937 }
15938
15939 pub struct GetExtendedAttribute;
15940
15941 impl ::fidl_next::Method for GetExtendedAttribute {
15942 const ORDINAL: u64 = 5043930208506967771;
15943
15944 type Protocol = crate::Directory;
15945
15946 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
15947
15948 type Response = ::fidl_next::WireResult<
15949 'static,
15950 crate::WireExtendedAttributeValue<'static>,
15951 ::fidl_next::WireI32,
15952 >;
15953 }
15954
15955 pub struct SetExtendedAttribute;
15956
15957 impl ::fidl_next::Method for SetExtendedAttribute {
15958 const ORDINAL: u64 = 5374223046099989052;
15959
15960 type Protocol = crate::Directory;
15961
15962 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
15963
15964 type Response = ::fidl_next::WireResult<
15965 'static,
15966 crate::WireNodeSetExtendedAttributeResponse,
15967 ::fidl_next::WireI32,
15968 >;
15969 }
15970
15971 pub struct RemoveExtendedAttribute;
15972
15973 impl ::fidl_next::Method for RemoveExtendedAttribute {
15974 const ORDINAL: u64 = 8794297771444732717;
15975
15976 type Protocol = crate::Directory;
15977
15978 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
15979
15980 type Response = ::fidl_next::WireResult<
15981 'static,
15982 crate::WireNodeRemoveExtendedAttributeResponse,
15983 ::fidl_next::WireI32,
15984 >;
15985 }
15986
15987 pub struct DeprecatedOpen;
15988
15989 impl ::fidl_next::Method for DeprecatedOpen {
15990 const ORDINAL: u64 = 3193127272456937152;
15991
15992 type Protocol = crate::Directory;
15993
15994 type Request = crate::WireDirectoryDeprecatedOpenRequest<'static>;
15995
15996 type Response = ::fidl_next::Never;
15997 }
15998
15999 pub struct Open;
16000
16001 impl ::fidl_next::Method for Open {
16002 const ORDINAL: u64 = 6236883748953765593;
16003
16004 type Protocol = crate::Directory;
16005
16006 type Request = crate::WireDirectoryOpenRequest<'static>;
16007
16008 type Response = ::fidl_next::Never;
16009 }
16010
16011 pub struct ReadDirents;
16012
16013 impl ::fidl_next::Method for ReadDirents {
16014 const ORDINAL: u64 = 3855785432100874762;
16015
16016 type Protocol = crate::Directory;
16017
16018 type Request = crate::WireDirectoryReadDirentsRequest;
16019
16020 type Response = crate::WireDirectoryReadDirentsResponse<'static>;
16021 }
16022
16023 pub struct Rewind;
16024
16025 impl ::fidl_next::Method for Rewind {
16026 const ORDINAL: u64 = 1635123508515392625;
16027
16028 type Protocol = crate::Directory;
16029
16030 type Request = ();
16031
16032 type Response = crate::WireDirectoryRewindResponse;
16033 }
16034
16035 pub struct GetToken;
16036
16037 impl ::fidl_next::Method for GetToken {
16038 const ORDINAL: u64 = 2787337947777369685;
16039
16040 type Protocol = crate::Directory;
16041
16042 type Request = ();
16043
16044 type Response = crate::WireDirectoryGetTokenResponse;
16045 }
16046
16047 pub struct Link;
16048
16049 impl ::fidl_next::Method for Link {
16050 const ORDINAL: u64 = 8360374984291987687;
16051
16052 type Protocol = crate::Directory;
16053
16054 type Request = crate::WireDirectoryLinkRequest<'static>;
16055
16056 type Response = crate::WireDirectoryLinkResponse;
16057 }
16058
16059 pub struct Unlink;
16060
16061 impl ::fidl_next::Method for Unlink {
16062 const ORDINAL: u64 = 8433556716759383021;
16063
16064 type Protocol = crate::Directory;
16065
16066 type Request = crate::WireDirectoryUnlinkRequest<'static>;
16067
16068 type Response = ::fidl_next::WireResult<
16069 'static,
16070 crate::WireDirectoryUnlinkResponse,
16071 ::fidl_next::WireI32,
16072 >;
16073 }
16074
16075 pub struct Rename;
16076
16077 impl ::fidl_next::Method for Rename {
16078 const ORDINAL: u64 = 8097726607824333022;
16079
16080 type Protocol = crate::Directory;
16081
16082 type Request = crate::WireDirectoryRenameRequest<'static>;
16083
16084 type Response = ::fidl_next::WireResult<
16085 'static,
16086 crate::WireDirectoryRenameResponse,
16087 ::fidl_next::WireI32,
16088 >;
16089 }
16090
16091 pub struct CreateSymlink;
16092
16093 impl ::fidl_next::Method for CreateSymlink {
16094 const ORDINAL: u64 = 2435901052462315657;
16095
16096 type Protocol = crate::Directory;
16097
16098 type Request = crate::WireDirectoryCreateSymlinkRequest<'static>;
16099
16100 type Response = ::fidl_next::WireResult<
16101 'static,
16102 crate::WireDirectoryCreateSymlinkResponse,
16103 ::fidl_next::WireI32,
16104 >;
16105 }
16106
16107 pub struct Watch;
16108
16109 impl ::fidl_next::Method for Watch {
16110 const ORDINAL: u64 = 6275512344170098065;
16111
16112 type Protocol = crate::Directory;
16113
16114 type Request = crate::WireDirectoryWatchRequest;
16115
16116 type Response = crate::WireDirectoryWatchResponse;
16117 }
16118
16119 mod ___detail {
16120
16121 pub struct AdvisoryLock<T0> {
16122 request: T0,
16123 }
16124
16125 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
16126 where
16127 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
16128 {
16129 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
16130 }
16131
16132 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
16133 where
16134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16135 ___E: ::fidl_next::Encoder,
16136 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
16137 {
16138 #[inline]
16139 fn encode(
16140 self,
16141 encoder_: &mut ___E,
16142 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16144 ::fidl_next::munge! {
16145 let Self::Encoded {
16146 request,
16147
16148 } = out_;
16149 }
16150
16151 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
16152
16153 Ok(())
16154 }
16155 }
16156
16157 pub struct Clone<T0> {
16158 request: T0,
16159 }
16160
16161 impl<T0> ::fidl_next::Encodable for Clone<T0>
16162 where
16163 T0: ::fidl_next::Encodable<
16164 Encoded = ::fidl_next::ServerEnd<
16165 ::fidl_next_fuchsia_unknown::Cloneable,
16166 ::fidl_next::fuchsia::WireChannel,
16167 >,
16168 >,
16169 {
16170 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
16171 }
16172
16173 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
16174 where
16175 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16176 ___E: ::fidl_next::fuchsia::HandleEncoder,
16177 T0: ::fidl_next::Encode<
16178 ___E,
16179 Encoded = ::fidl_next::ServerEnd<
16180 ::fidl_next_fuchsia_unknown::Cloneable,
16181 ::fidl_next::fuchsia::WireChannel,
16182 >,
16183 >,
16184 {
16185 #[inline]
16186 fn encode(
16187 self,
16188 encoder_: &mut ___E,
16189 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16190 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16191 ::fidl_next::munge! {
16192 let Self::Encoded {
16193 request,
16194
16195 } = out_;
16196 }
16197
16198 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
16199
16200 Ok(())
16201 }
16202 }
16203
16204 pub struct DeprecatedClone<T0, T1> {
16205 flags: T0,
16206
16207 object: T1,
16208 }
16209
16210 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
16211 where
16212 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
16213 T1: ::fidl_next::Encodable<
16214 Encoded = ::fidl_next::ServerEnd<
16215 crate::Node,
16216 ::fidl_next::fuchsia::WireChannel,
16217 >,
16218 >,
16219 {
16220 type Encoded = crate::WireNodeDeprecatedCloneRequest;
16221 }
16222
16223 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
16224 where
16225 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16226 ___E: ::fidl_next::fuchsia::HandleEncoder,
16227 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
16228 T1: ::fidl_next::Encode<
16229 ___E,
16230 Encoded = ::fidl_next::ServerEnd<
16231 crate::Node,
16232 ::fidl_next::fuchsia::WireChannel,
16233 >,
16234 >,
16235 {
16236 #[inline]
16237 fn encode(
16238 self,
16239 encoder_: &mut ___E,
16240 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16242 ::fidl_next::munge! {
16243 let Self::Encoded {
16244 flags,
16245 object,
16246
16247 } = out_;
16248 }
16249
16250 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16251
16252 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
16253
16254 Ok(())
16255 }
16256 }
16257
16258 pub struct OnOpen<T0, T1> {
16259 s: T0,
16260
16261 info: T1,
16262 }
16263
16264 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
16265 where
16266 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
16267 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
16268 {
16269 type Encoded = crate::WireNodeOnOpenRequest<'static>;
16270 }
16271
16272 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
16273 where
16274 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16275 ___E: ::fidl_next::Encoder,
16276 ___E: ::fidl_next::fuchsia::HandleEncoder,
16277 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
16278 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
16279 {
16280 #[inline]
16281 fn encode(
16282 self,
16283 encoder_: &mut ___E,
16284 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16285 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16286 ::fidl_next::munge! {
16287 let Self::Encoded {
16288 s,
16289 info,
16290
16291 } = out_;
16292 }
16293
16294 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
16295
16296 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
16297
16298 Ok(())
16299 }
16300 }
16301
16302 pub struct DeprecatedSetAttr<T0, T1> {
16303 flags: T0,
16304
16305 attributes: T1,
16306 }
16307
16308 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
16309 where
16310 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
16311 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
16312 {
16313 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
16314 }
16315
16316 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
16317 where
16318 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16319 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
16320 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
16321 {
16322 #[inline]
16323 fn encode(
16324 self,
16325 encoder_: &mut ___E,
16326 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16327 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16328 ::fidl_next::munge! {
16329 let Self::Encoded {
16330 flags,
16331 attributes,
16332
16333 } = out_;
16334 }
16335
16336 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16337
16338 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
16339
16340 Ok(())
16341 }
16342 }
16343
16344 pub struct DeprecatedSetFlags<T0> {
16345 flags: T0,
16346 }
16347
16348 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
16349 where
16350 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
16351 {
16352 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
16353 }
16354
16355 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
16356 where
16357 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16358 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
16359 {
16360 #[inline]
16361 fn encode(
16362 self,
16363 encoder_: &mut ___E,
16364 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16365 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16366 ::fidl_next::munge! {
16367 let Self::Encoded {
16368 flags,
16369
16370 } = out_;
16371 }
16372
16373 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16374
16375 Ok(())
16376 }
16377 }
16378
16379 pub struct SetFlags<T0> {
16380 flags: T0,
16381 }
16382
16383 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
16384 where
16385 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
16386 {
16387 type Encoded = crate::WireNodeSetFlagsRequest;
16388 }
16389
16390 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
16391 where
16392 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16393 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
16394 {
16395 #[inline]
16396 fn encode(
16397 self,
16398 encoder_: &mut ___E,
16399 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16400 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16401 ::fidl_next::munge! {
16402 let Self::Encoded {
16403 flags,
16404
16405 } = out_;
16406 }
16407
16408 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16409
16410 Ok(())
16411 }
16412 }
16413
16414 pub struct GetAttributes<T0> {
16415 query: T0,
16416 }
16417
16418 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
16419 where
16420 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
16421 {
16422 type Encoded = crate::WireNodeGetAttributesRequest;
16423 }
16424
16425 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
16426 where
16427 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16428 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
16429 {
16430 #[inline]
16431 fn encode(
16432 self,
16433 encoder_: &mut ___E,
16434 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16435 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16436 ::fidl_next::munge! {
16437 let Self::Encoded {
16438 query,
16439
16440 } = out_;
16441 }
16442
16443 ::fidl_next::Encode::encode(self.query, encoder_, query)?;
16444
16445 Ok(())
16446 }
16447 }
16448
16449 pub struct ListExtendedAttributes<T0> {
16450 iterator: T0,
16451 }
16452
16453 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
16454 where
16455 T0: ::fidl_next::Encodable<
16456 Encoded = ::fidl_next::ServerEnd<
16457 crate::ExtendedAttributeIterator,
16458 ::fidl_next::fuchsia::WireChannel,
16459 >,
16460 >,
16461 {
16462 type Encoded = crate::WireNodeListExtendedAttributesRequest;
16463 }
16464
16465 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
16466 where
16467 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16468 ___E: ::fidl_next::fuchsia::HandleEncoder,
16469 T0: ::fidl_next::Encode<
16470 ___E,
16471 Encoded = ::fidl_next::ServerEnd<
16472 crate::ExtendedAttributeIterator,
16473 ::fidl_next::fuchsia::WireChannel,
16474 >,
16475 >,
16476 {
16477 #[inline]
16478 fn encode(
16479 self,
16480 encoder_: &mut ___E,
16481 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16482 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16483 ::fidl_next::munge! {
16484 let Self::Encoded {
16485 iterator,
16486
16487 } = out_;
16488 }
16489
16490 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator)?;
16491
16492 Ok(())
16493 }
16494 }
16495
16496 pub struct GetExtendedAttribute<T0> {
16497 name: T0,
16498 }
16499
16500 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
16501 where
16502 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
16503 {
16504 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
16505 }
16506
16507 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
16508 where
16509 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16510 ___E: ::fidl_next::Encoder,
16511 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
16512 {
16513 #[inline]
16514 fn encode(
16515 self,
16516 encoder_: &mut ___E,
16517 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16518 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16519 ::fidl_next::munge! {
16520 let Self::Encoded {
16521 name,
16522
16523 } = out_;
16524 }
16525
16526 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
16527
16528 Ok(())
16529 }
16530 }
16531
16532 pub struct SetExtendedAttribute<T0, T1, T2> {
16533 name: T0,
16534
16535 value: T1,
16536
16537 mode: T2,
16538 }
16539
16540 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
16541 where
16542 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
16543 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
16544 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
16545 {
16546 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
16547 }
16548
16549 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
16550 where
16551 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16552 ___E: ::fidl_next::Encoder,
16553 ___E: ::fidl_next::fuchsia::HandleEncoder,
16554 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
16555 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
16556 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
16557 {
16558 #[inline]
16559 fn encode(
16560 self,
16561 encoder_: &mut ___E,
16562 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16563 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16564 ::fidl_next::munge! {
16565 let Self::Encoded {
16566 name,
16567 value,
16568 mode,
16569
16570 } = out_;
16571 }
16572
16573 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
16574
16575 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
16576
16577 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
16578
16579 Ok(())
16580 }
16581 }
16582
16583 pub struct RemoveExtendedAttribute<T0> {
16584 name: T0,
16585 }
16586
16587 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
16588 where
16589 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
16590 {
16591 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
16592 }
16593
16594 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
16595 where
16596 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16597 ___E: ::fidl_next::Encoder,
16598 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
16599 {
16600 #[inline]
16601 fn encode(
16602 self,
16603 encoder_: &mut ___E,
16604 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16605 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16606 ::fidl_next::munge! {
16607 let Self::Encoded {
16608 name,
16609
16610 } = out_;
16611 }
16612
16613 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
16614
16615 Ok(())
16616 }
16617 }
16618
16619 pub struct DeprecatedOpen<T0, T1, T2, T3> {
16620 flags: T0,
16621
16622 mode: T1,
16623
16624 path: T2,
16625
16626 object: T3,
16627 }
16628
16629 impl<T0, T1, T2, T3> ::fidl_next::Encodable for DeprecatedOpen<T0, T1, T2, T3>
16630 where
16631 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
16632 T1: ::fidl_next::Encodable<Encoded = crate::WireModeType>,
16633 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16634 T3: ::fidl_next::Encodable<
16635 Encoded = ::fidl_next::ServerEnd<
16636 crate::Node,
16637 ::fidl_next::fuchsia::WireChannel,
16638 >,
16639 >,
16640 {
16641 type Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>;
16642 }
16643
16644 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for DeprecatedOpen<T0, T1, T2, T3>
16645 where
16646 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16647 ___E: ::fidl_next::Encoder,
16648 ___E: ::fidl_next::fuchsia::HandleEncoder,
16649 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
16650 T1: ::fidl_next::Encode<___E, Encoded = crate::WireModeType>,
16651 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16652 T3: ::fidl_next::Encode<
16653 ___E,
16654 Encoded = ::fidl_next::ServerEnd<
16655 crate::Node,
16656 ::fidl_next::fuchsia::WireChannel,
16657 >,
16658 >,
16659 {
16660 #[inline]
16661 fn encode(
16662 self,
16663 encoder_: &mut ___E,
16664 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16665 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16666 ::fidl_next::munge! {
16667 let Self::Encoded {
16668 flags,
16669 mode,
16670 path,
16671 object,
16672
16673 } = out_;
16674 }
16675
16676 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16677
16678 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
16679
16680 ::fidl_next::Encode::encode(self.path, encoder_, path)?;
16681
16682 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
16683
16684 Ok(())
16685 }
16686 }
16687
16688 pub struct Open<T0, T1, T2, T3> {
16689 path: T0,
16690
16691 flags: T1,
16692
16693 options: T2,
16694
16695 object: T3,
16696 }
16697
16698 impl<T0, T1, T2, T3> ::fidl_next::Encodable for Open<T0, T1, T2, T3>
16699 where
16700 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16701 T1: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
16702 T2: ::fidl_next::Encodable<Encoded = crate::WireOptions<'static>>,
16703 T3: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireChannel>,
16704 {
16705 type Encoded = crate::WireDirectoryOpenRequest<'static>;
16706 }
16707
16708 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for Open<T0, T1, T2, T3>
16709 where
16710 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16711 ___E: ::fidl_next::Encoder,
16712 ___E: ::fidl_next::fuchsia::HandleEncoder,
16713 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16714 T1: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
16715 T2: ::fidl_next::Encode<___E, Encoded = crate::WireOptions<'static>>,
16716 T3: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireChannel>,
16717 {
16718 #[inline]
16719 fn encode(
16720 self,
16721 encoder_: &mut ___E,
16722 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16723 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16724 ::fidl_next::munge! {
16725 let Self::Encoded {
16726 path,
16727 flags,
16728 options,
16729 object,
16730
16731 } = out_;
16732 }
16733
16734 ::fidl_next::Encode::encode(self.path, encoder_, path)?;
16735
16736 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
16737
16738 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
16739
16740 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
16741
16742 Ok(())
16743 }
16744 }
16745
16746 pub struct ReadDirents<T0> {
16747 max_bytes: T0,
16748 }
16749
16750 impl<T0> ::fidl_next::Encodable for ReadDirents<T0>
16751 where
16752 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
16753 {
16754 type Encoded = crate::WireDirectoryReadDirentsRequest;
16755 }
16756
16757 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ReadDirents<T0>
16758 where
16759 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16760 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
16761 {
16762 #[inline]
16763 fn encode(
16764 self,
16765 encoder_: &mut ___E,
16766 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16767 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16768 ::fidl_next::munge! {
16769 let Self::Encoded {
16770 max_bytes,
16771
16772 } = out_;
16773 }
16774
16775 ::fidl_next::Encode::encode(self.max_bytes, encoder_, max_bytes)?;
16776
16777 Ok(())
16778 }
16779 }
16780
16781 pub struct Link<T0, T1, T2> {
16782 src: T0,
16783
16784 dst_parent_token: T1,
16785
16786 dst: T2,
16787 }
16788
16789 impl<T0, T1, T2> ::fidl_next::Encodable for Link<T0, T1, T2>
16790 where
16791 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16792 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
16793 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16794 {
16795 type Encoded = crate::WireDirectoryLinkRequest<'static>;
16796 }
16797
16798 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Link<T0, T1, T2>
16799 where
16800 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16801 ___E: ::fidl_next::Encoder,
16802 ___E: ::fidl_next::fuchsia::HandleEncoder,
16803 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16804 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
16805 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16806 {
16807 #[inline]
16808 fn encode(
16809 self,
16810 encoder_: &mut ___E,
16811 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16812 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16813 ::fidl_next::munge! {
16814 let Self::Encoded {
16815 src,
16816 dst_parent_token,
16817 dst,
16818
16819 } = out_;
16820 }
16821
16822 ::fidl_next::Encode::encode(self.src, encoder_, src)?;
16823
16824 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
16825
16826 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
16827
16828 Ok(())
16829 }
16830 }
16831
16832 pub struct Unlink<T0, T1> {
16833 name: T0,
16834
16835 options: T1,
16836 }
16837
16838 impl<T0, T1> ::fidl_next::Encodable for Unlink<T0, T1>
16839 where
16840 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16841 T1: ::fidl_next::Encodable<Encoded = crate::WireUnlinkOptions<'static>>,
16842 {
16843 type Encoded = crate::WireDirectoryUnlinkRequest<'static>;
16844 }
16845
16846 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Unlink<T0, T1>
16847 where
16848 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16849 ___E: ::fidl_next::Encoder,
16850 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16851 T1: ::fidl_next::Encode<___E, Encoded = crate::WireUnlinkOptions<'static>>,
16852 {
16853 #[inline]
16854 fn encode(
16855 self,
16856 encoder_: &mut ___E,
16857 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16858 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16859 ::fidl_next::munge! {
16860 let Self::Encoded {
16861 name,
16862 options,
16863
16864 } = out_;
16865 }
16866
16867 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
16868
16869 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
16870
16871 Ok(())
16872 }
16873 }
16874
16875 pub struct Rename<T0, T1, T2> {
16876 src: T0,
16877
16878 dst_parent_token: T1,
16879
16880 dst: T2,
16881 }
16882
16883 impl<T0, T1, T2> ::fidl_next::Encodable for Rename<T0, T1, T2>
16884 where
16885 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16886 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
16887 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16888 {
16889 type Encoded = crate::WireDirectoryRenameRequest<'static>;
16890 }
16891
16892 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Rename<T0, T1, T2>
16893 where
16894 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16895 ___E: ::fidl_next::Encoder,
16896 ___E: ::fidl_next::fuchsia::HandleEncoder,
16897 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16898 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
16899 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16900 {
16901 #[inline]
16902 fn encode(
16903 self,
16904 encoder_: &mut ___E,
16905 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16906 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16907 ::fidl_next::munge! {
16908 let Self::Encoded {
16909 src,
16910 dst_parent_token,
16911 dst,
16912
16913 } = out_;
16914 }
16915
16916 ::fidl_next::Encode::encode(self.src, encoder_, src)?;
16917
16918 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
16919
16920 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
16921
16922 Ok(())
16923 }
16924 }
16925
16926 pub struct CreateSymlink<T0, T1, T2> {
16927 name: T0,
16928
16929 target: T1,
16930
16931 connection: T2,
16932 }
16933
16934 impl<T0, T1, T2> ::fidl_next::Encodable for CreateSymlink<T0, T1, T2>
16935 where
16936 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
16937 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
16938 T2: ::fidl_next::Encodable<
16939 Encoded = ::fidl_next::ServerEnd<
16940 crate::Symlink,
16941 ::fidl_next::fuchsia::WireOptionalChannel,
16942 >,
16943 >,
16944 {
16945 type Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>;
16946 }
16947
16948 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for CreateSymlink<T0, T1, T2>
16949 where
16950 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16951 ___E: ::fidl_next::Encoder,
16952 ___E: ::fidl_next::fuchsia::HandleEncoder,
16953 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
16954 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
16955 T2: ::fidl_next::Encode<
16956 ___E,
16957 Encoded = ::fidl_next::ServerEnd<
16958 crate::Symlink,
16959 ::fidl_next::fuchsia::WireOptionalChannel,
16960 >,
16961 >,
16962 {
16963 #[inline]
16964 fn encode(
16965 self,
16966 encoder_: &mut ___E,
16967 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16968 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16969 ::fidl_next::munge! {
16970 let Self::Encoded {
16971 name,
16972 target,
16973 connection,
16974
16975 } = out_;
16976 }
16977
16978 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
16979
16980 ::fidl_next::Encode::encode(self.target, encoder_, target)?;
16981
16982 ::fidl_next::Encode::encode(self.connection, encoder_, connection)?;
16983
16984 Ok(())
16985 }
16986 }
16987
16988 pub struct Watch<T0, T1, T2> {
16989 mask: T0,
16990
16991 options: T1,
16992
16993 watcher: T2,
16994 }
16995
16996 impl<T0, T1, T2> ::fidl_next::Encodable for Watch<T0, T1, T2>
16997 where
16998 T0: ::fidl_next::Encodable<Encoded = crate::WireWatchMask>,
16999 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
17000 T2: ::fidl_next::Encodable<
17001 Encoded = ::fidl_next::ServerEnd<
17002 crate::DirectoryWatcher,
17003 ::fidl_next::fuchsia::WireChannel,
17004 >,
17005 >,
17006 {
17007 type Encoded = crate::WireDirectoryWatchRequest;
17008 }
17009
17010 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Watch<T0, T1, T2>
17011 where
17012 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17013 ___E: ::fidl_next::fuchsia::HandleEncoder,
17014 T0: ::fidl_next::Encode<___E, Encoded = crate::WireWatchMask>,
17015 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
17016 T2: ::fidl_next::Encode<
17017 ___E,
17018 Encoded = ::fidl_next::ServerEnd<
17019 crate::DirectoryWatcher,
17020 ::fidl_next::fuchsia::WireChannel,
17021 >,
17022 >,
17023 {
17024 #[inline]
17025 fn encode(
17026 self,
17027 encoder_: &mut ___E,
17028 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17029 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17030 ::fidl_next::munge! {
17031 let Self::Encoded {
17032 mask,
17033 options,
17034 watcher,
17035
17036 } = out_;
17037 }
17038
17039 ::fidl_next::Encode::encode(self.mask, encoder_, mask)?;
17040
17041 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
17042
17043 ::fidl_next::Encode::encode(self.watcher, encoder_, watcher)?;
17044
17045 Ok(())
17046 }
17047 }
17048
17049 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Directory
17050 where
17051 ___T: ::fidl_next::Transport,
17052 {
17053 type Client = DirectoryClient<___T>;
17054 type Server = DirectoryServer<___T>;
17055 }
17056
17057 #[repr(transparent)]
17059 pub struct DirectoryClient<___T: ::fidl_next::Transport> {
17060 #[allow(dead_code)]
17061 client: ::fidl_next::protocol::Client<___T>,
17062 }
17063
17064 impl<___T> DirectoryClient<___T>
17065 where
17066 ___T: ::fidl_next::Transport,
17067 {
17068 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
17069 pub fn advisory_lock(
17070 &self,
17071
17072 request: impl ::fidl_next::Encode<
17073 <___T as ::fidl_next::Transport>::SendBuffer,
17074 Encoded = crate::WireAdvisoryLockRequest<'static>,
17075 >,
17076 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
17077 where
17078 <___T as ::fidl_next::Transport>::SendBuffer:
17079 ::fidl_next::encoder::InternalHandleEncoder,
17080 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17081 {
17082 self.advisory_lock_with(AdvisoryLock { request })
17083 }
17084
17085 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
17086 pub fn advisory_lock_with<___R>(
17087 &self,
17088 request: ___R,
17089 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
17090 where
17091 ___R: ::fidl_next::Encode<
17092 <___T as ::fidl_next::Transport>::SendBuffer,
17093 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
17094 >,
17095 {
17096 ::fidl_next::TwoWayFuture::from_untyped(
17097 self.client.send_two_way(7992130864415541162, request),
17098 )
17099 }
17100
17101 pub fn clone(
17102 &self,
17103
17104 request: impl ::fidl_next::Encode<
17105 <___T as ::fidl_next::Transport>::SendBuffer,
17106 Encoded = ::fidl_next::ServerEnd<
17107 ::fidl_next_fuchsia_unknown::Cloneable,
17108 ::fidl_next::fuchsia::WireChannel,
17109 >,
17110 >,
17111 ) -> ::fidl_next::SendFuture<'_, ___T>
17112 where
17113 <___T as ::fidl_next::Transport>::SendBuffer:
17114 ::fidl_next::encoder::InternalHandleEncoder,
17115 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17116 {
17117 self.clone_with(Clone { request })
17118 }
17119
17120 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
17121 where
17122 ___R: ::fidl_next::Encode<
17123 <___T as ::fidl_next::Transport>::SendBuffer,
17124 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
17125 >,
17126 {
17127 ::fidl_next::SendFuture::from_untyped(
17128 self.client.send_one_way(2366825959783828089, request),
17129 )
17130 }
17131
17132 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
17133 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
17134 ::fidl_next::TwoWayFuture::from_untyped(
17135 self.client.send_two_way(6540867515453498750, ()),
17136 )
17137 }
17138
17139 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
17140 ::fidl_next::TwoWayFuture::from_untyped(
17141 self.client.send_two_way(2763219980499352582, ()),
17142 )
17143 }
17144
17145 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
17146 pub fn deprecated_clone(
17147 &self,
17148
17149 flags: impl ::fidl_next::Encode<
17150 <___T as ::fidl_next::Transport>::SendBuffer,
17151 Encoded = crate::WireOpenFlags,
17152 >,
17153
17154 object: impl ::fidl_next::Encode<
17155 <___T as ::fidl_next::Transport>::SendBuffer,
17156 Encoded = ::fidl_next::ServerEnd<
17157 crate::Node,
17158 ::fidl_next::fuchsia::WireChannel,
17159 >,
17160 >,
17161 ) -> ::fidl_next::SendFuture<'_, ___T>
17162 where
17163 <___T as ::fidl_next::Transport>::SendBuffer:
17164 ::fidl_next::encoder::InternalHandleEncoder,
17165 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17166 {
17167 self.deprecated_clone_with(DeprecatedClone { flags, object })
17168 }
17169
17170 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
17171 pub fn deprecated_clone_with<___R>(
17172 &self,
17173 request: ___R,
17174 ) -> ::fidl_next::SendFuture<'_, ___T>
17175 where
17176 ___R: ::fidl_next::Encode<
17177 <___T as ::fidl_next::Transport>::SendBuffer,
17178 Encoded = crate::WireNodeDeprecatedCloneRequest,
17179 >,
17180 {
17181 ::fidl_next::SendFuture::from_untyped(
17182 self.client.send_one_way(6512600400724287855, request),
17183 )
17184 }
17185
17186 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
17187 pub fn deprecated_get_attr(
17188 &self,
17189 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
17190 ::fidl_next::TwoWayFuture::from_untyped(
17191 self.client.send_two_way(8689798978500614909, ()),
17192 )
17193 }
17194
17195 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
17196 pub fn deprecated_set_attr(
17197 &self,
17198
17199 flags: impl ::fidl_next::Encode<
17200 <___T as ::fidl_next::Transport>::SendBuffer,
17201 Encoded = crate::WireNodeAttributeFlags,
17202 >,
17203
17204 attributes: impl ::fidl_next::Encode<
17205 <___T as ::fidl_next::Transport>::SendBuffer,
17206 Encoded = crate::WireNodeAttributes,
17207 >,
17208 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
17209 where
17210 <___T as ::fidl_next::Transport>::SendBuffer:
17211 ::fidl_next::encoder::InternalHandleEncoder,
17212 {
17213 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
17214 }
17215
17216 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
17217 pub fn deprecated_set_attr_with<___R>(
17218 &self,
17219 request: ___R,
17220 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
17221 where
17222 ___R: ::fidl_next::Encode<
17223 <___T as ::fidl_next::Transport>::SendBuffer,
17224 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
17225 >,
17226 {
17227 ::fidl_next::TwoWayFuture::from_untyped(
17228 self.client.send_two_way(4721673413776871238, request),
17229 )
17230 }
17231
17232 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
17233 pub fn deprecated_get_flags(
17234 &self,
17235 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
17236 ::fidl_next::TwoWayFuture::from_untyped(
17237 self.client.send_two_way(6595803110182632097, ()),
17238 )
17239 }
17240
17241 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
17242 pub fn deprecated_set_flags(
17243 &self,
17244
17245 flags: impl ::fidl_next::Encode<
17246 <___T as ::fidl_next::Transport>::SendBuffer,
17247 Encoded = crate::WireOpenFlags,
17248 >,
17249 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
17250 where
17251 <___T as ::fidl_next::Transport>::SendBuffer:
17252 ::fidl_next::encoder::InternalHandleEncoder,
17253 {
17254 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
17255 }
17256
17257 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
17258 pub fn deprecated_set_flags_with<___R>(
17259 &self,
17260 request: ___R,
17261 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
17262 where
17263 ___R: ::fidl_next::Encode<
17264 <___T as ::fidl_next::Transport>::SendBuffer,
17265 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
17266 >,
17267 {
17268 ::fidl_next::TwoWayFuture::from_untyped(
17269 self.client.send_two_way(5950864159036794675, request),
17270 )
17271 }
17272
17273 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
17274 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
17275 ::fidl_next::TwoWayFuture::from_untyped(
17276 self.client.send_two_way(105530239381466147, ()),
17277 )
17278 }
17279
17280 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
17281 pub fn set_flags(
17282 &self,
17283
17284 flags: impl ::fidl_next::Encode<
17285 <___T as ::fidl_next::Transport>::SendBuffer,
17286 Encoded = crate::WireFlags,
17287 >,
17288 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
17289 where
17290 <___T as ::fidl_next::Transport>::SendBuffer:
17291 ::fidl_next::encoder::InternalHandleEncoder,
17292 {
17293 self.set_flags_with(SetFlags { flags })
17294 }
17295
17296 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
17297 pub fn set_flags_with<___R>(
17298 &self,
17299 request: ___R,
17300 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
17301 where
17302 ___R: ::fidl_next::Encode<
17303 <___T as ::fidl_next::Transport>::SendBuffer,
17304 Encoded = crate::WireNodeSetFlagsRequest,
17305 >,
17306 {
17307 ::fidl_next::TwoWayFuture::from_untyped(
17308 self.client.send_two_way(6172186066099445416, request),
17309 )
17310 }
17311
17312 #[doc = " Query the filesystem for filesystem-specific information.\n"]
17313 pub fn query_filesystem(
17314 &self,
17315 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
17316 ::fidl_next::TwoWayFuture::from_untyped(
17317 self.client.send_two_way(8013111122914313744, ()),
17318 )
17319 }
17320
17321 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17322 pub fn get_attributes(
17323 &self,
17324
17325 query: impl ::fidl_next::Encode<
17326 <___T as ::fidl_next::Transport>::SendBuffer,
17327 Encoded = crate::WireNodeAttributesQuery,
17328 >,
17329 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
17330 where
17331 <___T as ::fidl_next::Transport>::SendBuffer:
17332 ::fidl_next::encoder::InternalHandleEncoder,
17333 {
17334 self.get_attributes_with(GetAttributes { query })
17335 }
17336
17337 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17338 pub fn get_attributes_with<___R>(
17339 &self,
17340 request: ___R,
17341 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
17342 where
17343 ___R: ::fidl_next::Encode<
17344 <___T as ::fidl_next::Transport>::SendBuffer,
17345 Encoded = crate::WireNodeGetAttributesRequest,
17346 >,
17347 {
17348 ::fidl_next::TwoWayFuture::from_untyped(
17349 self.client.send_two_way(4414537700416816443, request),
17350 )
17351 }
17352
17353 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
17354 pub fn update_attributes_with<___R>(
17355 &self,
17356 request: ___R,
17357 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
17358 where
17359 ___R: ::fidl_next::Encode<
17360 <___T as ::fidl_next::Transport>::SendBuffer,
17361 Encoded = crate::WireMutableNodeAttributes<'static>,
17362 >,
17363 {
17364 ::fidl_next::TwoWayFuture::from_untyped(
17365 self.client.send_two_way(3677402239314018056, request),
17366 )
17367 }
17368
17369 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
17370 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
17371 ::fidl_next::TwoWayFuture::from_untyped(
17372 self.client.send_two_way(3196473584242777161, ()),
17373 )
17374 }
17375
17376 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17377 pub fn list_extended_attributes(
17378 &self,
17379
17380 iterator: impl ::fidl_next::Encode<
17381 <___T as ::fidl_next::Transport>::SendBuffer,
17382 Encoded = ::fidl_next::ServerEnd<
17383 crate::ExtendedAttributeIterator,
17384 ::fidl_next::fuchsia::WireChannel,
17385 >,
17386 >,
17387 ) -> ::fidl_next::SendFuture<'_, ___T>
17388 where
17389 <___T as ::fidl_next::Transport>::SendBuffer:
17390 ::fidl_next::encoder::InternalHandleEncoder,
17391 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17392 {
17393 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
17394 }
17395
17396 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17397 pub fn list_extended_attributes_with<___R>(
17398 &self,
17399 request: ___R,
17400 ) -> ::fidl_next::SendFuture<'_, ___T>
17401 where
17402 ___R: ::fidl_next::Encode<
17403 <___T as ::fidl_next::Transport>::SendBuffer,
17404 Encoded = crate::WireNodeListExtendedAttributesRequest,
17405 >,
17406 {
17407 ::fidl_next::SendFuture::from_untyped(
17408 self.client.send_one_way(5431626189872037072, request),
17409 )
17410 }
17411
17412 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17413 pub fn get_extended_attribute(
17414 &self,
17415
17416 name: impl ::fidl_next::Encode<
17417 <___T as ::fidl_next::Transport>::SendBuffer,
17418 Encoded = ::fidl_next::WireVector<'static, u8>,
17419 >,
17420 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
17421 where
17422 <___T as ::fidl_next::Transport>::SendBuffer:
17423 ::fidl_next::encoder::InternalHandleEncoder,
17424 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17425 {
17426 self.get_extended_attribute_with(GetExtendedAttribute { name })
17427 }
17428
17429 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
17430 pub fn get_extended_attribute_with<___R>(
17431 &self,
17432 request: ___R,
17433 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
17434 where
17435 ___R: ::fidl_next::Encode<
17436 <___T as ::fidl_next::Transport>::SendBuffer,
17437 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
17438 >,
17439 {
17440 ::fidl_next::TwoWayFuture::from_untyped(
17441 self.client.send_two_way(5043930208506967771, request),
17442 )
17443 }
17444
17445 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
17446 pub fn set_extended_attribute(
17447 &self,
17448
17449 name: impl ::fidl_next::Encode<
17450 <___T as ::fidl_next::Transport>::SendBuffer,
17451 Encoded = ::fidl_next::WireVector<'static, u8>,
17452 >,
17453
17454 value: impl ::fidl_next::Encode<
17455 <___T as ::fidl_next::Transport>::SendBuffer,
17456 Encoded = crate::WireExtendedAttributeValue<'static>,
17457 >,
17458
17459 mode: impl ::fidl_next::Encode<
17460 <___T as ::fidl_next::Transport>::SendBuffer,
17461 Encoded = crate::WireSetExtendedAttributeMode,
17462 >,
17463 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
17464 where
17465 <___T as ::fidl_next::Transport>::SendBuffer:
17466 ::fidl_next::encoder::InternalHandleEncoder,
17467 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17468 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17469 {
17470 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
17471 }
17472
17473 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
17474 pub fn set_extended_attribute_with<___R>(
17475 &self,
17476 request: ___R,
17477 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
17478 where
17479 ___R: ::fidl_next::Encode<
17480 <___T as ::fidl_next::Transport>::SendBuffer,
17481 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
17482 >,
17483 {
17484 ::fidl_next::TwoWayFuture::from_untyped(
17485 self.client.send_two_way(5374223046099989052, request),
17486 )
17487 }
17488
17489 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
17490 pub fn remove_extended_attribute(
17491 &self,
17492
17493 name: impl ::fidl_next::Encode<
17494 <___T as ::fidl_next::Transport>::SendBuffer,
17495 Encoded = ::fidl_next::WireVector<'static, u8>,
17496 >,
17497 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
17498 where
17499 <___T as ::fidl_next::Transport>::SendBuffer:
17500 ::fidl_next::encoder::InternalHandleEncoder,
17501 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17502 {
17503 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
17504 }
17505
17506 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
17507 pub fn remove_extended_attribute_with<___R>(
17508 &self,
17509 request: ___R,
17510 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
17511 where
17512 ___R: ::fidl_next::Encode<
17513 <___T as ::fidl_next::Transport>::SendBuffer,
17514 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
17515 >,
17516 {
17517 ::fidl_next::TwoWayFuture::from_untyped(
17518 self.client.send_two_way(8794297771444732717, request),
17519 )
17520 }
17521
17522 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
17523 pub fn deprecated_open(
17524 &self,
17525
17526 flags: impl ::fidl_next::Encode<
17527 <___T as ::fidl_next::Transport>::SendBuffer,
17528 Encoded = crate::WireOpenFlags,
17529 >,
17530
17531 mode: impl ::fidl_next::Encode<
17532 <___T as ::fidl_next::Transport>::SendBuffer,
17533 Encoded = crate::WireModeType,
17534 >,
17535
17536 path: impl ::fidl_next::Encode<
17537 <___T as ::fidl_next::Transport>::SendBuffer,
17538 Encoded = ::fidl_next::WireString<'static>,
17539 >,
17540
17541 object: impl ::fidl_next::Encode<
17542 <___T as ::fidl_next::Transport>::SendBuffer,
17543 Encoded = ::fidl_next::ServerEnd<
17544 crate::Node,
17545 ::fidl_next::fuchsia::WireChannel,
17546 >,
17547 >,
17548 ) -> ::fidl_next::SendFuture<'_, ___T>
17549 where
17550 <___T as ::fidl_next::Transport>::SendBuffer:
17551 ::fidl_next::encoder::InternalHandleEncoder,
17552 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17553 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17554 {
17555 self.deprecated_open_with(DeprecatedOpen { flags, mode, path, object })
17556 }
17557
17558 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
17559 pub fn deprecated_open_with<___R>(
17560 &self,
17561 request: ___R,
17562 ) -> ::fidl_next::SendFuture<'_, ___T>
17563 where
17564 ___R: ::fidl_next::Encode<
17565 <___T as ::fidl_next::Transport>::SendBuffer,
17566 Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>,
17567 >,
17568 {
17569 ::fidl_next::SendFuture::from_untyped(
17570 self.client.send_one_way(3193127272456937152, request),
17571 )
17572 }
17573
17574 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
17575 pub fn open(
17576 &self,
17577
17578 path: impl ::fidl_next::Encode<
17579 <___T as ::fidl_next::Transport>::SendBuffer,
17580 Encoded = ::fidl_next::WireString<'static>,
17581 >,
17582
17583 flags: impl ::fidl_next::Encode<
17584 <___T as ::fidl_next::Transport>::SendBuffer,
17585 Encoded = crate::WireFlags,
17586 >,
17587
17588 options: impl ::fidl_next::Encode<
17589 <___T as ::fidl_next::Transport>::SendBuffer,
17590 Encoded = crate::WireOptions<'static>,
17591 >,
17592
17593 object: impl ::fidl_next::Encode<
17594 <___T as ::fidl_next::Transport>::SendBuffer,
17595 Encoded = ::fidl_next::fuchsia::WireChannel,
17596 >,
17597 ) -> ::fidl_next::SendFuture<'_, ___T>
17598 where
17599 <___T as ::fidl_next::Transport>::SendBuffer:
17600 ::fidl_next::encoder::InternalHandleEncoder,
17601 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17602 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17603 {
17604 self.open_with(Open { path, flags, options, object })
17605 }
17606
17607 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
17608 pub fn open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
17609 where
17610 ___R: ::fidl_next::Encode<
17611 <___T as ::fidl_next::Transport>::SendBuffer,
17612 Encoded = crate::WireDirectoryOpenRequest<'static>,
17613 >,
17614 {
17615 ::fidl_next::SendFuture::from_untyped(
17616 self.client.send_one_way(6236883748953765593, request),
17617 )
17618 }
17619
17620 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
17621 pub fn read_dirents(
17622 &self,
17623
17624 max_bytes: impl ::fidl_next::Encode<
17625 <___T as ::fidl_next::Transport>::SendBuffer,
17626 Encoded = ::fidl_next::WireU64,
17627 >,
17628 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadDirents, ___T>
17629 where
17630 <___T as ::fidl_next::Transport>::SendBuffer:
17631 ::fidl_next::encoder::InternalHandleEncoder,
17632 {
17633 self.read_dirents_with(ReadDirents { max_bytes })
17634 }
17635
17636 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
17637 pub fn read_dirents_with<___R>(
17638 &self,
17639 request: ___R,
17640 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadDirents, ___T>
17641 where
17642 ___R: ::fidl_next::Encode<
17643 <___T as ::fidl_next::Transport>::SendBuffer,
17644 Encoded = crate::WireDirectoryReadDirentsRequest,
17645 >,
17646 {
17647 ::fidl_next::TwoWayFuture::from_untyped(
17648 self.client.send_two_way(3855785432100874762, request),
17649 )
17650 }
17651
17652 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
17653 pub fn rewind(&self) -> ::fidl_next::TwoWayFuture<'_, super::Rewind, ___T> {
17654 ::fidl_next::TwoWayFuture::from_untyped(
17655 self.client.send_two_way(1635123508515392625, ()),
17656 )
17657 }
17658
17659 #[doc = " Acquires a token to a Directory which can be used to identify access to it at a later point\n in time. The token will remain valid for as long as the connection requesting the token\n remains open.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
17660 pub fn get_token(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetToken, ___T> {
17661 ::fidl_next::TwoWayFuture::from_untyped(
17662 self.client.send_two_way(2787337947777369685, ()),
17663 )
17664 }
17665
17666 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
17667 pub fn link(
17668 &self,
17669
17670 src: impl ::fidl_next::Encode<
17671 <___T as ::fidl_next::Transport>::SendBuffer,
17672 Encoded = ::fidl_next::WireString<'static>,
17673 >,
17674
17675 dst_parent_token: impl ::fidl_next::Encode<
17676 <___T as ::fidl_next::Transport>::SendBuffer,
17677 Encoded = ::fidl_next::fuchsia::WireHandle,
17678 >,
17679
17680 dst: impl ::fidl_next::Encode<
17681 <___T as ::fidl_next::Transport>::SendBuffer,
17682 Encoded = ::fidl_next::WireString<'static>,
17683 >,
17684 ) -> ::fidl_next::TwoWayFuture<'_, super::Link, ___T>
17685 where
17686 <___T as ::fidl_next::Transport>::SendBuffer:
17687 ::fidl_next::encoder::InternalHandleEncoder,
17688 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17689 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17690 {
17691 self.link_with(Link { src, dst_parent_token, dst })
17692 }
17693
17694 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
17695 pub fn link_with<___R>(
17696 &self,
17697 request: ___R,
17698 ) -> ::fidl_next::TwoWayFuture<'_, super::Link, ___T>
17699 where
17700 ___R: ::fidl_next::Encode<
17701 <___T as ::fidl_next::Transport>::SendBuffer,
17702 Encoded = crate::WireDirectoryLinkRequest<'static>,
17703 >,
17704 {
17705 ::fidl_next::TwoWayFuture::from_untyped(
17706 self.client.send_two_way(8360374984291987687, request),
17707 )
17708 }
17709
17710 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
17711 pub fn unlink(
17712 &self,
17713
17714 name: impl ::fidl_next::Encode<
17715 <___T as ::fidl_next::Transport>::SendBuffer,
17716 Encoded = ::fidl_next::WireString<'static>,
17717 >,
17718
17719 options: impl ::fidl_next::Encode<
17720 <___T as ::fidl_next::Transport>::SendBuffer,
17721 Encoded = crate::WireUnlinkOptions<'static>,
17722 >,
17723 ) -> ::fidl_next::TwoWayFuture<'_, super::Unlink, ___T>
17724 where
17725 <___T as ::fidl_next::Transport>::SendBuffer:
17726 ::fidl_next::encoder::InternalHandleEncoder,
17727 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17728 {
17729 self.unlink_with(Unlink { name, options })
17730 }
17731
17732 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
17733 pub fn unlink_with<___R>(
17734 &self,
17735 request: ___R,
17736 ) -> ::fidl_next::TwoWayFuture<'_, super::Unlink, ___T>
17737 where
17738 ___R: ::fidl_next::Encode<
17739 <___T as ::fidl_next::Transport>::SendBuffer,
17740 Encoded = crate::WireDirectoryUnlinkRequest<'static>,
17741 >,
17742 {
17743 ::fidl_next::TwoWayFuture::from_untyped(
17744 self.client.send_two_way(8433556716759383021, request),
17745 )
17746 }
17747
17748 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
17749 pub fn rename(
17750 &self,
17751
17752 src: impl ::fidl_next::Encode<
17753 <___T as ::fidl_next::Transport>::SendBuffer,
17754 Encoded = ::fidl_next::WireString<'static>,
17755 >,
17756
17757 dst_parent_token: impl ::fidl_next::Encode<
17758 <___T as ::fidl_next::Transport>::SendBuffer,
17759 Encoded = ::fidl_next::fuchsia::WireEvent,
17760 >,
17761
17762 dst: impl ::fidl_next::Encode<
17763 <___T as ::fidl_next::Transport>::SendBuffer,
17764 Encoded = ::fidl_next::WireString<'static>,
17765 >,
17766 ) -> ::fidl_next::TwoWayFuture<'_, super::Rename, ___T>
17767 where
17768 <___T as ::fidl_next::Transport>::SendBuffer:
17769 ::fidl_next::encoder::InternalHandleEncoder,
17770 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17771 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17772 {
17773 self.rename_with(Rename { src, dst_parent_token, dst })
17774 }
17775
17776 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
17777 pub fn rename_with<___R>(
17778 &self,
17779 request: ___R,
17780 ) -> ::fidl_next::TwoWayFuture<'_, super::Rename, ___T>
17781 where
17782 ___R: ::fidl_next::Encode<
17783 <___T as ::fidl_next::Transport>::SendBuffer,
17784 Encoded = crate::WireDirectoryRenameRequest<'static>,
17785 >,
17786 {
17787 ::fidl_next::TwoWayFuture::from_untyped(
17788 self.client.send_two_way(8097726607824333022, request),
17789 )
17790 }
17791
17792 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
17793 pub fn create_symlink(
17794 &self,
17795
17796 name: impl ::fidl_next::Encode<
17797 <___T as ::fidl_next::Transport>::SendBuffer,
17798 Encoded = ::fidl_next::WireString<'static>,
17799 >,
17800
17801 target: impl ::fidl_next::Encode<
17802 <___T as ::fidl_next::Transport>::SendBuffer,
17803 Encoded = ::fidl_next::WireVector<'static, u8>,
17804 >,
17805
17806 connection: impl ::fidl_next::Encode<
17807 <___T as ::fidl_next::Transport>::SendBuffer,
17808 Encoded = ::fidl_next::ServerEnd<
17809 crate::Symlink,
17810 ::fidl_next::fuchsia::WireOptionalChannel,
17811 >,
17812 >,
17813 ) -> ::fidl_next::TwoWayFuture<'_, super::CreateSymlink, ___T>
17814 where
17815 <___T as ::fidl_next::Transport>::SendBuffer:
17816 ::fidl_next::encoder::InternalHandleEncoder,
17817 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17818 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17819 {
17820 self.create_symlink_with(CreateSymlink { name, target, connection })
17821 }
17822
17823 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
17824 pub fn create_symlink_with<___R>(
17825 &self,
17826 request: ___R,
17827 ) -> ::fidl_next::TwoWayFuture<'_, super::CreateSymlink, ___T>
17828 where
17829 ___R: ::fidl_next::Encode<
17830 <___T as ::fidl_next::Transport>::SendBuffer,
17831 Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>,
17832 >,
17833 {
17834 ::fidl_next::TwoWayFuture::from_untyped(
17835 self.client.send_two_way(2435901052462315657, request),
17836 )
17837 }
17838
17839 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
17840 pub fn watch(
17841 &self,
17842
17843 mask: impl ::fidl_next::Encode<
17844 <___T as ::fidl_next::Transport>::SendBuffer,
17845 Encoded = crate::WireWatchMask,
17846 >,
17847
17848 options: impl ::fidl_next::Encode<
17849 <___T as ::fidl_next::Transport>::SendBuffer,
17850 Encoded = ::fidl_next::WireU32,
17851 >,
17852
17853 watcher: impl ::fidl_next::Encode<
17854 <___T as ::fidl_next::Transport>::SendBuffer,
17855 Encoded = ::fidl_next::ServerEnd<
17856 crate::DirectoryWatcher,
17857 ::fidl_next::fuchsia::WireChannel,
17858 >,
17859 >,
17860 ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
17861 where
17862 <___T as ::fidl_next::Transport>::SendBuffer:
17863 ::fidl_next::encoder::InternalHandleEncoder,
17864 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17865 {
17866 self.watch_with(Watch { mask, options, watcher })
17867 }
17868
17869 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
17870 pub fn watch_with<___R>(
17871 &self,
17872 request: ___R,
17873 ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
17874 where
17875 ___R: ::fidl_next::Encode<
17876 <___T as ::fidl_next::Transport>::SendBuffer,
17877 Encoded = crate::WireDirectoryWatchRequest,
17878 >,
17879 {
17880 ::fidl_next::TwoWayFuture::from_untyped(
17881 self.client.send_two_way(6275512344170098065, request),
17882 )
17883 }
17884 }
17885
17886 #[repr(transparent)]
17888 pub struct DirectoryServer<___T: ::fidl_next::Transport> {
17889 server: ::fidl_next::protocol::Server<___T>,
17890 }
17891
17892 impl<___T> DirectoryServer<___T>
17893 where
17894 ___T: ::fidl_next::Transport,
17895 {
17896 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
17897 pub fn on_open(
17898 &self,
17899
17900 s: impl ::fidl_next::Encode<
17901 <___T as ::fidl_next::Transport>::SendBuffer,
17902 Encoded = ::fidl_next::WireI32,
17903 >,
17904
17905 info: impl ::fidl_next::Encode<
17906 <___T as ::fidl_next::Transport>::SendBuffer,
17907 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
17908 >,
17909 ) -> ::fidl_next::SendFuture<'_, ___T>
17910 where
17911 <___T as ::fidl_next::Transport>::SendBuffer:
17912 ::fidl_next::encoder::InternalHandleEncoder,
17913 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17914 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17915 {
17916 self.on_open_with(OnOpen { s, info })
17917 }
17918
17919 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
17920
17921 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
17922 where
17923 ___R: ::fidl_next::Encode<
17924 <___T as ::fidl_next::Transport>::SendBuffer,
17925 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
17926 >,
17927 {
17928 ::fidl_next::SendFuture::from_untyped(
17929 self.server.send_event(9207534335756671346, request),
17930 )
17931 }
17932
17933 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
17934
17935 pub fn on_representation_with<___R>(
17936 &self,
17937 request: ___R,
17938 ) -> ::fidl_next::SendFuture<'_, ___T>
17939 where
17940 ___R: ::fidl_next::Encode<
17941 <___T as ::fidl_next::Transport>::SendBuffer,
17942 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
17943 >,
17944 {
17945 ::fidl_next::SendFuture::from_untyped(
17946 self.server.send_event(6679970090861613324, request),
17947 )
17948 }
17949 }
17950 }
17951}
17952
17953pub trait DirectoryClientHandler<
17957 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
17958 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
17959>
17960{
17961 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
17962 fn on_open(
17963 &mut self,
17964
17965 event: ::fidl_next::Response<directory::OnOpen, ___T>,
17966 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17967
17968 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
17969 fn on_representation(
17970 &mut self,
17971
17972 event: ::fidl_next::Response<directory::OnRepresentation, ___T>,
17973 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17974
17975 fn on_unknown_interaction(
17976 &mut self,
17977 ordinal: u64,
17978 ) -> impl ::core::future::Future<
17979 Output = ::core::result::Result<
17980 (),
17981 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
17982 >,
17983 > + ::core::marker::Send {
17984 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
17985 }
17986}
17987
17988impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Directory
17989where
17990 ___H: DirectoryClientHandler<___T> + ::core::marker::Send,
17991 ___T: ::fidl_next::Transport,
17992 <directory::AdvisoryLock as ::fidl_next::Method>::Response:
17993 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17994 <directory::Close as ::fidl_next::Method>::Response:
17995 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17996 <directory::Query as ::fidl_next::Method>::Response:
17997 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17998 <directory::OnOpen as ::fidl_next::Method>::Response:
17999 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18000 <directory::DeprecatedGetAttr as ::fidl_next::Method>::Response:
18001 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18002 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Response:
18003 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18004 <directory::DeprecatedGetFlags as ::fidl_next::Method>::Response:
18005 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18006 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Response:
18007 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18008 <directory::GetFlags as ::fidl_next::Method>::Response:
18009 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18010 <directory::SetFlags as ::fidl_next::Method>::Response:
18011 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18012 <directory::QueryFilesystem as ::fidl_next::Method>::Response:
18013 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18014 <directory::OnRepresentation as ::fidl_next::Method>::Response:
18015 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18016 <directory::GetAttributes as ::fidl_next::Method>::Response:
18017 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18018 <directory::UpdateAttributes as ::fidl_next::Method>::Response:
18019 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18020 <directory::Sync as ::fidl_next::Method>::Response:
18021 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18022 <directory::GetExtendedAttribute as ::fidl_next::Method>::Response:
18023 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18024 <directory::SetExtendedAttribute as ::fidl_next::Method>::Response:
18025 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18026 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
18027 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18028 <directory::ReadDirents as ::fidl_next::Method>::Response:
18029 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18030 <directory::Rewind as ::fidl_next::Method>::Response:
18031 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18032 <directory::GetToken as ::fidl_next::Method>::Response:
18033 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18034 <directory::Link as ::fidl_next::Method>::Response:
18035 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18036 <directory::Unlink as ::fidl_next::Method>::Response:
18037 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18038 <directory::Rename as ::fidl_next::Method>::Response:
18039 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18040 <directory::CreateSymlink as ::fidl_next::Method>::Response:
18041 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18042 <directory::Watch as ::fidl_next::Method>::Response:
18043 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18044{
18045 async fn on_event(
18046 handler: &mut ___H,
18047 ordinal: u64,
18048 buffer: ___T::RecvBuffer,
18049 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18050 match ordinal {
18051 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
18052 Ok(decoded) => {
18053 handler.on_open(decoded).await;
18054 Ok(())
18055 }
18056 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18057 ordinal: 9207534335756671346,
18058 error,
18059 }),
18060 },
18061
18062 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
18063 Ok(decoded) => {
18064 handler.on_representation(decoded).await;
18065 Ok(())
18066 }
18067 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18068 ordinal: 6679970090861613324,
18069 error,
18070 }),
18071 },
18072
18073 ordinal => handler.on_unknown_interaction(ordinal).await,
18074 }
18075 }
18076}
18077
18078pub trait DirectoryServerHandler<
18082 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18083 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18084>
18085{
18086 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
18087 fn advisory_lock(
18088 &mut self,
18089
18090 request: ::fidl_next::Request<directory::AdvisoryLock, ___T>,
18091
18092 responder: ::fidl_next::Responder<directory::AdvisoryLock, ___T>,
18093 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18094
18095 fn clone(
18096 &mut self,
18097
18098 request: ::fidl_next::Request<directory::Clone, ___T>,
18099 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18100
18101 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
18102 fn close(
18103 &mut self,
18104
18105 responder: ::fidl_next::Responder<directory::Close, ___T>,
18106 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18107
18108 fn query(
18109 &mut self,
18110
18111 responder: ::fidl_next::Responder<directory::Query, ___T>,
18112 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18113
18114 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
18115 fn deprecated_clone(
18116 &mut self,
18117
18118 request: ::fidl_next::Request<directory::DeprecatedClone, ___T>,
18119 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18120
18121 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
18122 fn deprecated_get_attr(
18123 &mut self,
18124
18125 responder: ::fidl_next::Responder<directory::DeprecatedGetAttr, ___T>,
18126 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18127
18128 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
18129 fn deprecated_set_attr(
18130 &mut self,
18131
18132 request: ::fidl_next::Request<directory::DeprecatedSetAttr, ___T>,
18133
18134 responder: ::fidl_next::Responder<directory::DeprecatedSetAttr, ___T>,
18135 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18136
18137 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
18138 fn deprecated_get_flags(
18139 &mut self,
18140
18141 responder: ::fidl_next::Responder<directory::DeprecatedGetFlags, ___T>,
18142 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18143
18144 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
18145 fn deprecated_set_flags(
18146 &mut self,
18147
18148 request: ::fidl_next::Request<directory::DeprecatedSetFlags, ___T>,
18149
18150 responder: ::fidl_next::Responder<directory::DeprecatedSetFlags, ___T>,
18151 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18152
18153 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
18154 fn get_flags(
18155 &mut self,
18156
18157 responder: ::fidl_next::Responder<directory::GetFlags, ___T>,
18158 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18159
18160 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
18161 fn set_flags(
18162 &mut self,
18163
18164 request: ::fidl_next::Request<directory::SetFlags, ___T>,
18165
18166 responder: ::fidl_next::Responder<directory::SetFlags, ___T>,
18167 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18168
18169 #[doc = " Query the filesystem for filesystem-specific information.\n"]
18170 fn query_filesystem(
18171 &mut self,
18172
18173 responder: ::fidl_next::Responder<directory::QueryFilesystem, ___T>,
18174 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18175
18176 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
18177 fn get_attributes(
18178 &mut self,
18179
18180 request: ::fidl_next::Request<directory::GetAttributes, ___T>,
18181
18182 responder: ::fidl_next::Responder<directory::GetAttributes, ___T>,
18183 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18184
18185 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
18186 fn update_attributes(
18187 &mut self,
18188
18189 request: ::fidl_next::Request<directory::UpdateAttributes, ___T>,
18190
18191 responder: ::fidl_next::Responder<directory::UpdateAttributes, ___T>,
18192 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18193
18194 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
18195 fn sync(
18196 &mut self,
18197
18198 responder: ::fidl_next::Responder<directory::Sync, ___T>,
18199 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18200
18201 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
18202 fn list_extended_attributes(
18203 &mut self,
18204
18205 request: ::fidl_next::Request<directory::ListExtendedAttributes, ___T>,
18206 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18207
18208 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
18209 fn get_extended_attribute(
18210 &mut self,
18211
18212 request: ::fidl_next::Request<directory::GetExtendedAttribute, ___T>,
18213
18214 responder: ::fidl_next::Responder<directory::GetExtendedAttribute, ___T>,
18215 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18216
18217 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
18218 fn set_extended_attribute(
18219 &mut self,
18220
18221 request: ::fidl_next::Request<directory::SetExtendedAttribute, ___T>,
18222
18223 responder: ::fidl_next::Responder<directory::SetExtendedAttribute, ___T>,
18224 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18225
18226 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
18227 fn remove_extended_attribute(
18228 &mut self,
18229
18230 request: ::fidl_next::Request<directory::RemoveExtendedAttribute, ___T>,
18231
18232 responder: ::fidl_next::Responder<directory::RemoveExtendedAttribute, ___T>,
18233 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18234
18235 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
18236 fn deprecated_open(
18237 &mut self,
18238
18239 request: ::fidl_next::Request<directory::DeprecatedOpen, ___T>,
18240 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18241
18242 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
18243 fn open(
18244 &mut self,
18245
18246 request: ::fidl_next::Request<directory::Open, ___T>,
18247 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18248
18249 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
18250 fn read_dirents(
18251 &mut self,
18252
18253 request: ::fidl_next::Request<directory::ReadDirents, ___T>,
18254
18255 responder: ::fidl_next::Responder<directory::ReadDirents, ___T>,
18256 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18257
18258 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
18259 fn rewind(
18260 &mut self,
18261
18262 responder: ::fidl_next::Responder<directory::Rewind, ___T>,
18263 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18264
18265 #[doc = " Acquires a token to a Directory which can be used to identify access to it at a later point\n in time. The token will remain valid for as long as the connection requesting the token\n remains open.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
18266 fn get_token(
18267 &mut self,
18268
18269 responder: ::fidl_next::Responder<directory::GetToken, ___T>,
18270 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18271
18272 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
18273 fn link(
18274 &mut self,
18275
18276 request: ::fidl_next::Request<directory::Link, ___T>,
18277
18278 responder: ::fidl_next::Responder<directory::Link, ___T>,
18279 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18280
18281 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
18282 fn unlink(
18283 &mut self,
18284
18285 request: ::fidl_next::Request<directory::Unlink, ___T>,
18286
18287 responder: ::fidl_next::Responder<directory::Unlink, ___T>,
18288 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18289
18290 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
18291 fn rename(
18292 &mut self,
18293
18294 request: ::fidl_next::Request<directory::Rename, ___T>,
18295
18296 responder: ::fidl_next::Responder<directory::Rename, ___T>,
18297 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18298
18299 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
18300 fn create_symlink(
18301 &mut self,
18302
18303 request: ::fidl_next::Request<directory::CreateSymlink, ___T>,
18304
18305 responder: ::fidl_next::Responder<directory::CreateSymlink, ___T>,
18306 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18307
18308 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
18309 fn watch(
18310 &mut self,
18311
18312 request: ::fidl_next::Request<directory::Watch, ___T>,
18313
18314 responder: ::fidl_next::Responder<directory::Watch, ___T>,
18315 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18316
18317 fn on_unknown_interaction(
18318 &mut self,
18319 ordinal: u64,
18320 ) -> impl ::core::future::Future<
18321 Output = ::core::result::Result<
18322 (),
18323 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18324 >,
18325 > + ::core::marker::Send {
18326 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
18327 }
18328}
18329
18330impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Directory
18331where
18332 ___H: DirectoryServerHandler<___T> + ::core::marker::Send,
18333 ___T: ::fidl_next::Transport,
18334 <directory::AdvisoryLock as ::fidl_next::Method>::Request:
18335 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18336 <directory::Clone as ::fidl_next::Method>::Request:
18337 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18338 <directory::DeprecatedClone as ::fidl_next::Method>::Request:
18339 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18340 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Request:
18341 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18342 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Request:
18343 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18344 <directory::SetFlags as ::fidl_next::Method>::Request:
18345 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18346 <directory::GetAttributes as ::fidl_next::Method>::Request:
18347 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18348 <directory::UpdateAttributes as ::fidl_next::Method>::Request:
18349 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18350 <directory::ListExtendedAttributes as ::fidl_next::Method>::Request:
18351 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18352 <directory::GetExtendedAttribute as ::fidl_next::Method>::Request:
18353 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18354 <directory::SetExtendedAttribute as ::fidl_next::Method>::Request:
18355 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18356 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
18357 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18358 <directory::DeprecatedOpen as ::fidl_next::Method>::Request:
18359 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18360 <directory::Open as ::fidl_next::Method>::Request:
18361 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18362 <directory::ReadDirents as ::fidl_next::Method>::Request:
18363 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18364 <directory::Link as ::fidl_next::Method>::Request:
18365 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18366 <directory::Unlink as ::fidl_next::Method>::Request:
18367 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18368 <directory::Rename as ::fidl_next::Method>::Request:
18369 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18370 <directory::CreateSymlink as ::fidl_next::Method>::Request:
18371 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18372 <directory::Watch as ::fidl_next::Method>::Request:
18373 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18374{
18375 async fn on_one_way(
18376 handler: &mut ___H,
18377 ordinal: u64,
18378 buffer: ___T::RecvBuffer,
18379 ) -> ::core::result::Result<
18380 (),
18381 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18382 > {
18383 match ordinal {
18384 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
18385 Ok(decoded) => {
18386 handler.clone(decoded).await;
18387 Ok(())
18388 }
18389 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18390 ordinal: 2366825959783828089,
18391 error,
18392 }),
18393 },
18394
18395 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
18396 Ok(decoded) => {
18397 handler.deprecated_clone(decoded).await;
18398 Ok(())
18399 }
18400 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18401 ordinal: 6512600400724287855,
18402 error,
18403 }),
18404 },
18405
18406 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
18407 Ok(decoded) => {
18408 handler.list_extended_attributes(decoded).await;
18409 Ok(())
18410 }
18411 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18412 ordinal: 5431626189872037072,
18413 error,
18414 }),
18415 },
18416
18417 3193127272456937152 => match ::fidl_next::DecoderExt::decode(buffer) {
18418 Ok(decoded) => {
18419 handler.deprecated_open(decoded).await;
18420 Ok(())
18421 }
18422 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18423 ordinal: 3193127272456937152,
18424 error,
18425 }),
18426 },
18427
18428 6236883748953765593 => match ::fidl_next::DecoderExt::decode(buffer) {
18429 Ok(decoded) => {
18430 handler.open(decoded).await;
18431 Ok(())
18432 }
18433 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18434 ordinal: 6236883748953765593,
18435 error,
18436 }),
18437 },
18438
18439 ordinal => handler.on_unknown_interaction(ordinal).await,
18440 }
18441 }
18442
18443 async fn on_two_way(
18444 handler: &mut ___H,
18445 ordinal: u64,
18446 buffer: ___T::RecvBuffer,
18447 responder: ::fidl_next::protocol::Responder<___T>,
18448 ) -> ::core::result::Result<
18449 (),
18450 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18451 > {
18452 match ordinal {
18453 7992130864415541162 => {
18454 let responder = ::fidl_next::Responder::from_untyped(responder);
18455
18456 match ::fidl_next::DecoderExt::decode(buffer) {
18457 Ok(decoded) => {
18458 handler.advisory_lock(decoded, responder).await;
18459 Ok(())
18460 }
18461 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18462 ordinal: 7992130864415541162,
18463 error,
18464 }),
18465 }
18466 }
18467
18468 6540867515453498750 => {
18469 let responder = ::fidl_next::Responder::from_untyped(responder);
18470
18471 handler.close(responder).await;
18472 Ok(())
18473 }
18474
18475 2763219980499352582 => {
18476 let responder = ::fidl_next::Responder::from_untyped(responder);
18477
18478 handler.query(responder).await;
18479 Ok(())
18480 }
18481
18482 8689798978500614909 => {
18483 let responder = ::fidl_next::Responder::from_untyped(responder);
18484
18485 handler.deprecated_get_attr(responder).await;
18486 Ok(())
18487 }
18488
18489 4721673413776871238 => {
18490 let responder = ::fidl_next::Responder::from_untyped(responder);
18491
18492 match ::fidl_next::DecoderExt::decode(buffer) {
18493 Ok(decoded) => {
18494 handler.deprecated_set_attr(decoded, responder).await;
18495 Ok(())
18496 }
18497 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18498 ordinal: 4721673413776871238,
18499 error,
18500 }),
18501 }
18502 }
18503
18504 6595803110182632097 => {
18505 let responder = ::fidl_next::Responder::from_untyped(responder);
18506
18507 handler.deprecated_get_flags(responder).await;
18508 Ok(())
18509 }
18510
18511 5950864159036794675 => {
18512 let responder = ::fidl_next::Responder::from_untyped(responder);
18513
18514 match ::fidl_next::DecoderExt::decode(buffer) {
18515 Ok(decoded) => {
18516 handler.deprecated_set_flags(decoded, responder).await;
18517 Ok(())
18518 }
18519 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18520 ordinal: 5950864159036794675,
18521 error,
18522 }),
18523 }
18524 }
18525
18526 105530239381466147 => {
18527 let responder = ::fidl_next::Responder::from_untyped(responder);
18528
18529 handler.get_flags(responder).await;
18530 Ok(())
18531 }
18532
18533 6172186066099445416 => {
18534 let responder = ::fidl_next::Responder::from_untyped(responder);
18535
18536 match ::fidl_next::DecoderExt::decode(buffer) {
18537 Ok(decoded) => {
18538 handler.set_flags(decoded, responder).await;
18539 Ok(())
18540 }
18541 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18542 ordinal: 6172186066099445416,
18543 error,
18544 }),
18545 }
18546 }
18547
18548 8013111122914313744 => {
18549 let responder = ::fidl_next::Responder::from_untyped(responder);
18550
18551 handler.query_filesystem(responder).await;
18552 Ok(())
18553 }
18554
18555 4414537700416816443 => {
18556 let responder = ::fidl_next::Responder::from_untyped(responder);
18557
18558 match ::fidl_next::DecoderExt::decode(buffer) {
18559 Ok(decoded) => {
18560 handler.get_attributes(decoded, responder).await;
18561 Ok(())
18562 }
18563 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18564 ordinal: 4414537700416816443,
18565 error,
18566 }),
18567 }
18568 }
18569
18570 3677402239314018056 => {
18571 let responder = ::fidl_next::Responder::from_untyped(responder);
18572
18573 match ::fidl_next::DecoderExt::decode(buffer) {
18574 Ok(decoded) => {
18575 handler.update_attributes(decoded, responder).await;
18576 Ok(())
18577 }
18578 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18579 ordinal: 3677402239314018056,
18580 error,
18581 }),
18582 }
18583 }
18584
18585 3196473584242777161 => {
18586 let responder = ::fidl_next::Responder::from_untyped(responder);
18587
18588 handler.sync(responder).await;
18589 Ok(())
18590 }
18591
18592 5043930208506967771 => {
18593 let responder = ::fidl_next::Responder::from_untyped(responder);
18594
18595 match ::fidl_next::DecoderExt::decode(buffer) {
18596 Ok(decoded) => {
18597 handler.get_extended_attribute(decoded, responder).await;
18598 Ok(())
18599 }
18600 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18601 ordinal: 5043930208506967771,
18602 error,
18603 }),
18604 }
18605 }
18606
18607 5374223046099989052 => {
18608 let responder = ::fidl_next::Responder::from_untyped(responder);
18609
18610 match ::fidl_next::DecoderExt::decode(buffer) {
18611 Ok(decoded) => {
18612 handler.set_extended_attribute(decoded, responder).await;
18613 Ok(())
18614 }
18615 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18616 ordinal: 5374223046099989052,
18617 error,
18618 }),
18619 }
18620 }
18621
18622 8794297771444732717 => {
18623 let responder = ::fidl_next::Responder::from_untyped(responder);
18624
18625 match ::fidl_next::DecoderExt::decode(buffer) {
18626 Ok(decoded) => {
18627 handler.remove_extended_attribute(decoded, responder).await;
18628 Ok(())
18629 }
18630 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18631 ordinal: 8794297771444732717,
18632 error,
18633 }),
18634 }
18635 }
18636
18637 3855785432100874762 => {
18638 let responder = ::fidl_next::Responder::from_untyped(responder);
18639
18640 match ::fidl_next::DecoderExt::decode(buffer) {
18641 Ok(decoded) => {
18642 handler.read_dirents(decoded, responder).await;
18643 Ok(())
18644 }
18645 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18646 ordinal: 3855785432100874762,
18647 error,
18648 }),
18649 }
18650 }
18651
18652 1635123508515392625 => {
18653 let responder = ::fidl_next::Responder::from_untyped(responder);
18654
18655 handler.rewind(responder).await;
18656 Ok(())
18657 }
18658
18659 2787337947777369685 => {
18660 let responder = ::fidl_next::Responder::from_untyped(responder);
18661
18662 handler.get_token(responder).await;
18663 Ok(())
18664 }
18665
18666 8360374984291987687 => {
18667 let responder = ::fidl_next::Responder::from_untyped(responder);
18668
18669 match ::fidl_next::DecoderExt::decode(buffer) {
18670 Ok(decoded) => {
18671 handler.link(decoded, responder).await;
18672 Ok(())
18673 }
18674 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18675 ordinal: 8360374984291987687,
18676 error,
18677 }),
18678 }
18679 }
18680
18681 8433556716759383021 => {
18682 let responder = ::fidl_next::Responder::from_untyped(responder);
18683
18684 match ::fidl_next::DecoderExt::decode(buffer) {
18685 Ok(decoded) => {
18686 handler.unlink(decoded, responder).await;
18687 Ok(())
18688 }
18689 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18690 ordinal: 8433556716759383021,
18691 error,
18692 }),
18693 }
18694 }
18695
18696 8097726607824333022 => {
18697 let responder = ::fidl_next::Responder::from_untyped(responder);
18698
18699 match ::fidl_next::DecoderExt::decode(buffer) {
18700 Ok(decoded) => {
18701 handler.rename(decoded, responder).await;
18702 Ok(())
18703 }
18704 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18705 ordinal: 8097726607824333022,
18706 error,
18707 }),
18708 }
18709 }
18710
18711 2435901052462315657 => {
18712 let responder = ::fidl_next::Responder::from_untyped(responder);
18713
18714 match ::fidl_next::DecoderExt::decode(buffer) {
18715 Ok(decoded) => {
18716 handler.create_symlink(decoded, responder).await;
18717 Ok(())
18718 }
18719 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18720 ordinal: 2435901052462315657,
18721 error,
18722 }),
18723 }
18724 }
18725
18726 6275512344170098065 => {
18727 let responder = ::fidl_next::Responder::from_untyped(responder);
18728
18729 match ::fidl_next::DecoderExt::decode(buffer) {
18730 Ok(decoded) => {
18731 handler.watch(decoded, responder).await;
18732 Ok(())
18733 }
18734 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18735 ordinal: 6275512344170098065,
18736 error,
18737 }),
18738 }
18739 }
18740
18741 ordinal => handler.on_unknown_interaction(ordinal).await,
18742 }
18743 }
18744}
18745
18746#[derive(PartialEq, Clone, Debug)]
18747#[repr(C)]
18748pub struct DirectoryObject {}
18749
18750impl ::fidl_next::Encodable for DirectoryObject {
18751 type Encoded = WireDirectoryObject;
18752}
18753
18754unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryObject
18755where
18756 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18757{
18758 #[inline]
18759 fn encode(
18760 self,
18761 encoder_: &mut ___E,
18762 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18763 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18764 *out_ = ::core::mem::MaybeUninit::zeroed();
18765
18766 Ok(())
18767 }
18768}
18769
18770unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryObject
18771where
18772 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18773{
18774 #[inline]
18775 fn encode_ref(
18776 &self,
18777 encoder_: &mut ___E,
18778 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18780 ::fidl_next::munge! {
18781 let Self::Encoded {
18782
18783 _empty,
18784
18785
18786 } = out_;
18787 }
18788
18789 Ok(())
18790 }
18791}
18792
18793impl ::fidl_next::EncodableOption for DirectoryObject {
18794 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryObject>;
18795}
18796
18797unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryObject
18798where
18799 ___E: ::fidl_next::Encoder + ?Sized,
18800 DirectoryObject: ::fidl_next::Encode<___E>,
18801{
18802 #[inline]
18803 fn encode_option(
18804 this: ::core::option::Option<Self>,
18805 encoder: &mut ___E,
18806 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18807 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18808 if let Some(inner) = this {
18809 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18810 ::fidl_next::WireBox::encode_present(out);
18811 } else {
18812 ::fidl_next::WireBox::encode_absent(out);
18813 }
18814
18815 Ok(())
18816 }
18817}
18818
18819unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryObject
18820where
18821 ___E: ::fidl_next::Encoder + ?Sized,
18822 DirectoryObject: ::fidl_next::EncodeRef<___E>,
18823{
18824 #[inline]
18825 fn encode_option_ref(
18826 this: ::core::option::Option<&Self>,
18827 encoder: &mut ___E,
18828 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18829 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18830 if let Some(inner) = this {
18831 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18832 ::fidl_next::WireBox::encode_present(out);
18833 } else {
18834 ::fidl_next::WireBox::encode_absent(out);
18835 }
18836
18837 Ok(())
18838 }
18839}
18840
18841impl ::fidl_next::FromWire<WireDirectoryObject> for DirectoryObject {
18842 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryObject, Self> =
18843 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
18844
18845 #[inline]
18846 fn from_wire(wire: WireDirectoryObject) -> Self {
18847 Self {}
18848 }
18849}
18850
18851impl ::fidl_next::IntoNatural for WireDirectoryObject {
18852 type Natural = DirectoryObject;
18853}
18854
18855impl ::fidl_next::FromWireRef<WireDirectoryObject> for DirectoryObject {
18856 #[inline]
18857 fn from_wire_ref(wire: &WireDirectoryObject) -> Self {
18858 Self {}
18859 }
18860}
18861
18862#[derive(Clone, Debug)]
18864#[repr(C)]
18865pub struct WireDirectoryObject {
18866 _empty: fidl_next::WireEmptyStructPlaceholder,
18867}
18868static_assertions::const_assert_eq!(std::mem::size_of::<WireDirectoryObject>(), 1);
18869static_assertions::const_assert_eq!(std::mem::align_of::<WireDirectoryObject>(), 1);
18870
18871unsafe impl ::fidl_next::Wire for WireDirectoryObject {
18872 type Decoded<'de> = WireDirectoryObject;
18873
18874 #[inline]
18875 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
18876 ::fidl_next::munge! {
18877 let Self {
18878
18879 _empty,
18880
18881
18882 } = &mut *out_;
18883 }
18884 }
18885}
18886
18887unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryObject
18888where
18889 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18890{
18891 fn decode(
18892 slot_: ::fidl_next::Slot<'_, Self>,
18893 decoder_: &mut ___D,
18894 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
18895 ::fidl_next::munge! {
18896 let Self {
18897
18898 mut _empty,
18899
18900
18901 } = slot_;
18902 }
18903
18904 if _empty.as_bytes() != &[0u8] {
18905 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
18906 }
18907
18908 Ok(())
18909 }
18910}
18911
18912#[doc = " DirectoryWatcher transmits messages from a filesystem server\n about events happening in the filesystem. Clients can register\n new watchers using the `Directory.Watch` method, where they can\n filter which events they want to receive notifications for.\n\n The DirectoryWatcher will send messages of the form:\n ```\n struct {\n uint8 event;\n uint8 len;\n char name[];\n };\n ```\n Where names are NOT null-terminated. The name is the relative\n path to the entry the event is refering to. It will be empty if\n the event isn\'t referencing a particular entry (e.g. for the\n `IDLE` event).\n"]
18914#[derive(PartialEq, Debug)]
18915pub struct DirectoryWatcher;
18916
18917pub mod directory_watcher {
18918 pub mod prelude {
18919 pub use crate::{
18920 DirectoryWatcher, DirectoryWatcherClientHandler, DirectoryWatcherServerHandler,
18921 directory_watcher,
18922 };
18923 }
18924
18925 mod ___detail {
18926
18927 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirectoryWatcher
18928 where
18929 ___T: ::fidl_next::Transport,
18930 {
18931 type Client = DirectoryWatcherClient<___T>;
18932 type Server = DirectoryWatcherServer<___T>;
18933 }
18934
18935 #[repr(transparent)]
18937 pub struct DirectoryWatcherClient<___T: ::fidl_next::Transport> {
18938 #[allow(dead_code)]
18939 client: ::fidl_next::protocol::Client<___T>,
18940 }
18941
18942 impl<___T> DirectoryWatcherClient<___T> where ___T: ::fidl_next::Transport {}
18943
18944 #[repr(transparent)]
18946 pub struct DirectoryWatcherServer<___T: ::fidl_next::Transport> {
18947 server: ::fidl_next::protocol::Server<___T>,
18948 }
18949
18950 impl<___T> DirectoryWatcherServer<___T> where ___T: ::fidl_next::Transport {}
18951 }
18952}
18953
18954pub trait DirectoryWatcherClientHandler<
18958 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18959 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18960>
18961{
18962}
18963
18964impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DirectoryWatcher
18965where
18966 ___H: DirectoryWatcherClientHandler<___T> + ::core::marker::Send,
18967 ___T: ::fidl_next::Transport,
18968{
18969 async fn on_event(
18970 handler: &mut ___H,
18971 ordinal: u64,
18972 buffer: ___T::RecvBuffer,
18973 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18974 match ordinal {
18975 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
18976 }
18977 }
18978}
18979
18980pub trait DirectoryWatcherServerHandler<
18984 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18985 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18986>
18987{
18988}
18989
18990impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DirectoryWatcher
18991where
18992 ___H: DirectoryWatcherServerHandler<___T> + ::core::marker::Send,
18993 ___T: ::fidl_next::Transport,
18994{
18995 async fn on_one_way(
18996 handler: &mut ___H,
18997 ordinal: u64,
18998 buffer: ___T::RecvBuffer,
18999 ) -> ::core::result::Result<
19000 (),
19001 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19002 > {
19003 match ordinal {
19004 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
19005 }
19006 }
19007
19008 async fn on_two_way(
19009 handler: &mut ___H,
19010 ordinal: u64,
19011 buffer: ___T::RecvBuffer,
19012 responder: ::fidl_next::protocol::Responder<___T>,
19013 ) -> ::core::result::Result<
19014 (),
19015 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19016 > {
19017 match ordinal {
19018 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
19019 }
19020 }
19021}
19022
19023#[derive(Clone, Copy, Debug, PartialEq, Eq)]
19024#[repr(u8)]
19025pub enum DirentType {
19026 Unknown = 0,
19027 Directory = 4,
19028 BlockDevice = 6,
19029 File = 8,
19030 Symlink = 10,
19031 Service = 16,
19032 UnknownOrdinal_(u8) = 17,
19033}
19034
19035impl ::fidl_next::Encodable for DirentType {
19036 type Encoded = WireDirentType;
19037}
19038impl ::std::convert::From<u8> for DirentType {
19039 fn from(value: u8) -> Self {
19040 match value {
19041 0 => Self::Unknown,
19042 4 => Self::Directory,
19043 6 => Self::BlockDevice,
19044 8 => Self::File,
19045 10 => Self::Symlink,
19046 16 => Self::Service,
19047
19048 _ => Self::UnknownOrdinal_(value),
19049 }
19050 }
19051}
19052
19053unsafe impl<___E> ::fidl_next::Encode<___E> for DirentType
19054where
19055 ___E: ?Sized,
19056{
19057 #[inline]
19058 fn encode(
19059 self,
19060 encoder: &mut ___E,
19061 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19062 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19063 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
19064 }
19065}
19066
19067unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirentType
19068where
19069 ___E: ?Sized,
19070{
19071 #[inline]
19072 fn encode_ref(
19073 &self,
19074 encoder: &mut ___E,
19075 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19076 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19077 ::fidl_next::munge!(let WireDirentType { value } = out);
19078 let _ = value.write(u8::from(match *self {
19079 Self::Unknown => 0,
19080
19081 Self::Directory => 4,
19082
19083 Self::BlockDevice => 6,
19084
19085 Self::File => 8,
19086
19087 Self::Symlink => 10,
19088
19089 Self::Service => 16,
19090
19091 Self::UnknownOrdinal_(value) => value,
19092 }));
19093
19094 Ok(())
19095 }
19096}
19097
19098impl ::core::convert::From<WireDirentType> for DirentType {
19099 fn from(wire: WireDirentType) -> Self {
19100 match u8::from(wire.value) {
19101 0 => Self::Unknown,
19102
19103 4 => Self::Directory,
19104
19105 6 => Self::BlockDevice,
19106
19107 8 => Self::File,
19108
19109 10 => Self::Symlink,
19110
19111 16 => Self::Service,
19112
19113 value => Self::UnknownOrdinal_(value),
19114 }
19115 }
19116}
19117
19118impl ::fidl_next::FromWire<WireDirentType> for DirentType {
19119 #[inline]
19120 fn from_wire(wire: WireDirentType) -> Self {
19121 Self::from(wire)
19122 }
19123}
19124
19125impl ::fidl_next::IntoNatural for WireDirentType {
19126 type Natural = DirentType;
19127}
19128
19129impl ::fidl_next::FromWireRef<WireDirentType> for DirentType {
19130 #[inline]
19131 fn from_wire_ref(wire: &WireDirentType) -> Self {
19132 Self::from(*wire)
19133 }
19134}
19135
19136#[derive(Clone, Copy, Debug, PartialEq, Eq)]
19138#[repr(transparent)]
19139pub struct WireDirentType {
19140 value: u8,
19141}
19142
19143unsafe impl ::fidl_next::Wire for WireDirentType {
19144 type Decoded<'de> = Self;
19145
19146 #[inline]
19147 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
19148 }
19150}
19151
19152impl WireDirentType {
19153 pub const UNKNOWN: WireDirentType = WireDirentType { value: 0 };
19154
19155 pub const DIRECTORY: WireDirentType = WireDirentType { value: 4 };
19156
19157 pub const BLOCK_DEVICE: WireDirentType = WireDirentType { value: 6 };
19158
19159 pub const FILE: WireDirentType = WireDirentType { value: 8 };
19160
19161 pub const SYMLINK: WireDirentType = WireDirentType { value: 10 };
19162
19163 pub const SERVICE: WireDirentType = WireDirentType { value: 16 };
19164}
19165
19166unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirentType
19167where
19168 ___D: ?Sized,
19169{
19170 fn decode(
19171 slot: ::fidl_next::Slot<'_, Self>,
19172 _: &mut ___D,
19173 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19174 Ok(())
19175 }
19176}
19177
19178impl ::core::convert::From<DirentType> for WireDirentType {
19179 fn from(natural: DirentType) -> Self {
19180 match natural {
19181 DirentType::Unknown => WireDirentType::UNKNOWN,
19182
19183 DirentType::Directory => WireDirentType::DIRECTORY,
19184
19185 DirentType::BlockDevice => WireDirentType::BLOCK_DEVICE,
19186
19187 DirentType::File => WireDirentType::FILE,
19188
19189 DirentType::Symlink => WireDirentType::SYMLINK,
19190
19191 DirentType::Service => WireDirentType::SERVICE,
19192
19193 DirentType::UnknownOrdinal_(value) => WireDirentType { value: u8::from(value) },
19194 }
19195 }
19196}
19197
19198#[doc = " The maximum size of a chunk in the ListExtendedAttributes iterator.\n"]
19199pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128 as u64;
19200
19201#[derive(PartialEq, Clone, Debug)]
19202pub struct ExtendedAttributeIteratorGetNextResponse {
19203 pub attributes: ::std::vec::Vec<::std::vec::Vec<u8>>,
19204
19205 pub last: bool,
19206}
19207
19208impl ::fidl_next::Encodable for ExtendedAttributeIteratorGetNextResponse {
19209 type Encoded = WireExtendedAttributeIteratorGetNextResponse<'static>;
19210}
19211
19212unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeIteratorGetNextResponse
19213where
19214 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19215 ___E: ::fidl_next::Encoder,
19216{
19217 #[inline]
19218 fn encode(
19219 self,
19220 encoder_: &mut ___E,
19221 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19222 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19223 ::fidl_next::munge! {
19224 let Self::Encoded {
19225 attributes,
19226 last,
19227
19228 } = out_;
19229 }
19230
19231 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
19232
19233 ::fidl_next::Encode::encode(self.last, encoder_, last)?;
19234
19235 Ok(())
19236 }
19237}
19238
19239unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExtendedAttributeIteratorGetNextResponse
19240where
19241 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19242 ___E: ::fidl_next::Encoder,
19243{
19244 #[inline]
19245 fn encode_ref(
19246 &self,
19247 encoder_: &mut ___E,
19248 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19249 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19250 ::fidl_next::munge! {
19251 let Self::Encoded {
19252
19253 attributes,
19254 last,
19255
19256 } = out_;
19257 }
19258
19259 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder_, attributes)?;
19260
19261 ::fidl_next::EncodeRef::encode_ref(&self.last, encoder_, last)?;
19262
19263 Ok(())
19264 }
19265}
19266
19267impl ::fidl_next::EncodableOption for ExtendedAttributeIteratorGetNextResponse {
19268 type EncodedOption =
19269 ::fidl_next::WireBox<'static, WireExtendedAttributeIteratorGetNextResponse<'static>>;
19270}
19271
19272unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeIteratorGetNextResponse
19273where
19274 ___E: ::fidl_next::Encoder + ?Sized,
19275 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<___E>,
19276{
19277 #[inline]
19278 fn encode_option(
19279 this: ::core::option::Option<Self>,
19280 encoder: &mut ___E,
19281 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19282 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19283 if let Some(inner) = this {
19284 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19285 ::fidl_next::WireBox::encode_present(out);
19286 } else {
19287 ::fidl_next::WireBox::encode_absent(out);
19288 }
19289
19290 Ok(())
19291 }
19292}
19293
19294unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ExtendedAttributeIteratorGetNextResponse
19295where
19296 ___E: ::fidl_next::Encoder + ?Sized,
19297 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::EncodeRef<___E>,
19298{
19299 #[inline]
19300 fn encode_option_ref(
19301 this: ::core::option::Option<&Self>,
19302 encoder: &mut ___E,
19303 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19304 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19305 if let Some(inner) = this {
19306 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19307 ::fidl_next::WireBox::encode_present(out);
19308 } else {
19309 ::fidl_next::WireBox::encode_absent(out);
19310 }
19311
19312 Ok(())
19313 }
19314}
19315
19316impl<'de> ::fidl_next::FromWire<WireExtendedAttributeIteratorGetNextResponse<'de>>
19317 for ExtendedAttributeIteratorGetNextResponse
19318{
19319 #[inline]
19320 fn from_wire(wire: WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
19321 Self {
19322 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
19323
19324 last: ::fidl_next::FromWire::from_wire(wire.last),
19325 }
19326 }
19327}
19328
19329impl<'de> ::fidl_next::IntoNatural for WireExtendedAttributeIteratorGetNextResponse<'de> {
19330 type Natural = ExtendedAttributeIteratorGetNextResponse;
19331}
19332
19333impl<'de> ::fidl_next::FromWireRef<WireExtendedAttributeIteratorGetNextResponse<'de>>
19334 for ExtendedAttributeIteratorGetNextResponse
19335{
19336 #[inline]
19337 fn from_wire_ref(wire: &WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
19338 Self {
19339 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
19340
19341 last: ::fidl_next::FromWireRef::from_wire_ref(&wire.last),
19342 }
19343 }
19344}
19345
19346#[derive(Debug)]
19348#[repr(C)]
19349pub struct WireExtendedAttributeIteratorGetNextResponse<'de> {
19350 pub attributes: ::fidl_next::WireVector<'de, ::fidl_next::WireVector<'de, u8>>,
19351
19352 pub last: bool,
19353}
19354static_assertions::const_assert_eq!(
19355 std::mem::size_of::<WireExtendedAttributeIteratorGetNextResponse<'_>>(),
19356 24
19357);
19358static_assertions::const_assert_eq!(
19359 std::mem::align_of::<WireExtendedAttributeIteratorGetNextResponse<'_>>(),
19360 8
19361);
19362
19363static_assertions::const_assert_eq!(
19364 std::mem::offset_of!(WireExtendedAttributeIteratorGetNextResponse<'_>, attributes),
19365 0
19366);
19367
19368static_assertions::const_assert_eq!(
19369 std::mem::offset_of!(WireExtendedAttributeIteratorGetNextResponse<'_>, last),
19370 16
19371);
19372
19373unsafe impl ::fidl_next::Wire for WireExtendedAttributeIteratorGetNextResponse<'static> {
19374 type Decoded<'de> = WireExtendedAttributeIteratorGetNextResponse<'de>;
19375
19376 #[inline]
19377 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
19378 ::fidl_next::munge! {
19379 let Self {
19380
19381 attributes,
19382 last,
19383
19384 } = &mut *out_;
19385 }
19386
19387 ::fidl_next::Wire::zero_padding(attributes);
19388
19389 ::fidl_next::Wire::zero_padding(last);
19390
19391 unsafe {
19392 out_.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
19393 }
19394 }
19395}
19396
19397unsafe impl<___D> ::fidl_next::Decode<___D>
19398 for WireExtendedAttributeIteratorGetNextResponse<'static>
19399where
19400 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19401 ___D: ::fidl_next::Decoder,
19402{
19403 fn decode(
19404 slot_: ::fidl_next::Slot<'_, Self>,
19405 decoder_: &mut ___D,
19406 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19407 ::fidl_next::munge! {
19408 let Self {
19409
19410 mut attributes,
19411 mut last,
19412
19413 } = slot_;
19414 }
19415
19416 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_)?;
19417
19418 let attributes = unsafe { attributes.deref_unchecked() };
19419
19420 if attributes.len() > 128 {
19421 return Err(::fidl_next::DecodeError::VectorTooLong {
19422 size: attributes.len() as u64,
19423 limit: 128,
19424 });
19425 }
19426
19427 ::fidl_next::Decode::decode(last.as_mut(), decoder_)?;
19428
19429 Ok(())
19430 }
19431}
19432
19433#[derive(PartialEq, Debug)]
19435pub struct ExtendedAttributeIterator;
19436
19437pub mod extended_attribute_iterator {
19438 pub mod prelude {
19439 pub use crate::{
19440 ExtendedAttributeIterator, ExtendedAttributeIteratorClientHandler,
19441 ExtendedAttributeIteratorServerHandler, extended_attribute_iterator,
19442 };
19443
19444 pub use crate::ExtendedAttributeIteratorGetNextResponse;
19445 }
19446
19447 pub struct GetNext;
19448
19449 impl ::fidl_next::Method for GetNext {
19450 const ORDINAL: u64 = 268639596268373415;
19451
19452 type Protocol = crate::ExtendedAttributeIterator;
19453
19454 type Request = ();
19455
19456 type Response = ::fidl_next::WireResult<
19457 'static,
19458 crate::WireExtendedAttributeIteratorGetNextResponse<'static>,
19459 ::fidl_next::WireI32,
19460 >;
19461 }
19462
19463 mod ___detail {
19464
19465 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ExtendedAttributeIterator
19466 where
19467 ___T: ::fidl_next::Transport,
19468 {
19469 type Client = ExtendedAttributeIteratorClient<___T>;
19470 type Server = ExtendedAttributeIteratorServer<___T>;
19471 }
19472
19473 #[repr(transparent)]
19475 pub struct ExtendedAttributeIteratorClient<___T: ::fidl_next::Transport> {
19476 #[allow(dead_code)]
19477 client: ::fidl_next::protocol::Client<___T>,
19478 }
19479
19480 impl<___T> ExtendedAttributeIteratorClient<___T>
19481 where
19482 ___T: ::fidl_next::Transport,
19483 {
19484 #[doc = " Get the next chunk of extended attribute names. If this is the last\n chunk, last will be true, and the channel will be closed after the\n call.\n"]
19485 pub fn get_next(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetNext, ___T> {
19486 ::fidl_next::TwoWayFuture::from_untyped(
19487 self.client.send_two_way(268639596268373415, ()),
19488 )
19489 }
19490 }
19491
19492 #[repr(transparent)]
19494 pub struct ExtendedAttributeIteratorServer<___T: ::fidl_next::Transport> {
19495 server: ::fidl_next::protocol::Server<___T>,
19496 }
19497
19498 impl<___T> ExtendedAttributeIteratorServer<___T> where ___T: ::fidl_next::Transport {}
19499 }
19500}
19501
19502pub trait ExtendedAttributeIteratorClientHandler<
19506 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
19507 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19508>
19509{
19510}
19511
19512impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ExtendedAttributeIterator
19513where
19514 ___H: ExtendedAttributeIteratorClientHandler<___T> + ::core::marker::Send,
19515 ___T: ::fidl_next::Transport,
19516 <extended_attribute_iterator::GetNext as ::fidl_next::Method>::Response:
19517 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19518{
19519 async fn on_event(
19520 handler: &mut ___H,
19521 ordinal: u64,
19522 buffer: ___T::RecvBuffer,
19523 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
19524 match ordinal {
19525 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
19526 }
19527 }
19528}
19529
19530pub trait ExtendedAttributeIteratorServerHandler<
19534 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
19535 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19536>
19537{
19538 #[doc = " Get the next chunk of extended attribute names. If this is the last\n chunk, last will be true, and the channel will be closed after the\n call.\n"]
19539 fn get_next(
19540 &mut self,
19541
19542 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext, ___T>,
19543 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19544}
19545
19546impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ExtendedAttributeIterator
19547where
19548 ___H: ExtendedAttributeIteratorServerHandler<___T> + ::core::marker::Send,
19549 ___T: ::fidl_next::Transport,
19550{
19551 async fn on_one_way(
19552 handler: &mut ___H,
19553 ordinal: u64,
19554 buffer: ___T::RecvBuffer,
19555 ) -> ::core::result::Result<
19556 (),
19557 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19558 > {
19559 match ordinal {
19560 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
19561 }
19562 }
19563
19564 async fn on_two_way(
19565 handler: &mut ___H,
19566 ordinal: u64,
19567 buffer: ___T::RecvBuffer,
19568 responder: ::fidl_next::protocol::Responder<___T>,
19569 ) -> ::core::result::Result<
19570 (),
19571 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19572 > {
19573 match ordinal {
19574 268639596268373415 => {
19575 let responder = ::fidl_next::Responder::from_untyped(responder);
19576
19577 handler.get_next(responder).await;
19578 Ok(())
19579 }
19580
19581 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
19582 }
19583 }
19584}
19585
19586pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
19587
19588#[doc = " Specifies that this object is not linkable. This is only intended to be used in the context of\n creating a temporary unnamed objects. When that is not the case, the node protocol defines if it\n is linkable (i.e. if it composes the `Linkable` protocol). When this flag is set along with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`, an unnamed temporary object will be created that\n cannot be linked into the filesystem. This would be similar to Linux `O_TMPFILE | O_EXCL`.\n\n CAUTION: if `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY` is not specified, then this is treated as\n a \"must create\" flag.\n\n The reason for overloading `Flags.FLAG_MUST_CREATE` to mean \"not linkable\" in this context and\n \"must create\" in other contexts is due to the assumption that some POSIX flags are compatible\n with the members in `Flags`. In particular the POSIX `O_EXCL` has the same value as\n `Flags.FLAG_MUST_CREATE`. We are not able to define different bit members of the same value,\n hence it is defined separately outside of `Flags`.\n"]
19589pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: crate::Flags = crate::Flags::FLAG_MUST_CREATE;
19590
19591#[derive(PartialEq, Clone, Debug)]
19592#[repr(C)]
19593pub struct ReadableReadRequest {
19594 pub count: u64,
19595}
19596
19597impl ::fidl_next::Encodable for ReadableReadRequest {
19598 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireReadableReadRequest> = unsafe {
19599 ::fidl_next::CopyOptimization::enable_if(
19600 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
19601 )
19602 };
19603
19604 type Encoded = WireReadableReadRequest;
19605}
19606
19607unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadRequest
19608where
19609 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19610{
19611 #[inline]
19612 fn encode(
19613 self,
19614 encoder_: &mut ___E,
19615 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19616 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19617 ::fidl_next::munge! {
19618 let Self::Encoded {
19619 count,
19620
19621 } = out_;
19622 }
19623
19624 ::fidl_next::Encode::encode(self.count, encoder_, count)?;
19625
19626 Ok(())
19627 }
19628}
19629
19630unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadRequest
19631where
19632 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19633{
19634 #[inline]
19635 fn encode_ref(
19636 &self,
19637 encoder_: &mut ___E,
19638 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19639 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19640 ::fidl_next::munge! {
19641 let Self::Encoded {
19642
19643 count,
19644
19645 } = out_;
19646 }
19647
19648 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder_, count)?;
19649
19650 Ok(())
19651 }
19652}
19653
19654impl ::fidl_next::EncodableOption for ReadableReadRequest {
19655 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadRequest>;
19656}
19657
19658unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadRequest
19659where
19660 ___E: ::fidl_next::Encoder + ?Sized,
19661 ReadableReadRequest: ::fidl_next::Encode<___E>,
19662{
19663 #[inline]
19664 fn encode_option(
19665 this: ::core::option::Option<Self>,
19666 encoder: &mut ___E,
19667 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19668 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19669 if let Some(inner) = this {
19670 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19671 ::fidl_next::WireBox::encode_present(out);
19672 } else {
19673 ::fidl_next::WireBox::encode_absent(out);
19674 }
19675
19676 Ok(())
19677 }
19678}
19679
19680unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadRequest
19681where
19682 ___E: ::fidl_next::Encoder + ?Sized,
19683 ReadableReadRequest: ::fidl_next::EncodeRef<___E>,
19684{
19685 #[inline]
19686 fn encode_option_ref(
19687 this: ::core::option::Option<&Self>,
19688 encoder: &mut ___E,
19689 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19690 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19691 if let Some(inner) = this {
19692 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19693 ::fidl_next::WireBox::encode_present(out);
19694 } else {
19695 ::fidl_next::WireBox::encode_absent(out);
19696 }
19697
19698 Ok(())
19699 }
19700}
19701
19702impl ::fidl_next::FromWire<WireReadableReadRequest> for ReadableReadRequest {
19703 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireReadableReadRequest, Self> = unsafe {
19704 ::fidl_next::CopyOptimization::enable_if(
19705 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
19706 .is_enabled(),
19707 )
19708 };
19709
19710 #[inline]
19711 fn from_wire(wire: WireReadableReadRequest) -> Self {
19712 Self { count: ::fidl_next::FromWire::from_wire(wire.count) }
19713 }
19714}
19715
19716impl ::fidl_next::IntoNatural for WireReadableReadRequest {
19717 type Natural = ReadableReadRequest;
19718}
19719
19720impl ::fidl_next::FromWireRef<WireReadableReadRequest> for ReadableReadRequest {
19721 #[inline]
19722 fn from_wire_ref(wire: &WireReadableReadRequest) -> Self {
19723 Self { count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count) }
19724 }
19725}
19726
19727#[derive(Clone, Debug)]
19729#[repr(C)]
19730pub struct WireReadableReadRequest {
19731 pub count: ::fidl_next::WireU64,
19732}
19733static_assertions::const_assert_eq!(std::mem::size_of::<WireReadableReadRequest>(), 8);
19734static_assertions::const_assert_eq!(std::mem::align_of::<WireReadableReadRequest>(), 8);
19735
19736static_assertions::const_assert_eq!(std::mem::offset_of!(WireReadableReadRequest, count), 0);
19737
19738unsafe impl ::fidl_next::Wire for WireReadableReadRequest {
19739 type Decoded<'de> = WireReadableReadRequest;
19740
19741 #[inline]
19742 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
19743 ::fidl_next::munge! {
19744 let Self {
19745
19746 count,
19747
19748 } = &mut *out_;
19749 }
19750
19751 ::fidl_next::Wire::zero_padding(count);
19752 }
19753}
19754
19755unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadRequest
19756where
19757 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19758{
19759 fn decode(
19760 slot_: ::fidl_next::Slot<'_, Self>,
19761 decoder_: &mut ___D,
19762 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19763 ::fidl_next::munge! {
19764 let Self {
19765
19766 mut count,
19767
19768 } = slot_;
19769 }
19770
19771 ::fidl_next::Decode::decode(count.as_mut(), decoder_)?;
19772
19773 Ok(())
19774 }
19775}
19776
19777#[doc = " The maximum I/O size that is allowed for read/write operations using\n byte vectors.\n"]
19778pub const MAX_TRANSFER_SIZE: u64 = 8192 as u64;
19779
19780#[doc = " The byte vector type used for read/write operations.\n"]
19781pub type Transfer = ::std::vec::Vec<u8>;
19782
19783pub type WireTransfer<'de> = ::fidl_next::WireVector<'de, u8>;
19785
19786#[derive(PartialEq, Clone, Debug)]
19787pub struct ReadableReadResponse {
19788 pub data: ::std::vec::Vec<u8>,
19789}
19790
19791impl ::fidl_next::Encodable for ReadableReadResponse {
19792 type Encoded = WireReadableReadResponse<'static>;
19793}
19794
19795unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadResponse
19796where
19797 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19798 ___E: ::fidl_next::Encoder,
19799{
19800 #[inline]
19801 fn encode(
19802 self,
19803 encoder_: &mut ___E,
19804 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19805 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19806 ::fidl_next::munge! {
19807 let Self::Encoded {
19808 data,
19809
19810 } = out_;
19811 }
19812
19813 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
19814
19815 Ok(())
19816 }
19817}
19818
19819unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadResponse
19820where
19821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19822 ___E: ::fidl_next::Encoder,
19823{
19824 #[inline]
19825 fn encode_ref(
19826 &self,
19827 encoder_: &mut ___E,
19828 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19829 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19830 ::fidl_next::munge! {
19831 let Self::Encoded {
19832
19833 data,
19834
19835 } = out_;
19836 }
19837
19838 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder_, data)?;
19839
19840 Ok(())
19841 }
19842}
19843
19844impl ::fidl_next::EncodableOption for ReadableReadResponse {
19845 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadResponse<'static>>;
19846}
19847
19848unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadResponse
19849where
19850 ___E: ::fidl_next::Encoder + ?Sized,
19851 ReadableReadResponse: ::fidl_next::Encode<___E>,
19852{
19853 #[inline]
19854 fn encode_option(
19855 this: ::core::option::Option<Self>,
19856 encoder: &mut ___E,
19857 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19858 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19859 if let Some(inner) = this {
19860 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19861 ::fidl_next::WireBox::encode_present(out);
19862 } else {
19863 ::fidl_next::WireBox::encode_absent(out);
19864 }
19865
19866 Ok(())
19867 }
19868}
19869
19870unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadResponse
19871where
19872 ___E: ::fidl_next::Encoder + ?Sized,
19873 ReadableReadResponse: ::fidl_next::EncodeRef<___E>,
19874{
19875 #[inline]
19876 fn encode_option_ref(
19877 this: ::core::option::Option<&Self>,
19878 encoder: &mut ___E,
19879 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19880 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19881 if let Some(inner) = this {
19882 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19883 ::fidl_next::WireBox::encode_present(out);
19884 } else {
19885 ::fidl_next::WireBox::encode_absent(out);
19886 }
19887
19888 Ok(())
19889 }
19890}
19891
19892impl<'de> ::fidl_next::FromWire<WireReadableReadResponse<'de>> for ReadableReadResponse {
19893 #[inline]
19894 fn from_wire(wire: WireReadableReadResponse<'de>) -> Self {
19895 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
19896 }
19897}
19898
19899impl<'de> ::fidl_next::IntoNatural for WireReadableReadResponse<'de> {
19900 type Natural = ReadableReadResponse;
19901}
19902
19903impl<'de> ::fidl_next::FromWireRef<WireReadableReadResponse<'de>> for ReadableReadResponse {
19904 #[inline]
19905 fn from_wire_ref(wire: &WireReadableReadResponse<'de>) -> Self {
19906 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
19907 }
19908}
19909
19910#[derive(Debug)]
19912#[repr(C)]
19913pub struct WireReadableReadResponse<'de> {
19914 pub data: ::fidl_next::WireVector<'de, u8>,
19915}
19916static_assertions::const_assert_eq!(std::mem::size_of::<WireReadableReadResponse<'_>>(), 16);
19917static_assertions::const_assert_eq!(std::mem::align_of::<WireReadableReadResponse<'_>>(), 8);
19918
19919static_assertions::const_assert_eq!(std::mem::offset_of!(WireReadableReadResponse<'_>, data), 0);
19920
19921unsafe impl ::fidl_next::Wire for WireReadableReadResponse<'static> {
19922 type Decoded<'de> = WireReadableReadResponse<'de>;
19923
19924 #[inline]
19925 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
19926 ::fidl_next::munge! {
19927 let Self {
19928
19929 data,
19930
19931 } = &mut *out_;
19932 }
19933
19934 ::fidl_next::Wire::zero_padding(data);
19935 }
19936}
19937
19938unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadResponse<'static>
19939where
19940 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19941 ___D: ::fidl_next::Decoder,
19942{
19943 fn decode(
19944 slot_: ::fidl_next::Slot<'_, Self>,
19945 decoder_: &mut ___D,
19946 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19947 ::fidl_next::munge! {
19948 let Self {
19949
19950 mut data,
19951
19952 } = slot_;
19953 }
19954
19955 ::fidl_next::Decode::decode(data.as_mut(), decoder_)?;
19956
19957 let data = unsafe { data.deref_unchecked() };
19958
19959 if data.len() > 8192 {
19960 return Err(::fidl_next::DecodeError::VectorTooLong {
19961 size: data.len() as u64,
19962 limit: 8192,
19963 });
19964 }
19965
19966 Ok(())
19967 }
19968}
19969
19970#[derive(PartialEq, Debug)]
19972pub struct Readable;
19973
19974pub mod readable {
19975 pub mod prelude {
19976 pub use crate::{Readable, ReadableClientHandler, ReadableServerHandler, readable};
19977
19978 pub use crate::ReadableReadRequest;
19979
19980 pub use crate::ReadableReadResponse;
19981 }
19982
19983 pub struct Read;
19984
19985 impl ::fidl_next::Method for Read {
19986 const ORDINAL: u64 = 395825947633028830;
19987
19988 type Protocol = crate::Readable;
19989
19990 type Request = crate::WireReadableReadRequest;
19991
19992 type Response = ::fidl_next::WireResult<
19993 'static,
19994 crate::WireReadableReadResponse<'static>,
19995 ::fidl_next::WireI32,
19996 >;
19997 }
19998
19999 mod ___detail {
20000
20001 pub struct Read<T0> {
20002 count: T0,
20003 }
20004
20005 impl<T0> ::fidl_next::Encodable for Read<T0>
20006 where
20007 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
20008 {
20009 type Encoded = crate::WireReadableReadRequest;
20010 }
20011
20012 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
20013 where
20014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20015 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
20016 {
20017 #[inline]
20018 fn encode(
20019 self,
20020 encoder_: &mut ___E,
20021 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20022 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20023 ::fidl_next::munge! {
20024 let Self::Encoded {
20025 count,
20026
20027 } = out_;
20028 }
20029
20030 ::fidl_next::Encode::encode(self.count, encoder_, count)?;
20031
20032 Ok(())
20033 }
20034 }
20035
20036 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Readable
20037 where
20038 ___T: ::fidl_next::Transport,
20039 {
20040 type Client = ReadableClient<___T>;
20041 type Server = ReadableServer<___T>;
20042 }
20043
20044 #[repr(transparent)]
20046 pub struct ReadableClient<___T: ::fidl_next::Transport> {
20047 #[allow(dead_code)]
20048 client: ::fidl_next::protocol::Client<___T>,
20049 }
20050
20051 impl<___T> ReadableClient<___T>
20052 where
20053 ___T: ::fidl_next::Transport,
20054 {
20055 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
20056 pub fn read(
20057 &self,
20058
20059 count: impl ::fidl_next::Encode<
20060 <___T as ::fidl_next::Transport>::SendBuffer,
20061 Encoded = ::fidl_next::WireU64,
20062 >,
20063 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
20064 where
20065 <___T as ::fidl_next::Transport>::SendBuffer:
20066 ::fidl_next::encoder::InternalHandleEncoder,
20067 {
20068 self.read_with(Read { count })
20069 }
20070
20071 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
20072 pub fn read_with<___R>(
20073 &self,
20074 request: ___R,
20075 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
20076 where
20077 ___R: ::fidl_next::Encode<
20078 <___T as ::fidl_next::Transport>::SendBuffer,
20079 Encoded = crate::WireReadableReadRequest,
20080 >,
20081 {
20082 ::fidl_next::TwoWayFuture::from_untyped(
20083 self.client.send_two_way(395825947633028830, request),
20084 )
20085 }
20086 }
20087
20088 #[repr(transparent)]
20090 pub struct ReadableServer<___T: ::fidl_next::Transport> {
20091 server: ::fidl_next::protocol::Server<___T>,
20092 }
20093
20094 impl<___T> ReadableServer<___T> where ___T: ::fidl_next::Transport {}
20095 }
20096}
20097
20098pub trait ReadableClientHandler<
20102 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
20103 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
20104>
20105{
20106}
20107
20108impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Readable
20109where
20110 ___H: ReadableClientHandler<___T> + ::core::marker::Send,
20111 ___T: ::fidl_next::Transport,
20112 <readable::Read as ::fidl_next::Method>::Response:
20113 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20114{
20115 async fn on_event(
20116 handler: &mut ___H,
20117 ordinal: u64,
20118 buffer: ___T::RecvBuffer,
20119 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
20120 match ordinal {
20121 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20122 }
20123 }
20124}
20125
20126pub trait ReadableServerHandler<
20130 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
20131 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
20132>
20133{
20134 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
20135 fn read(
20136 &mut self,
20137
20138 request: ::fidl_next::Request<readable::Read, ___T>,
20139
20140 responder: ::fidl_next::Responder<readable::Read, ___T>,
20141 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
20142}
20143
20144impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Readable
20145where
20146 ___H: ReadableServerHandler<___T> + ::core::marker::Send,
20147 ___T: ::fidl_next::Transport,
20148 <readable::Read as ::fidl_next::Method>::Request:
20149 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20150{
20151 async fn on_one_way(
20152 handler: &mut ___H,
20153 ordinal: u64,
20154 buffer: ___T::RecvBuffer,
20155 ) -> ::core::result::Result<
20156 (),
20157 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
20158 > {
20159 match ordinal {
20160 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20161 }
20162 }
20163
20164 async fn on_two_way(
20165 handler: &mut ___H,
20166 ordinal: u64,
20167 buffer: ___T::RecvBuffer,
20168 responder: ::fidl_next::protocol::Responder<___T>,
20169 ) -> ::core::result::Result<
20170 (),
20171 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
20172 > {
20173 match ordinal {
20174 395825947633028830 => {
20175 let responder = ::fidl_next::Responder::from_untyped(responder);
20176
20177 match ::fidl_next::DecoderExt::decode(buffer) {
20178 Ok(decoded) => {
20179 handler.read(decoded, responder).await;
20180 Ok(())
20181 }
20182 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
20183 ordinal: 395825947633028830,
20184 error,
20185 }),
20186 }
20187 }
20188
20189 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20190 }
20191 }
20192}
20193
20194#[derive(PartialEq, Clone, Debug)]
20195pub struct WritableWriteRequest {
20196 pub data: ::std::vec::Vec<u8>,
20197}
20198
20199impl ::fidl_next::Encodable for WritableWriteRequest {
20200 type Encoded = WireWritableWriteRequest<'static>;
20201}
20202
20203unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteRequest
20204where
20205 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20206 ___E: ::fidl_next::Encoder,
20207{
20208 #[inline]
20209 fn encode(
20210 self,
20211 encoder_: &mut ___E,
20212 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20213 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20214 ::fidl_next::munge! {
20215 let Self::Encoded {
20216 data,
20217
20218 } = out_;
20219 }
20220
20221 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
20222
20223 Ok(())
20224 }
20225}
20226
20227unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteRequest
20228where
20229 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20230 ___E: ::fidl_next::Encoder,
20231{
20232 #[inline]
20233 fn encode_ref(
20234 &self,
20235 encoder_: &mut ___E,
20236 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20237 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20238 ::fidl_next::munge! {
20239 let Self::Encoded {
20240
20241 data,
20242
20243 } = out_;
20244 }
20245
20246 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder_, data)?;
20247
20248 Ok(())
20249 }
20250}
20251
20252impl ::fidl_next::EncodableOption for WritableWriteRequest {
20253 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteRequest<'static>>;
20254}
20255
20256unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteRequest
20257where
20258 ___E: ::fidl_next::Encoder + ?Sized,
20259 WritableWriteRequest: ::fidl_next::Encode<___E>,
20260{
20261 #[inline]
20262 fn encode_option(
20263 this: ::core::option::Option<Self>,
20264 encoder: &mut ___E,
20265 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20267 if let Some(inner) = this {
20268 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20269 ::fidl_next::WireBox::encode_present(out);
20270 } else {
20271 ::fidl_next::WireBox::encode_absent(out);
20272 }
20273
20274 Ok(())
20275 }
20276}
20277
20278unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteRequest
20279where
20280 ___E: ::fidl_next::Encoder + ?Sized,
20281 WritableWriteRequest: ::fidl_next::EncodeRef<___E>,
20282{
20283 #[inline]
20284 fn encode_option_ref(
20285 this: ::core::option::Option<&Self>,
20286 encoder: &mut ___E,
20287 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20288 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20289 if let Some(inner) = this {
20290 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20291 ::fidl_next::WireBox::encode_present(out);
20292 } else {
20293 ::fidl_next::WireBox::encode_absent(out);
20294 }
20295
20296 Ok(())
20297 }
20298}
20299
20300impl<'de> ::fidl_next::FromWire<WireWritableWriteRequest<'de>> for WritableWriteRequest {
20301 #[inline]
20302 fn from_wire(wire: WireWritableWriteRequest<'de>) -> Self {
20303 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
20304 }
20305}
20306
20307impl<'de> ::fidl_next::IntoNatural for WireWritableWriteRequest<'de> {
20308 type Natural = WritableWriteRequest;
20309}
20310
20311impl<'de> ::fidl_next::FromWireRef<WireWritableWriteRequest<'de>> for WritableWriteRequest {
20312 #[inline]
20313 fn from_wire_ref(wire: &WireWritableWriteRequest<'de>) -> Self {
20314 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
20315 }
20316}
20317
20318#[derive(Debug)]
20320#[repr(C)]
20321pub struct WireWritableWriteRequest<'de> {
20322 pub data: ::fidl_next::WireVector<'de, u8>,
20323}
20324static_assertions::const_assert_eq!(std::mem::size_of::<WireWritableWriteRequest<'_>>(), 16);
20325static_assertions::const_assert_eq!(std::mem::align_of::<WireWritableWriteRequest<'_>>(), 8);
20326
20327static_assertions::const_assert_eq!(std::mem::offset_of!(WireWritableWriteRequest<'_>, data), 0);
20328
20329unsafe impl ::fidl_next::Wire for WireWritableWriteRequest<'static> {
20330 type Decoded<'de> = WireWritableWriteRequest<'de>;
20331
20332 #[inline]
20333 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
20334 ::fidl_next::munge! {
20335 let Self {
20336
20337 data,
20338
20339 } = &mut *out_;
20340 }
20341
20342 ::fidl_next::Wire::zero_padding(data);
20343 }
20344}
20345
20346unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteRequest<'static>
20347where
20348 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20349 ___D: ::fidl_next::Decoder,
20350{
20351 fn decode(
20352 slot_: ::fidl_next::Slot<'_, Self>,
20353 decoder_: &mut ___D,
20354 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
20355 ::fidl_next::munge! {
20356 let Self {
20357
20358 mut data,
20359
20360 } = slot_;
20361 }
20362
20363 ::fidl_next::Decode::decode(data.as_mut(), decoder_)?;
20364
20365 let data = unsafe { data.deref_unchecked() };
20366
20367 if data.len() > 8192 {
20368 return Err(::fidl_next::DecodeError::VectorTooLong {
20369 size: data.len() as u64,
20370 limit: 8192,
20371 });
20372 }
20373
20374 Ok(())
20375 }
20376}
20377
20378#[derive(PartialEq, Clone, Debug)]
20379#[repr(C)]
20380pub struct WritableWriteResponse {
20381 pub actual_count: u64,
20382}
20383
20384impl ::fidl_next::Encodable for WritableWriteResponse {
20385 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireWritableWriteResponse> = unsafe {
20386 ::fidl_next::CopyOptimization::enable_if(
20387 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20388 )
20389 };
20390
20391 type Encoded = WireWritableWriteResponse;
20392}
20393
20394unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteResponse
20395where
20396 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20397{
20398 #[inline]
20399 fn encode(
20400 self,
20401 encoder_: &mut ___E,
20402 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20404 ::fidl_next::munge! {
20405 let Self::Encoded {
20406 actual_count,
20407
20408 } = out_;
20409 }
20410
20411 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count)?;
20412
20413 Ok(())
20414 }
20415}
20416
20417unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteResponse
20418where
20419 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20420{
20421 #[inline]
20422 fn encode_ref(
20423 &self,
20424 encoder_: &mut ___E,
20425 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20426 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20427 ::fidl_next::munge! {
20428 let Self::Encoded {
20429
20430 actual_count,
20431
20432 } = out_;
20433 }
20434
20435 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder_, actual_count)?;
20436
20437 Ok(())
20438 }
20439}
20440
20441impl ::fidl_next::EncodableOption for WritableWriteResponse {
20442 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteResponse>;
20443}
20444
20445unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteResponse
20446where
20447 ___E: ::fidl_next::Encoder + ?Sized,
20448 WritableWriteResponse: ::fidl_next::Encode<___E>,
20449{
20450 #[inline]
20451 fn encode_option(
20452 this: ::core::option::Option<Self>,
20453 encoder: &mut ___E,
20454 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20456 if let Some(inner) = this {
20457 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20458 ::fidl_next::WireBox::encode_present(out);
20459 } else {
20460 ::fidl_next::WireBox::encode_absent(out);
20461 }
20462
20463 Ok(())
20464 }
20465}
20466
20467unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteResponse
20468where
20469 ___E: ::fidl_next::Encoder + ?Sized,
20470 WritableWriteResponse: ::fidl_next::EncodeRef<___E>,
20471{
20472 #[inline]
20473 fn encode_option_ref(
20474 this: ::core::option::Option<&Self>,
20475 encoder: &mut ___E,
20476 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20477 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20478 if let Some(inner) = this {
20479 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20480 ::fidl_next::WireBox::encode_present(out);
20481 } else {
20482 ::fidl_next::WireBox::encode_absent(out);
20483 }
20484
20485 Ok(())
20486 }
20487}
20488
20489impl ::fidl_next::FromWire<WireWritableWriteResponse> for WritableWriteResponse {
20490 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireWritableWriteResponse, Self> = unsafe {
20491 ::fidl_next::CopyOptimization::enable_if(
20492 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20493 .is_enabled(),
20494 )
20495 };
20496
20497 #[inline]
20498 fn from_wire(wire: WireWritableWriteResponse) -> Self {
20499 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
20500 }
20501}
20502
20503impl ::fidl_next::IntoNatural for WireWritableWriteResponse {
20504 type Natural = WritableWriteResponse;
20505}
20506
20507impl ::fidl_next::FromWireRef<WireWritableWriteResponse> for WritableWriteResponse {
20508 #[inline]
20509 fn from_wire_ref(wire: &WireWritableWriteResponse) -> Self {
20510 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
20511 }
20512}
20513
20514#[derive(Clone, Debug)]
20516#[repr(C)]
20517pub struct WireWritableWriteResponse {
20518 pub actual_count: ::fidl_next::WireU64,
20519}
20520static_assertions::const_assert_eq!(std::mem::size_of::<WireWritableWriteResponse>(), 8);
20521static_assertions::const_assert_eq!(std::mem::align_of::<WireWritableWriteResponse>(), 8);
20522
20523static_assertions::const_assert_eq!(
20524 std::mem::offset_of!(WireWritableWriteResponse, actual_count),
20525 0
20526);
20527
20528unsafe impl ::fidl_next::Wire for WireWritableWriteResponse {
20529 type Decoded<'de> = WireWritableWriteResponse;
20530
20531 #[inline]
20532 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
20533 ::fidl_next::munge! {
20534 let Self {
20535
20536 actual_count,
20537
20538 } = &mut *out_;
20539 }
20540
20541 ::fidl_next::Wire::zero_padding(actual_count);
20542 }
20543}
20544
20545unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteResponse
20546where
20547 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20548{
20549 fn decode(
20550 slot_: ::fidl_next::Slot<'_, Self>,
20551 decoder_: &mut ___D,
20552 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
20553 ::fidl_next::munge! {
20554 let Self {
20555
20556 mut actual_count,
20557
20558 } = slot_;
20559 }
20560
20561 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder_)?;
20562
20563 Ok(())
20564 }
20565}
20566
20567#[derive(PartialEq, Debug)]
20569pub struct Writable;
20570
20571pub mod writable {
20572 pub mod prelude {
20573 pub use crate::{Writable, WritableClientHandler, WritableServerHandler, writable};
20574
20575 pub use crate::WritableWriteRequest;
20576
20577 pub use crate::WritableWriteResponse;
20578 }
20579
20580 pub struct Write;
20581
20582 impl ::fidl_next::Method for Write {
20583 const ORDINAL: u64 = 7651971425397809026;
20584
20585 type Protocol = crate::Writable;
20586
20587 type Request = crate::WireWritableWriteRequest<'static>;
20588
20589 type Response = ::fidl_next::WireResult<
20590 'static,
20591 crate::WireWritableWriteResponse,
20592 ::fidl_next::WireI32,
20593 >;
20594 }
20595
20596 mod ___detail {
20597
20598 pub struct Write<T0> {
20599 data: T0,
20600 }
20601
20602 impl<T0> ::fidl_next::Encodable for Write<T0>
20603 where
20604 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
20605 {
20606 type Encoded = crate::WireWritableWriteRequest<'static>;
20607 }
20608
20609 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
20610 where
20611 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20612 ___E: ::fidl_next::Encoder,
20613 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
20614 {
20615 #[inline]
20616 fn encode(
20617 self,
20618 encoder_: &mut ___E,
20619 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20620 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20621 ::fidl_next::munge! {
20622 let Self::Encoded {
20623 data,
20624
20625 } = out_;
20626 }
20627
20628 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
20629
20630 Ok(())
20631 }
20632 }
20633
20634 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Writable
20635 where
20636 ___T: ::fidl_next::Transport,
20637 {
20638 type Client = WritableClient<___T>;
20639 type Server = WritableServer<___T>;
20640 }
20641
20642 #[repr(transparent)]
20644 pub struct WritableClient<___T: ::fidl_next::Transport> {
20645 #[allow(dead_code)]
20646 client: ::fidl_next::protocol::Client<___T>,
20647 }
20648
20649 impl<___T> WritableClient<___T>
20650 where
20651 ___T: ::fidl_next::Transport,
20652 {
20653 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
20654 pub fn write(
20655 &self,
20656
20657 data: impl ::fidl_next::Encode<
20658 <___T as ::fidl_next::Transport>::SendBuffer,
20659 Encoded = ::fidl_next::WireVector<'static, u8>,
20660 >,
20661 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
20662 where
20663 <___T as ::fidl_next::Transport>::SendBuffer:
20664 ::fidl_next::encoder::InternalHandleEncoder,
20665 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
20666 {
20667 self.write_with(Write { data })
20668 }
20669
20670 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
20671 pub fn write_with<___R>(
20672 &self,
20673 request: ___R,
20674 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
20675 where
20676 ___R: ::fidl_next::Encode<
20677 <___T as ::fidl_next::Transport>::SendBuffer,
20678 Encoded = crate::WireWritableWriteRequest<'static>,
20679 >,
20680 {
20681 ::fidl_next::TwoWayFuture::from_untyped(
20682 self.client.send_two_way(7651971425397809026, request),
20683 )
20684 }
20685 }
20686
20687 #[repr(transparent)]
20689 pub struct WritableServer<___T: ::fidl_next::Transport> {
20690 server: ::fidl_next::protocol::Server<___T>,
20691 }
20692
20693 impl<___T> WritableServer<___T> where ___T: ::fidl_next::Transport {}
20694 }
20695}
20696
20697pub trait WritableClientHandler<
20701 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
20702 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
20703>
20704{
20705}
20706
20707impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Writable
20708where
20709 ___H: WritableClientHandler<___T> + ::core::marker::Send,
20710 ___T: ::fidl_next::Transport,
20711 <writable::Write as ::fidl_next::Method>::Response:
20712 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20713{
20714 async fn on_event(
20715 handler: &mut ___H,
20716 ordinal: u64,
20717 buffer: ___T::RecvBuffer,
20718 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
20719 match ordinal {
20720 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20721 }
20722 }
20723}
20724
20725pub trait WritableServerHandler<
20729 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
20730 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
20731>
20732{
20733 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
20734 fn write(
20735 &mut self,
20736
20737 request: ::fidl_next::Request<writable::Write, ___T>,
20738
20739 responder: ::fidl_next::Responder<writable::Write, ___T>,
20740 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
20741}
20742
20743impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Writable
20744where
20745 ___H: WritableServerHandler<___T> + ::core::marker::Send,
20746 ___T: ::fidl_next::Transport,
20747 <writable::Write as ::fidl_next::Method>::Request:
20748 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20749{
20750 async fn on_one_way(
20751 handler: &mut ___H,
20752 ordinal: u64,
20753 buffer: ___T::RecvBuffer,
20754 ) -> ::core::result::Result<
20755 (),
20756 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
20757 > {
20758 match ordinal {
20759 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20760 }
20761 }
20762
20763 async fn on_two_way(
20764 handler: &mut ___H,
20765 ordinal: u64,
20766 buffer: ___T::RecvBuffer,
20767 responder: ::fidl_next::protocol::Responder<___T>,
20768 ) -> ::core::result::Result<
20769 (),
20770 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
20771 > {
20772 match ordinal {
20773 7651971425397809026 => {
20774 let responder = ::fidl_next::Responder::from_untyped(responder);
20775
20776 match ::fidl_next::DecoderExt::decode(buffer) {
20777 Ok(decoded) => {
20778 handler.write(decoded, responder).await;
20779 Ok(())
20780 }
20781 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
20782 ordinal: 7651971425397809026,
20783 error,
20784 }),
20785 }
20786 }
20787
20788 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
20789 }
20790 }
20791}
20792
20793#[derive(PartialEq, Clone, Debug)]
20794pub struct FileSeekRequest {
20795 pub origin: crate::SeekOrigin,
20796
20797 pub offset: i64,
20798}
20799
20800impl ::fidl_next::Encodable for FileSeekRequest {
20801 type Encoded = WireFileSeekRequest;
20802}
20803
20804unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekRequest
20805where
20806 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20807{
20808 #[inline]
20809 fn encode(
20810 self,
20811 encoder_: &mut ___E,
20812 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20813 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20814 ::fidl_next::munge! {
20815 let Self::Encoded {
20816 origin,
20817 offset,
20818
20819 } = out_;
20820 }
20821
20822 ::fidl_next::Encode::encode(self.origin, encoder_, origin)?;
20823
20824 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
20825
20826 Ok(())
20827 }
20828}
20829
20830unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekRequest
20831where
20832 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20833{
20834 #[inline]
20835 fn encode_ref(
20836 &self,
20837 encoder_: &mut ___E,
20838 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20840 ::fidl_next::munge! {
20841 let Self::Encoded {
20842
20843 origin,
20844 offset,
20845
20846 } = out_;
20847 }
20848
20849 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder_, origin)?;
20850
20851 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder_, offset)?;
20852
20853 Ok(())
20854 }
20855}
20856
20857impl ::fidl_next::EncodableOption for FileSeekRequest {
20858 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekRequest>;
20859}
20860
20861unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekRequest
20862where
20863 ___E: ::fidl_next::Encoder + ?Sized,
20864 FileSeekRequest: ::fidl_next::Encode<___E>,
20865{
20866 #[inline]
20867 fn encode_option(
20868 this: ::core::option::Option<Self>,
20869 encoder: &mut ___E,
20870 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20871 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20872 if let Some(inner) = this {
20873 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20874 ::fidl_next::WireBox::encode_present(out);
20875 } else {
20876 ::fidl_next::WireBox::encode_absent(out);
20877 }
20878
20879 Ok(())
20880 }
20881}
20882
20883unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekRequest
20884where
20885 ___E: ::fidl_next::Encoder + ?Sized,
20886 FileSeekRequest: ::fidl_next::EncodeRef<___E>,
20887{
20888 #[inline]
20889 fn encode_option_ref(
20890 this: ::core::option::Option<&Self>,
20891 encoder: &mut ___E,
20892 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20893 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20894 if let Some(inner) = this {
20895 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20896 ::fidl_next::WireBox::encode_present(out);
20897 } else {
20898 ::fidl_next::WireBox::encode_absent(out);
20899 }
20900
20901 Ok(())
20902 }
20903}
20904
20905impl ::fidl_next::FromWire<WireFileSeekRequest> for FileSeekRequest {
20906 #[inline]
20907 fn from_wire(wire: WireFileSeekRequest) -> Self {
20908 Self {
20909 origin: ::fidl_next::FromWire::from_wire(wire.origin),
20910
20911 offset: ::fidl_next::FromWire::from_wire(wire.offset),
20912 }
20913 }
20914}
20915
20916impl ::fidl_next::IntoNatural for WireFileSeekRequest {
20917 type Natural = FileSeekRequest;
20918}
20919
20920impl ::fidl_next::FromWireRef<WireFileSeekRequest> for FileSeekRequest {
20921 #[inline]
20922 fn from_wire_ref(wire: &WireFileSeekRequest) -> Self {
20923 Self {
20924 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
20925
20926 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
20927 }
20928 }
20929}
20930
20931#[derive(Clone, Debug)]
20933#[repr(C)]
20934pub struct WireFileSeekRequest {
20935 pub origin: crate::WireSeekOrigin,
20936
20937 pub offset: ::fidl_next::WireI64,
20938}
20939static_assertions::const_assert_eq!(std::mem::size_of::<WireFileSeekRequest>(), 16);
20940static_assertions::const_assert_eq!(std::mem::align_of::<WireFileSeekRequest>(), 8);
20941
20942static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileSeekRequest, origin), 0);
20943
20944static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileSeekRequest, offset), 8);
20945
20946unsafe impl ::fidl_next::Wire for WireFileSeekRequest {
20947 type Decoded<'de> = WireFileSeekRequest;
20948
20949 #[inline]
20950 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
20951 ::fidl_next::munge! {
20952 let Self {
20953
20954 origin,
20955 offset,
20956
20957 } = &mut *out_;
20958 }
20959
20960 ::fidl_next::Wire::zero_padding(origin);
20961
20962 ::fidl_next::Wire::zero_padding(offset);
20963
20964 unsafe {
20965 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
20966 }
20967 }
20968}
20969
20970unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekRequest
20971where
20972 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20973{
20974 fn decode(
20975 slot_: ::fidl_next::Slot<'_, Self>,
20976 decoder_: &mut ___D,
20977 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
20978 ::fidl_next::munge! {
20979 let Self {
20980
20981 mut origin,
20982 mut offset,
20983
20984 } = slot_;
20985 }
20986
20987 ::fidl_next::Decode::decode(origin.as_mut(), decoder_)?;
20988
20989 ::fidl_next::Decode::decode(offset.as_mut(), decoder_)?;
20990
20991 Ok(())
20992 }
20993}
20994
20995#[derive(PartialEq, Clone, Debug)]
20996#[repr(C)]
20997pub struct FileSeekResponse {
20998 pub offset_from_start: u64,
20999}
21000
21001impl ::fidl_next::Encodable for FileSeekResponse {
21002 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileSeekResponse> = unsafe {
21003 ::fidl_next::CopyOptimization::enable_if(
21004 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21005 )
21006 };
21007
21008 type Encoded = WireFileSeekResponse;
21009}
21010
21011unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekResponse
21012where
21013 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21014{
21015 #[inline]
21016 fn encode(
21017 self,
21018 encoder_: &mut ___E,
21019 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21020 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21021 ::fidl_next::munge! {
21022 let Self::Encoded {
21023 offset_from_start,
21024
21025 } = out_;
21026 }
21027
21028 ::fidl_next::Encode::encode(self.offset_from_start, encoder_, offset_from_start)?;
21029
21030 Ok(())
21031 }
21032}
21033
21034unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekResponse
21035where
21036 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21037{
21038 #[inline]
21039 fn encode_ref(
21040 &self,
21041 encoder_: &mut ___E,
21042 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21043 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21044 ::fidl_next::munge! {
21045 let Self::Encoded {
21046
21047 offset_from_start,
21048
21049 } = out_;
21050 }
21051
21052 ::fidl_next::EncodeRef::encode_ref(&self.offset_from_start, encoder_, offset_from_start)?;
21053
21054 Ok(())
21055 }
21056}
21057
21058impl ::fidl_next::EncodableOption for FileSeekResponse {
21059 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekResponse>;
21060}
21061
21062unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekResponse
21063where
21064 ___E: ::fidl_next::Encoder + ?Sized,
21065 FileSeekResponse: ::fidl_next::Encode<___E>,
21066{
21067 #[inline]
21068 fn encode_option(
21069 this: ::core::option::Option<Self>,
21070 encoder: &mut ___E,
21071 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21072 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21073 if let Some(inner) = this {
21074 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21075 ::fidl_next::WireBox::encode_present(out);
21076 } else {
21077 ::fidl_next::WireBox::encode_absent(out);
21078 }
21079
21080 Ok(())
21081 }
21082}
21083
21084unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekResponse
21085where
21086 ___E: ::fidl_next::Encoder + ?Sized,
21087 FileSeekResponse: ::fidl_next::EncodeRef<___E>,
21088{
21089 #[inline]
21090 fn encode_option_ref(
21091 this: ::core::option::Option<&Self>,
21092 encoder: &mut ___E,
21093 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21094 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21095 if let Some(inner) = this {
21096 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21097 ::fidl_next::WireBox::encode_present(out);
21098 } else {
21099 ::fidl_next::WireBox::encode_absent(out);
21100 }
21101
21102 Ok(())
21103 }
21104}
21105
21106impl ::fidl_next::FromWire<WireFileSeekResponse> for FileSeekResponse {
21107 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileSeekResponse, Self> = unsafe {
21108 ::fidl_next::CopyOptimization::enable_if(
21109 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
21110 .is_enabled(),
21111 )
21112 };
21113
21114 #[inline]
21115 fn from_wire(wire: WireFileSeekResponse) -> Self {
21116 Self { offset_from_start: ::fidl_next::FromWire::from_wire(wire.offset_from_start) }
21117 }
21118}
21119
21120impl ::fidl_next::IntoNatural for WireFileSeekResponse {
21121 type Natural = FileSeekResponse;
21122}
21123
21124impl ::fidl_next::FromWireRef<WireFileSeekResponse> for FileSeekResponse {
21125 #[inline]
21126 fn from_wire_ref(wire: &WireFileSeekResponse) -> Self {
21127 Self { offset_from_start: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset_from_start) }
21128 }
21129}
21130
21131#[derive(Clone, Debug)]
21133#[repr(C)]
21134pub struct WireFileSeekResponse {
21135 pub offset_from_start: ::fidl_next::WireU64,
21136}
21137static_assertions::const_assert_eq!(std::mem::size_of::<WireFileSeekResponse>(), 8);
21138static_assertions::const_assert_eq!(std::mem::align_of::<WireFileSeekResponse>(), 8);
21139
21140static_assertions::const_assert_eq!(
21141 std::mem::offset_of!(WireFileSeekResponse, offset_from_start),
21142 0
21143);
21144
21145unsafe impl ::fidl_next::Wire for WireFileSeekResponse {
21146 type Decoded<'de> = WireFileSeekResponse;
21147
21148 #[inline]
21149 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21150 ::fidl_next::munge! {
21151 let Self {
21152
21153 offset_from_start,
21154
21155 } = &mut *out_;
21156 }
21157
21158 ::fidl_next::Wire::zero_padding(offset_from_start);
21159 }
21160}
21161
21162unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekResponse
21163where
21164 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21165{
21166 fn decode(
21167 slot_: ::fidl_next::Slot<'_, Self>,
21168 decoder_: &mut ___D,
21169 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21170 ::fidl_next::munge! {
21171 let Self {
21172
21173 mut offset_from_start,
21174
21175 } = slot_;
21176 }
21177
21178 ::fidl_next::Decode::decode(offset_from_start.as_mut(), decoder_)?;
21179
21180 Ok(())
21181 }
21182}
21183
21184#[derive(PartialEq, Clone, Debug)]
21185#[repr(C)]
21186pub struct FileReadAtRequest {
21187 pub count: u64,
21188
21189 pub offset: u64,
21190}
21191
21192impl ::fidl_next::Encodable for FileReadAtRequest {
21193 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileReadAtRequest> = unsafe {
21194 ::fidl_next::CopyOptimization::enable_if(
21195 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21196 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21197 )
21198 };
21199
21200 type Encoded = WireFileReadAtRequest;
21201}
21202
21203unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtRequest
21204where
21205 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21206{
21207 #[inline]
21208 fn encode(
21209 self,
21210 encoder_: &mut ___E,
21211 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21213 ::fidl_next::munge! {
21214 let Self::Encoded {
21215 count,
21216 offset,
21217
21218 } = out_;
21219 }
21220
21221 ::fidl_next::Encode::encode(self.count, encoder_, count)?;
21222
21223 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
21224
21225 Ok(())
21226 }
21227}
21228
21229unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtRequest
21230where
21231 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21232{
21233 #[inline]
21234 fn encode_ref(
21235 &self,
21236 encoder_: &mut ___E,
21237 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21238 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21239 ::fidl_next::munge! {
21240 let Self::Encoded {
21241
21242 count,
21243 offset,
21244
21245 } = out_;
21246 }
21247
21248 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder_, count)?;
21249
21250 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder_, offset)?;
21251
21252 Ok(())
21253 }
21254}
21255
21256impl ::fidl_next::EncodableOption for FileReadAtRequest {
21257 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtRequest>;
21258}
21259
21260unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtRequest
21261where
21262 ___E: ::fidl_next::Encoder + ?Sized,
21263 FileReadAtRequest: ::fidl_next::Encode<___E>,
21264{
21265 #[inline]
21266 fn encode_option(
21267 this: ::core::option::Option<Self>,
21268 encoder: &mut ___E,
21269 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21270 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21271 if let Some(inner) = this {
21272 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21273 ::fidl_next::WireBox::encode_present(out);
21274 } else {
21275 ::fidl_next::WireBox::encode_absent(out);
21276 }
21277
21278 Ok(())
21279 }
21280}
21281
21282unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileReadAtRequest
21283where
21284 ___E: ::fidl_next::Encoder + ?Sized,
21285 FileReadAtRequest: ::fidl_next::EncodeRef<___E>,
21286{
21287 #[inline]
21288 fn encode_option_ref(
21289 this: ::core::option::Option<&Self>,
21290 encoder: &mut ___E,
21291 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21292 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21293 if let Some(inner) = this {
21294 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21295 ::fidl_next::WireBox::encode_present(out);
21296 } else {
21297 ::fidl_next::WireBox::encode_absent(out);
21298 }
21299
21300 Ok(())
21301 }
21302}
21303
21304impl ::fidl_next::FromWire<WireFileReadAtRequest> for FileReadAtRequest {
21305 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileReadAtRequest, Self> = unsafe {
21306 ::fidl_next::CopyOptimization::enable_if(
21307 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
21308 .is_enabled()
21309 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
21310 .is_enabled(),
21311 )
21312 };
21313
21314 #[inline]
21315 fn from_wire(wire: WireFileReadAtRequest) -> Self {
21316 Self {
21317 count: ::fidl_next::FromWire::from_wire(wire.count),
21318
21319 offset: ::fidl_next::FromWire::from_wire(wire.offset),
21320 }
21321 }
21322}
21323
21324impl ::fidl_next::IntoNatural for WireFileReadAtRequest {
21325 type Natural = FileReadAtRequest;
21326}
21327
21328impl ::fidl_next::FromWireRef<WireFileReadAtRequest> for FileReadAtRequest {
21329 #[inline]
21330 fn from_wire_ref(wire: &WireFileReadAtRequest) -> Self {
21331 Self {
21332 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
21333
21334 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
21335 }
21336 }
21337}
21338
21339#[derive(Clone, Debug)]
21341#[repr(C)]
21342pub struct WireFileReadAtRequest {
21343 pub count: ::fidl_next::WireU64,
21344
21345 pub offset: ::fidl_next::WireU64,
21346}
21347static_assertions::const_assert_eq!(std::mem::size_of::<WireFileReadAtRequest>(), 16);
21348static_assertions::const_assert_eq!(std::mem::align_of::<WireFileReadAtRequest>(), 8);
21349
21350static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileReadAtRequest, count), 0);
21351
21352static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileReadAtRequest, offset), 8);
21353
21354unsafe impl ::fidl_next::Wire for WireFileReadAtRequest {
21355 type Decoded<'de> = WireFileReadAtRequest;
21356
21357 #[inline]
21358 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21359 ::fidl_next::munge! {
21360 let Self {
21361
21362 count,
21363 offset,
21364
21365 } = &mut *out_;
21366 }
21367
21368 ::fidl_next::Wire::zero_padding(count);
21369
21370 ::fidl_next::Wire::zero_padding(offset);
21371 }
21372}
21373
21374unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtRequest
21375where
21376 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21377{
21378 fn decode(
21379 slot_: ::fidl_next::Slot<'_, Self>,
21380 decoder_: &mut ___D,
21381 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21382 ::fidl_next::munge! {
21383 let Self {
21384
21385 mut count,
21386 mut offset,
21387
21388 } = slot_;
21389 }
21390
21391 ::fidl_next::Decode::decode(count.as_mut(), decoder_)?;
21392
21393 ::fidl_next::Decode::decode(offset.as_mut(), decoder_)?;
21394
21395 Ok(())
21396 }
21397}
21398
21399#[derive(PartialEq, Clone, Debug)]
21400pub struct FileReadAtResponse {
21401 pub data: ::std::vec::Vec<u8>,
21402}
21403
21404impl ::fidl_next::Encodable for FileReadAtResponse {
21405 type Encoded = WireFileReadAtResponse<'static>;
21406}
21407
21408unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtResponse
21409where
21410 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21411 ___E: ::fidl_next::Encoder,
21412{
21413 #[inline]
21414 fn encode(
21415 self,
21416 encoder_: &mut ___E,
21417 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21418 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21419 ::fidl_next::munge! {
21420 let Self::Encoded {
21421 data,
21422
21423 } = out_;
21424 }
21425
21426 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
21427
21428 Ok(())
21429 }
21430}
21431
21432unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtResponse
21433where
21434 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21435 ___E: ::fidl_next::Encoder,
21436{
21437 #[inline]
21438 fn encode_ref(
21439 &self,
21440 encoder_: &mut ___E,
21441 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21442 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21443 ::fidl_next::munge! {
21444 let Self::Encoded {
21445
21446 data,
21447
21448 } = out_;
21449 }
21450
21451 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder_, data)?;
21452
21453 Ok(())
21454 }
21455}
21456
21457impl ::fidl_next::EncodableOption for FileReadAtResponse {
21458 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtResponse<'static>>;
21459}
21460
21461unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtResponse
21462where
21463 ___E: ::fidl_next::Encoder + ?Sized,
21464 FileReadAtResponse: ::fidl_next::Encode<___E>,
21465{
21466 #[inline]
21467 fn encode_option(
21468 this: ::core::option::Option<Self>,
21469 encoder: &mut ___E,
21470 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21471 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21472 if let Some(inner) = this {
21473 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21474 ::fidl_next::WireBox::encode_present(out);
21475 } else {
21476 ::fidl_next::WireBox::encode_absent(out);
21477 }
21478
21479 Ok(())
21480 }
21481}
21482
21483unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileReadAtResponse
21484where
21485 ___E: ::fidl_next::Encoder + ?Sized,
21486 FileReadAtResponse: ::fidl_next::EncodeRef<___E>,
21487{
21488 #[inline]
21489 fn encode_option_ref(
21490 this: ::core::option::Option<&Self>,
21491 encoder: &mut ___E,
21492 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21493 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21494 if let Some(inner) = this {
21495 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21496 ::fidl_next::WireBox::encode_present(out);
21497 } else {
21498 ::fidl_next::WireBox::encode_absent(out);
21499 }
21500
21501 Ok(())
21502 }
21503}
21504
21505impl<'de> ::fidl_next::FromWire<WireFileReadAtResponse<'de>> for FileReadAtResponse {
21506 #[inline]
21507 fn from_wire(wire: WireFileReadAtResponse<'de>) -> Self {
21508 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
21509 }
21510}
21511
21512impl<'de> ::fidl_next::IntoNatural for WireFileReadAtResponse<'de> {
21513 type Natural = FileReadAtResponse;
21514}
21515
21516impl<'de> ::fidl_next::FromWireRef<WireFileReadAtResponse<'de>> for FileReadAtResponse {
21517 #[inline]
21518 fn from_wire_ref(wire: &WireFileReadAtResponse<'de>) -> Self {
21519 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
21520 }
21521}
21522
21523#[derive(Debug)]
21525#[repr(C)]
21526pub struct WireFileReadAtResponse<'de> {
21527 pub data: ::fidl_next::WireVector<'de, u8>,
21528}
21529static_assertions::const_assert_eq!(std::mem::size_of::<WireFileReadAtResponse<'_>>(), 16);
21530static_assertions::const_assert_eq!(std::mem::align_of::<WireFileReadAtResponse<'_>>(), 8);
21531
21532static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileReadAtResponse<'_>, data), 0);
21533
21534unsafe impl ::fidl_next::Wire for WireFileReadAtResponse<'static> {
21535 type Decoded<'de> = WireFileReadAtResponse<'de>;
21536
21537 #[inline]
21538 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21539 ::fidl_next::munge! {
21540 let Self {
21541
21542 data,
21543
21544 } = &mut *out_;
21545 }
21546
21547 ::fidl_next::Wire::zero_padding(data);
21548 }
21549}
21550
21551unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtResponse<'static>
21552where
21553 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21554 ___D: ::fidl_next::Decoder,
21555{
21556 fn decode(
21557 slot_: ::fidl_next::Slot<'_, Self>,
21558 decoder_: &mut ___D,
21559 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21560 ::fidl_next::munge! {
21561 let Self {
21562
21563 mut data,
21564
21565 } = slot_;
21566 }
21567
21568 ::fidl_next::Decode::decode(data.as_mut(), decoder_)?;
21569
21570 let data = unsafe { data.deref_unchecked() };
21571
21572 if data.len() > 8192 {
21573 return Err(::fidl_next::DecodeError::VectorTooLong {
21574 size: data.len() as u64,
21575 limit: 8192,
21576 });
21577 }
21578
21579 Ok(())
21580 }
21581}
21582
21583#[derive(PartialEq, Clone, Debug)]
21584pub struct FileWriteAtRequest {
21585 pub data: ::std::vec::Vec<u8>,
21586
21587 pub offset: u64,
21588}
21589
21590impl ::fidl_next::Encodable for FileWriteAtRequest {
21591 type Encoded = WireFileWriteAtRequest<'static>;
21592}
21593
21594unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtRequest
21595where
21596 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21597 ___E: ::fidl_next::Encoder,
21598{
21599 #[inline]
21600 fn encode(
21601 self,
21602 encoder_: &mut ___E,
21603 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21604 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21605 ::fidl_next::munge! {
21606 let Self::Encoded {
21607 data,
21608 offset,
21609
21610 } = out_;
21611 }
21612
21613 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
21614
21615 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
21616
21617 Ok(())
21618 }
21619}
21620
21621unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtRequest
21622where
21623 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21624 ___E: ::fidl_next::Encoder,
21625{
21626 #[inline]
21627 fn encode_ref(
21628 &self,
21629 encoder_: &mut ___E,
21630 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21631 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21632 ::fidl_next::munge! {
21633 let Self::Encoded {
21634
21635 data,
21636 offset,
21637
21638 } = out_;
21639 }
21640
21641 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder_, data)?;
21642
21643 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder_, offset)?;
21644
21645 Ok(())
21646 }
21647}
21648
21649impl ::fidl_next::EncodableOption for FileWriteAtRequest {
21650 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtRequest<'static>>;
21651}
21652
21653unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtRequest
21654where
21655 ___E: ::fidl_next::Encoder + ?Sized,
21656 FileWriteAtRequest: ::fidl_next::Encode<___E>,
21657{
21658 #[inline]
21659 fn encode_option(
21660 this: ::core::option::Option<Self>,
21661 encoder: &mut ___E,
21662 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21663 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21664 if let Some(inner) = this {
21665 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21666 ::fidl_next::WireBox::encode_present(out);
21667 } else {
21668 ::fidl_next::WireBox::encode_absent(out);
21669 }
21670
21671 Ok(())
21672 }
21673}
21674
21675unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtRequest
21676where
21677 ___E: ::fidl_next::Encoder + ?Sized,
21678 FileWriteAtRequest: ::fidl_next::EncodeRef<___E>,
21679{
21680 #[inline]
21681 fn encode_option_ref(
21682 this: ::core::option::Option<&Self>,
21683 encoder: &mut ___E,
21684 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21686 if let Some(inner) = this {
21687 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21688 ::fidl_next::WireBox::encode_present(out);
21689 } else {
21690 ::fidl_next::WireBox::encode_absent(out);
21691 }
21692
21693 Ok(())
21694 }
21695}
21696
21697impl<'de> ::fidl_next::FromWire<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
21698 #[inline]
21699 fn from_wire(wire: WireFileWriteAtRequest<'de>) -> Self {
21700 Self {
21701 data: ::fidl_next::FromWire::from_wire(wire.data),
21702
21703 offset: ::fidl_next::FromWire::from_wire(wire.offset),
21704 }
21705 }
21706}
21707
21708impl<'de> ::fidl_next::IntoNatural for WireFileWriteAtRequest<'de> {
21709 type Natural = FileWriteAtRequest;
21710}
21711
21712impl<'de> ::fidl_next::FromWireRef<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
21713 #[inline]
21714 fn from_wire_ref(wire: &WireFileWriteAtRequest<'de>) -> Self {
21715 Self {
21716 data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
21717
21718 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
21719 }
21720 }
21721}
21722
21723#[derive(Debug)]
21725#[repr(C)]
21726pub struct WireFileWriteAtRequest<'de> {
21727 pub data: ::fidl_next::WireVector<'de, u8>,
21728
21729 pub offset: ::fidl_next::WireU64,
21730}
21731static_assertions::const_assert_eq!(std::mem::size_of::<WireFileWriteAtRequest<'_>>(), 24);
21732static_assertions::const_assert_eq!(std::mem::align_of::<WireFileWriteAtRequest<'_>>(), 8);
21733
21734static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileWriteAtRequest<'_>, data), 0);
21735
21736static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileWriteAtRequest<'_>, offset), 16);
21737
21738unsafe impl ::fidl_next::Wire for WireFileWriteAtRequest<'static> {
21739 type Decoded<'de> = WireFileWriteAtRequest<'de>;
21740
21741 #[inline]
21742 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21743 ::fidl_next::munge! {
21744 let Self {
21745
21746 data,
21747 offset,
21748
21749 } = &mut *out_;
21750 }
21751
21752 ::fidl_next::Wire::zero_padding(data);
21753
21754 ::fidl_next::Wire::zero_padding(offset);
21755 }
21756}
21757
21758unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtRequest<'static>
21759where
21760 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21761 ___D: ::fidl_next::Decoder,
21762{
21763 fn decode(
21764 slot_: ::fidl_next::Slot<'_, Self>,
21765 decoder_: &mut ___D,
21766 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21767 ::fidl_next::munge! {
21768 let Self {
21769
21770 mut data,
21771 mut offset,
21772
21773 } = slot_;
21774 }
21775
21776 ::fidl_next::Decode::decode(data.as_mut(), decoder_)?;
21777
21778 let data = unsafe { data.deref_unchecked() };
21779
21780 if data.len() > 8192 {
21781 return Err(::fidl_next::DecodeError::VectorTooLong {
21782 size: data.len() as u64,
21783 limit: 8192,
21784 });
21785 }
21786
21787 ::fidl_next::Decode::decode(offset.as_mut(), decoder_)?;
21788
21789 Ok(())
21790 }
21791}
21792
21793#[derive(PartialEq, Clone, Debug)]
21794#[repr(C)]
21795pub struct FileWriteAtResponse {
21796 pub actual_count: u64,
21797}
21798
21799impl ::fidl_next::Encodable for FileWriteAtResponse {
21800 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileWriteAtResponse> = unsafe {
21801 ::fidl_next::CopyOptimization::enable_if(
21802 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21803 )
21804 };
21805
21806 type Encoded = WireFileWriteAtResponse;
21807}
21808
21809unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtResponse
21810where
21811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21812{
21813 #[inline]
21814 fn encode(
21815 self,
21816 encoder_: &mut ___E,
21817 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21819 ::fidl_next::munge! {
21820 let Self::Encoded {
21821 actual_count,
21822
21823 } = out_;
21824 }
21825
21826 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count)?;
21827
21828 Ok(())
21829 }
21830}
21831
21832unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtResponse
21833where
21834 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21835{
21836 #[inline]
21837 fn encode_ref(
21838 &self,
21839 encoder_: &mut ___E,
21840 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21841 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21842 ::fidl_next::munge! {
21843 let Self::Encoded {
21844
21845 actual_count,
21846
21847 } = out_;
21848 }
21849
21850 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder_, actual_count)?;
21851
21852 Ok(())
21853 }
21854}
21855
21856impl ::fidl_next::EncodableOption for FileWriteAtResponse {
21857 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtResponse>;
21858}
21859
21860unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtResponse
21861where
21862 ___E: ::fidl_next::Encoder + ?Sized,
21863 FileWriteAtResponse: ::fidl_next::Encode<___E>,
21864{
21865 #[inline]
21866 fn encode_option(
21867 this: ::core::option::Option<Self>,
21868 encoder: &mut ___E,
21869 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21871 if let Some(inner) = this {
21872 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21873 ::fidl_next::WireBox::encode_present(out);
21874 } else {
21875 ::fidl_next::WireBox::encode_absent(out);
21876 }
21877
21878 Ok(())
21879 }
21880}
21881
21882unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtResponse
21883where
21884 ___E: ::fidl_next::Encoder + ?Sized,
21885 FileWriteAtResponse: ::fidl_next::EncodeRef<___E>,
21886{
21887 #[inline]
21888 fn encode_option_ref(
21889 this: ::core::option::Option<&Self>,
21890 encoder: &mut ___E,
21891 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21892 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21893 if let Some(inner) = this {
21894 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21895 ::fidl_next::WireBox::encode_present(out);
21896 } else {
21897 ::fidl_next::WireBox::encode_absent(out);
21898 }
21899
21900 Ok(())
21901 }
21902}
21903
21904impl ::fidl_next::FromWire<WireFileWriteAtResponse> for FileWriteAtResponse {
21905 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileWriteAtResponse, Self> = unsafe {
21906 ::fidl_next::CopyOptimization::enable_if(
21907 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
21908 .is_enabled(),
21909 )
21910 };
21911
21912 #[inline]
21913 fn from_wire(wire: WireFileWriteAtResponse) -> Self {
21914 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
21915 }
21916}
21917
21918impl ::fidl_next::IntoNatural for WireFileWriteAtResponse {
21919 type Natural = FileWriteAtResponse;
21920}
21921
21922impl ::fidl_next::FromWireRef<WireFileWriteAtResponse> for FileWriteAtResponse {
21923 #[inline]
21924 fn from_wire_ref(wire: &WireFileWriteAtResponse) -> Self {
21925 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
21926 }
21927}
21928
21929#[derive(Clone, Debug)]
21931#[repr(C)]
21932pub struct WireFileWriteAtResponse {
21933 pub actual_count: ::fidl_next::WireU64,
21934}
21935static_assertions::const_assert_eq!(std::mem::size_of::<WireFileWriteAtResponse>(), 8);
21936static_assertions::const_assert_eq!(std::mem::align_of::<WireFileWriteAtResponse>(), 8);
21937
21938static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileWriteAtResponse, actual_count), 0);
21939
21940unsafe impl ::fidl_next::Wire for WireFileWriteAtResponse {
21941 type Decoded<'de> = WireFileWriteAtResponse;
21942
21943 #[inline]
21944 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21945 ::fidl_next::munge! {
21946 let Self {
21947
21948 actual_count,
21949
21950 } = &mut *out_;
21951 }
21952
21953 ::fidl_next::Wire::zero_padding(actual_count);
21954 }
21955}
21956
21957unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtResponse
21958where
21959 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21960{
21961 fn decode(
21962 slot_: ::fidl_next::Slot<'_, Self>,
21963 decoder_: &mut ___D,
21964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21965 ::fidl_next::munge! {
21966 let Self {
21967
21968 mut actual_count,
21969
21970 } = slot_;
21971 }
21972
21973 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder_)?;
21974
21975 Ok(())
21976 }
21977}
21978
21979#[derive(PartialEq, Clone, Debug)]
21980#[repr(C)]
21981pub struct FileResizeRequest {
21982 pub length: u64,
21983}
21984
21985impl ::fidl_next::Encodable for FileResizeRequest {
21986 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileResizeRequest> = unsafe {
21987 ::fidl_next::CopyOptimization::enable_if(
21988 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21989 )
21990 };
21991
21992 type Encoded = WireFileResizeRequest;
21993}
21994
21995unsafe impl<___E> ::fidl_next::Encode<___E> for FileResizeRequest
21996where
21997 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21998{
21999 #[inline]
22000 fn encode(
22001 self,
22002 encoder_: &mut ___E,
22003 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22004 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22005 ::fidl_next::munge! {
22006 let Self::Encoded {
22007 length,
22008
22009 } = out_;
22010 }
22011
22012 ::fidl_next::Encode::encode(self.length, encoder_, length)?;
22013
22014 Ok(())
22015 }
22016}
22017
22018unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileResizeRequest
22019where
22020 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22021{
22022 #[inline]
22023 fn encode_ref(
22024 &self,
22025 encoder_: &mut ___E,
22026 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22027 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22028 ::fidl_next::munge! {
22029 let Self::Encoded {
22030
22031 length,
22032
22033 } = out_;
22034 }
22035
22036 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder_, length)?;
22037
22038 Ok(())
22039 }
22040}
22041
22042impl ::fidl_next::EncodableOption for FileResizeRequest {
22043 type EncodedOption = ::fidl_next::WireBox<'static, WireFileResizeRequest>;
22044}
22045
22046unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileResizeRequest
22047where
22048 ___E: ::fidl_next::Encoder + ?Sized,
22049 FileResizeRequest: ::fidl_next::Encode<___E>,
22050{
22051 #[inline]
22052 fn encode_option(
22053 this: ::core::option::Option<Self>,
22054 encoder: &mut ___E,
22055 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22057 if let Some(inner) = this {
22058 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22059 ::fidl_next::WireBox::encode_present(out);
22060 } else {
22061 ::fidl_next::WireBox::encode_absent(out);
22062 }
22063
22064 Ok(())
22065 }
22066}
22067
22068unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileResizeRequest
22069where
22070 ___E: ::fidl_next::Encoder + ?Sized,
22071 FileResizeRequest: ::fidl_next::EncodeRef<___E>,
22072{
22073 #[inline]
22074 fn encode_option_ref(
22075 this: ::core::option::Option<&Self>,
22076 encoder: &mut ___E,
22077 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22078 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22079 if let Some(inner) = this {
22080 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22081 ::fidl_next::WireBox::encode_present(out);
22082 } else {
22083 ::fidl_next::WireBox::encode_absent(out);
22084 }
22085
22086 Ok(())
22087 }
22088}
22089
22090impl ::fidl_next::FromWire<WireFileResizeRequest> for FileResizeRequest {
22091 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileResizeRequest, Self> = unsafe {
22092 ::fidl_next::CopyOptimization::enable_if(
22093 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
22094 .is_enabled(),
22095 )
22096 };
22097
22098 #[inline]
22099 fn from_wire(wire: WireFileResizeRequest) -> Self {
22100 Self { length: ::fidl_next::FromWire::from_wire(wire.length) }
22101 }
22102}
22103
22104impl ::fidl_next::IntoNatural for WireFileResizeRequest {
22105 type Natural = FileResizeRequest;
22106}
22107
22108impl ::fidl_next::FromWireRef<WireFileResizeRequest> for FileResizeRequest {
22109 #[inline]
22110 fn from_wire_ref(wire: &WireFileResizeRequest) -> Self {
22111 Self { length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length) }
22112 }
22113}
22114
22115#[derive(Clone, Debug)]
22117#[repr(C)]
22118pub struct WireFileResizeRequest {
22119 pub length: ::fidl_next::WireU64,
22120}
22121static_assertions::const_assert_eq!(std::mem::size_of::<WireFileResizeRequest>(), 8);
22122static_assertions::const_assert_eq!(std::mem::align_of::<WireFileResizeRequest>(), 8);
22123
22124static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileResizeRequest, length), 0);
22125
22126unsafe impl ::fidl_next::Wire for WireFileResizeRequest {
22127 type Decoded<'de> = WireFileResizeRequest;
22128
22129 #[inline]
22130 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22131 ::fidl_next::munge! {
22132 let Self {
22133
22134 length,
22135
22136 } = &mut *out_;
22137 }
22138
22139 ::fidl_next::Wire::zero_padding(length);
22140 }
22141}
22142
22143unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileResizeRequest
22144where
22145 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22146{
22147 fn decode(
22148 slot_: ::fidl_next::Slot<'_, Self>,
22149 decoder_: &mut ___D,
22150 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22151 ::fidl_next::munge! {
22152 let Self {
22153
22154 mut length,
22155
22156 } = slot_;
22157 }
22158
22159 ::fidl_next::Decode::decode(length.as_mut(), decoder_)?;
22160
22161 Ok(())
22162 }
22163}
22164
22165pub type FileResizeResponse = ();
22166
22167pub type WireFileResizeResponse = ();
22169
22170::fidl_next::bitflags::bitflags! {
22171 #[derive(
22172 Clone,
22173 Copy,
22174 Debug,
22175 PartialEq,
22176 Eq,
22177 Hash,
22178 )]
22179 pub struct VmoFlags: u32 {
22180 #[doc = " Requests that the VMO be readable.\n"]const READ = 1;
22181 #[doc = " Requests that the VMO be writable.\n"]const WRITE = 2;
22182 #[doc = " Request that the VMO be executable.\n"]const EXECUTE = 4;
22183 #[doc = " Require a copy-on-write clone of the underlying VMO. The request\n should fail if the VMO cannot be cloned. May not be supplied\n with `SHARED_BUFFER`.\n\n A private clone uses at least the guarantees of the\n `ZX_VMO_CHILD_SNAPSHOT_AT_LEAST_ON_WRITE` flag to\n `zx_vmo_create_child()`. This means that the returned VMO will\n be copy-on-write (if `WRITE` is requested) but that it may or\n may not reflect subsequent content changes to the underlying\n file. The returned VMO will not reflect size changes to the\n file. These semantics match those of the POSIX `mmap()`\n `MAP_PRIVATE` flag.\n\n In some cases, clients requiring a guaranteed snapshot of the\n file can use `SHARED_BUFFER` and then use\n `zx_vmo_create_child()` with `ZX_VMO_CHILD_SNAPSHOT`. However,\n in addition to cases where the implementation can\'t return a\n `SHARED_BUFFER`, creating a full snapshot will fail if the VMO\n is attached to the pager. Since most filesystems will use the\n paging system, the full snapshot approach should only be used in\n specific cases where the client is talking to a known server.\n"]const PRIVATE_CLONE = 65536;
22184 #[doc = " Require a VMO that provides direct access to the contents of the\n file\'s underlying VMO. The request should fail if such a VMO\n cannot be provided. May not be supplied with `PRIVATE_CLONE`.\n\n The returned VMO may not be resizable even when `WRITE` access is\n requested. In this case, [`File.Resize`] should be used to resize\n the file.\n"]const SHARED_BUFFER = 131072;
22185
22186 }
22187}
22188
22189impl ::fidl_next::Encodable for VmoFlags {
22190 type Encoded = WireVmoFlags;
22191}
22192
22193unsafe impl<___E> ::fidl_next::Encode<___E> for VmoFlags
22194where
22195 ___E: ?Sized,
22196{
22197 #[inline]
22198 fn encode(
22199 self,
22200 encoder: &mut ___E,
22201 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22203 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
22204 }
22205}
22206
22207unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VmoFlags
22208where
22209 ___E: ?Sized,
22210{
22211 #[inline]
22212 fn encode_ref(
22213 &self,
22214 _: &mut ___E,
22215 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22216 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22217 ::fidl_next::munge!(let WireVmoFlags { value } = out);
22218
22219 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
22220 return Err(::fidl_next::EncodeError::InvalidStrictBits);
22221 }
22222
22223 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
22224 Ok(())
22225 }
22226}
22227
22228impl ::core::convert::From<WireVmoFlags> for VmoFlags {
22229 fn from(wire: WireVmoFlags) -> Self {
22230 Self::from_bits_retain(u32::from(wire.value))
22231 }
22232}
22233
22234impl ::fidl_next::FromWire<WireVmoFlags> for VmoFlags {
22235 #[inline]
22236 fn from_wire(wire: WireVmoFlags) -> Self {
22237 Self::from(wire)
22238 }
22239}
22240
22241impl ::fidl_next::IntoNatural for WireVmoFlags {
22242 type Natural = VmoFlags;
22243}
22244
22245impl ::fidl_next::FromWireRef<WireVmoFlags> for VmoFlags {
22246 #[inline]
22247 fn from_wire_ref(wire: &WireVmoFlags) -> Self {
22248 Self::from(*wire)
22249 }
22250}
22251
22252#[derive(Clone, Copy, Debug)]
22254#[repr(transparent)]
22255pub struct WireVmoFlags {
22256 value: ::fidl_next::WireU32,
22257}
22258
22259unsafe impl ::fidl_next::Wire for WireVmoFlags {
22260 type Decoded<'de> = Self;
22261
22262 #[inline]
22263 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
22264 }
22266}
22267
22268unsafe impl<___D> ::fidl_next::Decode<___D> for WireVmoFlags
22269where
22270 ___D: ?Sized,
22271{
22272 fn decode(
22273 slot: ::fidl_next::Slot<'_, Self>,
22274 _: &mut ___D,
22275 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22276 ::fidl_next::munge!(let Self { value } = slot);
22277 let set = u32::from(*value);
22278 if set & !VmoFlags::all().bits() != 0 {
22279 return Err(::fidl_next::DecodeError::InvalidBits {
22280 expected: VmoFlags::all().bits() as usize,
22281 actual: set as usize,
22282 });
22283 }
22284
22285 Ok(())
22286 }
22287}
22288
22289impl ::core::convert::From<VmoFlags> for WireVmoFlags {
22290 fn from(natural: VmoFlags) -> Self {
22291 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
22292 }
22293}
22294
22295#[derive(PartialEq, Clone, Debug)]
22296#[repr(C)]
22297pub struct FileGetBackingMemoryRequest {
22298 pub flags: crate::VmoFlags,
22299}
22300
22301impl ::fidl_next::Encodable for FileGetBackingMemoryRequest {
22302 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryRequest> = unsafe {
22303 ::fidl_next::CopyOptimization::enable_if(
22304 true && <crate::VmoFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
22305 )
22306 };
22307
22308 type Encoded = WireFileGetBackingMemoryRequest;
22309}
22310
22311unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryRequest
22312where
22313 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22314{
22315 #[inline]
22316 fn encode(
22317 self,
22318 encoder_: &mut ___E,
22319 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22321 ::fidl_next::munge! {
22322 let Self::Encoded {
22323 flags,
22324
22325 } = out_;
22326 }
22327
22328 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
22329
22330 Ok(())
22331 }
22332}
22333
22334unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileGetBackingMemoryRequest
22335where
22336 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22337{
22338 #[inline]
22339 fn encode_ref(
22340 &self,
22341 encoder_: &mut ___E,
22342 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22343 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22344 ::fidl_next::munge! {
22345 let Self::Encoded {
22346
22347 flags,
22348
22349 } = out_;
22350 }
22351
22352 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder_, flags)?;
22353
22354 Ok(())
22355 }
22356}
22357
22358impl ::fidl_next::EncodableOption for FileGetBackingMemoryRequest {
22359 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryRequest>;
22360}
22361
22362unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryRequest
22363where
22364 ___E: ::fidl_next::Encoder + ?Sized,
22365 FileGetBackingMemoryRequest: ::fidl_next::Encode<___E>,
22366{
22367 #[inline]
22368 fn encode_option(
22369 this: ::core::option::Option<Self>,
22370 encoder: &mut ___E,
22371 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22372 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22373 if let Some(inner) = this {
22374 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22375 ::fidl_next::WireBox::encode_present(out);
22376 } else {
22377 ::fidl_next::WireBox::encode_absent(out);
22378 }
22379
22380 Ok(())
22381 }
22382}
22383
22384unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileGetBackingMemoryRequest
22385where
22386 ___E: ::fidl_next::Encoder + ?Sized,
22387 FileGetBackingMemoryRequest: ::fidl_next::EncodeRef<___E>,
22388{
22389 #[inline]
22390 fn encode_option_ref(
22391 this: ::core::option::Option<&Self>,
22392 encoder: &mut ___E,
22393 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22394 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22395 if let Some(inner) = this {
22396 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22397 ::fidl_next::WireBox::encode_present(out);
22398 } else {
22399 ::fidl_next::WireBox::encode_absent(out);
22400 }
22401
22402 Ok(())
22403 }
22404}
22405
22406impl ::fidl_next::FromWire<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
22407 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryRequest, Self> = unsafe {
22408 ::fidl_next::CopyOptimization::enable_if(
22409 true
22410
22411 && <
22412 crate::VmoFlags as ::fidl_next::FromWire<crate::WireVmoFlags>
22413 >::COPY_OPTIMIZATION.is_enabled()
22414
22415 )
22416 };
22417
22418 #[inline]
22419 fn from_wire(wire: WireFileGetBackingMemoryRequest) -> Self {
22420 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
22421 }
22422}
22423
22424impl ::fidl_next::IntoNatural for WireFileGetBackingMemoryRequest {
22425 type Natural = FileGetBackingMemoryRequest;
22426}
22427
22428impl ::fidl_next::FromWireRef<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
22429 #[inline]
22430 fn from_wire_ref(wire: &WireFileGetBackingMemoryRequest) -> Self {
22431 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
22432 }
22433}
22434
22435#[derive(Clone, Debug)]
22437#[repr(C)]
22438pub struct WireFileGetBackingMemoryRequest {
22439 pub flags: crate::WireVmoFlags,
22440}
22441static_assertions::const_assert_eq!(std::mem::size_of::<WireFileGetBackingMemoryRequest>(), 4);
22442static_assertions::const_assert_eq!(std::mem::align_of::<WireFileGetBackingMemoryRequest>(), 4);
22443
22444static_assertions::const_assert_eq!(
22445 std::mem::offset_of!(WireFileGetBackingMemoryRequest, flags),
22446 0
22447);
22448
22449unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryRequest {
22450 type Decoded<'de> = WireFileGetBackingMemoryRequest;
22451
22452 #[inline]
22453 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22454 ::fidl_next::munge! {
22455 let Self {
22456
22457 flags,
22458
22459 } = &mut *out_;
22460 }
22461
22462 ::fidl_next::Wire::zero_padding(flags);
22463 }
22464}
22465
22466unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryRequest
22467where
22468 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22469{
22470 fn decode(
22471 slot_: ::fidl_next::Slot<'_, Self>,
22472 decoder_: &mut ___D,
22473 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22474 ::fidl_next::munge! {
22475 let Self {
22476
22477 mut flags,
22478
22479 } = slot_;
22480 }
22481
22482 ::fidl_next::Decode::decode(flags.as_mut(), decoder_)?;
22483
22484 Ok(())
22485 }
22486}
22487
22488#[derive(PartialEq, Debug)]
22489#[repr(C)]
22490pub struct FileGetBackingMemoryResponse {
22491 pub vmo: ::fidl_next::fuchsia::zx::Vmo,
22492}
22493
22494impl ::fidl_next::Encodable for FileGetBackingMemoryResponse {
22495 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryResponse> = unsafe {
22496 ::fidl_next::CopyOptimization::enable_if(
22497 true && <::fidl_next::fuchsia::zx::Vmo as ::fidl_next::Encodable>::COPY_OPTIMIZATION
22498 .is_enabled(),
22499 )
22500 };
22501
22502 type Encoded = WireFileGetBackingMemoryResponse;
22503}
22504
22505unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryResponse
22506where
22507 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22508 ___E: ::fidl_next::fuchsia::HandleEncoder,
22509{
22510 #[inline]
22511 fn encode(
22512 self,
22513 encoder_: &mut ___E,
22514 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22515 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22516 ::fidl_next::munge! {
22517 let Self::Encoded {
22518 vmo,
22519
22520 } = out_;
22521 }
22522
22523 ::fidl_next::Encode::encode(self.vmo, encoder_, vmo)?;
22524
22525 Ok(())
22526 }
22527}
22528
22529impl ::fidl_next::EncodableOption for FileGetBackingMemoryResponse {
22530 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryResponse>;
22531}
22532
22533unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryResponse
22534where
22535 ___E: ::fidl_next::Encoder + ?Sized,
22536 FileGetBackingMemoryResponse: ::fidl_next::Encode<___E>,
22537{
22538 #[inline]
22539 fn encode_option(
22540 this: ::core::option::Option<Self>,
22541 encoder: &mut ___E,
22542 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22543 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22544 if let Some(inner) = this {
22545 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22546 ::fidl_next::WireBox::encode_present(out);
22547 } else {
22548 ::fidl_next::WireBox::encode_absent(out);
22549 }
22550
22551 Ok(())
22552 }
22553}
22554
22555impl ::fidl_next::FromWire<WireFileGetBackingMemoryResponse> for FileGetBackingMemoryResponse {
22556 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryResponse, Self> = unsafe {
22557 ::fidl_next::CopyOptimization::enable_if(
22558 true && <::fidl_next::fuchsia::zx::Vmo as ::fidl_next::FromWire<
22559 ::fidl_next::fuchsia::WireVmo,
22560 >>::COPY_OPTIMIZATION
22561 .is_enabled(),
22562 )
22563 };
22564
22565 #[inline]
22566 fn from_wire(wire: WireFileGetBackingMemoryResponse) -> Self {
22567 Self { vmo: ::fidl_next::FromWire::from_wire(wire.vmo) }
22568 }
22569}
22570
22571impl ::fidl_next::IntoNatural for WireFileGetBackingMemoryResponse {
22572 type Natural = FileGetBackingMemoryResponse;
22573}
22574
22575#[derive(Debug)]
22577#[repr(C)]
22578pub struct WireFileGetBackingMemoryResponse {
22579 pub vmo: ::fidl_next::fuchsia::WireVmo,
22580}
22581static_assertions::const_assert_eq!(std::mem::size_of::<WireFileGetBackingMemoryResponse>(), 4);
22582static_assertions::const_assert_eq!(std::mem::align_of::<WireFileGetBackingMemoryResponse>(), 4);
22583
22584static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileGetBackingMemoryResponse, vmo), 0);
22585
22586unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryResponse {
22587 type Decoded<'de> = WireFileGetBackingMemoryResponse;
22588
22589 #[inline]
22590 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22591 ::fidl_next::munge! {
22592 let Self {
22593
22594 vmo,
22595
22596 } = &mut *out_;
22597 }
22598
22599 ::fidl_next::Wire::zero_padding(vmo);
22600 }
22601}
22602
22603unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryResponse
22604where
22605 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22606 ___D: ::fidl_next::fuchsia::HandleDecoder,
22607{
22608 fn decode(
22609 slot_: ::fidl_next::Slot<'_, Self>,
22610 decoder_: &mut ___D,
22611 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22612 ::fidl_next::munge! {
22613 let Self {
22614
22615 mut vmo,
22616
22617 } = slot_;
22618 }
22619
22620 ::fidl_next::Decode::decode(vmo.as_mut(), decoder_)?;
22621
22622 Ok(())
22623 }
22624}
22625
22626#[derive(PartialEq, Debug)]
22627pub struct LinkableLinkIntoRequest {
22628 pub dst_parent_token: ::fidl_next::fuchsia::zx::Event,
22629
22630 pub dst: ::std::string::String,
22631}
22632
22633impl ::fidl_next::Encodable for LinkableLinkIntoRequest {
22634 type Encoded = WireLinkableLinkIntoRequest<'static>;
22635}
22636
22637unsafe impl<___E> ::fidl_next::Encode<___E> for LinkableLinkIntoRequest
22638where
22639 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22640 ___E: ::fidl_next::Encoder,
22641 ___E: ::fidl_next::fuchsia::HandleEncoder,
22642{
22643 #[inline]
22644 fn encode(
22645 self,
22646 encoder_: &mut ___E,
22647 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22648 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22649 ::fidl_next::munge! {
22650 let Self::Encoded {
22651 dst_parent_token,
22652 dst,
22653
22654 } = out_;
22655 }
22656
22657 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
22658
22659 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
22660
22661 Ok(())
22662 }
22663}
22664
22665impl ::fidl_next::EncodableOption for LinkableLinkIntoRequest {
22666 type EncodedOption = ::fidl_next::WireBox<'static, WireLinkableLinkIntoRequest<'static>>;
22667}
22668
22669unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LinkableLinkIntoRequest
22670where
22671 ___E: ::fidl_next::Encoder + ?Sized,
22672 LinkableLinkIntoRequest: ::fidl_next::Encode<___E>,
22673{
22674 #[inline]
22675 fn encode_option(
22676 this: ::core::option::Option<Self>,
22677 encoder: &mut ___E,
22678 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
22679 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22680 if let Some(inner) = this {
22681 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
22682 ::fidl_next::WireBox::encode_present(out);
22683 } else {
22684 ::fidl_next::WireBox::encode_absent(out);
22685 }
22686
22687 Ok(())
22688 }
22689}
22690
22691impl<'de> ::fidl_next::FromWire<WireLinkableLinkIntoRequest<'de>> for LinkableLinkIntoRequest {
22692 #[inline]
22693 fn from_wire(wire: WireLinkableLinkIntoRequest<'de>) -> Self {
22694 Self {
22695 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
22696
22697 dst: ::fidl_next::FromWire::from_wire(wire.dst),
22698 }
22699 }
22700}
22701
22702impl<'de> ::fidl_next::IntoNatural for WireLinkableLinkIntoRequest<'de> {
22703 type Natural = LinkableLinkIntoRequest;
22704}
22705
22706#[derive(Debug)]
22708#[repr(C)]
22709pub struct WireLinkableLinkIntoRequest<'de> {
22710 pub dst_parent_token: ::fidl_next::fuchsia::WireEvent,
22711
22712 pub dst: ::fidl_next::WireString<'de>,
22713}
22714static_assertions::const_assert_eq!(std::mem::size_of::<WireLinkableLinkIntoRequest<'_>>(), 24);
22715static_assertions::const_assert_eq!(std::mem::align_of::<WireLinkableLinkIntoRequest<'_>>(), 8);
22716
22717static_assertions::const_assert_eq!(
22718 std::mem::offset_of!(WireLinkableLinkIntoRequest<'_>, dst_parent_token),
22719 0
22720);
22721
22722static_assertions::const_assert_eq!(std::mem::offset_of!(WireLinkableLinkIntoRequest<'_>, dst), 8);
22723
22724unsafe impl ::fidl_next::Wire for WireLinkableLinkIntoRequest<'static> {
22725 type Decoded<'de> = WireLinkableLinkIntoRequest<'de>;
22726
22727 #[inline]
22728 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22729 ::fidl_next::munge! {
22730 let Self {
22731
22732 dst_parent_token,
22733 dst,
22734
22735 } = &mut *out_;
22736 }
22737
22738 ::fidl_next::Wire::zero_padding(dst_parent_token);
22739
22740 ::fidl_next::Wire::zero_padding(dst);
22741
22742 unsafe {
22743 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
22744 }
22745 }
22746}
22747
22748unsafe impl<___D> ::fidl_next::Decode<___D> for WireLinkableLinkIntoRequest<'static>
22749where
22750 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22751 ___D: ::fidl_next::Decoder,
22752 ___D: ::fidl_next::fuchsia::HandleDecoder,
22753{
22754 fn decode(
22755 slot_: ::fidl_next::Slot<'_, Self>,
22756 decoder_: &mut ___D,
22757 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22758 ::fidl_next::munge! {
22759 let Self {
22760
22761 mut dst_parent_token,
22762 mut dst,
22763
22764 } = slot_;
22765 }
22766
22767 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder_)?;
22768
22769 ::fidl_next::Decode::decode(dst.as_mut(), decoder_)?;
22770
22771 let dst = unsafe { dst.deref_unchecked() };
22772
22773 if dst.len() > 255 {
22774 return Err(::fidl_next::DecodeError::VectorTooLong {
22775 size: dst.len() as u64,
22776 limit: 255,
22777 });
22778 }
22779
22780 Ok(())
22781 }
22782}
22783
22784pub type LinkableLinkIntoResponse = ();
22785
22786pub type WireLinkableLinkIntoResponse = ();
22788
22789#[derive(PartialEq, Debug)]
22791pub struct Linkable;
22792
22793pub mod linkable {
22794 pub mod prelude {
22795 pub use crate::{Linkable, LinkableClientHandler, LinkableServerHandler, linkable};
22796
22797 pub use crate::LinkableLinkIntoRequest;
22798
22799 pub use crate::LinkableLinkIntoResponse;
22800 }
22801
22802 pub struct LinkInto;
22803
22804 impl ::fidl_next::Method for LinkInto {
22805 const ORDINAL: u64 = 6121399674497678964;
22806
22807 type Protocol = crate::Linkable;
22808
22809 type Request = crate::WireLinkableLinkIntoRequest<'static>;
22810
22811 type Response = ::fidl_next::WireResult<
22812 'static,
22813 crate::WireLinkableLinkIntoResponse,
22814 ::fidl_next::WireI32,
22815 >;
22816 }
22817
22818 mod ___detail {
22819
22820 pub struct LinkInto<T0, T1> {
22821 dst_parent_token: T0,
22822
22823 dst: T1,
22824 }
22825
22826 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
22827 where
22828 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
22829 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
22830 {
22831 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
22832 }
22833
22834 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
22835 where
22836 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22837 ___E: ::fidl_next::Encoder,
22838 ___E: ::fidl_next::fuchsia::HandleEncoder,
22839 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
22840 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
22841 {
22842 #[inline]
22843 fn encode(
22844 self,
22845 encoder_: &mut ___E,
22846 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22847 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22848 ::fidl_next::munge! {
22849 let Self::Encoded {
22850 dst_parent_token,
22851 dst,
22852
22853 } = out_;
22854 }
22855
22856 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
22857
22858 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
22859
22860 Ok(())
22861 }
22862 }
22863
22864 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Linkable
22865 where
22866 ___T: ::fidl_next::Transport,
22867 {
22868 type Client = LinkableClient<___T>;
22869 type Server = LinkableServer<___T>;
22870 }
22871
22872 #[repr(transparent)]
22874 pub struct LinkableClient<___T: ::fidl_next::Transport> {
22875 #[allow(dead_code)]
22876 client: ::fidl_next::protocol::Client<___T>,
22877 }
22878
22879 impl<___T> LinkableClient<___T>
22880 where
22881 ___T: ::fidl_next::Transport,
22882 {
22883 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
22884 pub fn link_into(
22885 &self,
22886
22887 dst_parent_token: impl ::fidl_next::Encode<
22888 <___T as ::fidl_next::Transport>::SendBuffer,
22889 Encoded = ::fidl_next::fuchsia::WireEvent,
22890 >,
22891
22892 dst: impl ::fidl_next::Encode<
22893 <___T as ::fidl_next::Transport>::SendBuffer,
22894 Encoded = ::fidl_next::WireString<'static>,
22895 >,
22896 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
22897 where
22898 <___T as ::fidl_next::Transport>::SendBuffer:
22899 ::fidl_next::encoder::InternalHandleEncoder,
22900 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
22901 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
22902 {
22903 self.link_into_with(LinkInto { dst_parent_token, dst })
22904 }
22905
22906 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
22907 pub fn link_into_with<___R>(
22908 &self,
22909 request: ___R,
22910 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
22911 where
22912 ___R: ::fidl_next::Encode<
22913 <___T as ::fidl_next::Transport>::SendBuffer,
22914 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
22915 >,
22916 {
22917 ::fidl_next::TwoWayFuture::from_untyped(
22918 self.client.send_two_way(6121399674497678964, request),
22919 )
22920 }
22921 }
22922
22923 #[repr(transparent)]
22925 pub struct LinkableServer<___T: ::fidl_next::Transport> {
22926 server: ::fidl_next::protocol::Server<___T>,
22927 }
22928
22929 impl<___T> LinkableServer<___T> where ___T: ::fidl_next::Transport {}
22930 }
22931}
22932
22933pub trait LinkableClientHandler<
22937 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
22938 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
22939>
22940{
22941}
22942
22943impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Linkable
22944where
22945 ___H: LinkableClientHandler<___T> + ::core::marker::Send,
22946 ___T: ::fidl_next::Transport,
22947 <linkable::LinkInto as ::fidl_next::Method>::Response:
22948 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
22949{
22950 async fn on_event(
22951 handler: &mut ___H,
22952 ordinal: u64,
22953 buffer: ___T::RecvBuffer,
22954 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
22955 match ordinal {
22956 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
22957 }
22958 }
22959}
22960
22961pub trait LinkableServerHandler<
22965 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
22966 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
22967>
22968{
22969 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
22970 fn link_into(
22971 &mut self,
22972
22973 request: ::fidl_next::Request<linkable::LinkInto, ___T>,
22974
22975 responder: ::fidl_next::Responder<linkable::LinkInto, ___T>,
22976 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
22977}
22978
22979impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Linkable
22980where
22981 ___H: LinkableServerHandler<___T> + ::core::marker::Send,
22982 ___T: ::fidl_next::Transport,
22983 <linkable::LinkInto as ::fidl_next::Method>::Request:
22984 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
22985{
22986 async fn on_one_way(
22987 handler: &mut ___H,
22988 ordinal: u64,
22989 buffer: ___T::RecvBuffer,
22990 ) -> ::core::result::Result<
22991 (),
22992 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
22993 > {
22994 match ordinal {
22995 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
22996 }
22997 }
22998
22999 async fn on_two_way(
23000 handler: &mut ___H,
23001 ordinal: u64,
23002 buffer: ___T::RecvBuffer,
23003 responder: ::fidl_next::protocol::Responder<___T>,
23004 ) -> ::core::result::Result<
23005 (),
23006 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
23007 > {
23008 match ordinal {
23009 6121399674497678964 => {
23010 let responder = ::fidl_next::Responder::from_untyped(responder);
23011
23012 match ::fidl_next::DecoderExt::decode(buffer) {
23013 Ok(decoded) => {
23014 handler.link_into(decoded, responder).await;
23015 Ok(())
23016 }
23017 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
23018 ordinal: 6121399674497678964,
23019 error,
23020 }),
23021 }
23022 }
23023
23024 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
23025 }
23026 }
23027}
23028
23029#[derive(PartialEq, Debug)]
23030pub struct FileAllocateRequest {
23031 pub offset: u64,
23032
23033 pub length: u64,
23034
23035 pub mode: crate::AllocateMode,
23036}
23037
23038impl ::fidl_next::Encodable for FileAllocateRequest {
23039 type Encoded = WireFileAllocateRequest;
23040}
23041
23042unsafe impl<___E> ::fidl_next::Encode<___E> for FileAllocateRequest
23043where
23044 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23045 ___E: ::fidl_next::fuchsia::HandleEncoder,
23046{
23047 #[inline]
23048 fn encode(
23049 self,
23050 encoder_: &mut ___E,
23051 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23052 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23053 ::fidl_next::munge! {
23054 let Self::Encoded {
23055 offset,
23056 length,
23057 mode,
23058
23059 } = out_;
23060 }
23061
23062 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
23063
23064 ::fidl_next::Encode::encode(self.length, encoder_, length)?;
23065
23066 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
23067
23068 Ok(())
23069 }
23070}
23071
23072impl ::fidl_next::EncodableOption for FileAllocateRequest {
23073 type EncodedOption = ::fidl_next::WireBox<'static, WireFileAllocateRequest>;
23074}
23075
23076unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileAllocateRequest
23077where
23078 ___E: ::fidl_next::Encoder + ?Sized,
23079 FileAllocateRequest: ::fidl_next::Encode<___E>,
23080{
23081 #[inline]
23082 fn encode_option(
23083 this: ::core::option::Option<Self>,
23084 encoder: &mut ___E,
23085 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
23086 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23087 if let Some(inner) = this {
23088 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
23089 ::fidl_next::WireBox::encode_present(out);
23090 } else {
23091 ::fidl_next::WireBox::encode_absent(out);
23092 }
23093
23094 Ok(())
23095 }
23096}
23097
23098impl ::fidl_next::FromWire<WireFileAllocateRequest> for FileAllocateRequest {
23099 #[inline]
23100 fn from_wire(wire: WireFileAllocateRequest) -> Self {
23101 Self {
23102 offset: ::fidl_next::FromWire::from_wire(wire.offset),
23103
23104 length: ::fidl_next::FromWire::from_wire(wire.length),
23105
23106 mode: ::fidl_next::FromWire::from_wire(wire.mode),
23107 }
23108 }
23109}
23110
23111impl ::fidl_next::IntoNatural for WireFileAllocateRequest {
23112 type Natural = FileAllocateRequest;
23113}
23114
23115#[derive(Debug)]
23117#[repr(C)]
23118pub struct WireFileAllocateRequest {
23119 pub offset: ::fidl_next::WireU64,
23120
23121 pub length: ::fidl_next::WireU64,
23122
23123 pub mode: crate::WireAllocateMode,
23124}
23125static_assertions::const_assert_eq!(std::mem::size_of::<WireFileAllocateRequest>(), 24);
23126static_assertions::const_assert_eq!(std::mem::align_of::<WireFileAllocateRequest>(), 8);
23127
23128static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileAllocateRequest, offset), 0);
23129
23130static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileAllocateRequest, length), 8);
23131
23132static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileAllocateRequest, mode), 16);
23133
23134unsafe impl ::fidl_next::Wire for WireFileAllocateRequest {
23135 type Decoded<'de> = WireFileAllocateRequest;
23136
23137 #[inline]
23138 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
23139 ::fidl_next::munge! {
23140 let Self {
23141
23142 offset,
23143 length,
23144 mode,
23145
23146 } = &mut *out_;
23147 }
23148
23149 ::fidl_next::Wire::zero_padding(offset);
23150
23151 ::fidl_next::Wire::zero_padding(length);
23152
23153 ::fidl_next::Wire::zero_padding(mode);
23154
23155 unsafe {
23156 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
23157 }
23158 }
23159}
23160
23161unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileAllocateRequest
23162where
23163 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23164 ___D: ::fidl_next::fuchsia::HandleDecoder,
23165{
23166 fn decode(
23167 slot_: ::fidl_next::Slot<'_, Self>,
23168 decoder_: &mut ___D,
23169 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23170 ::fidl_next::munge! {
23171 let Self {
23172
23173 mut offset,
23174 mut length,
23175 mut mode,
23176
23177 } = slot_;
23178 }
23179
23180 ::fidl_next::Decode::decode(offset.as_mut(), decoder_)?;
23181
23182 ::fidl_next::Decode::decode(length.as_mut(), decoder_)?;
23183
23184 ::fidl_next::Decode::decode(mode.as_mut(), decoder_)?;
23185
23186 Ok(())
23187 }
23188}
23189
23190pub type FileAllocateResponse = ();
23191
23192pub type WireFileAllocateResponse = ();
23194
23195#[derive(PartialEq, Debug)]
23196pub struct FileEnableVerityRequest {
23197 pub options: crate::VerificationOptions,
23198}
23199
23200impl ::fidl_next::Encodable for FileEnableVerityRequest {
23201 type Encoded = WireFileEnableVerityRequest<'static>;
23202}
23203
23204unsafe impl<___E> ::fidl_next::Encode<___E> for FileEnableVerityRequest
23205where
23206 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23207 ___E: ::fidl_next::Encoder,
23208 ___E: ::fidl_next::fuchsia::HandleEncoder,
23209{
23210 #[inline]
23211 fn encode(
23212 self,
23213 encoder_: &mut ___E,
23214 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23215 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23216 ::fidl_next::munge! {
23217 let Self::Encoded {
23218 options,
23219
23220 } = out_;
23221 }
23222
23223 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
23224
23225 Ok(())
23226 }
23227}
23228
23229impl ::fidl_next::EncodableOption for FileEnableVerityRequest {
23230 type EncodedOption = ::fidl_next::WireBox<'static, WireFileEnableVerityRequest<'static>>;
23231}
23232
23233unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileEnableVerityRequest
23234where
23235 ___E: ::fidl_next::Encoder + ?Sized,
23236 FileEnableVerityRequest: ::fidl_next::Encode<___E>,
23237{
23238 #[inline]
23239 fn encode_option(
23240 this: ::core::option::Option<Self>,
23241 encoder: &mut ___E,
23242 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
23243 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23244 if let Some(inner) = this {
23245 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
23246 ::fidl_next::WireBox::encode_present(out);
23247 } else {
23248 ::fidl_next::WireBox::encode_absent(out);
23249 }
23250
23251 Ok(())
23252 }
23253}
23254
23255impl<'de> ::fidl_next::FromWire<WireFileEnableVerityRequest<'de>> for FileEnableVerityRequest {
23256 #[inline]
23257 fn from_wire(wire: WireFileEnableVerityRequest<'de>) -> Self {
23258 Self { options: ::fidl_next::FromWire::from_wire(wire.options) }
23259 }
23260}
23261
23262impl<'de> ::fidl_next::IntoNatural for WireFileEnableVerityRequest<'de> {
23263 type Natural = FileEnableVerityRequest;
23264}
23265
23266#[derive(Debug)]
23268#[repr(C)]
23269pub struct WireFileEnableVerityRequest<'de> {
23270 pub options: crate::WireVerificationOptions<'de>,
23271}
23272static_assertions::const_assert_eq!(std::mem::size_of::<WireFileEnableVerityRequest<'_>>(), 16);
23273static_assertions::const_assert_eq!(std::mem::align_of::<WireFileEnableVerityRequest<'_>>(), 8);
23274
23275static_assertions::const_assert_eq!(
23276 std::mem::offset_of!(WireFileEnableVerityRequest<'_>, options),
23277 0
23278);
23279
23280unsafe impl ::fidl_next::Wire for WireFileEnableVerityRequest<'static> {
23281 type Decoded<'de> = WireFileEnableVerityRequest<'de>;
23282
23283 #[inline]
23284 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
23285 ::fidl_next::munge! {
23286 let Self {
23287
23288 options,
23289
23290 } = &mut *out_;
23291 }
23292
23293 ::fidl_next::Wire::zero_padding(options);
23294 }
23295}
23296
23297unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileEnableVerityRequest<'static>
23298where
23299 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23300 ___D: ::fidl_next::Decoder,
23301 ___D: ::fidl_next::fuchsia::HandleDecoder,
23302{
23303 fn decode(
23304 slot_: ::fidl_next::Slot<'_, Self>,
23305 decoder_: &mut ___D,
23306 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23307 ::fidl_next::munge! {
23308 let Self {
23309
23310 mut options,
23311
23312 } = slot_;
23313 }
23314
23315 ::fidl_next::Decode::decode(options.as_mut(), decoder_)?;
23316
23317 Ok(())
23318 }
23319}
23320
23321pub type FileEnableVerityResponse = ();
23322
23323pub type WireFileEnableVerityResponse = ();
23325
23326#[doc = " A [`Node`] which contains a sequence of bytes of definite length.\n\n NOTE: cloned connections do not share their seek offset with their source\n connection.\n"]
23328#[derive(PartialEq, Debug)]
23329pub struct File;
23330
23331impl ::fidl_next::Discoverable for File {
23332 const PROTOCOL_NAME: &'static str = "fuchsia.io.File";
23333}
23334
23335pub mod file {
23336 pub mod prelude {
23337 pub use crate::{File, FileClientHandler, FileServerHandler, file};
23338
23339 pub use crate::AdvisoryLockingAdvisoryLockRequest;
23340
23341 pub use crate::AdvisoryLockingAdvisoryLockResponse;
23342
23343 pub use crate::ExtendedAttributeValue;
23344
23345 pub use crate::FileAllocateRequest;
23346
23347 pub use crate::FileEnableVerityRequest;
23348
23349 pub use crate::FileGetBackingMemoryRequest;
23350
23351 pub use crate::FileInfo;
23352
23353 pub use crate::FileReadAtRequest;
23354
23355 pub use crate::FileResizeRequest;
23356
23357 pub use crate::FileSeekRequest;
23358
23359 pub use crate::FileWriteAtRequest;
23360
23361 pub use crate::FileAllocateResponse;
23362
23363 pub use crate::FileEnableVerityResponse;
23364
23365 pub use crate::FileGetBackingMemoryResponse;
23366
23367 pub use crate::FileReadAtResponse;
23368
23369 pub use crate::FileResizeResponse;
23370
23371 pub use crate::FileSeekResponse;
23372
23373 pub use crate::FileWriteAtResponse;
23374
23375 pub use crate::LinkableLinkIntoRequest;
23376
23377 pub use crate::LinkableLinkIntoResponse;
23378
23379 pub use crate::MutableNodeAttributes;
23380
23381 pub use crate::NodeAttributes2;
23382
23383 pub use crate::NodeDeprecatedCloneRequest;
23384
23385 pub use crate::NodeDeprecatedGetAttrResponse;
23386
23387 pub use crate::NodeDeprecatedGetFlagsResponse;
23388
23389 pub use crate::NodeDeprecatedSetAttrRequest;
23390
23391 pub use crate::NodeDeprecatedSetAttrResponse;
23392
23393 pub use crate::NodeDeprecatedSetFlagsRequest;
23394
23395 pub use crate::NodeDeprecatedSetFlagsResponse;
23396
23397 pub use crate::NodeGetAttributesRequest;
23398
23399 pub use crate::NodeGetExtendedAttributeRequest;
23400
23401 pub use crate::NodeListExtendedAttributesRequest;
23402
23403 pub use crate::NodeOnOpenRequest;
23404
23405 pub use crate::NodeQueryFilesystemResponse;
23406
23407 pub use crate::NodeRemoveExtendedAttributeRequest;
23408
23409 pub use crate::NodeSetExtendedAttributeRequest;
23410
23411 pub use crate::NodeSetFlagsRequest;
23412
23413 pub use crate::NodeGetFlagsResponse;
23414
23415 pub use crate::NodeRemoveExtendedAttributeResponse;
23416
23417 pub use crate::NodeSetExtendedAttributeResponse;
23418
23419 pub use crate::NodeSetFlagsResponse;
23420
23421 pub use crate::NodeSyncResponse;
23422
23423 pub use crate::NodeUpdateAttributesResponse;
23424
23425 pub use crate::ReadableReadRequest;
23426
23427 pub use crate::ReadableReadResponse;
23428
23429 pub use crate::Representation;
23430
23431 pub use crate::WritableWriteRequest;
23432
23433 pub use crate::WritableWriteResponse;
23434
23435 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
23436
23437 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
23438
23439 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
23440 }
23441
23442 pub struct AdvisoryLock;
23443
23444 impl ::fidl_next::Method for AdvisoryLock {
23445 const ORDINAL: u64 = 7992130864415541162;
23446
23447 type Protocol = crate::File;
23448
23449 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
23450
23451 type Response = ::fidl_next::WireResult<
23452 'static,
23453 crate::WireAdvisoryLockingAdvisoryLockResponse,
23454 ::fidl_next::WireI32,
23455 >;
23456 }
23457
23458 pub struct LinkInto;
23459
23460 impl ::fidl_next::Method for LinkInto {
23461 const ORDINAL: u64 = 6121399674497678964;
23462
23463 type Protocol = crate::File;
23464
23465 type Request = crate::WireLinkableLinkIntoRequest<'static>;
23466
23467 type Response = ::fidl_next::WireResult<
23468 'static,
23469 crate::WireLinkableLinkIntoResponse,
23470 ::fidl_next::WireI32,
23471 >;
23472 }
23473
23474 pub struct Clone;
23475
23476 impl ::fidl_next::Method for Clone {
23477 const ORDINAL: u64 = 2366825959783828089;
23478
23479 type Protocol = crate::File;
23480
23481 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
23482
23483 type Response = ::fidl_next::Never;
23484 }
23485
23486 pub struct Close;
23487
23488 impl ::fidl_next::Method for Close {
23489 const ORDINAL: u64 = 6540867515453498750;
23490
23491 type Protocol = crate::File;
23492
23493 type Request = ();
23494
23495 type Response = ::fidl_next::WireResult<
23496 'static,
23497 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
23498 ::fidl_next::WireI32,
23499 >;
23500 }
23501
23502 pub struct Query;
23503
23504 impl ::fidl_next::Method for Query {
23505 const ORDINAL: u64 = 2763219980499352582;
23506
23507 type Protocol = crate::File;
23508
23509 type Request = ();
23510
23511 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
23512 }
23513
23514 pub struct DeprecatedClone;
23515
23516 impl ::fidl_next::Method for DeprecatedClone {
23517 const ORDINAL: u64 = 6512600400724287855;
23518
23519 type Protocol = crate::File;
23520
23521 type Request = crate::WireNodeDeprecatedCloneRequest;
23522
23523 type Response = ::fidl_next::Never;
23524 }
23525
23526 pub struct OnOpen;
23527
23528 impl ::fidl_next::Method for OnOpen {
23529 const ORDINAL: u64 = 9207534335756671346;
23530
23531 type Protocol = crate::File;
23532
23533 type Request = ::fidl_next::Never;
23534
23535 type Response = crate::WireNodeOnOpenRequest<'static>;
23536 }
23537
23538 pub struct DeprecatedGetAttr;
23539
23540 impl ::fidl_next::Method for DeprecatedGetAttr {
23541 const ORDINAL: u64 = 8689798978500614909;
23542
23543 type Protocol = crate::File;
23544
23545 type Request = ();
23546
23547 type Response = crate::WireNodeDeprecatedGetAttrResponse;
23548 }
23549
23550 pub struct DeprecatedSetAttr;
23551
23552 impl ::fidl_next::Method for DeprecatedSetAttr {
23553 const ORDINAL: u64 = 4721673413776871238;
23554
23555 type Protocol = crate::File;
23556
23557 type Request = crate::WireNodeDeprecatedSetAttrRequest;
23558
23559 type Response = crate::WireNodeDeprecatedSetAttrResponse;
23560 }
23561
23562 pub struct DeprecatedGetFlags;
23563
23564 impl ::fidl_next::Method for DeprecatedGetFlags {
23565 const ORDINAL: u64 = 6595803110182632097;
23566
23567 type Protocol = crate::File;
23568
23569 type Request = ();
23570
23571 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
23572 }
23573
23574 pub struct DeprecatedSetFlags;
23575
23576 impl ::fidl_next::Method for DeprecatedSetFlags {
23577 const ORDINAL: u64 = 5950864159036794675;
23578
23579 type Protocol = crate::File;
23580
23581 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
23582
23583 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
23584 }
23585
23586 pub struct GetFlags;
23587
23588 impl ::fidl_next::Method for GetFlags {
23589 const ORDINAL: u64 = 105530239381466147;
23590
23591 type Protocol = crate::File;
23592
23593 type Request = ();
23594
23595 type Response = ::fidl_next::WireFlexibleResult<
23596 'static,
23597 crate::WireNodeGetFlagsResponse,
23598 ::fidl_next::WireI32,
23599 >;
23600 }
23601
23602 pub struct SetFlags;
23603
23604 impl ::fidl_next::Method for SetFlags {
23605 const ORDINAL: u64 = 6172186066099445416;
23606
23607 type Protocol = crate::File;
23608
23609 type Request = crate::WireNodeSetFlagsRequest;
23610
23611 type Response = ::fidl_next::WireFlexibleResult<
23612 'static,
23613 crate::WireNodeSetFlagsResponse,
23614 ::fidl_next::WireI32,
23615 >;
23616 }
23617
23618 pub struct QueryFilesystem;
23619
23620 impl ::fidl_next::Method for QueryFilesystem {
23621 const ORDINAL: u64 = 8013111122914313744;
23622
23623 type Protocol = crate::File;
23624
23625 type Request = ();
23626
23627 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
23628 }
23629
23630 pub struct OnRepresentation;
23631
23632 impl ::fidl_next::Method for OnRepresentation {
23633 const ORDINAL: u64 = 6679970090861613324;
23634
23635 type Protocol = crate::File;
23636
23637 type Request = ::fidl_next::Never;
23638
23639 type Response = crate::WireRepresentation<'static>;
23640 }
23641
23642 pub struct GetAttributes;
23643
23644 impl ::fidl_next::Method for GetAttributes {
23645 const ORDINAL: u64 = 4414537700416816443;
23646
23647 type Protocol = crate::File;
23648
23649 type Request = crate::WireNodeGetAttributesRequest;
23650
23651 type Response = ::fidl_next::WireResult<
23652 'static,
23653 crate::WireNodeAttributes2<'static>,
23654 ::fidl_next::WireI32,
23655 >;
23656 }
23657
23658 pub struct UpdateAttributes;
23659
23660 impl ::fidl_next::Method for UpdateAttributes {
23661 const ORDINAL: u64 = 3677402239314018056;
23662
23663 type Protocol = crate::File;
23664
23665 type Request = crate::WireMutableNodeAttributes<'static>;
23666
23667 type Response = ::fidl_next::WireResult<
23668 'static,
23669 crate::WireNodeUpdateAttributesResponse,
23670 ::fidl_next::WireI32,
23671 >;
23672 }
23673
23674 pub struct Sync;
23675
23676 impl ::fidl_next::Method for Sync {
23677 const ORDINAL: u64 = 3196473584242777161;
23678
23679 type Protocol = crate::File;
23680
23681 type Request = ();
23682
23683 type Response =
23684 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
23685 }
23686
23687 pub struct ListExtendedAttributes;
23688
23689 impl ::fidl_next::Method for ListExtendedAttributes {
23690 const ORDINAL: u64 = 5431626189872037072;
23691
23692 type Protocol = crate::File;
23693
23694 type Request = crate::WireNodeListExtendedAttributesRequest;
23695
23696 type Response = ::fidl_next::Never;
23697 }
23698
23699 pub struct GetExtendedAttribute;
23700
23701 impl ::fidl_next::Method for GetExtendedAttribute {
23702 const ORDINAL: u64 = 5043930208506967771;
23703
23704 type Protocol = crate::File;
23705
23706 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
23707
23708 type Response = ::fidl_next::WireResult<
23709 'static,
23710 crate::WireExtendedAttributeValue<'static>,
23711 ::fidl_next::WireI32,
23712 >;
23713 }
23714
23715 pub struct SetExtendedAttribute;
23716
23717 impl ::fidl_next::Method for SetExtendedAttribute {
23718 const ORDINAL: u64 = 5374223046099989052;
23719
23720 type Protocol = crate::File;
23721
23722 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
23723
23724 type Response = ::fidl_next::WireResult<
23725 'static,
23726 crate::WireNodeSetExtendedAttributeResponse,
23727 ::fidl_next::WireI32,
23728 >;
23729 }
23730
23731 pub struct RemoveExtendedAttribute;
23732
23733 impl ::fidl_next::Method for RemoveExtendedAttribute {
23734 const ORDINAL: u64 = 8794297771444732717;
23735
23736 type Protocol = crate::File;
23737
23738 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
23739
23740 type Response = ::fidl_next::WireResult<
23741 'static,
23742 crate::WireNodeRemoveExtendedAttributeResponse,
23743 ::fidl_next::WireI32,
23744 >;
23745 }
23746
23747 pub struct Read;
23748
23749 impl ::fidl_next::Method for Read {
23750 const ORDINAL: u64 = 395825947633028830;
23751
23752 type Protocol = crate::File;
23753
23754 type Request = crate::WireReadableReadRequest;
23755
23756 type Response = ::fidl_next::WireResult<
23757 'static,
23758 crate::WireReadableReadResponse<'static>,
23759 ::fidl_next::WireI32,
23760 >;
23761 }
23762
23763 pub struct Write;
23764
23765 impl ::fidl_next::Method for Write {
23766 const ORDINAL: u64 = 7651971425397809026;
23767
23768 type Protocol = crate::File;
23769
23770 type Request = crate::WireWritableWriteRequest<'static>;
23771
23772 type Response = ::fidl_next::WireResult<
23773 'static,
23774 crate::WireWritableWriteResponse,
23775 ::fidl_next::WireI32,
23776 >;
23777 }
23778
23779 pub struct Describe;
23780
23781 impl ::fidl_next::Method for Describe {
23782 const ORDINAL: u64 = 7545125870053689020;
23783
23784 type Protocol = crate::File;
23785
23786 type Request = ();
23787
23788 type Response = crate::WireFileInfo<'static>;
23789 }
23790
23791 pub struct Seek;
23792
23793 impl ::fidl_next::Method for Seek {
23794 const ORDINAL: u64 = 8649041485622956551;
23795
23796 type Protocol = crate::File;
23797
23798 type Request = crate::WireFileSeekRequest;
23799
23800 type Response =
23801 ::fidl_next::WireResult<'static, crate::WireFileSeekResponse, ::fidl_next::WireI32>;
23802 }
23803
23804 pub struct ReadAt;
23805
23806 impl ::fidl_next::Method for ReadAt {
23807 const ORDINAL: u64 = 1587416148701180478;
23808
23809 type Protocol = crate::File;
23810
23811 type Request = crate::WireFileReadAtRequest;
23812
23813 type Response = ::fidl_next::WireResult<
23814 'static,
23815 crate::WireFileReadAtResponse<'static>,
23816 ::fidl_next::WireI32,
23817 >;
23818 }
23819
23820 pub struct WriteAt;
23821
23822 impl ::fidl_next::Method for WriteAt {
23823 const ORDINAL: u64 = 8736683935131400491;
23824
23825 type Protocol = crate::File;
23826
23827 type Request = crate::WireFileWriteAtRequest<'static>;
23828
23829 type Response =
23830 ::fidl_next::WireResult<'static, crate::WireFileWriteAtResponse, ::fidl_next::WireI32>;
23831 }
23832
23833 pub struct Resize;
23834
23835 impl ::fidl_next::Method for Resize {
23836 const ORDINAL: u64 = 3134648685270758458;
23837
23838 type Protocol = crate::File;
23839
23840 type Request = crate::WireFileResizeRequest;
23841
23842 type Response =
23843 ::fidl_next::WireResult<'static, crate::WireFileResizeResponse, ::fidl_next::WireI32>;
23844 }
23845
23846 pub struct GetBackingMemory;
23847
23848 impl ::fidl_next::Method for GetBackingMemory {
23849 const ORDINAL: u64 = 46911652864194091;
23850
23851 type Protocol = crate::File;
23852
23853 type Request = crate::WireFileGetBackingMemoryRequest;
23854
23855 type Response = ::fidl_next::WireResult<
23856 'static,
23857 crate::WireFileGetBackingMemoryResponse,
23858 ::fidl_next::WireI32,
23859 >;
23860 }
23861
23862 pub struct Allocate;
23863
23864 impl ::fidl_next::Method for Allocate {
23865 const ORDINAL: u64 = 8645235848064269614;
23866
23867 type Protocol = crate::File;
23868
23869 type Request = crate::WireFileAllocateRequest;
23870
23871 type Response = ::fidl_next::WireFlexibleResult<
23872 'static,
23873 crate::WireFileAllocateResponse,
23874 ::fidl_next::WireI32,
23875 >;
23876 }
23877
23878 pub struct EnableVerity;
23879
23880 impl ::fidl_next::Method for EnableVerity {
23881 const ORDINAL: u64 = 3189145313204943035;
23882
23883 type Protocol = crate::File;
23884
23885 type Request = crate::WireFileEnableVerityRequest<'static>;
23886
23887 type Response = ::fidl_next::WireFlexibleResult<
23888 'static,
23889 crate::WireFileEnableVerityResponse,
23890 ::fidl_next::WireI32,
23891 >;
23892 }
23893
23894 mod ___detail {
23895
23896 pub struct AdvisoryLock<T0> {
23897 request: T0,
23898 }
23899
23900 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
23901 where
23902 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
23903 {
23904 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
23905 }
23906
23907 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
23908 where
23909 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23910 ___E: ::fidl_next::Encoder,
23911 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
23912 {
23913 #[inline]
23914 fn encode(
23915 self,
23916 encoder_: &mut ___E,
23917 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23918 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23919 ::fidl_next::munge! {
23920 let Self::Encoded {
23921 request,
23922
23923 } = out_;
23924 }
23925
23926 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
23927
23928 Ok(())
23929 }
23930 }
23931
23932 pub struct LinkInto<T0, T1> {
23933 dst_parent_token: T0,
23934
23935 dst: T1,
23936 }
23937
23938 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
23939 where
23940 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
23941 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
23942 {
23943 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
23944 }
23945
23946 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
23947 where
23948 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23949 ___E: ::fidl_next::Encoder,
23950 ___E: ::fidl_next::fuchsia::HandleEncoder,
23951 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
23952 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
23953 {
23954 #[inline]
23955 fn encode(
23956 self,
23957 encoder_: &mut ___E,
23958 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23960 ::fidl_next::munge! {
23961 let Self::Encoded {
23962 dst_parent_token,
23963 dst,
23964
23965 } = out_;
23966 }
23967
23968 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
23969
23970 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
23971
23972 Ok(())
23973 }
23974 }
23975
23976 pub struct Clone<T0> {
23977 request: T0,
23978 }
23979
23980 impl<T0> ::fidl_next::Encodable for Clone<T0>
23981 where
23982 T0: ::fidl_next::Encodable<
23983 Encoded = ::fidl_next::ServerEnd<
23984 ::fidl_next_fuchsia_unknown::Cloneable,
23985 ::fidl_next::fuchsia::WireChannel,
23986 >,
23987 >,
23988 {
23989 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
23990 }
23991
23992 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
23993 where
23994 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23995 ___E: ::fidl_next::fuchsia::HandleEncoder,
23996 T0: ::fidl_next::Encode<
23997 ___E,
23998 Encoded = ::fidl_next::ServerEnd<
23999 ::fidl_next_fuchsia_unknown::Cloneable,
24000 ::fidl_next::fuchsia::WireChannel,
24001 >,
24002 >,
24003 {
24004 #[inline]
24005 fn encode(
24006 self,
24007 encoder_: &mut ___E,
24008 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24009 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24010 ::fidl_next::munge! {
24011 let Self::Encoded {
24012 request,
24013
24014 } = out_;
24015 }
24016
24017 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
24018
24019 Ok(())
24020 }
24021 }
24022
24023 pub struct DeprecatedClone<T0, T1> {
24024 flags: T0,
24025
24026 object: T1,
24027 }
24028
24029 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
24030 where
24031 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
24032 T1: ::fidl_next::Encodable<
24033 Encoded = ::fidl_next::ServerEnd<
24034 crate::Node,
24035 ::fidl_next::fuchsia::WireChannel,
24036 >,
24037 >,
24038 {
24039 type Encoded = crate::WireNodeDeprecatedCloneRequest;
24040 }
24041
24042 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
24043 where
24044 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24045 ___E: ::fidl_next::fuchsia::HandleEncoder,
24046 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
24047 T1: ::fidl_next::Encode<
24048 ___E,
24049 Encoded = ::fidl_next::ServerEnd<
24050 crate::Node,
24051 ::fidl_next::fuchsia::WireChannel,
24052 >,
24053 >,
24054 {
24055 #[inline]
24056 fn encode(
24057 self,
24058 encoder_: &mut ___E,
24059 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24060 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24061 ::fidl_next::munge! {
24062 let Self::Encoded {
24063 flags,
24064 object,
24065
24066 } = out_;
24067 }
24068
24069 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
24070
24071 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
24072
24073 Ok(())
24074 }
24075 }
24076
24077 pub struct OnOpen<T0, T1> {
24078 s: T0,
24079
24080 info: T1,
24081 }
24082
24083 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
24084 where
24085 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
24086 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
24087 {
24088 type Encoded = crate::WireNodeOnOpenRequest<'static>;
24089 }
24090
24091 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
24092 where
24093 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24094 ___E: ::fidl_next::Encoder,
24095 ___E: ::fidl_next::fuchsia::HandleEncoder,
24096 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
24097 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
24098 {
24099 #[inline]
24100 fn encode(
24101 self,
24102 encoder_: &mut ___E,
24103 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24104 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24105 ::fidl_next::munge! {
24106 let Self::Encoded {
24107 s,
24108 info,
24109
24110 } = out_;
24111 }
24112
24113 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
24114
24115 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
24116
24117 Ok(())
24118 }
24119 }
24120
24121 pub struct DeprecatedSetAttr<T0, T1> {
24122 flags: T0,
24123
24124 attributes: T1,
24125 }
24126
24127 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
24128 where
24129 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
24130 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
24131 {
24132 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
24133 }
24134
24135 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
24136 where
24137 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24138 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
24139 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
24140 {
24141 #[inline]
24142 fn encode(
24143 self,
24144 encoder_: &mut ___E,
24145 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24146 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24147 ::fidl_next::munge! {
24148 let Self::Encoded {
24149 flags,
24150 attributes,
24151
24152 } = out_;
24153 }
24154
24155 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
24156
24157 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
24158
24159 Ok(())
24160 }
24161 }
24162
24163 pub struct DeprecatedSetFlags<T0> {
24164 flags: T0,
24165 }
24166
24167 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
24168 where
24169 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
24170 {
24171 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
24172 }
24173
24174 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
24175 where
24176 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24177 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
24178 {
24179 #[inline]
24180 fn encode(
24181 self,
24182 encoder_: &mut ___E,
24183 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24184 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24185 ::fidl_next::munge! {
24186 let Self::Encoded {
24187 flags,
24188
24189 } = out_;
24190 }
24191
24192 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
24193
24194 Ok(())
24195 }
24196 }
24197
24198 pub struct SetFlags<T0> {
24199 flags: T0,
24200 }
24201
24202 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
24203 where
24204 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
24205 {
24206 type Encoded = crate::WireNodeSetFlagsRequest;
24207 }
24208
24209 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
24210 where
24211 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24212 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
24213 {
24214 #[inline]
24215 fn encode(
24216 self,
24217 encoder_: &mut ___E,
24218 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24219 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24220 ::fidl_next::munge! {
24221 let Self::Encoded {
24222 flags,
24223
24224 } = out_;
24225 }
24226
24227 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
24228
24229 Ok(())
24230 }
24231 }
24232
24233 pub struct GetAttributes<T0> {
24234 query: T0,
24235 }
24236
24237 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
24238 where
24239 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
24240 {
24241 type Encoded = crate::WireNodeGetAttributesRequest;
24242 }
24243
24244 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
24245 where
24246 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24247 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
24248 {
24249 #[inline]
24250 fn encode(
24251 self,
24252 encoder_: &mut ___E,
24253 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24254 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24255 ::fidl_next::munge! {
24256 let Self::Encoded {
24257 query,
24258
24259 } = out_;
24260 }
24261
24262 ::fidl_next::Encode::encode(self.query, encoder_, query)?;
24263
24264 Ok(())
24265 }
24266 }
24267
24268 pub struct ListExtendedAttributes<T0> {
24269 iterator: T0,
24270 }
24271
24272 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
24273 where
24274 T0: ::fidl_next::Encodable<
24275 Encoded = ::fidl_next::ServerEnd<
24276 crate::ExtendedAttributeIterator,
24277 ::fidl_next::fuchsia::WireChannel,
24278 >,
24279 >,
24280 {
24281 type Encoded = crate::WireNodeListExtendedAttributesRequest;
24282 }
24283
24284 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
24285 where
24286 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24287 ___E: ::fidl_next::fuchsia::HandleEncoder,
24288 T0: ::fidl_next::Encode<
24289 ___E,
24290 Encoded = ::fidl_next::ServerEnd<
24291 crate::ExtendedAttributeIterator,
24292 ::fidl_next::fuchsia::WireChannel,
24293 >,
24294 >,
24295 {
24296 #[inline]
24297 fn encode(
24298 self,
24299 encoder_: &mut ___E,
24300 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24301 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24302 ::fidl_next::munge! {
24303 let Self::Encoded {
24304 iterator,
24305
24306 } = out_;
24307 }
24308
24309 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator)?;
24310
24311 Ok(())
24312 }
24313 }
24314
24315 pub struct GetExtendedAttribute<T0> {
24316 name: T0,
24317 }
24318
24319 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
24320 where
24321 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
24322 {
24323 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
24324 }
24325
24326 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
24327 where
24328 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24329 ___E: ::fidl_next::Encoder,
24330 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
24331 {
24332 #[inline]
24333 fn encode(
24334 self,
24335 encoder_: &mut ___E,
24336 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24337 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24338 ::fidl_next::munge! {
24339 let Self::Encoded {
24340 name,
24341
24342 } = out_;
24343 }
24344
24345 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
24346
24347 Ok(())
24348 }
24349 }
24350
24351 pub struct SetExtendedAttribute<T0, T1, T2> {
24352 name: T0,
24353
24354 value: T1,
24355
24356 mode: T2,
24357 }
24358
24359 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
24360 where
24361 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
24362 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
24363 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
24364 {
24365 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
24366 }
24367
24368 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
24369 where
24370 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24371 ___E: ::fidl_next::Encoder,
24372 ___E: ::fidl_next::fuchsia::HandleEncoder,
24373 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
24374 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
24375 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
24376 {
24377 #[inline]
24378 fn encode(
24379 self,
24380 encoder_: &mut ___E,
24381 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24382 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24383 ::fidl_next::munge! {
24384 let Self::Encoded {
24385 name,
24386 value,
24387 mode,
24388
24389 } = out_;
24390 }
24391
24392 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
24393
24394 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
24395
24396 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
24397
24398 Ok(())
24399 }
24400 }
24401
24402 pub struct RemoveExtendedAttribute<T0> {
24403 name: T0,
24404 }
24405
24406 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
24407 where
24408 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
24409 {
24410 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
24411 }
24412
24413 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
24414 where
24415 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24416 ___E: ::fidl_next::Encoder,
24417 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
24418 {
24419 #[inline]
24420 fn encode(
24421 self,
24422 encoder_: &mut ___E,
24423 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24424 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24425 ::fidl_next::munge! {
24426 let Self::Encoded {
24427 name,
24428
24429 } = out_;
24430 }
24431
24432 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
24433
24434 Ok(())
24435 }
24436 }
24437
24438 pub struct Read<T0> {
24439 count: T0,
24440 }
24441
24442 impl<T0> ::fidl_next::Encodable for Read<T0>
24443 where
24444 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24445 {
24446 type Encoded = crate::WireReadableReadRequest;
24447 }
24448
24449 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
24450 where
24451 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24452 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24453 {
24454 #[inline]
24455 fn encode(
24456 self,
24457 encoder_: &mut ___E,
24458 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24459 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24460 ::fidl_next::munge! {
24461 let Self::Encoded {
24462 count,
24463
24464 } = out_;
24465 }
24466
24467 ::fidl_next::Encode::encode(self.count, encoder_, count)?;
24468
24469 Ok(())
24470 }
24471 }
24472
24473 pub struct Write<T0> {
24474 data: T0,
24475 }
24476
24477 impl<T0> ::fidl_next::Encodable for Write<T0>
24478 where
24479 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
24480 {
24481 type Encoded = crate::WireWritableWriteRequest<'static>;
24482 }
24483
24484 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
24485 where
24486 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24487 ___E: ::fidl_next::Encoder,
24488 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
24489 {
24490 #[inline]
24491 fn encode(
24492 self,
24493 encoder_: &mut ___E,
24494 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24496 ::fidl_next::munge! {
24497 let Self::Encoded {
24498 data,
24499
24500 } = out_;
24501 }
24502
24503 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
24504
24505 Ok(())
24506 }
24507 }
24508
24509 pub struct Seek<T0, T1> {
24510 origin: T0,
24511
24512 offset: T1,
24513 }
24514
24515 impl<T0, T1> ::fidl_next::Encodable for Seek<T0, T1>
24516 where
24517 T0: ::fidl_next::Encodable<Encoded = crate::WireSeekOrigin>,
24518 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI64>,
24519 {
24520 type Encoded = crate::WireFileSeekRequest;
24521 }
24522
24523 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Seek<T0, T1>
24524 where
24525 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24526 T0: ::fidl_next::Encode<___E, Encoded = crate::WireSeekOrigin>,
24527 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI64>,
24528 {
24529 #[inline]
24530 fn encode(
24531 self,
24532 encoder_: &mut ___E,
24533 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24534 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24535 ::fidl_next::munge! {
24536 let Self::Encoded {
24537 origin,
24538 offset,
24539
24540 } = out_;
24541 }
24542
24543 ::fidl_next::Encode::encode(self.origin, encoder_, origin)?;
24544
24545 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
24546
24547 Ok(())
24548 }
24549 }
24550
24551 pub struct ReadAt<T0, T1> {
24552 count: T0,
24553
24554 offset: T1,
24555 }
24556
24557 impl<T0, T1> ::fidl_next::Encodable for ReadAt<T0, T1>
24558 where
24559 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24560 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24561 {
24562 type Encoded = crate::WireFileReadAtRequest;
24563 }
24564
24565 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ReadAt<T0, T1>
24566 where
24567 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24568 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24569 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24570 {
24571 #[inline]
24572 fn encode(
24573 self,
24574 encoder_: &mut ___E,
24575 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24576 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24577 ::fidl_next::munge! {
24578 let Self::Encoded {
24579 count,
24580 offset,
24581
24582 } = out_;
24583 }
24584
24585 ::fidl_next::Encode::encode(self.count, encoder_, count)?;
24586
24587 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
24588
24589 Ok(())
24590 }
24591 }
24592
24593 pub struct WriteAt<T0, T1> {
24594 data: T0,
24595
24596 offset: T1,
24597 }
24598
24599 impl<T0, T1> ::fidl_next::Encodable for WriteAt<T0, T1>
24600 where
24601 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
24602 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24603 {
24604 type Encoded = crate::WireFileWriteAtRequest<'static>;
24605 }
24606
24607 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for WriteAt<T0, T1>
24608 where
24609 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24610 ___E: ::fidl_next::Encoder,
24611 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
24612 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24613 {
24614 #[inline]
24615 fn encode(
24616 self,
24617 encoder_: &mut ___E,
24618 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24619 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24620 ::fidl_next::munge! {
24621 let Self::Encoded {
24622 data,
24623 offset,
24624
24625 } = out_;
24626 }
24627
24628 ::fidl_next::Encode::encode(self.data, encoder_, data)?;
24629
24630 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
24631
24632 Ok(())
24633 }
24634 }
24635
24636 pub struct Resize<T0> {
24637 length: T0,
24638 }
24639
24640 impl<T0> ::fidl_next::Encodable for Resize<T0>
24641 where
24642 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24643 {
24644 type Encoded = crate::WireFileResizeRequest;
24645 }
24646
24647 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Resize<T0>
24648 where
24649 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24650 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24651 {
24652 #[inline]
24653 fn encode(
24654 self,
24655 encoder_: &mut ___E,
24656 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24657 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24658 ::fidl_next::munge! {
24659 let Self::Encoded {
24660 length,
24661
24662 } = out_;
24663 }
24664
24665 ::fidl_next::Encode::encode(self.length, encoder_, length)?;
24666
24667 Ok(())
24668 }
24669 }
24670
24671 pub struct GetBackingMemory<T0> {
24672 flags: T0,
24673 }
24674
24675 impl<T0> ::fidl_next::Encodable for GetBackingMemory<T0>
24676 where
24677 T0: ::fidl_next::Encodable<Encoded = crate::WireVmoFlags>,
24678 {
24679 type Encoded = crate::WireFileGetBackingMemoryRequest;
24680 }
24681
24682 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetBackingMemory<T0>
24683 where
24684 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24685 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVmoFlags>,
24686 {
24687 #[inline]
24688 fn encode(
24689 self,
24690 encoder_: &mut ___E,
24691 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24692 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24693 ::fidl_next::munge! {
24694 let Self::Encoded {
24695 flags,
24696
24697 } = out_;
24698 }
24699
24700 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
24701
24702 Ok(())
24703 }
24704 }
24705
24706 pub struct Allocate<T0, T1, T2> {
24707 offset: T0,
24708
24709 length: T1,
24710
24711 mode: T2,
24712 }
24713
24714 impl<T0, T1, T2> ::fidl_next::Encodable for Allocate<T0, T1, T2>
24715 where
24716 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24717 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
24718 T2: ::fidl_next::Encodable<Encoded = crate::WireAllocateMode>,
24719 {
24720 type Encoded = crate::WireFileAllocateRequest;
24721 }
24722
24723 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Allocate<T0, T1, T2>
24724 where
24725 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24726 ___E: ::fidl_next::fuchsia::HandleEncoder,
24727 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24728 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
24729 T2: ::fidl_next::Encode<___E, Encoded = crate::WireAllocateMode>,
24730 {
24731 #[inline]
24732 fn encode(
24733 self,
24734 encoder_: &mut ___E,
24735 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24736 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24737 ::fidl_next::munge! {
24738 let Self::Encoded {
24739 offset,
24740 length,
24741 mode,
24742
24743 } = out_;
24744 }
24745
24746 ::fidl_next::Encode::encode(self.offset, encoder_, offset)?;
24747
24748 ::fidl_next::Encode::encode(self.length, encoder_, length)?;
24749
24750 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
24751
24752 Ok(())
24753 }
24754 }
24755
24756 pub struct EnableVerity<T0> {
24757 options: T0,
24758 }
24759
24760 impl<T0> ::fidl_next::Encodable for EnableVerity<T0>
24761 where
24762 T0: ::fidl_next::Encodable<Encoded = crate::WireVerificationOptions<'static>>,
24763 {
24764 type Encoded = crate::WireFileEnableVerityRequest<'static>;
24765 }
24766
24767 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for EnableVerity<T0>
24768 where
24769 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24770 ___E: ::fidl_next::Encoder,
24771 ___E: ::fidl_next::fuchsia::HandleEncoder,
24772 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVerificationOptions<'static>>,
24773 {
24774 #[inline]
24775 fn encode(
24776 self,
24777 encoder_: &mut ___E,
24778 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24780 ::fidl_next::munge! {
24781 let Self::Encoded {
24782 options,
24783
24784 } = out_;
24785 }
24786
24787 ::fidl_next::Encode::encode(self.options, encoder_, options)?;
24788
24789 Ok(())
24790 }
24791 }
24792
24793 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::File
24794 where
24795 ___T: ::fidl_next::Transport,
24796 {
24797 type Client = FileClient<___T>;
24798 type Server = FileServer<___T>;
24799 }
24800
24801 #[repr(transparent)]
24803 pub struct FileClient<___T: ::fidl_next::Transport> {
24804 #[allow(dead_code)]
24805 client: ::fidl_next::protocol::Client<___T>,
24806 }
24807
24808 impl<___T> FileClient<___T>
24809 where
24810 ___T: ::fidl_next::Transport,
24811 {
24812 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
24813 pub fn advisory_lock(
24814 &self,
24815
24816 request: impl ::fidl_next::Encode<
24817 <___T as ::fidl_next::Transport>::SendBuffer,
24818 Encoded = crate::WireAdvisoryLockRequest<'static>,
24819 >,
24820 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
24821 where
24822 <___T as ::fidl_next::Transport>::SendBuffer:
24823 ::fidl_next::encoder::InternalHandleEncoder,
24824 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24825 {
24826 self.advisory_lock_with(AdvisoryLock { request })
24827 }
24828
24829 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
24830 pub fn advisory_lock_with<___R>(
24831 &self,
24832 request: ___R,
24833 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
24834 where
24835 ___R: ::fidl_next::Encode<
24836 <___T as ::fidl_next::Transport>::SendBuffer,
24837 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
24838 >,
24839 {
24840 ::fidl_next::TwoWayFuture::from_untyped(
24841 self.client.send_two_way(7992130864415541162, request),
24842 )
24843 }
24844
24845 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
24846 pub fn link_into(
24847 &self,
24848
24849 dst_parent_token: impl ::fidl_next::Encode<
24850 <___T as ::fidl_next::Transport>::SendBuffer,
24851 Encoded = ::fidl_next::fuchsia::WireEvent,
24852 >,
24853
24854 dst: impl ::fidl_next::Encode<
24855 <___T as ::fidl_next::Transport>::SendBuffer,
24856 Encoded = ::fidl_next::WireString<'static>,
24857 >,
24858 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
24859 where
24860 <___T as ::fidl_next::Transport>::SendBuffer:
24861 ::fidl_next::encoder::InternalHandleEncoder,
24862 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24863 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24864 {
24865 self.link_into_with(LinkInto { dst_parent_token, dst })
24866 }
24867
24868 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
24869 pub fn link_into_with<___R>(
24870 &self,
24871 request: ___R,
24872 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
24873 where
24874 ___R: ::fidl_next::Encode<
24875 <___T as ::fidl_next::Transport>::SendBuffer,
24876 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
24877 >,
24878 {
24879 ::fidl_next::TwoWayFuture::from_untyped(
24880 self.client.send_two_way(6121399674497678964, request),
24881 )
24882 }
24883
24884 pub fn clone(
24885 &self,
24886
24887 request: impl ::fidl_next::Encode<
24888 <___T as ::fidl_next::Transport>::SendBuffer,
24889 Encoded = ::fidl_next::ServerEnd<
24890 ::fidl_next_fuchsia_unknown::Cloneable,
24891 ::fidl_next::fuchsia::WireChannel,
24892 >,
24893 >,
24894 ) -> ::fidl_next::SendFuture<'_, ___T>
24895 where
24896 <___T as ::fidl_next::Transport>::SendBuffer:
24897 ::fidl_next::encoder::InternalHandleEncoder,
24898 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24899 {
24900 self.clone_with(Clone { request })
24901 }
24902
24903 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
24904 where
24905 ___R: ::fidl_next::Encode<
24906 <___T as ::fidl_next::Transport>::SendBuffer,
24907 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
24908 >,
24909 {
24910 ::fidl_next::SendFuture::from_untyped(
24911 self.client.send_one_way(2366825959783828089, request),
24912 )
24913 }
24914
24915 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
24916 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
24917 ::fidl_next::TwoWayFuture::from_untyped(
24918 self.client.send_two_way(6540867515453498750, ()),
24919 )
24920 }
24921
24922 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
24923 ::fidl_next::TwoWayFuture::from_untyped(
24924 self.client.send_two_way(2763219980499352582, ()),
24925 )
24926 }
24927
24928 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
24929 pub fn deprecated_clone(
24930 &self,
24931
24932 flags: impl ::fidl_next::Encode<
24933 <___T as ::fidl_next::Transport>::SendBuffer,
24934 Encoded = crate::WireOpenFlags,
24935 >,
24936
24937 object: impl ::fidl_next::Encode<
24938 <___T as ::fidl_next::Transport>::SendBuffer,
24939 Encoded = ::fidl_next::ServerEnd<
24940 crate::Node,
24941 ::fidl_next::fuchsia::WireChannel,
24942 >,
24943 >,
24944 ) -> ::fidl_next::SendFuture<'_, ___T>
24945 where
24946 <___T as ::fidl_next::Transport>::SendBuffer:
24947 ::fidl_next::encoder::InternalHandleEncoder,
24948 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24949 {
24950 self.deprecated_clone_with(DeprecatedClone { flags, object })
24951 }
24952
24953 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
24954 pub fn deprecated_clone_with<___R>(
24955 &self,
24956 request: ___R,
24957 ) -> ::fidl_next::SendFuture<'_, ___T>
24958 where
24959 ___R: ::fidl_next::Encode<
24960 <___T as ::fidl_next::Transport>::SendBuffer,
24961 Encoded = crate::WireNodeDeprecatedCloneRequest,
24962 >,
24963 {
24964 ::fidl_next::SendFuture::from_untyped(
24965 self.client.send_one_way(6512600400724287855, request),
24966 )
24967 }
24968
24969 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
24970 pub fn deprecated_get_attr(
24971 &self,
24972 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
24973 ::fidl_next::TwoWayFuture::from_untyped(
24974 self.client.send_two_way(8689798978500614909, ()),
24975 )
24976 }
24977
24978 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
24979 pub fn deprecated_set_attr(
24980 &self,
24981
24982 flags: impl ::fidl_next::Encode<
24983 <___T as ::fidl_next::Transport>::SendBuffer,
24984 Encoded = crate::WireNodeAttributeFlags,
24985 >,
24986
24987 attributes: impl ::fidl_next::Encode<
24988 <___T as ::fidl_next::Transport>::SendBuffer,
24989 Encoded = crate::WireNodeAttributes,
24990 >,
24991 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
24992 where
24993 <___T as ::fidl_next::Transport>::SendBuffer:
24994 ::fidl_next::encoder::InternalHandleEncoder,
24995 {
24996 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
24997 }
24998
24999 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
25000 pub fn deprecated_set_attr_with<___R>(
25001 &self,
25002 request: ___R,
25003 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
25004 where
25005 ___R: ::fidl_next::Encode<
25006 <___T as ::fidl_next::Transport>::SendBuffer,
25007 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
25008 >,
25009 {
25010 ::fidl_next::TwoWayFuture::from_untyped(
25011 self.client.send_two_way(4721673413776871238, request),
25012 )
25013 }
25014
25015 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
25016 pub fn deprecated_get_flags(
25017 &self,
25018 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
25019 ::fidl_next::TwoWayFuture::from_untyped(
25020 self.client.send_two_way(6595803110182632097, ()),
25021 )
25022 }
25023
25024 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
25025 pub fn deprecated_set_flags(
25026 &self,
25027
25028 flags: impl ::fidl_next::Encode<
25029 <___T as ::fidl_next::Transport>::SendBuffer,
25030 Encoded = crate::WireOpenFlags,
25031 >,
25032 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
25033 where
25034 <___T as ::fidl_next::Transport>::SendBuffer:
25035 ::fidl_next::encoder::InternalHandleEncoder,
25036 {
25037 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
25038 }
25039
25040 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
25041 pub fn deprecated_set_flags_with<___R>(
25042 &self,
25043 request: ___R,
25044 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
25045 where
25046 ___R: ::fidl_next::Encode<
25047 <___T as ::fidl_next::Transport>::SendBuffer,
25048 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
25049 >,
25050 {
25051 ::fidl_next::TwoWayFuture::from_untyped(
25052 self.client.send_two_way(5950864159036794675, request),
25053 )
25054 }
25055
25056 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
25057 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
25058 ::fidl_next::TwoWayFuture::from_untyped(
25059 self.client.send_two_way(105530239381466147, ()),
25060 )
25061 }
25062
25063 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
25064 pub fn set_flags(
25065 &self,
25066
25067 flags: impl ::fidl_next::Encode<
25068 <___T as ::fidl_next::Transport>::SendBuffer,
25069 Encoded = crate::WireFlags,
25070 >,
25071 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
25072 where
25073 <___T as ::fidl_next::Transport>::SendBuffer:
25074 ::fidl_next::encoder::InternalHandleEncoder,
25075 {
25076 self.set_flags_with(SetFlags { flags })
25077 }
25078
25079 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
25080 pub fn set_flags_with<___R>(
25081 &self,
25082 request: ___R,
25083 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
25084 where
25085 ___R: ::fidl_next::Encode<
25086 <___T as ::fidl_next::Transport>::SendBuffer,
25087 Encoded = crate::WireNodeSetFlagsRequest,
25088 >,
25089 {
25090 ::fidl_next::TwoWayFuture::from_untyped(
25091 self.client.send_two_way(6172186066099445416, request),
25092 )
25093 }
25094
25095 #[doc = " Query the filesystem for filesystem-specific information.\n"]
25096 pub fn query_filesystem(
25097 &self,
25098 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
25099 ::fidl_next::TwoWayFuture::from_untyped(
25100 self.client.send_two_way(8013111122914313744, ()),
25101 )
25102 }
25103
25104 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25105 pub fn get_attributes(
25106 &self,
25107
25108 query: impl ::fidl_next::Encode<
25109 <___T as ::fidl_next::Transport>::SendBuffer,
25110 Encoded = crate::WireNodeAttributesQuery,
25111 >,
25112 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
25113 where
25114 <___T as ::fidl_next::Transport>::SendBuffer:
25115 ::fidl_next::encoder::InternalHandleEncoder,
25116 {
25117 self.get_attributes_with(GetAttributes { query })
25118 }
25119
25120 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25121 pub fn get_attributes_with<___R>(
25122 &self,
25123 request: ___R,
25124 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
25125 where
25126 ___R: ::fidl_next::Encode<
25127 <___T as ::fidl_next::Transport>::SendBuffer,
25128 Encoded = crate::WireNodeGetAttributesRequest,
25129 >,
25130 {
25131 ::fidl_next::TwoWayFuture::from_untyped(
25132 self.client.send_two_way(4414537700416816443, request),
25133 )
25134 }
25135
25136 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25137 pub fn update_attributes_with<___R>(
25138 &self,
25139 request: ___R,
25140 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
25141 where
25142 ___R: ::fidl_next::Encode<
25143 <___T as ::fidl_next::Transport>::SendBuffer,
25144 Encoded = crate::WireMutableNodeAttributes<'static>,
25145 >,
25146 {
25147 ::fidl_next::TwoWayFuture::from_untyped(
25148 self.client.send_two_way(3677402239314018056, request),
25149 )
25150 }
25151
25152 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
25153 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
25154 ::fidl_next::TwoWayFuture::from_untyped(
25155 self.client.send_two_way(3196473584242777161, ()),
25156 )
25157 }
25158
25159 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25160 pub fn list_extended_attributes(
25161 &self,
25162
25163 iterator: impl ::fidl_next::Encode<
25164 <___T as ::fidl_next::Transport>::SendBuffer,
25165 Encoded = ::fidl_next::ServerEnd<
25166 crate::ExtendedAttributeIterator,
25167 ::fidl_next::fuchsia::WireChannel,
25168 >,
25169 >,
25170 ) -> ::fidl_next::SendFuture<'_, ___T>
25171 where
25172 <___T as ::fidl_next::Transport>::SendBuffer:
25173 ::fidl_next::encoder::InternalHandleEncoder,
25174 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
25175 {
25176 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
25177 }
25178
25179 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25180 pub fn list_extended_attributes_with<___R>(
25181 &self,
25182 request: ___R,
25183 ) -> ::fidl_next::SendFuture<'_, ___T>
25184 where
25185 ___R: ::fidl_next::Encode<
25186 <___T as ::fidl_next::Transport>::SendBuffer,
25187 Encoded = crate::WireNodeListExtendedAttributesRequest,
25188 >,
25189 {
25190 ::fidl_next::SendFuture::from_untyped(
25191 self.client.send_one_way(5431626189872037072, request),
25192 )
25193 }
25194
25195 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25196 pub fn get_extended_attribute(
25197 &self,
25198
25199 name: impl ::fidl_next::Encode<
25200 <___T as ::fidl_next::Transport>::SendBuffer,
25201 Encoded = ::fidl_next::WireVector<'static, u8>,
25202 >,
25203 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
25204 where
25205 <___T as ::fidl_next::Transport>::SendBuffer:
25206 ::fidl_next::encoder::InternalHandleEncoder,
25207 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25208 {
25209 self.get_extended_attribute_with(GetExtendedAttribute { name })
25210 }
25211
25212 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25213 pub fn get_extended_attribute_with<___R>(
25214 &self,
25215 request: ___R,
25216 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
25217 where
25218 ___R: ::fidl_next::Encode<
25219 <___T as ::fidl_next::Transport>::SendBuffer,
25220 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
25221 >,
25222 {
25223 ::fidl_next::TwoWayFuture::from_untyped(
25224 self.client.send_two_way(5043930208506967771, request),
25225 )
25226 }
25227
25228 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25229 pub fn set_extended_attribute(
25230 &self,
25231
25232 name: impl ::fidl_next::Encode<
25233 <___T as ::fidl_next::Transport>::SendBuffer,
25234 Encoded = ::fidl_next::WireVector<'static, u8>,
25235 >,
25236
25237 value: impl ::fidl_next::Encode<
25238 <___T as ::fidl_next::Transport>::SendBuffer,
25239 Encoded = crate::WireExtendedAttributeValue<'static>,
25240 >,
25241
25242 mode: impl ::fidl_next::Encode<
25243 <___T as ::fidl_next::Transport>::SendBuffer,
25244 Encoded = crate::WireSetExtendedAttributeMode,
25245 >,
25246 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
25247 where
25248 <___T as ::fidl_next::Transport>::SendBuffer:
25249 ::fidl_next::encoder::InternalHandleEncoder,
25250 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25251 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
25252 {
25253 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
25254 }
25255
25256 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25257 pub fn set_extended_attribute_with<___R>(
25258 &self,
25259 request: ___R,
25260 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
25261 where
25262 ___R: ::fidl_next::Encode<
25263 <___T as ::fidl_next::Transport>::SendBuffer,
25264 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
25265 >,
25266 {
25267 ::fidl_next::TwoWayFuture::from_untyped(
25268 self.client.send_two_way(5374223046099989052, request),
25269 )
25270 }
25271
25272 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25273 pub fn remove_extended_attribute(
25274 &self,
25275
25276 name: impl ::fidl_next::Encode<
25277 <___T as ::fidl_next::Transport>::SendBuffer,
25278 Encoded = ::fidl_next::WireVector<'static, u8>,
25279 >,
25280 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
25281 where
25282 <___T as ::fidl_next::Transport>::SendBuffer:
25283 ::fidl_next::encoder::InternalHandleEncoder,
25284 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25285 {
25286 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
25287 }
25288
25289 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25290 pub fn remove_extended_attribute_with<___R>(
25291 &self,
25292 request: ___R,
25293 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
25294 where
25295 ___R: ::fidl_next::Encode<
25296 <___T as ::fidl_next::Transport>::SendBuffer,
25297 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
25298 >,
25299 {
25300 ::fidl_next::TwoWayFuture::from_untyped(
25301 self.client.send_two_way(8794297771444732717, request),
25302 )
25303 }
25304
25305 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
25306 pub fn read(
25307 &self,
25308
25309 count: impl ::fidl_next::Encode<
25310 <___T as ::fidl_next::Transport>::SendBuffer,
25311 Encoded = ::fidl_next::WireU64,
25312 >,
25313 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
25314 where
25315 <___T as ::fidl_next::Transport>::SendBuffer:
25316 ::fidl_next::encoder::InternalHandleEncoder,
25317 {
25318 self.read_with(Read { count })
25319 }
25320
25321 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
25322 pub fn read_with<___R>(
25323 &self,
25324 request: ___R,
25325 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
25326 where
25327 ___R: ::fidl_next::Encode<
25328 <___T as ::fidl_next::Transport>::SendBuffer,
25329 Encoded = crate::WireReadableReadRequest,
25330 >,
25331 {
25332 ::fidl_next::TwoWayFuture::from_untyped(
25333 self.client.send_two_way(395825947633028830, request),
25334 )
25335 }
25336
25337 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25338 pub fn write(
25339 &self,
25340
25341 data: impl ::fidl_next::Encode<
25342 <___T as ::fidl_next::Transport>::SendBuffer,
25343 Encoded = ::fidl_next::WireVector<'static, u8>,
25344 >,
25345 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
25346 where
25347 <___T as ::fidl_next::Transport>::SendBuffer:
25348 ::fidl_next::encoder::InternalHandleEncoder,
25349 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25350 {
25351 self.write_with(Write { data })
25352 }
25353
25354 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25355 pub fn write_with<___R>(
25356 &self,
25357 request: ___R,
25358 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
25359 where
25360 ___R: ::fidl_next::Encode<
25361 <___T as ::fidl_next::Transport>::SendBuffer,
25362 Encoded = crate::WireWritableWriteRequest<'static>,
25363 >,
25364 {
25365 ::fidl_next::TwoWayFuture::from_untyped(
25366 self.client.send_two_way(7651971425397809026, request),
25367 )
25368 }
25369
25370 pub fn describe(&self) -> ::fidl_next::TwoWayFuture<'_, super::Describe, ___T> {
25371 ::fidl_next::TwoWayFuture::from_untyped(
25372 self.client.send_two_way(7545125870053689020, ()),
25373 )
25374 }
25375
25376 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
25377 pub fn seek(
25378 &self,
25379
25380 origin: impl ::fidl_next::Encode<
25381 <___T as ::fidl_next::Transport>::SendBuffer,
25382 Encoded = crate::WireSeekOrigin,
25383 >,
25384
25385 offset: impl ::fidl_next::Encode<
25386 <___T as ::fidl_next::Transport>::SendBuffer,
25387 Encoded = ::fidl_next::WireI64,
25388 >,
25389 ) -> ::fidl_next::TwoWayFuture<'_, super::Seek, ___T>
25390 where
25391 <___T as ::fidl_next::Transport>::SendBuffer:
25392 ::fidl_next::encoder::InternalHandleEncoder,
25393 {
25394 self.seek_with(Seek { origin, offset })
25395 }
25396
25397 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
25398 pub fn seek_with<___R>(
25399 &self,
25400 request: ___R,
25401 ) -> ::fidl_next::TwoWayFuture<'_, super::Seek, ___T>
25402 where
25403 ___R: ::fidl_next::Encode<
25404 <___T as ::fidl_next::Transport>::SendBuffer,
25405 Encoded = crate::WireFileSeekRequest,
25406 >,
25407 {
25408 ::fidl_next::TwoWayFuture::from_untyped(
25409 self.client.send_two_way(8649041485622956551, request),
25410 )
25411 }
25412
25413 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
25414 pub fn read_at(
25415 &self,
25416
25417 count: impl ::fidl_next::Encode<
25418 <___T as ::fidl_next::Transport>::SendBuffer,
25419 Encoded = ::fidl_next::WireU64,
25420 >,
25421
25422 offset: impl ::fidl_next::Encode<
25423 <___T as ::fidl_next::Transport>::SendBuffer,
25424 Encoded = ::fidl_next::WireU64,
25425 >,
25426 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadAt, ___T>
25427 where
25428 <___T as ::fidl_next::Transport>::SendBuffer:
25429 ::fidl_next::encoder::InternalHandleEncoder,
25430 {
25431 self.read_at_with(ReadAt { count, offset })
25432 }
25433
25434 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
25435 pub fn read_at_with<___R>(
25436 &self,
25437 request: ___R,
25438 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadAt, ___T>
25439 where
25440 ___R: ::fidl_next::Encode<
25441 <___T as ::fidl_next::Transport>::SendBuffer,
25442 Encoded = crate::WireFileReadAtRequest,
25443 >,
25444 {
25445 ::fidl_next::TwoWayFuture::from_untyped(
25446 self.client.send_two_way(1587416148701180478, request),
25447 )
25448 }
25449
25450 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25451 pub fn write_at(
25452 &self,
25453
25454 data: impl ::fidl_next::Encode<
25455 <___T as ::fidl_next::Transport>::SendBuffer,
25456 Encoded = ::fidl_next::WireVector<'static, u8>,
25457 >,
25458
25459 offset: impl ::fidl_next::Encode<
25460 <___T as ::fidl_next::Transport>::SendBuffer,
25461 Encoded = ::fidl_next::WireU64,
25462 >,
25463 ) -> ::fidl_next::TwoWayFuture<'_, super::WriteAt, ___T>
25464 where
25465 <___T as ::fidl_next::Transport>::SendBuffer:
25466 ::fidl_next::encoder::InternalHandleEncoder,
25467 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25468 {
25469 self.write_at_with(WriteAt { data, offset })
25470 }
25471
25472 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25473 pub fn write_at_with<___R>(
25474 &self,
25475 request: ___R,
25476 ) -> ::fidl_next::TwoWayFuture<'_, super::WriteAt, ___T>
25477 where
25478 ___R: ::fidl_next::Encode<
25479 <___T as ::fidl_next::Transport>::SendBuffer,
25480 Encoded = crate::WireFileWriteAtRequest<'static>,
25481 >,
25482 {
25483 ::fidl_next::TwoWayFuture::from_untyped(
25484 self.client.send_two_way(8736683935131400491, request),
25485 )
25486 }
25487
25488 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25489 pub fn resize(
25490 &self,
25491
25492 length: impl ::fidl_next::Encode<
25493 <___T as ::fidl_next::Transport>::SendBuffer,
25494 Encoded = ::fidl_next::WireU64,
25495 >,
25496 ) -> ::fidl_next::TwoWayFuture<'_, super::Resize, ___T>
25497 where
25498 <___T as ::fidl_next::Transport>::SendBuffer:
25499 ::fidl_next::encoder::InternalHandleEncoder,
25500 {
25501 self.resize_with(Resize { length })
25502 }
25503
25504 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
25505 pub fn resize_with<___R>(
25506 &self,
25507 request: ___R,
25508 ) -> ::fidl_next::TwoWayFuture<'_, super::Resize, ___T>
25509 where
25510 ___R: ::fidl_next::Encode<
25511 <___T as ::fidl_next::Transport>::SendBuffer,
25512 Encoded = crate::WireFileResizeRequest,
25513 >,
25514 {
25515 ::fidl_next::TwoWayFuture::from_untyped(
25516 self.client.send_two_way(3134648685270758458, request),
25517 )
25518 }
25519
25520 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
25521 pub fn get_backing_memory(
25522 &self,
25523
25524 flags: impl ::fidl_next::Encode<
25525 <___T as ::fidl_next::Transport>::SendBuffer,
25526 Encoded = crate::WireVmoFlags,
25527 >,
25528 ) -> ::fidl_next::TwoWayFuture<'_, super::GetBackingMemory, ___T>
25529 where
25530 <___T as ::fidl_next::Transport>::SendBuffer:
25531 ::fidl_next::encoder::InternalHandleEncoder,
25532 {
25533 self.get_backing_memory_with(GetBackingMemory { flags })
25534 }
25535
25536 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
25537 pub fn get_backing_memory_with<___R>(
25538 &self,
25539 request: ___R,
25540 ) -> ::fidl_next::TwoWayFuture<'_, super::GetBackingMemory, ___T>
25541 where
25542 ___R: ::fidl_next::Encode<
25543 <___T as ::fidl_next::Transport>::SendBuffer,
25544 Encoded = crate::WireFileGetBackingMemoryRequest,
25545 >,
25546 {
25547 ::fidl_next::TwoWayFuture::from_untyped(
25548 self.client.send_two_way(46911652864194091, request),
25549 )
25550 }
25551
25552 #[doc = " Pre-allocate on-disk space for this file.\n"]
25553 pub fn allocate(
25554 &self,
25555
25556 offset: impl ::fidl_next::Encode<
25557 <___T as ::fidl_next::Transport>::SendBuffer,
25558 Encoded = ::fidl_next::WireU64,
25559 >,
25560
25561 length: impl ::fidl_next::Encode<
25562 <___T as ::fidl_next::Transport>::SendBuffer,
25563 Encoded = ::fidl_next::WireU64,
25564 >,
25565
25566 mode: impl ::fidl_next::Encode<
25567 <___T as ::fidl_next::Transport>::SendBuffer,
25568 Encoded = crate::WireAllocateMode,
25569 >,
25570 ) -> ::fidl_next::TwoWayFuture<'_, super::Allocate, ___T>
25571 where
25572 <___T as ::fidl_next::Transport>::SendBuffer:
25573 ::fidl_next::encoder::InternalHandleEncoder,
25574 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
25575 {
25576 self.allocate_with(Allocate { offset, length, mode })
25577 }
25578
25579 #[doc = " Pre-allocate on-disk space for this file.\n"]
25580 pub fn allocate_with<___R>(
25581 &self,
25582 request: ___R,
25583 ) -> ::fidl_next::TwoWayFuture<'_, super::Allocate, ___T>
25584 where
25585 ___R: ::fidl_next::Encode<
25586 <___T as ::fidl_next::Transport>::SendBuffer,
25587 Encoded = crate::WireFileAllocateRequest,
25588 >,
25589 {
25590 ::fidl_next::TwoWayFuture::from_untyped(
25591 self.client.send_two_way(8645235848064269614, request),
25592 )
25593 }
25594
25595 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
25596 pub fn enable_verity(
25597 &self,
25598
25599 options: impl ::fidl_next::Encode<
25600 <___T as ::fidl_next::Transport>::SendBuffer,
25601 Encoded = crate::WireVerificationOptions<'static>,
25602 >,
25603 ) -> ::fidl_next::TwoWayFuture<'_, super::EnableVerity, ___T>
25604 where
25605 <___T as ::fidl_next::Transport>::SendBuffer:
25606 ::fidl_next::encoder::InternalHandleEncoder,
25607 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25608 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
25609 {
25610 self.enable_verity_with(EnableVerity { options })
25611 }
25612
25613 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
25614 pub fn enable_verity_with<___R>(
25615 &self,
25616 request: ___R,
25617 ) -> ::fidl_next::TwoWayFuture<'_, super::EnableVerity, ___T>
25618 where
25619 ___R: ::fidl_next::Encode<
25620 <___T as ::fidl_next::Transport>::SendBuffer,
25621 Encoded = crate::WireFileEnableVerityRequest<'static>,
25622 >,
25623 {
25624 ::fidl_next::TwoWayFuture::from_untyped(
25625 self.client.send_two_way(3189145313204943035, request),
25626 )
25627 }
25628 }
25629
25630 #[repr(transparent)]
25632 pub struct FileServer<___T: ::fidl_next::Transport> {
25633 server: ::fidl_next::protocol::Server<___T>,
25634 }
25635
25636 impl<___T> FileServer<___T>
25637 where
25638 ___T: ::fidl_next::Transport,
25639 {
25640 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
25641 pub fn on_open(
25642 &self,
25643
25644 s: impl ::fidl_next::Encode<
25645 <___T as ::fidl_next::Transport>::SendBuffer,
25646 Encoded = ::fidl_next::WireI32,
25647 >,
25648
25649 info: impl ::fidl_next::Encode<
25650 <___T as ::fidl_next::Transport>::SendBuffer,
25651 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
25652 >,
25653 ) -> ::fidl_next::SendFuture<'_, ___T>
25654 where
25655 <___T as ::fidl_next::Transport>::SendBuffer:
25656 ::fidl_next::encoder::InternalHandleEncoder,
25657 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
25658 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
25659 {
25660 self.on_open_with(OnOpen { s, info })
25661 }
25662
25663 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
25664
25665 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
25666 where
25667 ___R: ::fidl_next::Encode<
25668 <___T as ::fidl_next::Transport>::SendBuffer,
25669 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
25670 >,
25671 {
25672 ::fidl_next::SendFuture::from_untyped(
25673 self.server.send_event(9207534335756671346, request),
25674 )
25675 }
25676
25677 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
25678
25679 pub fn on_representation_with<___R>(
25680 &self,
25681 request: ___R,
25682 ) -> ::fidl_next::SendFuture<'_, ___T>
25683 where
25684 ___R: ::fidl_next::Encode<
25685 <___T as ::fidl_next::Transport>::SendBuffer,
25686 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
25687 >,
25688 {
25689 ::fidl_next::SendFuture::from_untyped(
25690 self.server.send_event(6679970090861613324, request),
25691 )
25692 }
25693 }
25694 }
25695}
25696
25697pub trait FileClientHandler<
25701 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
25702 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
25703>
25704{
25705 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
25706 fn on_open(
25707 &mut self,
25708
25709 event: ::fidl_next::Response<file::OnOpen, ___T>,
25710 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25711
25712 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
25713 fn on_representation(
25714 &mut self,
25715
25716 event: ::fidl_next::Response<file::OnRepresentation, ___T>,
25717 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25718
25719 fn on_unknown_interaction(
25720 &mut self,
25721 ordinal: u64,
25722 ) -> impl ::core::future::Future<
25723 Output = ::core::result::Result<
25724 (),
25725 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
25726 >,
25727 > + ::core::marker::Send {
25728 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
25729 }
25730}
25731
25732impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for File
25733where
25734 ___H: FileClientHandler<___T> + ::core::marker::Send,
25735 ___T: ::fidl_next::Transport,
25736 <file::AdvisoryLock as ::fidl_next::Method>::Response:
25737 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25738 <file::LinkInto as ::fidl_next::Method>::Response:
25739 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25740 <file::Close as ::fidl_next::Method>::Response:
25741 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25742 <file::Query as ::fidl_next::Method>::Response:
25743 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25744 <file::OnOpen as ::fidl_next::Method>::Response:
25745 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25746 <file::DeprecatedGetAttr as ::fidl_next::Method>::Response:
25747 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25748 <file::DeprecatedSetAttr as ::fidl_next::Method>::Response:
25749 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25750 <file::DeprecatedGetFlags as ::fidl_next::Method>::Response:
25751 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25752 <file::DeprecatedSetFlags as ::fidl_next::Method>::Response:
25753 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25754 <file::GetFlags as ::fidl_next::Method>::Response:
25755 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25756 <file::SetFlags as ::fidl_next::Method>::Response:
25757 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25758 <file::QueryFilesystem as ::fidl_next::Method>::Response:
25759 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25760 <file::OnRepresentation as ::fidl_next::Method>::Response:
25761 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25762 <file::GetAttributes as ::fidl_next::Method>::Response:
25763 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25764 <file::UpdateAttributes as ::fidl_next::Method>::Response:
25765 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25766 <file::Sync as ::fidl_next::Method>::Response:
25767 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25768 <file::GetExtendedAttribute as ::fidl_next::Method>::Response:
25769 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25770 <file::SetExtendedAttribute as ::fidl_next::Method>::Response:
25771 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25772 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
25773 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25774 <file::Read as ::fidl_next::Method>::Response:
25775 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25776 <file::Write as ::fidl_next::Method>::Response:
25777 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25778 <file::Describe as ::fidl_next::Method>::Response:
25779 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25780 <file::Seek as ::fidl_next::Method>::Response:
25781 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25782 <file::ReadAt as ::fidl_next::Method>::Response:
25783 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25784 <file::WriteAt as ::fidl_next::Method>::Response:
25785 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25786 <file::Resize as ::fidl_next::Method>::Response:
25787 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25788 <file::GetBackingMemory as ::fidl_next::Method>::Response:
25789 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25790 <file::Allocate as ::fidl_next::Method>::Response:
25791 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25792 <file::EnableVerity as ::fidl_next::Method>::Response:
25793 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25794{
25795 async fn on_event(
25796 handler: &mut ___H,
25797 ordinal: u64,
25798 buffer: ___T::RecvBuffer,
25799 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
25800 match ordinal {
25801 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
25802 Ok(decoded) => {
25803 handler.on_open(decoded).await;
25804 Ok(())
25805 }
25806 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
25807 ordinal: 9207534335756671346,
25808 error,
25809 }),
25810 },
25811
25812 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
25813 Ok(decoded) => {
25814 handler.on_representation(decoded).await;
25815 Ok(())
25816 }
25817 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
25818 ordinal: 6679970090861613324,
25819 error,
25820 }),
25821 },
25822
25823 ordinal => handler.on_unknown_interaction(ordinal).await,
25824 }
25825 }
25826}
25827
25828pub trait FileServerHandler<
25832 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
25833 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
25834>
25835{
25836 #[doc = " Acquires an advisory lock on the underlying file.\n\n The lock lasts until either this connection is closed or\n this method is called with |AdvisoryLockType.UNLOCK| to release the lock\n explicitly.\n\n Advisory locks are purely advisory. They do not prevent actual read or\n write operations from occurring on the file, either through this\n connection or through other connections.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].\n * [`Rights.WRITE_BYTES`] if `request.type` is\n [`AdvisoryLockType.WRITE`].\n\n # Errors\n\n * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For\n example, another connection might hold a conflicting lock type.\n * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.\n * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights\n to acquire the given type of lock.\n"]
25837 fn advisory_lock(
25838 &mut self,
25839
25840 request: ::fidl_next::Request<file::AdvisoryLock, ___T>,
25841
25842 responder: ::fidl_next::Responder<file::AdvisoryLock, ___T>,
25843 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25844
25845 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
25846 fn link_into(
25847 &mut self,
25848
25849 request: ::fidl_next::Request<file::LinkInto, ___T>,
25850
25851 responder: ::fidl_next::Responder<file::LinkInto, ___T>,
25852 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25853
25854 fn clone(
25855 &mut self,
25856
25857 request: ::fidl_next::Request<file::Clone, ___T>,
25858 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25859
25860 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
25861 fn close(
25862 &mut self,
25863
25864 responder: ::fidl_next::Responder<file::Close, ___T>,
25865 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25866
25867 fn query(
25868 &mut self,
25869
25870 responder: ::fidl_next::Responder<file::Query, ___T>,
25871 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25872
25873 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
25874 fn deprecated_clone(
25875 &mut self,
25876
25877 request: ::fidl_next::Request<file::DeprecatedClone, ___T>,
25878 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25879
25880 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
25881 fn deprecated_get_attr(
25882 &mut self,
25883
25884 responder: ::fidl_next::Responder<file::DeprecatedGetAttr, ___T>,
25885 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25886
25887 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
25888 fn deprecated_set_attr(
25889 &mut self,
25890
25891 request: ::fidl_next::Request<file::DeprecatedSetAttr, ___T>,
25892
25893 responder: ::fidl_next::Responder<file::DeprecatedSetAttr, ___T>,
25894 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25895
25896 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
25897 fn deprecated_get_flags(
25898 &mut self,
25899
25900 responder: ::fidl_next::Responder<file::DeprecatedGetFlags, ___T>,
25901 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25902
25903 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
25904 fn deprecated_set_flags(
25905 &mut self,
25906
25907 request: ::fidl_next::Request<file::DeprecatedSetFlags, ___T>,
25908
25909 responder: ::fidl_next::Responder<file::DeprecatedSetFlags, ___T>,
25910 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25911
25912 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
25913 fn get_flags(
25914 &mut self,
25915
25916 responder: ::fidl_next::Responder<file::GetFlags, ___T>,
25917 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25918
25919 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
25920 fn set_flags(
25921 &mut self,
25922
25923 request: ::fidl_next::Request<file::SetFlags, ___T>,
25924
25925 responder: ::fidl_next::Responder<file::SetFlags, ___T>,
25926 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25927
25928 #[doc = " Query the filesystem for filesystem-specific information.\n"]
25929 fn query_filesystem(
25930 &mut self,
25931
25932 responder: ::fidl_next::Responder<file::QueryFilesystem, ___T>,
25933 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25934
25935 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25936 fn get_attributes(
25937 &mut self,
25938
25939 request: ::fidl_next::Request<file::GetAttributes, ___T>,
25940
25941 responder: ::fidl_next::Responder<file::GetAttributes, ___T>,
25942 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25943
25944 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25945 fn update_attributes(
25946 &mut self,
25947
25948 request: ::fidl_next::Request<file::UpdateAttributes, ___T>,
25949
25950 responder: ::fidl_next::Responder<file::UpdateAttributes, ___T>,
25951 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25952
25953 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
25954 fn sync(
25955 &mut self,
25956
25957 responder: ::fidl_next::Responder<file::Sync, ___T>,
25958 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25959
25960 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25961 fn list_extended_attributes(
25962 &mut self,
25963
25964 request: ::fidl_next::Request<file::ListExtendedAttributes, ___T>,
25965 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25966
25967 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
25968 fn get_extended_attribute(
25969 &mut self,
25970
25971 request: ::fidl_next::Request<file::GetExtendedAttribute, ___T>,
25972
25973 responder: ::fidl_next::Responder<file::GetExtendedAttribute, ___T>,
25974 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25975
25976 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25977 fn set_extended_attribute(
25978 &mut self,
25979
25980 request: ::fidl_next::Request<file::SetExtendedAttribute, ___T>,
25981
25982 responder: ::fidl_next::Responder<file::SetExtendedAttribute, ___T>,
25983 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25984
25985 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
25986 fn remove_extended_attribute(
25987 &mut self,
25988
25989 request: ::fidl_next::Request<file::RemoveExtendedAttribute, ___T>,
25990
25991 responder: ::fidl_next::Responder<file::RemoveExtendedAttribute, ___T>,
25992 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
25993
25994 #[doc = " Reads up to \'count\' bytes at the seek offset.\n The seek offset is moved forward by the number of bytes read.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that the seek offset\n has reached the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that the\n seek offset is already at or beyond the end of file, and no data could\n be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually read anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
25995 fn read(
25996 &mut self,
25997
25998 request: ::fidl_next::Request<file::Read, ___T>,
25999
26000 responder: ::fidl_next::Responder<file::Read, ___T>,
26001 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26002
26003 #[doc = " Writes data at the seek offset.\n The seek offset is moved forward by the number of bytes written.\n If the file is in append mode, the seek offset is first set to the end\n of the file, followed by the write, in one atomic step.\n\n The file size may grow if the seek offset plus `data.length` is beyond\n the current end of file.\n\n + request `data` the byte buffer to write to the file.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file and return a\n successful write of zero bytes. The seek offset is still updated if\n in append mode.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
26004 fn write(
26005 &mut self,
26006
26007 request: ::fidl_next::Request<file::Write, ___T>,
26008
26009 responder: ::fidl_next::Responder<file::Write, ___T>,
26010 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26011
26012 fn describe(
26013 &mut self,
26014
26015 responder: ::fidl_next::Responder<file::Describe, ___T>,
26016 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26017
26018 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
26019 fn seek(
26020 &mut self,
26021
26022 request: ::fidl_next::Request<file::Seek, ___T>,
26023
26024 responder: ::fidl_next::Responder<file::Seek, ___T>,
26025 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26026
26027 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
26028 fn read_at(
26029 &mut self,
26030
26031 request: ::fidl_next::Request<file::ReadAt, ___T>,
26032
26033 responder: ::fidl_next::Responder<file::ReadAt, ___T>,
26034 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26035
26036 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
26037 fn write_at(
26038 &mut self,
26039
26040 request: ::fidl_next::Request<file::WriteAt, ___T>,
26041
26042 responder: ::fidl_next::Responder<file::WriteAt, ___T>,
26043 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26044
26045 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
26046 fn resize(
26047 &mut self,
26048
26049 request: ::fidl_next::Request<file::Resize, ___T>,
26050
26051 responder: ::fidl_next::Responder<file::Resize, ___T>,
26052 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26053
26054 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
26055 fn get_backing_memory(
26056 &mut self,
26057
26058 request: ::fidl_next::Request<file::GetBackingMemory, ___T>,
26059
26060 responder: ::fidl_next::Responder<file::GetBackingMemory, ___T>,
26061 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26062
26063 #[doc = " Pre-allocate on-disk space for this file.\n"]
26064 fn allocate(
26065 &mut self,
26066
26067 request: ::fidl_next::Request<file::Allocate, ___T>,
26068
26069 responder: ::fidl_next::Responder<file::Allocate, ___T>,
26070 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26071
26072 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
26073 fn enable_verity(
26074 &mut self,
26075
26076 request: ::fidl_next::Request<file::EnableVerity, ___T>,
26077
26078 responder: ::fidl_next::Responder<file::EnableVerity, ___T>,
26079 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
26080
26081 fn on_unknown_interaction(
26082 &mut self,
26083 ordinal: u64,
26084 ) -> impl ::core::future::Future<
26085 Output = ::core::result::Result<
26086 (),
26087 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
26088 >,
26089 > + ::core::marker::Send {
26090 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
26091 }
26092}
26093
26094impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for File
26095where
26096 ___H: FileServerHandler<___T> + ::core::marker::Send,
26097 ___T: ::fidl_next::Transport,
26098 <file::AdvisoryLock as ::fidl_next::Method>::Request:
26099 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26100 <file::LinkInto as ::fidl_next::Method>::Request:
26101 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26102 <file::Clone as ::fidl_next::Method>::Request:
26103 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26104 <file::DeprecatedClone as ::fidl_next::Method>::Request:
26105 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26106 <file::DeprecatedSetAttr as ::fidl_next::Method>::Request:
26107 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26108 <file::DeprecatedSetFlags as ::fidl_next::Method>::Request:
26109 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26110 <file::SetFlags as ::fidl_next::Method>::Request:
26111 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26112 <file::GetAttributes as ::fidl_next::Method>::Request:
26113 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26114 <file::UpdateAttributes as ::fidl_next::Method>::Request:
26115 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26116 <file::ListExtendedAttributes as ::fidl_next::Method>::Request:
26117 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26118 <file::GetExtendedAttribute as ::fidl_next::Method>::Request:
26119 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26120 <file::SetExtendedAttribute as ::fidl_next::Method>::Request:
26121 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26122 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
26123 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26124 <file::Read as ::fidl_next::Method>::Request:
26125 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26126 <file::Write as ::fidl_next::Method>::Request:
26127 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26128 <file::Seek as ::fidl_next::Method>::Request:
26129 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26130 <file::ReadAt as ::fidl_next::Method>::Request:
26131 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26132 <file::WriteAt as ::fidl_next::Method>::Request:
26133 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26134 <file::Resize as ::fidl_next::Method>::Request:
26135 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26136 <file::GetBackingMemory as ::fidl_next::Method>::Request:
26137 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26138 <file::Allocate as ::fidl_next::Method>::Request:
26139 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26140 <file::EnableVerity as ::fidl_next::Method>::Request:
26141 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
26142{
26143 async fn on_one_way(
26144 handler: &mut ___H,
26145 ordinal: u64,
26146 buffer: ___T::RecvBuffer,
26147 ) -> ::core::result::Result<
26148 (),
26149 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
26150 > {
26151 match ordinal {
26152 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
26153 Ok(decoded) => {
26154 handler.clone(decoded).await;
26155 Ok(())
26156 }
26157 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26158 ordinal: 2366825959783828089,
26159 error,
26160 }),
26161 },
26162
26163 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
26164 Ok(decoded) => {
26165 handler.deprecated_clone(decoded).await;
26166 Ok(())
26167 }
26168 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26169 ordinal: 6512600400724287855,
26170 error,
26171 }),
26172 },
26173
26174 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
26175 Ok(decoded) => {
26176 handler.list_extended_attributes(decoded).await;
26177 Ok(())
26178 }
26179 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26180 ordinal: 5431626189872037072,
26181 error,
26182 }),
26183 },
26184
26185 ordinal => handler.on_unknown_interaction(ordinal).await,
26186 }
26187 }
26188
26189 async fn on_two_way(
26190 handler: &mut ___H,
26191 ordinal: u64,
26192 buffer: ___T::RecvBuffer,
26193 responder: ::fidl_next::protocol::Responder<___T>,
26194 ) -> ::core::result::Result<
26195 (),
26196 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
26197 > {
26198 match ordinal {
26199 7992130864415541162 => {
26200 let responder = ::fidl_next::Responder::from_untyped(responder);
26201
26202 match ::fidl_next::DecoderExt::decode(buffer) {
26203 Ok(decoded) => {
26204 handler.advisory_lock(decoded, responder).await;
26205 Ok(())
26206 }
26207 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26208 ordinal: 7992130864415541162,
26209 error,
26210 }),
26211 }
26212 }
26213
26214 6121399674497678964 => {
26215 let responder = ::fidl_next::Responder::from_untyped(responder);
26216
26217 match ::fidl_next::DecoderExt::decode(buffer) {
26218 Ok(decoded) => {
26219 handler.link_into(decoded, responder).await;
26220 Ok(())
26221 }
26222 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26223 ordinal: 6121399674497678964,
26224 error,
26225 }),
26226 }
26227 }
26228
26229 6540867515453498750 => {
26230 let responder = ::fidl_next::Responder::from_untyped(responder);
26231
26232 handler.close(responder).await;
26233 Ok(())
26234 }
26235
26236 2763219980499352582 => {
26237 let responder = ::fidl_next::Responder::from_untyped(responder);
26238
26239 handler.query(responder).await;
26240 Ok(())
26241 }
26242
26243 8689798978500614909 => {
26244 let responder = ::fidl_next::Responder::from_untyped(responder);
26245
26246 handler.deprecated_get_attr(responder).await;
26247 Ok(())
26248 }
26249
26250 4721673413776871238 => {
26251 let responder = ::fidl_next::Responder::from_untyped(responder);
26252
26253 match ::fidl_next::DecoderExt::decode(buffer) {
26254 Ok(decoded) => {
26255 handler.deprecated_set_attr(decoded, responder).await;
26256 Ok(())
26257 }
26258 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26259 ordinal: 4721673413776871238,
26260 error,
26261 }),
26262 }
26263 }
26264
26265 6595803110182632097 => {
26266 let responder = ::fidl_next::Responder::from_untyped(responder);
26267
26268 handler.deprecated_get_flags(responder).await;
26269 Ok(())
26270 }
26271
26272 5950864159036794675 => {
26273 let responder = ::fidl_next::Responder::from_untyped(responder);
26274
26275 match ::fidl_next::DecoderExt::decode(buffer) {
26276 Ok(decoded) => {
26277 handler.deprecated_set_flags(decoded, responder).await;
26278 Ok(())
26279 }
26280 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26281 ordinal: 5950864159036794675,
26282 error,
26283 }),
26284 }
26285 }
26286
26287 105530239381466147 => {
26288 let responder = ::fidl_next::Responder::from_untyped(responder);
26289
26290 handler.get_flags(responder).await;
26291 Ok(())
26292 }
26293
26294 6172186066099445416 => {
26295 let responder = ::fidl_next::Responder::from_untyped(responder);
26296
26297 match ::fidl_next::DecoderExt::decode(buffer) {
26298 Ok(decoded) => {
26299 handler.set_flags(decoded, responder).await;
26300 Ok(())
26301 }
26302 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26303 ordinal: 6172186066099445416,
26304 error,
26305 }),
26306 }
26307 }
26308
26309 8013111122914313744 => {
26310 let responder = ::fidl_next::Responder::from_untyped(responder);
26311
26312 handler.query_filesystem(responder).await;
26313 Ok(())
26314 }
26315
26316 4414537700416816443 => {
26317 let responder = ::fidl_next::Responder::from_untyped(responder);
26318
26319 match ::fidl_next::DecoderExt::decode(buffer) {
26320 Ok(decoded) => {
26321 handler.get_attributes(decoded, responder).await;
26322 Ok(())
26323 }
26324 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26325 ordinal: 4414537700416816443,
26326 error,
26327 }),
26328 }
26329 }
26330
26331 3677402239314018056 => {
26332 let responder = ::fidl_next::Responder::from_untyped(responder);
26333
26334 match ::fidl_next::DecoderExt::decode(buffer) {
26335 Ok(decoded) => {
26336 handler.update_attributes(decoded, responder).await;
26337 Ok(())
26338 }
26339 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26340 ordinal: 3677402239314018056,
26341 error,
26342 }),
26343 }
26344 }
26345
26346 3196473584242777161 => {
26347 let responder = ::fidl_next::Responder::from_untyped(responder);
26348
26349 handler.sync(responder).await;
26350 Ok(())
26351 }
26352
26353 5043930208506967771 => {
26354 let responder = ::fidl_next::Responder::from_untyped(responder);
26355
26356 match ::fidl_next::DecoderExt::decode(buffer) {
26357 Ok(decoded) => {
26358 handler.get_extended_attribute(decoded, responder).await;
26359 Ok(())
26360 }
26361 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26362 ordinal: 5043930208506967771,
26363 error,
26364 }),
26365 }
26366 }
26367
26368 5374223046099989052 => {
26369 let responder = ::fidl_next::Responder::from_untyped(responder);
26370
26371 match ::fidl_next::DecoderExt::decode(buffer) {
26372 Ok(decoded) => {
26373 handler.set_extended_attribute(decoded, responder).await;
26374 Ok(())
26375 }
26376 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26377 ordinal: 5374223046099989052,
26378 error,
26379 }),
26380 }
26381 }
26382
26383 8794297771444732717 => {
26384 let responder = ::fidl_next::Responder::from_untyped(responder);
26385
26386 match ::fidl_next::DecoderExt::decode(buffer) {
26387 Ok(decoded) => {
26388 handler.remove_extended_attribute(decoded, responder).await;
26389 Ok(())
26390 }
26391 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26392 ordinal: 8794297771444732717,
26393 error,
26394 }),
26395 }
26396 }
26397
26398 395825947633028830 => {
26399 let responder = ::fidl_next::Responder::from_untyped(responder);
26400
26401 match ::fidl_next::DecoderExt::decode(buffer) {
26402 Ok(decoded) => {
26403 handler.read(decoded, responder).await;
26404 Ok(())
26405 }
26406 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26407 ordinal: 395825947633028830,
26408 error,
26409 }),
26410 }
26411 }
26412
26413 7651971425397809026 => {
26414 let responder = ::fidl_next::Responder::from_untyped(responder);
26415
26416 match ::fidl_next::DecoderExt::decode(buffer) {
26417 Ok(decoded) => {
26418 handler.write(decoded, responder).await;
26419 Ok(())
26420 }
26421 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26422 ordinal: 7651971425397809026,
26423 error,
26424 }),
26425 }
26426 }
26427
26428 7545125870053689020 => {
26429 let responder = ::fidl_next::Responder::from_untyped(responder);
26430
26431 handler.describe(responder).await;
26432 Ok(())
26433 }
26434
26435 8649041485622956551 => {
26436 let responder = ::fidl_next::Responder::from_untyped(responder);
26437
26438 match ::fidl_next::DecoderExt::decode(buffer) {
26439 Ok(decoded) => {
26440 handler.seek(decoded, responder).await;
26441 Ok(())
26442 }
26443 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26444 ordinal: 8649041485622956551,
26445 error,
26446 }),
26447 }
26448 }
26449
26450 1587416148701180478 => {
26451 let responder = ::fidl_next::Responder::from_untyped(responder);
26452
26453 match ::fidl_next::DecoderExt::decode(buffer) {
26454 Ok(decoded) => {
26455 handler.read_at(decoded, responder).await;
26456 Ok(())
26457 }
26458 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26459 ordinal: 1587416148701180478,
26460 error,
26461 }),
26462 }
26463 }
26464
26465 8736683935131400491 => {
26466 let responder = ::fidl_next::Responder::from_untyped(responder);
26467
26468 match ::fidl_next::DecoderExt::decode(buffer) {
26469 Ok(decoded) => {
26470 handler.write_at(decoded, responder).await;
26471 Ok(())
26472 }
26473 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26474 ordinal: 8736683935131400491,
26475 error,
26476 }),
26477 }
26478 }
26479
26480 3134648685270758458 => {
26481 let responder = ::fidl_next::Responder::from_untyped(responder);
26482
26483 match ::fidl_next::DecoderExt::decode(buffer) {
26484 Ok(decoded) => {
26485 handler.resize(decoded, responder).await;
26486 Ok(())
26487 }
26488 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26489 ordinal: 3134648685270758458,
26490 error,
26491 }),
26492 }
26493 }
26494
26495 46911652864194091 => {
26496 let responder = ::fidl_next::Responder::from_untyped(responder);
26497
26498 match ::fidl_next::DecoderExt::decode(buffer) {
26499 Ok(decoded) => {
26500 handler.get_backing_memory(decoded, responder).await;
26501 Ok(())
26502 }
26503 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26504 ordinal: 46911652864194091,
26505 error,
26506 }),
26507 }
26508 }
26509
26510 8645235848064269614 => {
26511 let responder = ::fidl_next::Responder::from_untyped(responder);
26512
26513 match ::fidl_next::DecoderExt::decode(buffer) {
26514 Ok(decoded) => {
26515 handler.allocate(decoded, responder).await;
26516 Ok(())
26517 }
26518 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26519 ordinal: 8645235848064269614,
26520 error,
26521 }),
26522 }
26523 }
26524
26525 3189145313204943035 => {
26526 let responder = ::fidl_next::Responder::from_untyped(responder);
26527
26528 match ::fidl_next::DecoderExt::decode(buffer) {
26529 Ok(decoded) => {
26530 handler.enable_verity(decoded, responder).await;
26531 Ok(())
26532 }
26533 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
26534 ordinal: 3189145313204943035,
26535 error,
26536 }),
26537 }
26538 }
26539
26540 ordinal => handler.on_unknown_interaction(ordinal).await,
26541 }
26542 }
26543}
26544
26545#[derive(PartialEq, Debug)]
26546#[repr(C)]
26547pub struct FileObject {
26548 pub event: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
26549
26550 pub stream: ::core::option::Option<::fidl_next::fuchsia::zx::Stream>,
26551}
26552
26553impl ::fidl_next::Encodable for FileObject {
26554 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileObject> = unsafe {
26555 ::fidl_next::CopyOptimization::enable_if(
26556 true
26557
26558 && <
26559 ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::Encodable
26560 >::COPY_OPTIMIZATION.is_enabled()
26561
26562 && <
26563 ::core::option::Option<::fidl_next::fuchsia::zx::Stream> as ::fidl_next::Encodable
26564 >::COPY_OPTIMIZATION.is_enabled()
26565
26566 )
26567 };
26568
26569 type Encoded = WireFileObject;
26570}
26571
26572unsafe impl<___E> ::fidl_next::Encode<___E> for FileObject
26573where
26574 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26575 ___E: ::fidl_next::fuchsia::HandleEncoder,
26576{
26577 #[inline]
26578 fn encode(
26579 self,
26580 encoder_: &mut ___E,
26581 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26582 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26583 ::fidl_next::munge! {
26584 let Self::Encoded {
26585 event,
26586 stream,
26587
26588 } = out_;
26589 }
26590
26591 ::fidl_next::Encode::encode(self.event, encoder_, event)?;
26592
26593 ::fidl_next::Encode::encode(self.stream, encoder_, stream)?;
26594
26595 Ok(())
26596 }
26597}
26598
26599impl ::fidl_next::EncodableOption for FileObject {
26600 type EncodedOption = ::fidl_next::WireBox<'static, WireFileObject>;
26601}
26602
26603unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileObject
26604where
26605 ___E: ::fidl_next::Encoder + ?Sized,
26606 FileObject: ::fidl_next::Encode<___E>,
26607{
26608 #[inline]
26609 fn encode_option(
26610 this: ::core::option::Option<Self>,
26611 encoder: &mut ___E,
26612 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26613 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26614 if let Some(inner) = this {
26615 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
26616 ::fidl_next::WireBox::encode_present(out);
26617 } else {
26618 ::fidl_next::WireBox::encode_absent(out);
26619 }
26620
26621 Ok(())
26622 }
26623}
26624
26625impl ::fidl_next::FromWire<WireFileObject> for FileObject {
26626 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileObject, Self> = unsafe {
26627 ::fidl_next::CopyOptimization::enable_if(
26628 true
26629
26630 && <
26631 ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::FromWire<::fidl_next::fuchsia::WireOptionalEvent>
26632 >::COPY_OPTIMIZATION.is_enabled()
26633
26634 && <
26635 ::core::option::Option<::fidl_next::fuchsia::zx::Stream> as ::fidl_next::FromWire<::fidl_next::fuchsia::WireOptionalStream>
26636 >::COPY_OPTIMIZATION.is_enabled()
26637
26638 )
26639 };
26640
26641 #[inline]
26642 fn from_wire(wire: WireFileObject) -> Self {
26643 Self {
26644 event: ::fidl_next::FromWire::from_wire(wire.event),
26645
26646 stream: ::fidl_next::FromWire::from_wire(wire.stream),
26647 }
26648 }
26649}
26650
26651impl ::fidl_next::IntoNatural for WireFileObject {
26652 type Natural = FileObject;
26653}
26654
26655#[derive(Debug)]
26657#[repr(C)]
26658pub struct WireFileObject {
26659 pub event: ::fidl_next::fuchsia::WireOptionalEvent,
26660
26661 pub stream: ::fidl_next::fuchsia::WireOptionalStream,
26662}
26663static_assertions::const_assert_eq!(std::mem::size_of::<WireFileObject>(), 8);
26664static_assertions::const_assert_eq!(std::mem::align_of::<WireFileObject>(), 4);
26665
26666static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileObject, event), 0);
26667
26668static_assertions::const_assert_eq!(std::mem::offset_of!(WireFileObject, stream), 4);
26669
26670unsafe impl ::fidl_next::Wire for WireFileObject {
26671 type Decoded<'de> = WireFileObject;
26672
26673 #[inline]
26674 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
26675 ::fidl_next::munge! {
26676 let Self {
26677
26678 event,
26679 stream,
26680
26681 } = &mut *out_;
26682 }
26683
26684 ::fidl_next::Wire::zero_padding(event);
26685
26686 ::fidl_next::Wire::zero_padding(stream);
26687 }
26688}
26689
26690unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileObject
26691where
26692 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26693 ___D: ::fidl_next::fuchsia::HandleDecoder,
26694{
26695 fn decode(
26696 slot_: ::fidl_next::Slot<'_, Self>,
26697 decoder_: &mut ___D,
26698 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26699 ::fidl_next::munge! {
26700 let Self {
26701
26702 mut event,
26703 mut stream,
26704
26705 } = slot_;
26706 }
26707
26708 ::fidl_next::Decode::decode(event.as_mut(), decoder_)?;
26709
26710 ::fidl_next::Decode::decode(stream.as_mut(), decoder_)?;
26711
26712 Ok(())
26713 }
26714}
26715
26716::fidl_next::bitflags::bitflags! {
26717 #[derive(
26718 Clone,
26719 Copy,
26720 Debug,
26721 PartialEq,
26722 Eq,
26723 Hash,
26724 )]
26725 pub struct FileSignal: u32 {
26726 #[doc = " Indicates the file is ready for reading.\n"]const READABLE = 16777216;
26727 #[doc = " Indicates the file is ready for writing.\n"]const WRITABLE = 33554432;
26728
26729 }
26730}
26731
26732impl ::fidl_next::Encodable for FileSignal {
26733 type Encoded = WireFileSignal;
26734}
26735
26736unsafe impl<___E> ::fidl_next::Encode<___E> for FileSignal
26737where
26738 ___E: ?Sized,
26739{
26740 #[inline]
26741 fn encode(
26742 self,
26743 encoder: &mut ___E,
26744 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26745 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26746 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
26747 }
26748}
26749
26750unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSignal
26751where
26752 ___E: ?Sized,
26753{
26754 #[inline]
26755 fn encode_ref(
26756 &self,
26757 _: &mut ___E,
26758 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26759 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26760 ::fidl_next::munge!(let WireFileSignal { value } = out);
26761
26762 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
26763 return Err(::fidl_next::EncodeError::InvalidStrictBits);
26764 }
26765
26766 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
26767 Ok(())
26768 }
26769}
26770
26771impl ::core::convert::From<WireFileSignal> for FileSignal {
26772 fn from(wire: WireFileSignal) -> Self {
26773 Self::from_bits_retain(u32::from(wire.value))
26774 }
26775}
26776
26777impl ::fidl_next::FromWire<WireFileSignal> for FileSignal {
26778 #[inline]
26779 fn from_wire(wire: WireFileSignal) -> Self {
26780 Self::from(wire)
26781 }
26782}
26783
26784impl ::fidl_next::IntoNatural for WireFileSignal {
26785 type Natural = FileSignal;
26786}
26787
26788impl ::fidl_next::FromWireRef<WireFileSignal> for FileSignal {
26789 #[inline]
26790 fn from_wire_ref(wire: &WireFileSignal) -> Self {
26791 Self::from(*wire)
26792 }
26793}
26794
26795#[derive(Clone, Copy, Debug)]
26797#[repr(transparent)]
26798pub struct WireFileSignal {
26799 value: ::fidl_next::WireU32,
26800}
26801
26802unsafe impl ::fidl_next::Wire for WireFileSignal {
26803 type Decoded<'de> = Self;
26804
26805 #[inline]
26806 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26807 }
26809}
26810
26811unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSignal
26812where
26813 ___D: ?Sized,
26814{
26815 fn decode(
26816 slot: ::fidl_next::Slot<'_, Self>,
26817 _: &mut ___D,
26818 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26819 ::fidl_next::munge!(let Self { value } = slot);
26820 let set = u32::from(*value);
26821 if set & !FileSignal::all().bits() != 0 {
26822 return Err(::fidl_next::DecodeError::InvalidBits {
26823 expected: FileSignal::all().bits() as usize,
26824 actual: set as usize,
26825 });
26826 }
26827
26828 Ok(())
26829 }
26830}
26831
26832impl ::core::convert::From<FileSignal> for WireFileSignal {
26833 fn from(natural: FileSignal) -> Self {
26834 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
26835 }
26836}
26837
26838pub const MAX_FS_NAME_BUFFER: u64 = 32 as u64;
26839
26840#[derive(PartialEq, Clone, Debug)]
26841#[repr(C)]
26842pub struct FilesystemInfo {
26843 pub total_bytes: u64,
26844
26845 pub used_bytes: u64,
26846
26847 pub total_nodes: u64,
26848
26849 pub used_nodes: u64,
26850
26851 pub free_shared_pool_bytes: u64,
26852
26853 pub fs_id: u64,
26854
26855 pub block_size: u32,
26856
26857 pub max_filename_size: u32,
26858
26859 pub fs_type: u32,
26860
26861 pub padding: u32,
26862
26863 pub name: [i8; 32],
26864}
26865
26866impl ::fidl_next::Encodable for FilesystemInfo {
26867 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFilesystemInfo> = unsafe {
26868 ::fidl_next::CopyOptimization::enable_if(
26869 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26870 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26871 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26872 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26873 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26874 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26875 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26876 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26877 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26878 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
26879 && <[i8; 32] as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
26880 )
26881 };
26882
26883 type Encoded = WireFilesystemInfo;
26884}
26885
26886unsafe impl<___E> ::fidl_next::Encode<___E> for FilesystemInfo
26887where
26888 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26889{
26890 #[inline]
26891 fn encode(
26892 self,
26893 encoder_: &mut ___E,
26894 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26895 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26896 ::fidl_next::munge! {
26897 let Self::Encoded {
26898 total_bytes,
26899 used_bytes,
26900 total_nodes,
26901 used_nodes,
26902 free_shared_pool_bytes,
26903 fs_id,
26904 block_size,
26905 max_filename_size,
26906 fs_type,
26907 padding,
26908 name,
26909
26910 } = out_;
26911 }
26912
26913 ::fidl_next::Encode::encode(self.total_bytes, encoder_, total_bytes)?;
26914
26915 ::fidl_next::Encode::encode(self.used_bytes, encoder_, used_bytes)?;
26916
26917 ::fidl_next::Encode::encode(self.total_nodes, encoder_, total_nodes)?;
26918
26919 ::fidl_next::Encode::encode(self.used_nodes, encoder_, used_nodes)?;
26920
26921 ::fidl_next::Encode::encode(self.free_shared_pool_bytes, encoder_, free_shared_pool_bytes)?;
26922
26923 ::fidl_next::Encode::encode(self.fs_id, encoder_, fs_id)?;
26924
26925 ::fidl_next::Encode::encode(self.block_size, encoder_, block_size)?;
26926
26927 ::fidl_next::Encode::encode(self.max_filename_size, encoder_, max_filename_size)?;
26928
26929 ::fidl_next::Encode::encode(self.fs_type, encoder_, fs_type)?;
26930
26931 ::fidl_next::Encode::encode(self.padding, encoder_, padding)?;
26932
26933 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
26934
26935 Ok(())
26936 }
26937}
26938
26939unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FilesystemInfo
26940where
26941 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26942{
26943 #[inline]
26944 fn encode_ref(
26945 &self,
26946 encoder_: &mut ___E,
26947 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26948 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26949 ::fidl_next::munge! {
26950 let Self::Encoded {
26951
26952 total_bytes,
26953 used_bytes,
26954 total_nodes,
26955 used_nodes,
26956 free_shared_pool_bytes,
26957 fs_id,
26958 block_size,
26959 max_filename_size,
26960 fs_type,
26961 padding,
26962 name,
26963
26964 } = out_;
26965 }
26966
26967 ::fidl_next::EncodeRef::encode_ref(&self.total_bytes, encoder_, total_bytes)?;
26968
26969 ::fidl_next::EncodeRef::encode_ref(&self.used_bytes, encoder_, used_bytes)?;
26970
26971 ::fidl_next::EncodeRef::encode_ref(&self.total_nodes, encoder_, total_nodes)?;
26972
26973 ::fidl_next::EncodeRef::encode_ref(&self.used_nodes, encoder_, used_nodes)?;
26974
26975 ::fidl_next::EncodeRef::encode_ref(
26976 &self.free_shared_pool_bytes,
26977 encoder_,
26978 free_shared_pool_bytes,
26979 )?;
26980
26981 ::fidl_next::EncodeRef::encode_ref(&self.fs_id, encoder_, fs_id)?;
26982
26983 ::fidl_next::EncodeRef::encode_ref(&self.block_size, encoder_, block_size)?;
26984
26985 ::fidl_next::EncodeRef::encode_ref(&self.max_filename_size, encoder_, max_filename_size)?;
26986
26987 ::fidl_next::EncodeRef::encode_ref(&self.fs_type, encoder_, fs_type)?;
26988
26989 ::fidl_next::EncodeRef::encode_ref(&self.padding, encoder_, padding)?;
26990
26991 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
26992
26993 Ok(())
26994 }
26995}
26996
26997impl ::fidl_next::EncodableOption for FilesystemInfo {
26998 type EncodedOption = ::fidl_next::WireBox<'static, WireFilesystemInfo>;
26999}
27000
27001unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FilesystemInfo
27002where
27003 ___E: ::fidl_next::Encoder + ?Sized,
27004 FilesystemInfo: ::fidl_next::Encode<___E>,
27005{
27006 #[inline]
27007 fn encode_option(
27008 this: ::core::option::Option<Self>,
27009 encoder: &mut ___E,
27010 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27011 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27012 if let Some(inner) = this {
27013 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27014 ::fidl_next::WireBox::encode_present(out);
27015 } else {
27016 ::fidl_next::WireBox::encode_absent(out);
27017 }
27018
27019 Ok(())
27020 }
27021}
27022
27023unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FilesystemInfo
27024where
27025 ___E: ::fidl_next::Encoder + ?Sized,
27026 FilesystemInfo: ::fidl_next::EncodeRef<___E>,
27027{
27028 #[inline]
27029 fn encode_option_ref(
27030 this: ::core::option::Option<&Self>,
27031 encoder: &mut ___E,
27032 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27033 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27034 if let Some(inner) = this {
27035 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27036 ::fidl_next::WireBox::encode_present(out);
27037 } else {
27038 ::fidl_next::WireBox::encode_absent(out);
27039 }
27040
27041 Ok(())
27042 }
27043}
27044
27045impl ::fidl_next::FromWire<WireFilesystemInfo> for FilesystemInfo {
27046 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFilesystemInfo, Self> = unsafe {
27047 ::fidl_next::CopyOptimization::enable_if(
27048 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27049 .is_enabled()
27050 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27051 .is_enabled()
27052 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27053 .is_enabled()
27054 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27055 .is_enabled()
27056 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27057 .is_enabled()
27058 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
27059 .is_enabled()
27060 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
27061 .is_enabled()
27062 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
27063 .is_enabled()
27064 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
27065 .is_enabled()
27066 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
27067 .is_enabled()
27068 && <[i8; 32] as ::fidl_next::FromWire<[i8; 32]>>::COPY_OPTIMIZATION.is_enabled(),
27069 )
27070 };
27071
27072 #[inline]
27073 fn from_wire(wire: WireFilesystemInfo) -> Self {
27074 Self {
27075 total_bytes: ::fidl_next::FromWire::from_wire(wire.total_bytes),
27076
27077 used_bytes: ::fidl_next::FromWire::from_wire(wire.used_bytes),
27078
27079 total_nodes: ::fidl_next::FromWire::from_wire(wire.total_nodes),
27080
27081 used_nodes: ::fidl_next::FromWire::from_wire(wire.used_nodes),
27082
27083 free_shared_pool_bytes: ::fidl_next::FromWire::from_wire(wire.free_shared_pool_bytes),
27084
27085 fs_id: ::fidl_next::FromWire::from_wire(wire.fs_id),
27086
27087 block_size: ::fidl_next::FromWire::from_wire(wire.block_size),
27088
27089 max_filename_size: ::fidl_next::FromWire::from_wire(wire.max_filename_size),
27090
27091 fs_type: ::fidl_next::FromWire::from_wire(wire.fs_type),
27092
27093 padding: ::fidl_next::FromWire::from_wire(wire.padding),
27094
27095 name: ::fidl_next::FromWire::from_wire(wire.name),
27096 }
27097 }
27098}
27099
27100impl ::fidl_next::IntoNatural for WireFilesystemInfo {
27101 type Natural = FilesystemInfo;
27102}
27103
27104impl ::fidl_next::FromWireRef<WireFilesystemInfo> for FilesystemInfo {
27105 #[inline]
27106 fn from_wire_ref(wire: &WireFilesystemInfo) -> Self {
27107 Self {
27108 total_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_bytes),
27109
27110 used_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_bytes),
27111
27112 total_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_nodes),
27113
27114 used_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_nodes),
27115
27116 free_shared_pool_bytes: ::fidl_next::FromWireRef::from_wire_ref(
27117 &wire.free_shared_pool_bytes,
27118 ),
27119
27120 fs_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_id),
27121
27122 block_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.block_size),
27123
27124 max_filename_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_filename_size),
27125
27126 fs_type: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_type),
27127
27128 padding: ::fidl_next::FromWireRef::from_wire_ref(&wire.padding),
27129
27130 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
27131 }
27132 }
27133}
27134
27135#[derive(Clone, Debug)]
27137#[repr(C)]
27138pub struct WireFilesystemInfo {
27139 pub total_bytes: ::fidl_next::WireU64,
27140
27141 pub used_bytes: ::fidl_next::WireU64,
27142
27143 pub total_nodes: ::fidl_next::WireU64,
27144
27145 pub used_nodes: ::fidl_next::WireU64,
27146
27147 pub free_shared_pool_bytes: ::fidl_next::WireU64,
27148
27149 pub fs_id: ::fidl_next::WireU64,
27150
27151 pub block_size: ::fidl_next::WireU32,
27152
27153 pub max_filename_size: ::fidl_next::WireU32,
27154
27155 pub fs_type: ::fidl_next::WireU32,
27156
27157 pub padding: ::fidl_next::WireU32,
27158
27159 pub name: [i8; 32],
27160}
27161static_assertions::const_assert_eq!(std::mem::size_of::<WireFilesystemInfo>(), 96);
27162static_assertions::const_assert_eq!(std::mem::align_of::<WireFilesystemInfo>(), 8);
27163
27164static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, total_bytes), 0);
27165
27166static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, used_bytes), 8);
27167
27168static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, total_nodes), 16);
27169
27170static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, used_nodes), 24);
27171
27172static_assertions::const_assert_eq!(
27173 std::mem::offset_of!(WireFilesystemInfo, free_shared_pool_bytes),
27174 32
27175);
27176
27177static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, fs_id), 40);
27178
27179static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, block_size), 48);
27180
27181static_assertions::const_assert_eq!(
27182 std::mem::offset_of!(WireFilesystemInfo, max_filename_size),
27183 52
27184);
27185
27186static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, fs_type), 56);
27187
27188static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, padding), 60);
27189
27190static_assertions::const_assert_eq!(std::mem::offset_of!(WireFilesystemInfo, name), 64);
27191
27192unsafe impl ::fidl_next::Wire for WireFilesystemInfo {
27193 type Decoded<'de> = WireFilesystemInfo;
27194
27195 #[inline]
27196 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
27197 ::fidl_next::munge! {
27198 let Self {
27199
27200 total_bytes,
27201 used_bytes,
27202 total_nodes,
27203 used_nodes,
27204 free_shared_pool_bytes,
27205 fs_id,
27206 block_size,
27207 max_filename_size,
27208 fs_type,
27209 padding,
27210 name,
27211
27212 } = &mut *out_;
27213 }
27214
27215 ::fidl_next::Wire::zero_padding(total_bytes);
27216
27217 ::fidl_next::Wire::zero_padding(used_bytes);
27218
27219 ::fidl_next::Wire::zero_padding(total_nodes);
27220
27221 ::fidl_next::Wire::zero_padding(used_nodes);
27222
27223 ::fidl_next::Wire::zero_padding(free_shared_pool_bytes);
27224
27225 ::fidl_next::Wire::zero_padding(fs_id);
27226
27227 ::fidl_next::Wire::zero_padding(block_size);
27228
27229 ::fidl_next::Wire::zero_padding(max_filename_size);
27230
27231 ::fidl_next::Wire::zero_padding(fs_type);
27232
27233 ::fidl_next::Wire::zero_padding(padding);
27234
27235 ::fidl_next::Wire::zero_padding(name);
27236 }
27237}
27238
27239unsafe impl<___D> ::fidl_next::Decode<___D> for WireFilesystemInfo
27240where
27241 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27242{
27243 fn decode(
27244 slot_: ::fidl_next::Slot<'_, Self>,
27245 decoder_: &mut ___D,
27246 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27247 ::fidl_next::munge! {
27248 let Self {
27249
27250 mut total_bytes,
27251 mut used_bytes,
27252 mut total_nodes,
27253 mut used_nodes,
27254 mut free_shared_pool_bytes,
27255 mut fs_id,
27256 mut block_size,
27257 mut max_filename_size,
27258 mut fs_type,
27259 mut padding,
27260 mut name,
27261
27262 } = slot_;
27263 }
27264
27265 ::fidl_next::Decode::decode(total_bytes.as_mut(), decoder_)?;
27266
27267 ::fidl_next::Decode::decode(used_bytes.as_mut(), decoder_)?;
27268
27269 ::fidl_next::Decode::decode(total_nodes.as_mut(), decoder_)?;
27270
27271 ::fidl_next::Decode::decode(used_nodes.as_mut(), decoder_)?;
27272
27273 ::fidl_next::Decode::decode(free_shared_pool_bytes.as_mut(), decoder_)?;
27274
27275 ::fidl_next::Decode::decode(fs_id.as_mut(), decoder_)?;
27276
27277 ::fidl_next::Decode::decode(block_size.as_mut(), decoder_)?;
27278
27279 ::fidl_next::Decode::decode(max_filename_size.as_mut(), decoder_)?;
27280
27281 ::fidl_next::Decode::decode(fs_type.as_mut(), decoder_)?;
27282
27283 ::fidl_next::Decode::decode(padding.as_mut(), decoder_)?;
27284
27285 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
27286
27287 Ok(())
27288 }
27289}
27290
27291#[doc = " Set of rights that [`Flags.PERM_INHERIT_WRITE`] will inherit from the parent connection if\n specified. Note that if any of these permissions are missing from the connection, none of these\n permissions will be inherited.\n"]
27292pub const INHERITED_WRITE_PERMISSIONS: crate::Operations = crate::Operations::from_bits_retain(356);
27293
27294#[doc = " Nodes which do not have ino values should return this value\n from Readdir and GetAttr.\n"]
27295pub const INO_UNKNOWN: u64 = 18446744073709551615 as u64;
27296
27297pub const MASK_KNOWN_PERMISSIONS: crate::Flags = crate::Flags::from_bits_retain(25087);
27298
27299pub const MASK_KNOWN_PROTOCOLS: crate::Flags = crate::Flags::from_bits_retain(30069489664);
27300
27301pub const MASK_PERMISSION_FLAGS: u64 = 65535 as u64;
27302
27303pub const MASK_POSIX_FLAGS: u64 = 4294967295 as u64;
27304
27305#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
27306pub const MAX_FILENAME: u64 = 255 as u64;
27307
27308pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
27309
27310#[derive(PartialEq, Clone, Debug)]
27311#[repr(C)]
27312pub struct Service {}
27313
27314impl ::fidl_next::Encodable for Service {
27315 type Encoded = WireService;
27316}
27317
27318unsafe impl<___E> ::fidl_next::Encode<___E> for Service
27319where
27320 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27321{
27322 #[inline]
27323 fn encode(
27324 self,
27325 encoder_: &mut ___E,
27326 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27327 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27328 *out_ = ::core::mem::MaybeUninit::zeroed();
27329
27330 Ok(())
27331 }
27332}
27333
27334unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
27335where
27336 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27337{
27338 #[inline]
27339 fn encode_ref(
27340 &self,
27341 encoder_: &mut ___E,
27342 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27343 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27344 ::fidl_next::munge! {
27345 let Self::Encoded {
27346
27347 _empty,
27348
27349
27350 } = out_;
27351 }
27352
27353 Ok(())
27354 }
27355}
27356
27357impl ::fidl_next::EncodableOption for Service {
27358 type EncodedOption = ::fidl_next::WireBox<'static, WireService>;
27359}
27360
27361unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Service
27362where
27363 ___E: ::fidl_next::Encoder + ?Sized,
27364 Service: ::fidl_next::Encode<___E>,
27365{
27366 #[inline]
27367 fn encode_option(
27368 this: ::core::option::Option<Self>,
27369 encoder: &mut ___E,
27370 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27371 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27372 if let Some(inner) = this {
27373 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27374 ::fidl_next::WireBox::encode_present(out);
27375 } else {
27376 ::fidl_next::WireBox::encode_absent(out);
27377 }
27378
27379 Ok(())
27380 }
27381}
27382
27383unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Service
27384where
27385 ___E: ::fidl_next::Encoder + ?Sized,
27386 Service: ::fidl_next::EncodeRef<___E>,
27387{
27388 #[inline]
27389 fn encode_option_ref(
27390 this: ::core::option::Option<&Self>,
27391 encoder: &mut ___E,
27392 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27393 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27394 if let Some(inner) = this {
27395 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27396 ::fidl_next::WireBox::encode_present(out);
27397 } else {
27398 ::fidl_next::WireBox::encode_absent(out);
27399 }
27400
27401 Ok(())
27402 }
27403}
27404
27405impl ::fidl_next::FromWire<WireService> for Service {
27406 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireService, Self> =
27407 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
27408
27409 #[inline]
27410 fn from_wire(wire: WireService) -> Self {
27411 Self {}
27412 }
27413}
27414
27415impl ::fidl_next::IntoNatural for WireService {
27416 type Natural = Service;
27417}
27418
27419impl ::fidl_next::FromWireRef<WireService> for Service {
27420 #[inline]
27421 fn from_wire_ref(wire: &WireService) -> Self {
27422 Self {}
27423 }
27424}
27425
27426#[derive(Clone, Debug)]
27428#[repr(C)]
27429pub struct WireService {
27430 _empty: fidl_next::WireEmptyStructPlaceholder,
27431}
27432static_assertions::const_assert_eq!(std::mem::size_of::<WireService>(), 1);
27433static_assertions::const_assert_eq!(std::mem::align_of::<WireService>(), 1);
27434
27435unsafe impl ::fidl_next::Wire for WireService {
27436 type Decoded<'de> = WireService;
27437
27438 #[inline]
27439 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
27440 ::fidl_next::munge! {
27441 let Self {
27442
27443 _empty,
27444
27445
27446 } = &mut *out_;
27447 }
27448 }
27449}
27450
27451unsafe impl<___D> ::fidl_next::Decode<___D> for WireService
27452where
27453 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27454{
27455 fn decode(
27456 slot_: ::fidl_next::Slot<'_, Self>,
27457 decoder_: &mut ___D,
27458 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27459 ::fidl_next::munge! {
27460 let Self {
27461
27462 mut _empty,
27463
27464
27465 } = slot_;
27466 }
27467
27468 if _empty.as_bytes() != &[0u8] {
27469 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
27470 }
27471
27472 Ok(())
27473 }
27474}
27475
27476#[derive(PartialEq, Clone, Debug)]
27477pub struct SymlinkObject {
27478 pub target: ::std::vec::Vec<u8>,
27479}
27480
27481impl ::fidl_next::Encodable for SymlinkObject {
27482 type Encoded = WireSymlinkObject<'static>;
27483}
27484
27485unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkObject
27486where
27487 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27488 ___E: ::fidl_next::Encoder,
27489{
27490 #[inline]
27491 fn encode(
27492 self,
27493 encoder_: &mut ___E,
27494 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27496 ::fidl_next::munge! {
27497 let Self::Encoded {
27498 target,
27499
27500 } = out_;
27501 }
27502
27503 ::fidl_next::Encode::encode(self.target, encoder_, target)?;
27504
27505 Ok(())
27506 }
27507}
27508
27509unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkObject
27510where
27511 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27512 ___E: ::fidl_next::Encoder,
27513{
27514 #[inline]
27515 fn encode_ref(
27516 &self,
27517 encoder_: &mut ___E,
27518 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27519 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27520 ::fidl_next::munge! {
27521 let Self::Encoded {
27522
27523 target,
27524
27525 } = out_;
27526 }
27527
27528 ::fidl_next::EncodeRef::encode_ref(&self.target, encoder_, target)?;
27529
27530 Ok(())
27531 }
27532}
27533
27534impl ::fidl_next::EncodableOption for SymlinkObject {
27535 type EncodedOption = ::fidl_next::WireBox<'static, WireSymlinkObject<'static>>;
27536}
27537
27538unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SymlinkObject
27539where
27540 ___E: ::fidl_next::Encoder + ?Sized,
27541 SymlinkObject: ::fidl_next::Encode<___E>,
27542{
27543 #[inline]
27544 fn encode_option(
27545 this: ::core::option::Option<Self>,
27546 encoder: &mut ___E,
27547 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27548 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27549 if let Some(inner) = this {
27550 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27551 ::fidl_next::WireBox::encode_present(out);
27552 } else {
27553 ::fidl_next::WireBox::encode_absent(out);
27554 }
27555
27556 Ok(())
27557 }
27558}
27559
27560unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SymlinkObject
27561where
27562 ___E: ::fidl_next::Encoder + ?Sized,
27563 SymlinkObject: ::fidl_next::EncodeRef<___E>,
27564{
27565 #[inline]
27566 fn encode_option_ref(
27567 this: ::core::option::Option<&Self>,
27568 encoder: &mut ___E,
27569 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27570 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27571 if let Some(inner) = this {
27572 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
27573 ::fidl_next::WireBox::encode_present(out);
27574 } else {
27575 ::fidl_next::WireBox::encode_absent(out);
27576 }
27577
27578 Ok(())
27579 }
27580}
27581
27582impl<'de> ::fidl_next::FromWire<WireSymlinkObject<'de>> for SymlinkObject {
27583 #[inline]
27584 fn from_wire(wire: WireSymlinkObject<'de>) -> Self {
27585 Self { target: ::fidl_next::FromWire::from_wire(wire.target) }
27586 }
27587}
27588
27589impl<'de> ::fidl_next::IntoNatural for WireSymlinkObject<'de> {
27590 type Natural = SymlinkObject;
27591}
27592
27593impl<'de> ::fidl_next::FromWireRef<WireSymlinkObject<'de>> for SymlinkObject {
27594 #[inline]
27595 fn from_wire_ref(wire: &WireSymlinkObject<'de>) -> Self {
27596 Self { target: ::fidl_next::FromWireRef::from_wire_ref(&wire.target) }
27597 }
27598}
27599
27600#[derive(Debug)]
27602#[repr(C)]
27603pub struct WireSymlinkObject<'de> {
27604 pub target: ::fidl_next::WireVector<'de, u8>,
27605}
27606static_assertions::const_assert_eq!(std::mem::size_of::<WireSymlinkObject<'_>>(), 16);
27607static_assertions::const_assert_eq!(std::mem::align_of::<WireSymlinkObject<'_>>(), 8);
27608
27609static_assertions::const_assert_eq!(std::mem::offset_of!(WireSymlinkObject<'_>, target), 0);
27610
27611unsafe impl ::fidl_next::Wire for WireSymlinkObject<'static> {
27612 type Decoded<'de> = WireSymlinkObject<'de>;
27613
27614 #[inline]
27615 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
27616 ::fidl_next::munge! {
27617 let Self {
27618
27619 target,
27620
27621 } = &mut *out_;
27622 }
27623
27624 ::fidl_next::Wire::zero_padding(target);
27625 }
27626}
27627
27628unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkObject<'static>
27629where
27630 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27631 ___D: ::fidl_next::Decoder,
27632{
27633 fn decode(
27634 slot_: ::fidl_next::Slot<'_, Self>,
27635 decoder_: &mut ___D,
27636 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27637 ::fidl_next::munge! {
27638 let Self {
27639
27640 mut target,
27641
27642 } = slot_;
27643 }
27644
27645 ::fidl_next::Decode::decode(target.as_mut(), decoder_)?;
27646
27647 let target = unsafe { target.deref_unchecked() };
27648
27649 if target.len() > 4095 {
27650 return Err(::fidl_next::DecodeError::VectorTooLong {
27651 size: target.len() as u64,
27652 limit: 4095,
27653 });
27654 }
27655
27656 Ok(())
27657 }
27658}
27659
27660#[derive(PartialEq, Debug)]
27661pub enum NodeInfoDeprecated {
27662 Service(crate::Service),
27663
27664 File(crate::FileObject),
27665
27666 Directory(crate::DirectoryObject),
27667
27668 Symlink(crate::SymlinkObject),
27669}
27670
27671impl ::fidl_next::Encodable for NodeInfoDeprecated {
27672 type Encoded = WireNodeInfoDeprecated<'static>;
27673}
27674
27675unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfoDeprecated
27676where
27677 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27678 ___E: ::fidl_next::Encoder,
27679 ___E: ::fidl_next::fuchsia::HandleEncoder,
27680{
27681 #[inline]
27682 fn encode(
27683 self,
27684 encoder: &mut ___E,
27685 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27686 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27687 ::fidl_next::munge!(let WireNodeInfoDeprecated { raw, _phantom: _ } = out);
27688
27689 match self {
27690 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
27691 value, 1, encoder, raw,
27692 )?,
27693
27694 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileObject>(
27695 value, 2, encoder, raw,
27696 )?,
27697
27698 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
27699 ___E,
27700 crate::DirectoryObject,
27701 >(value, 3, encoder, raw)?,
27702
27703 Self::Symlink(value) => ::fidl_next::RawWireUnion::encode_as::<
27704 ___E,
27705 crate::SymlinkObject,
27706 >(value, 4, encoder, raw)?,
27707 }
27708
27709 Ok(())
27710 }
27711}
27712
27713impl ::fidl_next::EncodableOption for NodeInfoDeprecated {
27714 type EncodedOption = WireOptionalNodeInfoDeprecated<'static>;
27715}
27716
27717unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeInfoDeprecated
27718where
27719 ___E: ?Sized,
27720 NodeInfoDeprecated: ::fidl_next::Encode<___E>,
27721{
27722 #[inline]
27723 fn encode_option(
27724 this: ::core::option::Option<Self>,
27725 encoder: &mut ___E,
27726 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27727 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27728 ::fidl_next::munge!(let WireOptionalNodeInfoDeprecated { raw, _phantom: _ } = &mut *out);
27729
27730 if let Some(inner) = this {
27731 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
27732 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
27733 } else {
27734 ::fidl_next::RawWireUnion::encode_absent(raw);
27735 }
27736
27737 Ok(())
27738 }
27739}
27740
27741impl<'de> ::fidl_next::FromWire<WireNodeInfoDeprecated<'de>> for NodeInfoDeprecated {
27742 #[inline]
27743 fn from_wire(wire: WireNodeInfoDeprecated<'de>) -> Self {
27744 let wire = ::core::mem::ManuallyDrop::new(wire);
27745 match wire.raw.ordinal() {
27746 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
27747 wire.raw.get().read_unchecked::<crate::WireService>()
27748 })),
27749
27750 2 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
27751 wire.raw.get().read_unchecked::<crate::WireFileObject>()
27752 })),
27753
27754 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
27755 wire.raw.get().read_unchecked::<crate::WireDirectoryObject>()
27756 })),
27757
27758 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
27759 wire.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>()
27760 })),
27761
27762 _ => unsafe { ::core::hint::unreachable_unchecked() },
27763 }
27764 }
27765}
27766
27767impl<'de> ::fidl_next::IntoNatural for WireNodeInfoDeprecated<'de> {
27768 type Natural = NodeInfoDeprecated;
27769}
27770
27771impl<'de> ::fidl_next::FromWireOption<WireOptionalNodeInfoDeprecated<'de>> for NodeInfoDeprecated {
27772 #[inline]
27773 fn from_wire_option(wire: WireOptionalNodeInfoDeprecated<'de>) -> ::core::option::Option<Self> {
27774 if let Some(inner) = wire.into_option() {
27775 Some(::fidl_next::FromWire::from_wire(inner))
27776 } else {
27777 None
27778 }
27779 }
27780}
27781
27782impl<'de> ::fidl_next::IntoNatural for WireOptionalNodeInfoDeprecated<'de> {
27783 type Natural = ::core::option::Option<NodeInfoDeprecated>;
27784}
27785
27786impl<'de> ::fidl_next::FromWireOption<WireOptionalNodeInfoDeprecated<'de>>
27787 for Box<NodeInfoDeprecated>
27788{
27789 #[inline]
27790 fn from_wire_option(wire: WireOptionalNodeInfoDeprecated<'de>) -> ::core::option::Option<Self> {
27791 <
27792 NodeInfoDeprecated as ::fidl_next::FromWireOption<WireOptionalNodeInfoDeprecated<'de>>
27793 >::from_wire_option(wire).map(Box::new)
27794 }
27795}
27796
27797#[repr(transparent)]
27799pub struct WireNodeInfoDeprecated<'de> {
27800 raw: ::fidl_next::RawWireUnion,
27801 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
27802}
27803
27804impl<'de> Drop for WireNodeInfoDeprecated<'de> {
27805 fn drop(&mut self) {
27806 match self.raw.ordinal() {
27807 1 => {
27808 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireService>() };
27809 }
27810
27811 2 => {
27812 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileObject>() };
27813 }
27814
27815 3 => {
27816 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryObject>() };
27817 }
27818
27819 4 => {
27820 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>() };
27821 }
27822
27823 _ => unsafe { ::core::hint::unreachable_unchecked() },
27824 }
27825 }
27826}
27827
27828unsafe impl ::fidl_next::Wire for WireNodeInfoDeprecated<'static> {
27829 type Decoded<'de> = WireNodeInfoDeprecated<'de>;
27830
27831 #[inline]
27832 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27833 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
27834 ::fidl_next::RawWireUnion::zero_padding(raw);
27835 }
27836}
27837
27838pub mod node_info_deprecated {
27839 pub enum Ref<'de> {
27840 Service(&'de crate::WireService),
27841
27842 File(&'de crate::WireFileObject),
27843
27844 Directory(&'de crate::WireDirectoryObject),
27845
27846 Symlink(&'de crate::WireSymlinkObject<'de>),
27847 }
27848}
27849
27850impl<'de> WireNodeInfoDeprecated<'de> {
27851 pub fn as_ref(&self) -> crate::node_info_deprecated::Ref<'_> {
27852 match self.raw.ordinal() {
27853 1 => crate::node_info_deprecated::Ref::Service(unsafe {
27854 self.raw.get().deref_unchecked::<crate::WireService>()
27855 }),
27856
27857 2 => crate::node_info_deprecated::Ref::File(unsafe {
27858 self.raw.get().deref_unchecked::<crate::WireFileObject>()
27859 }),
27860
27861 3 => crate::node_info_deprecated::Ref::Directory(unsafe {
27862 self.raw.get().deref_unchecked::<crate::WireDirectoryObject>()
27863 }),
27864
27865 4 => crate::node_info_deprecated::Ref::Symlink(unsafe {
27866 self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>()
27867 }),
27868
27869 _ => unsafe { ::core::hint::unreachable_unchecked() },
27870 }
27871 }
27872}
27873
27874unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfoDeprecated<'static>
27875where
27876 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27877 ___D: ::fidl_next::Decoder,
27878 ___D: ::fidl_next::fuchsia::HandleDecoder,
27879{
27880 fn decode(
27881 mut slot: ::fidl_next::Slot<'_, Self>,
27882 decoder: &mut ___D,
27883 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27884 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
27885 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
27886 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
27887
27888 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
27889
27890 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
27891 raw, decoder,
27892 )?,
27893
27894 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
27895 raw, decoder,
27896 )?,
27897
27898 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
27899 }
27900
27901 Ok(())
27902 }
27903}
27904
27905impl<'de> ::core::fmt::Debug for WireNodeInfoDeprecated<'de> {
27906 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
27907 match self.raw.ordinal() {
27908 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService>().fmt(f) },
27909 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileObject>().fmt(f) },
27910 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryObject>().fmt(f) },
27911 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>().fmt(f) },
27912 _ => unsafe { ::core::hint::unreachable_unchecked() },
27913 }
27914 }
27915}
27916
27917#[repr(transparent)]
27918pub struct WireOptionalNodeInfoDeprecated<'de> {
27919 raw: ::fidl_next::RawWireUnion,
27920 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
27921}
27922
27923unsafe impl ::fidl_next::Wire for WireOptionalNodeInfoDeprecated<'static> {
27924 type Decoded<'de> = WireOptionalNodeInfoDeprecated<'de>;
27925
27926 #[inline]
27927 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27928 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
27929 ::fidl_next::RawWireUnion::zero_padding(raw);
27930 }
27931}
27932
27933impl<'de> WireOptionalNodeInfoDeprecated<'de> {
27934 pub fn is_some(&self) -> bool {
27935 self.raw.is_some()
27936 }
27937
27938 pub fn is_none(&self) -> bool {
27939 self.raw.is_none()
27940 }
27941
27942 pub fn as_ref(&self) -> ::core::option::Option<&WireNodeInfoDeprecated<'de>> {
27943 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
27944 }
27945
27946 pub fn into_option(self) -> ::core::option::Option<WireNodeInfoDeprecated<'de>> {
27947 if self.is_some() {
27948 Some(WireNodeInfoDeprecated { raw: self.raw, _phantom: ::core::marker::PhantomData })
27949 } else {
27950 None
27951 }
27952 }
27953}
27954
27955unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodeInfoDeprecated<'static>
27956where
27957 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27958 ___D: ::fidl_next::Decoder,
27959 ___D: ::fidl_next::fuchsia::HandleDecoder,
27960{
27961 fn decode(
27962 mut slot: ::fidl_next::Slot<'_, Self>,
27963 decoder: &mut ___D,
27964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27965 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
27966 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
27967 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
27968
27969 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
27970
27971 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
27972 raw, decoder,
27973 )?,
27974
27975 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
27976 raw, decoder,
27977 )?,
27978
27979 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
27980 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
27981 }
27982
27983 Ok(())
27984 }
27985}
27986
27987impl<'de> ::core::fmt::Debug for WireOptionalNodeInfoDeprecated<'de> {
27988 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
27989 self.as_ref().fmt(f)
27990 }
27991}
27992
27993#[doc = " Flags used when opening a node reference must fall within this mask.\n"]
27994pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: crate::OpenFlags =
27995 crate::OpenFlags::from_bits_retain(46661632);
27996
27997#[doc = " All known rights.\n"]
27998pub const OPEN_RIGHTS: crate::OpenFlags = crate::OpenFlags::from_bits_retain(11);
27999
28000#[doc = " Set of permissions that are expected when opening a node as executable.\n"]
28001pub const PERM_EXECUTABLE: crate::Flags = crate::Flags::from_bits_retain(201);
28002
28003#[doc = " Set of permissions that are expected when opening a node as readable.\n"]
28004pub const PERM_READABLE: crate::Flags = crate::Flags::from_bits_retain(211);
28005
28006#[doc = " Set of permissions that are expected when opening a node as writable.\n"]
28007pub const PERM_WRITABLE: crate::Flags = crate::Flags::from_bits_retain(485);
28008
28009#[doc = " Alias for directory permission alias rw*\n"]
28010pub const RW_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(503);
28011
28012#[doc = " Alias for directory permission alias rx*\n"]
28013pub const RX_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(219);
28014
28015#[doc = " Alias for directory permission alias r*\n"]
28016pub const R_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(211);
28017
28018#[doc = " The name of the extended attribute accessible via the SELinux context attribute.\n"]
28019pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
28020
28021pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
28022
28023#[doc = " A [\'Node\'] which contains a symbolic link.\n"]
28025#[derive(PartialEq, Debug)]
28026pub struct Symlink;
28027
28028impl ::fidl_next::Discoverable for Symlink {
28029 const PROTOCOL_NAME: &'static str = "fuchsia.io.Symlink";
28030}
28031
28032pub mod symlink {
28033 pub mod prelude {
28034 pub use crate::{Symlink, SymlinkClientHandler, SymlinkServerHandler, symlink};
28035
28036 pub use crate::ExtendedAttributeValue;
28037
28038 pub use crate::LinkableLinkIntoRequest;
28039
28040 pub use crate::LinkableLinkIntoResponse;
28041
28042 pub use crate::MutableNodeAttributes;
28043
28044 pub use crate::NodeAttributes2;
28045
28046 pub use crate::NodeDeprecatedCloneRequest;
28047
28048 pub use crate::NodeDeprecatedGetAttrResponse;
28049
28050 pub use crate::NodeDeprecatedGetFlagsResponse;
28051
28052 pub use crate::NodeDeprecatedSetAttrRequest;
28053
28054 pub use crate::NodeDeprecatedSetAttrResponse;
28055
28056 pub use crate::NodeDeprecatedSetFlagsRequest;
28057
28058 pub use crate::NodeDeprecatedSetFlagsResponse;
28059
28060 pub use crate::NodeGetAttributesRequest;
28061
28062 pub use crate::NodeGetExtendedAttributeRequest;
28063
28064 pub use crate::NodeListExtendedAttributesRequest;
28065
28066 pub use crate::NodeOnOpenRequest;
28067
28068 pub use crate::NodeQueryFilesystemResponse;
28069
28070 pub use crate::NodeRemoveExtendedAttributeRequest;
28071
28072 pub use crate::NodeSetExtendedAttributeRequest;
28073
28074 pub use crate::NodeSetFlagsRequest;
28075
28076 pub use crate::NodeGetFlagsResponse;
28077
28078 pub use crate::NodeRemoveExtendedAttributeResponse;
28079
28080 pub use crate::NodeSetExtendedAttributeResponse;
28081
28082 pub use crate::NodeSetFlagsResponse;
28083
28084 pub use crate::NodeSyncResponse;
28085
28086 pub use crate::NodeUpdateAttributesResponse;
28087
28088 pub use crate::Representation;
28089
28090 pub use crate::SymlinkInfo;
28091
28092 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
28093
28094 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
28095
28096 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
28097 }
28098
28099 pub struct LinkInto;
28100
28101 impl ::fidl_next::Method for LinkInto {
28102 const ORDINAL: u64 = 6121399674497678964;
28103
28104 type Protocol = crate::Symlink;
28105
28106 type Request = crate::WireLinkableLinkIntoRequest<'static>;
28107
28108 type Response = ::fidl_next::WireResult<
28109 'static,
28110 crate::WireLinkableLinkIntoResponse,
28111 ::fidl_next::WireI32,
28112 >;
28113 }
28114
28115 pub struct Clone;
28116
28117 impl ::fidl_next::Method for Clone {
28118 const ORDINAL: u64 = 2366825959783828089;
28119
28120 type Protocol = crate::Symlink;
28121
28122 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
28123
28124 type Response = ::fidl_next::Never;
28125 }
28126
28127 pub struct Close;
28128
28129 impl ::fidl_next::Method for Close {
28130 const ORDINAL: u64 = 6540867515453498750;
28131
28132 type Protocol = crate::Symlink;
28133
28134 type Request = ();
28135
28136 type Response = ::fidl_next::WireResult<
28137 'static,
28138 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
28139 ::fidl_next::WireI32,
28140 >;
28141 }
28142
28143 pub struct Query;
28144
28145 impl ::fidl_next::Method for Query {
28146 const ORDINAL: u64 = 2763219980499352582;
28147
28148 type Protocol = crate::Symlink;
28149
28150 type Request = ();
28151
28152 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
28153 }
28154
28155 pub struct DeprecatedClone;
28156
28157 impl ::fidl_next::Method for DeprecatedClone {
28158 const ORDINAL: u64 = 6512600400724287855;
28159
28160 type Protocol = crate::Symlink;
28161
28162 type Request = crate::WireNodeDeprecatedCloneRequest;
28163
28164 type Response = ::fidl_next::Never;
28165 }
28166
28167 pub struct OnOpen;
28168
28169 impl ::fidl_next::Method for OnOpen {
28170 const ORDINAL: u64 = 9207534335756671346;
28171
28172 type Protocol = crate::Symlink;
28173
28174 type Request = ::fidl_next::Never;
28175
28176 type Response = crate::WireNodeOnOpenRequest<'static>;
28177 }
28178
28179 pub struct DeprecatedGetAttr;
28180
28181 impl ::fidl_next::Method for DeprecatedGetAttr {
28182 const ORDINAL: u64 = 8689798978500614909;
28183
28184 type Protocol = crate::Symlink;
28185
28186 type Request = ();
28187
28188 type Response = crate::WireNodeDeprecatedGetAttrResponse;
28189 }
28190
28191 pub struct DeprecatedSetAttr;
28192
28193 impl ::fidl_next::Method for DeprecatedSetAttr {
28194 const ORDINAL: u64 = 4721673413776871238;
28195
28196 type Protocol = crate::Symlink;
28197
28198 type Request = crate::WireNodeDeprecatedSetAttrRequest;
28199
28200 type Response = crate::WireNodeDeprecatedSetAttrResponse;
28201 }
28202
28203 pub struct DeprecatedGetFlags;
28204
28205 impl ::fidl_next::Method for DeprecatedGetFlags {
28206 const ORDINAL: u64 = 6595803110182632097;
28207
28208 type Protocol = crate::Symlink;
28209
28210 type Request = ();
28211
28212 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
28213 }
28214
28215 pub struct DeprecatedSetFlags;
28216
28217 impl ::fidl_next::Method for DeprecatedSetFlags {
28218 const ORDINAL: u64 = 5950864159036794675;
28219
28220 type Protocol = crate::Symlink;
28221
28222 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
28223
28224 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
28225 }
28226
28227 pub struct GetFlags;
28228
28229 impl ::fidl_next::Method for GetFlags {
28230 const ORDINAL: u64 = 105530239381466147;
28231
28232 type Protocol = crate::Symlink;
28233
28234 type Request = ();
28235
28236 type Response = ::fidl_next::WireFlexibleResult<
28237 'static,
28238 crate::WireNodeGetFlagsResponse,
28239 ::fidl_next::WireI32,
28240 >;
28241 }
28242
28243 pub struct SetFlags;
28244
28245 impl ::fidl_next::Method for SetFlags {
28246 const ORDINAL: u64 = 6172186066099445416;
28247
28248 type Protocol = crate::Symlink;
28249
28250 type Request = crate::WireNodeSetFlagsRequest;
28251
28252 type Response = ::fidl_next::WireFlexibleResult<
28253 'static,
28254 crate::WireNodeSetFlagsResponse,
28255 ::fidl_next::WireI32,
28256 >;
28257 }
28258
28259 pub struct QueryFilesystem;
28260
28261 impl ::fidl_next::Method for QueryFilesystem {
28262 const ORDINAL: u64 = 8013111122914313744;
28263
28264 type Protocol = crate::Symlink;
28265
28266 type Request = ();
28267
28268 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
28269 }
28270
28271 pub struct OnRepresentation;
28272
28273 impl ::fidl_next::Method for OnRepresentation {
28274 const ORDINAL: u64 = 6679970090861613324;
28275
28276 type Protocol = crate::Symlink;
28277
28278 type Request = ::fidl_next::Never;
28279
28280 type Response = crate::WireRepresentation<'static>;
28281 }
28282
28283 pub struct GetAttributes;
28284
28285 impl ::fidl_next::Method for GetAttributes {
28286 const ORDINAL: u64 = 4414537700416816443;
28287
28288 type Protocol = crate::Symlink;
28289
28290 type Request = crate::WireNodeGetAttributesRequest;
28291
28292 type Response = ::fidl_next::WireResult<
28293 'static,
28294 crate::WireNodeAttributes2<'static>,
28295 ::fidl_next::WireI32,
28296 >;
28297 }
28298
28299 pub struct UpdateAttributes;
28300
28301 impl ::fidl_next::Method for UpdateAttributes {
28302 const ORDINAL: u64 = 3677402239314018056;
28303
28304 type Protocol = crate::Symlink;
28305
28306 type Request = crate::WireMutableNodeAttributes<'static>;
28307
28308 type Response = ::fidl_next::WireResult<
28309 'static,
28310 crate::WireNodeUpdateAttributesResponse,
28311 ::fidl_next::WireI32,
28312 >;
28313 }
28314
28315 pub struct Sync;
28316
28317 impl ::fidl_next::Method for Sync {
28318 const ORDINAL: u64 = 3196473584242777161;
28319
28320 type Protocol = crate::Symlink;
28321
28322 type Request = ();
28323
28324 type Response =
28325 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
28326 }
28327
28328 pub struct ListExtendedAttributes;
28329
28330 impl ::fidl_next::Method for ListExtendedAttributes {
28331 const ORDINAL: u64 = 5431626189872037072;
28332
28333 type Protocol = crate::Symlink;
28334
28335 type Request = crate::WireNodeListExtendedAttributesRequest;
28336
28337 type Response = ::fidl_next::Never;
28338 }
28339
28340 pub struct GetExtendedAttribute;
28341
28342 impl ::fidl_next::Method for GetExtendedAttribute {
28343 const ORDINAL: u64 = 5043930208506967771;
28344
28345 type Protocol = crate::Symlink;
28346
28347 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
28348
28349 type Response = ::fidl_next::WireResult<
28350 'static,
28351 crate::WireExtendedAttributeValue<'static>,
28352 ::fidl_next::WireI32,
28353 >;
28354 }
28355
28356 pub struct SetExtendedAttribute;
28357
28358 impl ::fidl_next::Method for SetExtendedAttribute {
28359 const ORDINAL: u64 = 5374223046099989052;
28360
28361 type Protocol = crate::Symlink;
28362
28363 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
28364
28365 type Response = ::fidl_next::WireResult<
28366 'static,
28367 crate::WireNodeSetExtendedAttributeResponse,
28368 ::fidl_next::WireI32,
28369 >;
28370 }
28371
28372 pub struct RemoveExtendedAttribute;
28373
28374 impl ::fidl_next::Method for RemoveExtendedAttribute {
28375 const ORDINAL: u64 = 8794297771444732717;
28376
28377 type Protocol = crate::Symlink;
28378
28379 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
28380
28381 type Response = ::fidl_next::WireResult<
28382 'static,
28383 crate::WireNodeRemoveExtendedAttributeResponse,
28384 ::fidl_next::WireI32,
28385 >;
28386 }
28387
28388 pub struct Describe;
28389
28390 impl ::fidl_next::Method for Describe {
28391 const ORDINAL: u64 = 8371117097481679347;
28392
28393 type Protocol = crate::Symlink;
28394
28395 type Request = ();
28396
28397 type Response = ::fidl_next::WireFlexible<'static, crate::WireSymlinkInfo<'static>>;
28398 }
28399
28400 mod ___detail {
28401
28402 pub struct LinkInto<T0, T1> {
28403 dst_parent_token: T0,
28404
28405 dst: T1,
28406 }
28407
28408 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
28409 where
28410 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
28411 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
28412 {
28413 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
28414 }
28415
28416 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
28417 where
28418 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28419 ___E: ::fidl_next::Encoder,
28420 ___E: ::fidl_next::fuchsia::HandleEncoder,
28421 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
28422 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
28423 {
28424 #[inline]
28425 fn encode(
28426 self,
28427 encoder_: &mut ___E,
28428 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28429 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28430 ::fidl_next::munge! {
28431 let Self::Encoded {
28432 dst_parent_token,
28433 dst,
28434
28435 } = out_;
28436 }
28437
28438 ::fidl_next::Encode::encode(self.dst_parent_token, encoder_, dst_parent_token)?;
28439
28440 ::fidl_next::Encode::encode(self.dst, encoder_, dst)?;
28441
28442 Ok(())
28443 }
28444 }
28445
28446 pub struct Clone<T0> {
28447 request: T0,
28448 }
28449
28450 impl<T0> ::fidl_next::Encodable for Clone<T0>
28451 where
28452 T0: ::fidl_next::Encodable<
28453 Encoded = ::fidl_next::ServerEnd<
28454 ::fidl_next_fuchsia_unknown::Cloneable,
28455 ::fidl_next::fuchsia::WireChannel,
28456 >,
28457 >,
28458 {
28459 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
28460 }
28461
28462 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
28463 where
28464 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28465 ___E: ::fidl_next::fuchsia::HandleEncoder,
28466 T0: ::fidl_next::Encode<
28467 ___E,
28468 Encoded = ::fidl_next::ServerEnd<
28469 ::fidl_next_fuchsia_unknown::Cloneable,
28470 ::fidl_next::fuchsia::WireChannel,
28471 >,
28472 >,
28473 {
28474 #[inline]
28475 fn encode(
28476 self,
28477 encoder_: &mut ___E,
28478 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28479 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28480 ::fidl_next::munge! {
28481 let Self::Encoded {
28482 request,
28483
28484 } = out_;
28485 }
28486
28487 ::fidl_next::Encode::encode(self.request, encoder_, request)?;
28488
28489 Ok(())
28490 }
28491 }
28492
28493 pub struct DeprecatedClone<T0, T1> {
28494 flags: T0,
28495
28496 object: T1,
28497 }
28498
28499 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
28500 where
28501 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
28502 T1: ::fidl_next::Encodable<
28503 Encoded = ::fidl_next::ServerEnd<
28504 crate::Node,
28505 ::fidl_next::fuchsia::WireChannel,
28506 >,
28507 >,
28508 {
28509 type Encoded = crate::WireNodeDeprecatedCloneRequest;
28510 }
28511
28512 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
28513 where
28514 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28515 ___E: ::fidl_next::fuchsia::HandleEncoder,
28516 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
28517 T1: ::fidl_next::Encode<
28518 ___E,
28519 Encoded = ::fidl_next::ServerEnd<
28520 crate::Node,
28521 ::fidl_next::fuchsia::WireChannel,
28522 >,
28523 >,
28524 {
28525 #[inline]
28526 fn encode(
28527 self,
28528 encoder_: &mut ___E,
28529 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28530 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28531 ::fidl_next::munge! {
28532 let Self::Encoded {
28533 flags,
28534 object,
28535
28536 } = out_;
28537 }
28538
28539 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
28540
28541 ::fidl_next::Encode::encode(self.object, encoder_, object)?;
28542
28543 Ok(())
28544 }
28545 }
28546
28547 pub struct OnOpen<T0, T1> {
28548 s: T0,
28549
28550 info: T1,
28551 }
28552
28553 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
28554 where
28555 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
28556 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
28557 {
28558 type Encoded = crate::WireNodeOnOpenRequest<'static>;
28559 }
28560
28561 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
28562 where
28563 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28564 ___E: ::fidl_next::Encoder,
28565 ___E: ::fidl_next::fuchsia::HandleEncoder,
28566 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
28567 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
28568 {
28569 #[inline]
28570 fn encode(
28571 self,
28572 encoder_: &mut ___E,
28573 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28575 ::fidl_next::munge! {
28576 let Self::Encoded {
28577 s,
28578 info,
28579
28580 } = out_;
28581 }
28582
28583 ::fidl_next::Encode::encode(self.s, encoder_, s)?;
28584
28585 ::fidl_next::Encode::encode(self.info, encoder_, info)?;
28586
28587 Ok(())
28588 }
28589 }
28590
28591 pub struct DeprecatedSetAttr<T0, T1> {
28592 flags: T0,
28593
28594 attributes: T1,
28595 }
28596
28597 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
28598 where
28599 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
28600 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
28601 {
28602 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
28603 }
28604
28605 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
28606 where
28607 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28608 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
28609 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
28610 {
28611 #[inline]
28612 fn encode(
28613 self,
28614 encoder_: &mut ___E,
28615 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28616 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28617 ::fidl_next::munge! {
28618 let Self::Encoded {
28619 flags,
28620 attributes,
28621
28622 } = out_;
28623 }
28624
28625 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
28626
28627 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes)?;
28628
28629 Ok(())
28630 }
28631 }
28632
28633 pub struct DeprecatedSetFlags<T0> {
28634 flags: T0,
28635 }
28636
28637 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
28638 where
28639 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
28640 {
28641 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
28642 }
28643
28644 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
28645 where
28646 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28647 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
28648 {
28649 #[inline]
28650 fn encode(
28651 self,
28652 encoder_: &mut ___E,
28653 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28654 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28655 ::fidl_next::munge! {
28656 let Self::Encoded {
28657 flags,
28658
28659 } = out_;
28660 }
28661
28662 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
28663
28664 Ok(())
28665 }
28666 }
28667
28668 pub struct SetFlags<T0> {
28669 flags: T0,
28670 }
28671
28672 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
28673 where
28674 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
28675 {
28676 type Encoded = crate::WireNodeSetFlagsRequest;
28677 }
28678
28679 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
28680 where
28681 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28682 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
28683 {
28684 #[inline]
28685 fn encode(
28686 self,
28687 encoder_: &mut ___E,
28688 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28689 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28690 ::fidl_next::munge! {
28691 let Self::Encoded {
28692 flags,
28693
28694 } = out_;
28695 }
28696
28697 ::fidl_next::Encode::encode(self.flags, encoder_, flags)?;
28698
28699 Ok(())
28700 }
28701 }
28702
28703 pub struct GetAttributes<T0> {
28704 query: T0,
28705 }
28706
28707 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
28708 where
28709 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
28710 {
28711 type Encoded = crate::WireNodeGetAttributesRequest;
28712 }
28713
28714 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
28715 where
28716 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28717 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
28718 {
28719 #[inline]
28720 fn encode(
28721 self,
28722 encoder_: &mut ___E,
28723 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28724 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28725 ::fidl_next::munge! {
28726 let Self::Encoded {
28727 query,
28728
28729 } = out_;
28730 }
28731
28732 ::fidl_next::Encode::encode(self.query, encoder_, query)?;
28733
28734 Ok(())
28735 }
28736 }
28737
28738 pub struct ListExtendedAttributes<T0> {
28739 iterator: T0,
28740 }
28741
28742 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
28743 where
28744 T0: ::fidl_next::Encodable<
28745 Encoded = ::fidl_next::ServerEnd<
28746 crate::ExtendedAttributeIterator,
28747 ::fidl_next::fuchsia::WireChannel,
28748 >,
28749 >,
28750 {
28751 type Encoded = crate::WireNodeListExtendedAttributesRequest;
28752 }
28753
28754 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
28755 where
28756 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28757 ___E: ::fidl_next::fuchsia::HandleEncoder,
28758 T0: ::fidl_next::Encode<
28759 ___E,
28760 Encoded = ::fidl_next::ServerEnd<
28761 crate::ExtendedAttributeIterator,
28762 ::fidl_next::fuchsia::WireChannel,
28763 >,
28764 >,
28765 {
28766 #[inline]
28767 fn encode(
28768 self,
28769 encoder_: &mut ___E,
28770 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28771 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28772 ::fidl_next::munge! {
28773 let Self::Encoded {
28774 iterator,
28775
28776 } = out_;
28777 }
28778
28779 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator)?;
28780
28781 Ok(())
28782 }
28783 }
28784
28785 pub struct GetExtendedAttribute<T0> {
28786 name: T0,
28787 }
28788
28789 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
28790 where
28791 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
28792 {
28793 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
28794 }
28795
28796 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
28797 where
28798 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28799 ___E: ::fidl_next::Encoder,
28800 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
28801 {
28802 #[inline]
28803 fn encode(
28804 self,
28805 encoder_: &mut ___E,
28806 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28807 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28808 ::fidl_next::munge! {
28809 let Self::Encoded {
28810 name,
28811
28812 } = out_;
28813 }
28814
28815 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
28816
28817 Ok(())
28818 }
28819 }
28820
28821 pub struct SetExtendedAttribute<T0, T1, T2> {
28822 name: T0,
28823
28824 value: T1,
28825
28826 mode: T2,
28827 }
28828
28829 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
28830 where
28831 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
28832 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
28833 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
28834 {
28835 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
28836 }
28837
28838 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
28839 where
28840 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28841 ___E: ::fidl_next::Encoder,
28842 ___E: ::fidl_next::fuchsia::HandleEncoder,
28843 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
28844 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
28845 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
28846 {
28847 #[inline]
28848 fn encode(
28849 self,
28850 encoder_: &mut ___E,
28851 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28852 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28853 ::fidl_next::munge! {
28854 let Self::Encoded {
28855 name,
28856 value,
28857 mode,
28858
28859 } = out_;
28860 }
28861
28862 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
28863
28864 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
28865
28866 ::fidl_next::Encode::encode(self.mode, encoder_, mode)?;
28867
28868 Ok(())
28869 }
28870 }
28871
28872 pub struct RemoveExtendedAttribute<T0> {
28873 name: T0,
28874 }
28875
28876 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
28877 where
28878 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
28879 {
28880 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
28881 }
28882
28883 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
28884 where
28885 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28886 ___E: ::fidl_next::Encoder,
28887 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
28888 {
28889 #[inline]
28890 fn encode(
28891 self,
28892 encoder_: &mut ___E,
28893 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28894 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28895 ::fidl_next::munge! {
28896 let Self::Encoded {
28897 name,
28898
28899 } = out_;
28900 }
28901
28902 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
28903
28904 Ok(())
28905 }
28906 }
28907
28908 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Symlink
28909 where
28910 ___T: ::fidl_next::Transport,
28911 {
28912 type Client = SymlinkClient<___T>;
28913 type Server = SymlinkServer<___T>;
28914 }
28915
28916 #[repr(transparent)]
28918 pub struct SymlinkClient<___T: ::fidl_next::Transport> {
28919 #[allow(dead_code)]
28920 client: ::fidl_next::protocol::Client<___T>,
28921 }
28922
28923 impl<___T> SymlinkClient<___T>
28924 where
28925 ___T: ::fidl_next::Transport,
28926 {
28927 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
28928 pub fn link_into(
28929 &self,
28930
28931 dst_parent_token: impl ::fidl_next::Encode<
28932 <___T as ::fidl_next::Transport>::SendBuffer,
28933 Encoded = ::fidl_next::fuchsia::WireEvent,
28934 >,
28935
28936 dst: impl ::fidl_next::Encode<
28937 <___T as ::fidl_next::Transport>::SendBuffer,
28938 Encoded = ::fidl_next::WireString<'static>,
28939 >,
28940 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
28941 where
28942 <___T as ::fidl_next::Transport>::SendBuffer:
28943 ::fidl_next::encoder::InternalHandleEncoder,
28944 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
28945 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
28946 {
28947 self.link_into_with(LinkInto { dst_parent_token, dst })
28948 }
28949
28950 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
28951 pub fn link_into_with<___R>(
28952 &self,
28953 request: ___R,
28954 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
28955 where
28956 ___R: ::fidl_next::Encode<
28957 <___T as ::fidl_next::Transport>::SendBuffer,
28958 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
28959 >,
28960 {
28961 ::fidl_next::TwoWayFuture::from_untyped(
28962 self.client.send_two_way(6121399674497678964, request),
28963 )
28964 }
28965
28966 pub fn clone(
28967 &self,
28968
28969 request: impl ::fidl_next::Encode<
28970 <___T as ::fidl_next::Transport>::SendBuffer,
28971 Encoded = ::fidl_next::ServerEnd<
28972 ::fidl_next_fuchsia_unknown::Cloneable,
28973 ::fidl_next::fuchsia::WireChannel,
28974 >,
28975 >,
28976 ) -> ::fidl_next::SendFuture<'_, ___T>
28977 where
28978 <___T as ::fidl_next::Transport>::SendBuffer:
28979 ::fidl_next::encoder::InternalHandleEncoder,
28980 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
28981 {
28982 self.clone_with(Clone { request })
28983 }
28984
28985 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
28986 where
28987 ___R: ::fidl_next::Encode<
28988 <___T as ::fidl_next::Transport>::SendBuffer,
28989 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
28990 >,
28991 {
28992 ::fidl_next::SendFuture::from_untyped(
28993 self.client.send_one_way(2366825959783828089, request),
28994 )
28995 }
28996
28997 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
28998 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
28999 ::fidl_next::TwoWayFuture::from_untyped(
29000 self.client.send_two_way(6540867515453498750, ()),
29001 )
29002 }
29003
29004 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
29005 ::fidl_next::TwoWayFuture::from_untyped(
29006 self.client.send_two_way(2763219980499352582, ()),
29007 )
29008 }
29009
29010 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
29011 pub fn deprecated_clone(
29012 &self,
29013
29014 flags: impl ::fidl_next::Encode<
29015 <___T as ::fidl_next::Transport>::SendBuffer,
29016 Encoded = crate::WireOpenFlags,
29017 >,
29018
29019 object: impl ::fidl_next::Encode<
29020 <___T as ::fidl_next::Transport>::SendBuffer,
29021 Encoded = ::fidl_next::ServerEnd<
29022 crate::Node,
29023 ::fidl_next::fuchsia::WireChannel,
29024 >,
29025 >,
29026 ) -> ::fidl_next::SendFuture<'_, ___T>
29027 where
29028 <___T as ::fidl_next::Transport>::SendBuffer:
29029 ::fidl_next::encoder::InternalHandleEncoder,
29030 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
29031 {
29032 self.deprecated_clone_with(DeprecatedClone { flags, object })
29033 }
29034
29035 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
29036 pub fn deprecated_clone_with<___R>(
29037 &self,
29038 request: ___R,
29039 ) -> ::fidl_next::SendFuture<'_, ___T>
29040 where
29041 ___R: ::fidl_next::Encode<
29042 <___T as ::fidl_next::Transport>::SendBuffer,
29043 Encoded = crate::WireNodeDeprecatedCloneRequest,
29044 >,
29045 {
29046 ::fidl_next::SendFuture::from_untyped(
29047 self.client.send_one_way(6512600400724287855, request),
29048 )
29049 }
29050
29051 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
29052 pub fn deprecated_get_attr(
29053 &self,
29054 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
29055 ::fidl_next::TwoWayFuture::from_untyped(
29056 self.client.send_two_way(8689798978500614909, ()),
29057 )
29058 }
29059
29060 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
29061 pub fn deprecated_set_attr(
29062 &self,
29063
29064 flags: impl ::fidl_next::Encode<
29065 <___T as ::fidl_next::Transport>::SendBuffer,
29066 Encoded = crate::WireNodeAttributeFlags,
29067 >,
29068
29069 attributes: impl ::fidl_next::Encode<
29070 <___T as ::fidl_next::Transport>::SendBuffer,
29071 Encoded = crate::WireNodeAttributes,
29072 >,
29073 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
29074 where
29075 <___T as ::fidl_next::Transport>::SendBuffer:
29076 ::fidl_next::encoder::InternalHandleEncoder,
29077 {
29078 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
29079 }
29080
29081 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
29082 pub fn deprecated_set_attr_with<___R>(
29083 &self,
29084 request: ___R,
29085 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
29086 where
29087 ___R: ::fidl_next::Encode<
29088 <___T as ::fidl_next::Transport>::SendBuffer,
29089 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
29090 >,
29091 {
29092 ::fidl_next::TwoWayFuture::from_untyped(
29093 self.client.send_two_way(4721673413776871238, request),
29094 )
29095 }
29096
29097 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
29098 pub fn deprecated_get_flags(
29099 &self,
29100 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
29101 ::fidl_next::TwoWayFuture::from_untyped(
29102 self.client.send_two_way(6595803110182632097, ()),
29103 )
29104 }
29105
29106 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
29107 pub fn deprecated_set_flags(
29108 &self,
29109
29110 flags: impl ::fidl_next::Encode<
29111 <___T as ::fidl_next::Transport>::SendBuffer,
29112 Encoded = crate::WireOpenFlags,
29113 >,
29114 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
29115 where
29116 <___T as ::fidl_next::Transport>::SendBuffer:
29117 ::fidl_next::encoder::InternalHandleEncoder,
29118 {
29119 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
29120 }
29121
29122 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
29123 pub fn deprecated_set_flags_with<___R>(
29124 &self,
29125 request: ___R,
29126 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
29127 where
29128 ___R: ::fidl_next::Encode<
29129 <___T as ::fidl_next::Transport>::SendBuffer,
29130 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
29131 >,
29132 {
29133 ::fidl_next::TwoWayFuture::from_untyped(
29134 self.client.send_two_way(5950864159036794675, request),
29135 )
29136 }
29137
29138 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
29139 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
29140 ::fidl_next::TwoWayFuture::from_untyped(
29141 self.client.send_two_way(105530239381466147, ()),
29142 )
29143 }
29144
29145 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
29146 pub fn set_flags(
29147 &self,
29148
29149 flags: impl ::fidl_next::Encode<
29150 <___T as ::fidl_next::Transport>::SendBuffer,
29151 Encoded = crate::WireFlags,
29152 >,
29153 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
29154 where
29155 <___T as ::fidl_next::Transport>::SendBuffer:
29156 ::fidl_next::encoder::InternalHandleEncoder,
29157 {
29158 self.set_flags_with(SetFlags { flags })
29159 }
29160
29161 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
29162 pub fn set_flags_with<___R>(
29163 &self,
29164 request: ___R,
29165 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
29166 where
29167 ___R: ::fidl_next::Encode<
29168 <___T as ::fidl_next::Transport>::SendBuffer,
29169 Encoded = crate::WireNodeSetFlagsRequest,
29170 >,
29171 {
29172 ::fidl_next::TwoWayFuture::from_untyped(
29173 self.client.send_two_way(6172186066099445416, request),
29174 )
29175 }
29176
29177 #[doc = " Query the filesystem for filesystem-specific information.\n"]
29178 pub fn query_filesystem(
29179 &self,
29180 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
29181 ::fidl_next::TwoWayFuture::from_untyped(
29182 self.client.send_two_way(8013111122914313744, ()),
29183 )
29184 }
29185
29186 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29187 pub fn get_attributes(
29188 &self,
29189
29190 query: impl ::fidl_next::Encode<
29191 <___T as ::fidl_next::Transport>::SendBuffer,
29192 Encoded = crate::WireNodeAttributesQuery,
29193 >,
29194 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
29195 where
29196 <___T as ::fidl_next::Transport>::SendBuffer:
29197 ::fidl_next::encoder::InternalHandleEncoder,
29198 {
29199 self.get_attributes_with(GetAttributes { query })
29200 }
29201
29202 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29203 pub fn get_attributes_with<___R>(
29204 &self,
29205 request: ___R,
29206 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
29207 where
29208 ___R: ::fidl_next::Encode<
29209 <___T as ::fidl_next::Transport>::SendBuffer,
29210 Encoded = crate::WireNodeGetAttributesRequest,
29211 >,
29212 {
29213 ::fidl_next::TwoWayFuture::from_untyped(
29214 self.client.send_two_way(4414537700416816443, request),
29215 )
29216 }
29217
29218 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29219 pub fn update_attributes_with<___R>(
29220 &self,
29221 request: ___R,
29222 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
29223 where
29224 ___R: ::fidl_next::Encode<
29225 <___T as ::fidl_next::Transport>::SendBuffer,
29226 Encoded = crate::WireMutableNodeAttributes<'static>,
29227 >,
29228 {
29229 ::fidl_next::TwoWayFuture::from_untyped(
29230 self.client.send_two_way(3677402239314018056, request),
29231 )
29232 }
29233
29234 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
29235 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
29236 ::fidl_next::TwoWayFuture::from_untyped(
29237 self.client.send_two_way(3196473584242777161, ()),
29238 )
29239 }
29240
29241 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29242 pub fn list_extended_attributes(
29243 &self,
29244
29245 iterator: impl ::fidl_next::Encode<
29246 <___T as ::fidl_next::Transport>::SendBuffer,
29247 Encoded = ::fidl_next::ServerEnd<
29248 crate::ExtendedAttributeIterator,
29249 ::fidl_next::fuchsia::WireChannel,
29250 >,
29251 >,
29252 ) -> ::fidl_next::SendFuture<'_, ___T>
29253 where
29254 <___T as ::fidl_next::Transport>::SendBuffer:
29255 ::fidl_next::encoder::InternalHandleEncoder,
29256 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
29257 {
29258 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
29259 }
29260
29261 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29262 pub fn list_extended_attributes_with<___R>(
29263 &self,
29264 request: ___R,
29265 ) -> ::fidl_next::SendFuture<'_, ___T>
29266 where
29267 ___R: ::fidl_next::Encode<
29268 <___T as ::fidl_next::Transport>::SendBuffer,
29269 Encoded = crate::WireNodeListExtendedAttributesRequest,
29270 >,
29271 {
29272 ::fidl_next::SendFuture::from_untyped(
29273 self.client.send_one_way(5431626189872037072, request),
29274 )
29275 }
29276
29277 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29278 pub fn get_extended_attribute(
29279 &self,
29280
29281 name: impl ::fidl_next::Encode<
29282 <___T as ::fidl_next::Transport>::SendBuffer,
29283 Encoded = ::fidl_next::WireVector<'static, u8>,
29284 >,
29285 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
29286 where
29287 <___T as ::fidl_next::Transport>::SendBuffer:
29288 ::fidl_next::encoder::InternalHandleEncoder,
29289 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
29290 {
29291 self.get_extended_attribute_with(GetExtendedAttribute { name })
29292 }
29293
29294 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29295 pub fn get_extended_attribute_with<___R>(
29296 &self,
29297 request: ___R,
29298 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
29299 where
29300 ___R: ::fidl_next::Encode<
29301 <___T as ::fidl_next::Transport>::SendBuffer,
29302 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
29303 >,
29304 {
29305 ::fidl_next::TwoWayFuture::from_untyped(
29306 self.client.send_two_way(5043930208506967771, request),
29307 )
29308 }
29309
29310 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29311 pub fn set_extended_attribute(
29312 &self,
29313
29314 name: impl ::fidl_next::Encode<
29315 <___T as ::fidl_next::Transport>::SendBuffer,
29316 Encoded = ::fidl_next::WireVector<'static, u8>,
29317 >,
29318
29319 value: impl ::fidl_next::Encode<
29320 <___T as ::fidl_next::Transport>::SendBuffer,
29321 Encoded = crate::WireExtendedAttributeValue<'static>,
29322 >,
29323
29324 mode: impl ::fidl_next::Encode<
29325 <___T as ::fidl_next::Transport>::SendBuffer,
29326 Encoded = crate::WireSetExtendedAttributeMode,
29327 >,
29328 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
29329 where
29330 <___T as ::fidl_next::Transport>::SendBuffer:
29331 ::fidl_next::encoder::InternalHandleEncoder,
29332 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
29333 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
29334 {
29335 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
29336 }
29337
29338 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29339 pub fn set_extended_attribute_with<___R>(
29340 &self,
29341 request: ___R,
29342 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
29343 where
29344 ___R: ::fidl_next::Encode<
29345 <___T as ::fidl_next::Transport>::SendBuffer,
29346 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
29347 >,
29348 {
29349 ::fidl_next::TwoWayFuture::from_untyped(
29350 self.client.send_two_way(5374223046099989052, request),
29351 )
29352 }
29353
29354 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29355 pub fn remove_extended_attribute(
29356 &self,
29357
29358 name: impl ::fidl_next::Encode<
29359 <___T as ::fidl_next::Transport>::SendBuffer,
29360 Encoded = ::fidl_next::WireVector<'static, u8>,
29361 >,
29362 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
29363 where
29364 <___T as ::fidl_next::Transport>::SendBuffer:
29365 ::fidl_next::encoder::InternalHandleEncoder,
29366 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
29367 {
29368 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
29369 }
29370
29371 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29372 pub fn remove_extended_attribute_with<___R>(
29373 &self,
29374 request: ___R,
29375 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
29376 where
29377 ___R: ::fidl_next::Encode<
29378 <___T as ::fidl_next::Transport>::SendBuffer,
29379 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
29380 >,
29381 {
29382 ::fidl_next::TwoWayFuture::from_untyped(
29383 self.client.send_two_way(8794297771444732717, request),
29384 )
29385 }
29386
29387 pub fn describe(&self) -> ::fidl_next::TwoWayFuture<'_, super::Describe, ___T> {
29388 ::fidl_next::TwoWayFuture::from_untyped(
29389 self.client.send_two_way(8371117097481679347, ()),
29390 )
29391 }
29392 }
29393
29394 #[repr(transparent)]
29396 pub struct SymlinkServer<___T: ::fidl_next::Transport> {
29397 server: ::fidl_next::protocol::Server<___T>,
29398 }
29399
29400 impl<___T> SymlinkServer<___T>
29401 where
29402 ___T: ::fidl_next::Transport,
29403 {
29404 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
29405 pub fn on_open(
29406 &self,
29407
29408 s: impl ::fidl_next::Encode<
29409 <___T as ::fidl_next::Transport>::SendBuffer,
29410 Encoded = ::fidl_next::WireI32,
29411 >,
29412
29413 info: impl ::fidl_next::Encode<
29414 <___T as ::fidl_next::Transport>::SendBuffer,
29415 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
29416 >,
29417 ) -> ::fidl_next::SendFuture<'_, ___T>
29418 where
29419 <___T as ::fidl_next::Transport>::SendBuffer:
29420 ::fidl_next::encoder::InternalHandleEncoder,
29421 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
29422 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
29423 {
29424 self.on_open_with(OnOpen { s, info })
29425 }
29426
29427 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
29428
29429 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
29430 where
29431 ___R: ::fidl_next::Encode<
29432 <___T as ::fidl_next::Transport>::SendBuffer,
29433 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
29434 >,
29435 {
29436 ::fidl_next::SendFuture::from_untyped(
29437 self.server.send_event(9207534335756671346, request),
29438 )
29439 }
29440
29441 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
29442
29443 pub fn on_representation_with<___R>(
29444 &self,
29445 request: ___R,
29446 ) -> ::fidl_next::SendFuture<'_, ___T>
29447 where
29448 ___R: ::fidl_next::Encode<
29449 <___T as ::fidl_next::Transport>::SendBuffer,
29450 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
29451 >,
29452 {
29453 ::fidl_next::SendFuture::from_untyped(
29454 self.server.send_event(6679970090861613324, request),
29455 )
29456 }
29457 }
29458 }
29459}
29460
29461pub trait SymlinkClientHandler<
29465 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
29466 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
29467>
29468{
29469 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
29470 fn on_open(
29471 &mut self,
29472
29473 event: ::fidl_next::Response<symlink::OnOpen, ___T>,
29474 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29475
29476 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
29477 fn on_representation(
29478 &mut self,
29479
29480 event: ::fidl_next::Response<symlink::OnRepresentation, ___T>,
29481 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29482
29483 fn on_unknown_interaction(
29484 &mut self,
29485 ordinal: u64,
29486 ) -> impl ::core::future::Future<
29487 Output = ::core::result::Result<
29488 (),
29489 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
29490 >,
29491 > + ::core::marker::Send {
29492 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
29493 }
29494}
29495
29496impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Symlink
29497where
29498 ___H: SymlinkClientHandler<___T> + ::core::marker::Send,
29499 ___T: ::fidl_next::Transport,
29500 <symlink::LinkInto as ::fidl_next::Method>::Response:
29501 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29502 <symlink::Close as ::fidl_next::Method>::Response:
29503 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29504 <symlink::Query as ::fidl_next::Method>::Response:
29505 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29506 <symlink::OnOpen as ::fidl_next::Method>::Response:
29507 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29508 <symlink::DeprecatedGetAttr as ::fidl_next::Method>::Response:
29509 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29510 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Response:
29511 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29512 <symlink::DeprecatedGetFlags as ::fidl_next::Method>::Response:
29513 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29514 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Response:
29515 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29516 <symlink::GetFlags as ::fidl_next::Method>::Response:
29517 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29518 <symlink::SetFlags as ::fidl_next::Method>::Response:
29519 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29520 <symlink::QueryFilesystem as ::fidl_next::Method>::Response:
29521 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29522 <symlink::OnRepresentation as ::fidl_next::Method>::Response:
29523 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29524 <symlink::GetAttributes as ::fidl_next::Method>::Response:
29525 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29526 <symlink::UpdateAttributes as ::fidl_next::Method>::Response:
29527 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29528 <symlink::Sync as ::fidl_next::Method>::Response:
29529 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29530 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Response:
29531 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29532 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Response:
29533 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29534 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
29535 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29536 <symlink::Describe as ::fidl_next::Method>::Response:
29537 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29538{
29539 async fn on_event(
29540 handler: &mut ___H,
29541 ordinal: u64,
29542 buffer: ___T::RecvBuffer,
29543 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
29544 match ordinal {
29545 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
29546 Ok(decoded) => {
29547 handler.on_open(decoded).await;
29548 Ok(())
29549 }
29550 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29551 ordinal: 9207534335756671346,
29552 error,
29553 }),
29554 },
29555
29556 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
29557 Ok(decoded) => {
29558 handler.on_representation(decoded).await;
29559 Ok(())
29560 }
29561 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29562 ordinal: 6679970090861613324,
29563 error,
29564 }),
29565 },
29566
29567 ordinal => handler.on_unknown_interaction(ordinal).await,
29568 }
29569 }
29570}
29571
29572pub trait SymlinkServerHandler<
29576 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
29577 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
29578>
29579{
29580 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
29581 fn link_into(
29582 &mut self,
29583
29584 request: ::fidl_next::Request<symlink::LinkInto, ___T>,
29585
29586 responder: ::fidl_next::Responder<symlink::LinkInto, ___T>,
29587 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29588
29589 fn clone(
29590 &mut self,
29591
29592 request: ::fidl_next::Request<symlink::Clone, ___T>,
29593 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29594
29595 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
29596 fn close(
29597 &mut self,
29598
29599 responder: ::fidl_next::Responder<symlink::Close, ___T>,
29600 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29601
29602 fn query(
29603 &mut self,
29604
29605 responder: ::fidl_next::Responder<symlink::Query, ___T>,
29606 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29607
29608 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
29609 fn deprecated_clone(
29610 &mut self,
29611
29612 request: ::fidl_next::Request<symlink::DeprecatedClone, ___T>,
29613 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29614
29615 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
29616 fn deprecated_get_attr(
29617 &mut self,
29618
29619 responder: ::fidl_next::Responder<symlink::DeprecatedGetAttr, ___T>,
29620 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29621
29622 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
29623 fn deprecated_set_attr(
29624 &mut self,
29625
29626 request: ::fidl_next::Request<symlink::DeprecatedSetAttr, ___T>,
29627
29628 responder: ::fidl_next::Responder<symlink::DeprecatedSetAttr, ___T>,
29629 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29630
29631 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
29632 fn deprecated_get_flags(
29633 &mut self,
29634
29635 responder: ::fidl_next::Responder<symlink::DeprecatedGetFlags, ___T>,
29636 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29637
29638 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
29639 fn deprecated_set_flags(
29640 &mut self,
29641
29642 request: ::fidl_next::Request<symlink::DeprecatedSetFlags, ___T>,
29643
29644 responder: ::fidl_next::Responder<symlink::DeprecatedSetFlags, ___T>,
29645 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29646
29647 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
29648 fn get_flags(
29649 &mut self,
29650
29651 responder: ::fidl_next::Responder<symlink::GetFlags, ___T>,
29652 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29653
29654 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
29655 fn set_flags(
29656 &mut self,
29657
29658 request: ::fidl_next::Request<symlink::SetFlags, ___T>,
29659
29660 responder: ::fidl_next::Responder<symlink::SetFlags, ___T>,
29661 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29662
29663 #[doc = " Query the filesystem for filesystem-specific information.\n"]
29664 fn query_filesystem(
29665 &mut self,
29666
29667 responder: ::fidl_next::Responder<symlink::QueryFilesystem, ___T>,
29668 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29669
29670 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29671 fn get_attributes(
29672 &mut self,
29673
29674 request: ::fidl_next::Request<symlink::GetAttributes, ___T>,
29675
29676 responder: ::fidl_next::Responder<symlink::GetAttributes, ___T>,
29677 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29678
29679 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29680 fn update_attributes(
29681 &mut self,
29682
29683 request: ::fidl_next::Request<symlink::UpdateAttributes, ___T>,
29684
29685 responder: ::fidl_next::Responder<symlink::UpdateAttributes, ___T>,
29686 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29687
29688 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
29689 fn sync(
29690 &mut self,
29691
29692 responder: ::fidl_next::Responder<symlink::Sync, ___T>,
29693 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29694
29695 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29696 fn list_extended_attributes(
29697 &mut self,
29698
29699 request: ::fidl_next::Request<symlink::ListExtendedAttributes, ___T>,
29700 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29701
29702 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
29703 fn get_extended_attribute(
29704 &mut self,
29705
29706 request: ::fidl_next::Request<symlink::GetExtendedAttribute, ___T>,
29707
29708 responder: ::fidl_next::Responder<symlink::GetExtendedAttribute, ___T>,
29709 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29710
29711 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29712 fn set_extended_attribute(
29713 &mut self,
29714
29715 request: ::fidl_next::Request<symlink::SetExtendedAttribute, ___T>,
29716
29717 responder: ::fidl_next::Responder<symlink::SetExtendedAttribute, ___T>,
29718 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29719
29720 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
29721 fn remove_extended_attribute(
29722 &mut self,
29723
29724 request: ::fidl_next::Request<symlink::RemoveExtendedAttribute, ___T>,
29725
29726 responder: ::fidl_next::Responder<symlink::RemoveExtendedAttribute, ___T>,
29727 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29728
29729 fn describe(
29730 &mut self,
29731
29732 responder: ::fidl_next::Responder<symlink::Describe, ___T>,
29733 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
29734
29735 fn on_unknown_interaction(
29736 &mut self,
29737 ordinal: u64,
29738 ) -> impl ::core::future::Future<
29739 Output = ::core::result::Result<
29740 (),
29741 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
29742 >,
29743 > + ::core::marker::Send {
29744 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
29745 }
29746}
29747
29748impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Symlink
29749where
29750 ___H: SymlinkServerHandler<___T> + ::core::marker::Send,
29751 ___T: ::fidl_next::Transport,
29752 <symlink::LinkInto as ::fidl_next::Method>::Request:
29753 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29754 <symlink::Clone as ::fidl_next::Method>::Request:
29755 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29756 <symlink::DeprecatedClone as ::fidl_next::Method>::Request:
29757 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29758 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Request:
29759 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29760 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Request:
29761 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29762 <symlink::SetFlags as ::fidl_next::Method>::Request:
29763 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29764 <symlink::GetAttributes as ::fidl_next::Method>::Request:
29765 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29766 <symlink::UpdateAttributes as ::fidl_next::Method>::Request:
29767 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29768 <symlink::ListExtendedAttributes as ::fidl_next::Method>::Request:
29769 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29770 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Request:
29771 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29772 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Request:
29773 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29774 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
29775 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
29776{
29777 async fn on_one_way(
29778 handler: &mut ___H,
29779 ordinal: u64,
29780 buffer: ___T::RecvBuffer,
29781 ) -> ::core::result::Result<
29782 (),
29783 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
29784 > {
29785 match ordinal {
29786 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
29787 Ok(decoded) => {
29788 handler.clone(decoded).await;
29789 Ok(())
29790 }
29791 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29792 ordinal: 2366825959783828089,
29793 error,
29794 }),
29795 },
29796
29797 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
29798 Ok(decoded) => {
29799 handler.deprecated_clone(decoded).await;
29800 Ok(())
29801 }
29802 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29803 ordinal: 6512600400724287855,
29804 error,
29805 }),
29806 },
29807
29808 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
29809 Ok(decoded) => {
29810 handler.list_extended_attributes(decoded).await;
29811 Ok(())
29812 }
29813 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29814 ordinal: 5431626189872037072,
29815 error,
29816 }),
29817 },
29818
29819 ordinal => handler.on_unknown_interaction(ordinal).await,
29820 }
29821 }
29822
29823 async fn on_two_way(
29824 handler: &mut ___H,
29825 ordinal: u64,
29826 buffer: ___T::RecvBuffer,
29827 responder: ::fidl_next::protocol::Responder<___T>,
29828 ) -> ::core::result::Result<
29829 (),
29830 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
29831 > {
29832 match ordinal {
29833 6121399674497678964 => {
29834 let responder = ::fidl_next::Responder::from_untyped(responder);
29835
29836 match ::fidl_next::DecoderExt::decode(buffer) {
29837 Ok(decoded) => {
29838 handler.link_into(decoded, responder).await;
29839 Ok(())
29840 }
29841 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29842 ordinal: 6121399674497678964,
29843 error,
29844 }),
29845 }
29846 }
29847
29848 6540867515453498750 => {
29849 let responder = ::fidl_next::Responder::from_untyped(responder);
29850
29851 handler.close(responder).await;
29852 Ok(())
29853 }
29854
29855 2763219980499352582 => {
29856 let responder = ::fidl_next::Responder::from_untyped(responder);
29857
29858 handler.query(responder).await;
29859 Ok(())
29860 }
29861
29862 8689798978500614909 => {
29863 let responder = ::fidl_next::Responder::from_untyped(responder);
29864
29865 handler.deprecated_get_attr(responder).await;
29866 Ok(())
29867 }
29868
29869 4721673413776871238 => {
29870 let responder = ::fidl_next::Responder::from_untyped(responder);
29871
29872 match ::fidl_next::DecoderExt::decode(buffer) {
29873 Ok(decoded) => {
29874 handler.deprecated_set_attr(decoded, responder).await;
29875 Ok(())
29876 }
29877 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29878 ordinal: 4721673413776871238,
29879 error,
29880 }),
29881 }
29882 }
29883
29884 6595803110182632097 => {
29885 let responder = ::fidl_next::Responder::from_untyped(responder);
29886
29887 handler.deprecated_get_flags(responder).await;
29888 Ok(())
29889 }
29890
29891 5950864159036794675 => {
29892 let responder = ::fidl_next::Responder::from_untyped(responder);
29893
29894 match ::fidl_next::DecoderExt::decode(buffer) {
29895 Ok(decoded) => {
29896 handler.deprecated_set_flags(decoded, responder).await;
29897 Ok(())
29898 }
29899 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29900 ordinal: 5950864159036794675,
29901 error,
29902 }),
29903 }
29904 }
29905
29906 105530239381466147 => {
29907 let responder = ::fidl_next::Responder::from_untyped(responder);
29908
29909 handler.get_flags(responder).await;
29910 Ok(())
29911 }
29912
29913 6172186066099445416 => {
29914 let responder = ::fidl_next::Responder::from_untyped(responder);
29915
29916 match ::fidl_next::DecoderExt::decode(buffer) {
29917 Ok(decoded) => {
29918 handler.set_flags(decoded, responder).await;
29919 Ok(())
29920 }
29921 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29922 ordinal: 6172186066099445416,
29923 error,
29924 }),
29925 }
29926 }
29927
29928 8013111122914313744 => {
29929 let responder = ::fidl_next::Responder::from_untyped(responder);
29930
29931 handler.query_filesystem(responder).await;
29932 Ok(())
29933 }
29934
29935 4414537700416816443 => {
29936 let responder = ::fidl_next::Responder::from_untyped(responder);
29937
29938 match ::fidl_next::DecoderExt::decode(buffer) {
29939 Ok(decoded) => {
29940 handler.get_attributes(decoded, responder).await;
29941 Ok(())
29942 }
29943 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29944 ordinal: 4414537700416816443,
29945 error,
29946 }),
29947 }
29948 }
29949
29950 3677402239314018056 => {
29951 let responder = ::fidl_next::Responder::from_untyped(responder);
29952
29953 match ::fidl_next::DecoderExt::decode(buffer) {
29954 Ok(decoded) => {
29955 handler.update_attributes(decoded, responder).await;
29956 Ok(())
29957 }
29958 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29959 ordinal: 3677402239314018056,
29960 error,
29961 }),
29962 }
29963 }
29964
29965 3196473584242777161 => {
29966 let responder = ::fidl_next::Responder::from_untyped(responder);
29967
29968 handler.sync(responder).await;
29969 Ok(())
29970 }
29971
29972 5043930208506967771 => {
29973 let responder = ::fidl_next::Responder::from_untyped(responder);
29974
29975 match ::fidl_next::DecoderExt::decode(buffer) {
29976 Ok(decoded) => {
29977 handler.get_extended_attribute(decoded, responder).await;
29978 Ok(())
29979 }
29980 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29981 ordinal: 5043930208506967771,
29982 error,
29983 }),
29984 }
29985 }
29986
29987 5374223046099989052 => {
29988 let responder = ::fidl_next::Responder::from_untyped(responder);
29989
29990 match ::fidl_next::DecoderExt::decode(buffer) {
29991 Ok(decoded) => {
29992 handler.set_extended_attribute(decoded, responder).await;
29993 Ok(())
29994 }
29995 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
29996 ordinal: 5374223046099989052,
29997 error,
29998 }),
29999 }
30000 }
30001
30002 8794297771444732717 => {
30003 let responder = ::fidl_next::Responder::from_untyped(responder);
30004
30005 match ::fidl_next::DecoderExt::decode(buffer) {
30006 Ok(decoded) => {
30007 handler.remove_extended_attribute(decoded, responder).await;
30008 Ok(())
30009 }
30010 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
30011 ordinal: 8794297771444732717,
30012 error,
30013 }),
30014 }
30015 }
30016
30017 8371117097481679347 => {
30018 let responder = ::fidl_next::Responder::from_untyped(responder);
30019
30020 handler.describe(responder).await;
30021 Ok(())
30022 }
30023
30024 ordinal => handler.on_unknown_interaction(ordinal).await,
30025 }
30026 }
30027}
30028
30029#[doc = " Alias for directory permission alias w*\n"]
30030pub const W_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(485);
30031
30032#[derive(Clone, Copy, Debug, PartialEq, Eq)]
30033#[repr(u8)]
30034pub enum WatchEvent {
30035 Deleted = 0,
30036 Added = 1,
30037 Removed = 2,
30038 Existing = 3,
30039 Idle = 4,
30040}
30041
30042impl ::fidl_next::Encodable for WatchEvent {
30043 type Encoded = WireWatchEvent;
30044}
30045impl ::core::convert::TryFrom<u8> for WatchEvent {
30046 type Error = ::fidl_next::UnknownStrictEnumMemberError;
30047 fn try_from(
30048 value: u8,
30049 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
30050 match value {
30051 0 => Ok(Self::Deleted),
30052 1 => Ok(Self::Added),
30053 2 => Ok(Self::Removed),
30054 3 => Ok(Self::Existing),
30055 4 => Ok(Self::Idle),
30056
30057 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
30058 }
30059 }
30060}
30061
30062unsafe impl<___E> ::fidl_next::Encode<___E> for WatchEvent
30063where
30064 ___E: ?Sized,
30065{
30066 #[inline]
30067 fn encode(
30068 self,
30069 encoder: &mut ___E,
30070 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30071 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30072 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
30073 }
30074}
30075
30076unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchEvent
30077where
30078 ___E: ?Sized,
30079{
30080 #[inline]
30081 fn encode_ref(
30082 &self,
30083 encoder: &mut ___E,
30084 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30085 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30086 ::fidl_next::munge!(let WireWatchEvent { value } = out);
30087 let _ = value.write(u8::from(match *self {
30088 Self::Deleted => 0,
30089
30090 Self::Added => 1,
30091
30092 Self::Removed => 2,
30093
30094 Self::Existing => 3,
30095
30096 Self::Idle => 4,
30097 }));
30098
30099 Ok(())
30100 }
30101}
30102
30103impl ::core::convert::From<WireWatchEvent> for WatchEvent {
30104 fn from(wire: WireWatchEvent) -> Self {
30105 match u8::from(wire.value) {
30106 0 => Self::Deleted,
30107
30108 1 => Self::Added,
30109
30110 2 => Self::Removed,
30111
30112 3 => Self::Existing,
30113
30114 4 => Self::Idle,
30115
30116 _ => unsafe { ::core::hint::unreachable_unchecked() },
30117 }
30118 }
30119}
30120
30121impl ::fidl_next::FromWire<WireWatchEvent> for WatchEvent {
30122 #[inline]
30123 fn from_wire(wire: WireWatchEvent) -> Self {
30124 Self::from(wire)
30125 }
30126}
30127
30128impl ::fidl_next::IntoNatural for WireWatchEvent {
30129 type Natural = WatchEvent;
30130}
30131
30132impl ::fidl_next::FromWireRef<WireWatchEvent> for WatchEvent {
30133 #[inline]
30134 fn from_wire_ref(wire: &WireWatchEvent) -> Self {
30135 Self::from(*wire)
30136 }
30137}
30138
30139#[derive(Clone, Copy, Debug, PartialEq, Eq)]
30141#[repr(transparent)]
30142pub struct WireWatchEvent {
30143 value: u8,
30144}
30145
30146unsafe impl ::fidl_next::Wire for WireWatchEvent {
30147 type Decoded<'de> = Self;
30148
30149 #[inline]
30150 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
30151 }
30153}
30154
30155impl WireWatchEvent {
30156 pub const DELETED: WireWatchEvent = WireWatchEvent { value: 0 };
30157
30158 pub const ADDED: WireWatchEvent = WireWatchEvent { value: 1 };
30159
30160 pub const REMOVED: WireWatchEvent = WireWatchEvent { value: 2 };
30161
30162 pub const EXISTING: WireWatchEvent = WireWatchEvent { value: 3 };
30163
30164 pub const IDLE: WireWatchEvent = WireWatchEvent { value: 4 };
30165}
30166
30167unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchEvent
30168where
30169 ___D: ?Sized,
30170{
30171 fn decode(
30172 slot: ::fidl_next::Slot<'_, Self>,
30173 _: &mut ___D,
30174 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30175 ::fidl_next::munge!(let Self { value } = slot);
30176
30177 match u8::from(*value) {
30178 0 | 1 | 2 | 3 | 4 => (),
30179 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
30180 }
30181
30182 Ok(())
30183 }
30184}
30185
30186impl ::core::convert::From<WatchEvent> for WireWatchEvent {
30187 fn from(natural: WatchEvent) -> Self {
30188 match natural {
30189 WatchEvent::Deleted => WireWatchEvent::DELETED,
30190
30191 WatchEvent::Added => WireWatchEvent::ADDED,
30192
30193 WatchEvent::Removed => WireWatchEvent::REMOVED,
30194
30195 WatchEvent::Existing => WireWatchEvent::EXISTING,
30196
30197 WatchEvent::Idle => WireWatchEvent::IDLE,
30198 }
30199 }
30200}
30201
30202#[doc = " Alias for directory permission alias x*\n"]
30203pub const X_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(201);
30204
30205pub mod compat {
30207
30208 impl ::fidl_next::CompatFrom<crate::Operations> for ::fidl_fuchsia_io::Operations {
30209 fn compat_from(value: crate::Operations) -> Self {
30210 Self::from_bits_retain(value.bits())
30211 }
30212 }
30213
30214 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Operations> for crate::Operations {
30215 fn compat_from(value: ::fidl_fuchsia_io::Operations) -> Self {
30216 Self::from_bits_retain(value.bits())
30217 }
30218 }
30219
30220 impl ::fidl_next::CompatFrom<crate::SeekOrigin> for ::fidl_fuchsia_io::SeekOrigin {
30221 fn compat_from(value: crate::SeekOrigin) -> Self {
30222 match value {
30223 crate::SeekOrigin::Start => Self::Start,
30224
30225 crate::SeekOrigin::Current => Self::Current,
30226
30227 crate::SeekOrigin::End => Self::End,
30228 }
30229 }
30230 }
30231
30232 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SeekOrigin> for crate::SeekOrigin {
30233 fn compat_from(value: ::fidl_fuchsia_io::SeekOrigin) -> Self {
30234 match value {
30235 ::fidl_fuchsia_io::SeekOrigin::Start => Self::Start,
30236
30237 ::fidl_fuchsia_io::SeekOrigin::Current => Self::Current,
30238
30239 ::fidl_fuchsia_io::SeekOrigin::End => Self::End,
30240 }
30241 }
30242 }
30243
30244 impl ::fidl_next::CompatFrom<crate::AdvisoryLockRange> for ::fidl_fuchsia_io::AdvisoryLockRange {
30245 #[inline]
30246 fn compat_from(value: crate::AdvisoryLockRange) -> Self {
30247 Self {
30248 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
30249
30250 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
30251
30252 length: ::fidl_next::CompatFrom::compat_from(value.length),
30253 }
30254 }
30255 }
30256
30257 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockRange> for crate::AdvisoryLockRange {
30258 #[inline]
30259 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockRange) -> Self {
30260 Self {
30261 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
30262
30263 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
30264
30265 length: ::fidl_next::CompatFrom::compat_from(value.length),
30266 }
30267 }
30268 }
30269
30270 impl ::fidl_next::CompatFrom<crate::AdvisoryLockType> for ::fidl_fuchsia_io::AdvisoryLockType {
30271 fn compat_from(value: crate::AdvisoryLockType) -> Self {
30272 match value {
30273 crate::AdvisoryLockType::Read => Self::Read,
30274
30275 crate::AdvisoryLockType::Write => Self::Write,
30276
30277 crate::AdvisoryLockType::Unlock => Self::Unlock,
30278 }
30279 }
30280 }
30281
30282 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockType> for crate::AdvisoryLockType {
30283 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockType) -> Self {
30284 match value {
30285 ::fidl_fuchsia_io::AdvisoryLockType::Read => Self::Read,
30286
30287 ::fidl_fuchsia_io::AdvisoryLockType::Write => Self::Write,
30288
30289 ::fidl_fuchsia_io::AdvisoryLockType::Unlock => Self::Unlock,
30290 }
30291 }
30292 }
30293
30294 impl ::fidl_next::CompatFrom<crate::AdvisoryLockRequest>
30295 for ::fidl_fuchsia_io::AdvisoryLockRequest
30296 {
30297 fn compat_from(value: crate::AdvisoryLockRequest) -> Self {
30298 Self {
30299 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
30300
30301 range: ::fidl_next::CompatFrom::compat_from(value.range),
30302
30303 wait: ::fidl_next::CompatFrom::compat_from(value.wait),
30304
30305 __source_breaking: ::fidl::marker::SourceBreaking,
30306 }
30307 }
30308 }
30309
30310 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockRequest>
30311 for crate::AdvisoryLockRequest
30312 {
30313 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockRequest) -> Self {
30314 Self {
30315 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
30316
30317 range: ::fidl_next::CompatFrom::compat_from(value.range),
30318
30319 wait: ::fidl_next::CompatFrom::compat_from(value.wait),
30320 }
30321 }
30322 }
30323
30324 impl ::fidl_next::CompatFrom<crate::AdvisoryLockingAdvisoryLockRequest>
30325 for ::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest
30326 {
30327 #[inline]
30328 fn compat_from(value: crate::AdvisoryLockingAdvisoryLockRequest) -> Self {
30329 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
30330 }
30331 }
30332
30333 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest>
30334 for crate::AdvisoryLockingAdvisoryLockRequest
30335 {
30336 #[inline]
30337 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest) -> Self {
30338 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
30339 }
30340 }
30341
30342 #[cfg(target_os = "fuchsia")]
30343 pub type AdvisoryLockingProxy = ::fidl_next::Client<crate::AdvisoryLocking>;
30346
30347 impl ::fidl_next::CompatFrom<crate::AdvisoryLocking> for ::fidl_fuchsia_io::AdvisoryLockingMarker {
30348 fn compat_from(_: crate::AdvisoryLocking) -> Self {
30349 Self
30350 }
30351 }
30352
30353 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockingMarker> for crate::AdvisoryLocking {
30354 fn compat_from(_: ::fidl_fuchsia_io::AdvisoryLockingMarker) -> Self {
30355 Self
30356 }
30357 }
30358
30359 #[cfg(target_os = "fuchsia")]
30360
30361 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::AdvisoryLockingProxy>
30362 for crate::AdvisoryLocking
30363 {
30364 fn client_compat_from(
30365 proxy: ::fidl_fuchsia_io::AdvisoryLockingProxy,
30366 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
30367 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
30368 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
30369 ::fidl_next::ClientDispatcher::new(client_end)
30370 }
30371 }
30372
30373 impl ::fidl_next::CompatFrom<crate::AllocateMode> for ::fidl_fuchsia_io::AllocateMode {
30374 fn compat_from(value: crate::AllocateMode) -> Self {
30375 Self::from_bits_retain(value.bits())
30376 }
30377 }
30378
30379 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AllocateMode> for crate::AllocateMode {
30380 fn compat_from(value: ::fidl_fuchsia_io::AllocateMode) -> Self {
30381 Self::from_bits_retain(value.bits())
30382 }
30383 }
30384
30385 impl ::fidl_next::CompatFrom<crate::ConnectionInfo> for ::fidl_fuchsia_io::ConnectionInfo {
30386 fn compat_from(value: crate::ConnectionInfo) -> Self {
30387 Self {
30388 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
30389
30390 __source_breaking: ::fidl::marker::SourceBreaking,
30391 }
30392 }
30393 }
30394
30395 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ConnectionInfo> for crate::ConnectionInfo {
30396 fn compat_from(value: ::fidl_fuchsia_io::ConnectionInfo) -> Self {
30397 Self { rights: ::fidl_next::CompatFrom::compat_from(value.rights) }
30398 }
30399 }
30400
30401 impl ::fidl_next::CompatFrom<crate::OpenFlags> for ::fidl_fuchsia_io::OpenFlags {
30402 fn compat_from(value: crate::OpenFlags) -> Self {
30403 Self::from_bits_retain(value.bits())
30404 }
30405 }
30406
30407 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::OpenFlags> for crate::OpenFlags {
30408 fn compat_from(value: ::fidl_fuchsia_io::OpenFlags) -> Self {
30409 Self::from_bits_retain(value.bits())
30410 }
30411 }
30412
30413 impl ::fidl_next::CompatFrom<crate::NodeAttributes> for ::fidl_fuchsia_io::NodeAttributes {
30414 #[inline]
30415 fn compat_from(value: crate::NodeAttributes) -> Self {
30416 Self {
30417 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30418
30419 id: ::fidl_next::CompatFrom::compat_from(value.id),
30420
30421 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
30422
30423 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
30424
30425 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
30426
30427 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
30428
30429 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
30430 }
30431 }
30432 }
30433
30434 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributes> for crate::NodeAttributes {
30435 #[inline]
30436 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributes) -> Self {
30437 Self {
30438 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30439
30440 id: ::fidl_next::CompatFrom::compat_from(value.id),
30441
30442 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
30443
30444 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
30445
30446 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
30447
30448 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
30449
30450 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
30451 }
30452 }
30453 }
30454
30455 impl ::fidl_next::CompatFrom<crate::NodeAttributeFlags> for ::fidl_fuchsia_io::NodeAttributeFlags {
30456 fn compat_from(value: crate::NodeAttributeFlags) -> Self {
30457 Self::from_bits_retain(value.bits())
30458 }
30459 }
30460
30461 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributeFlags> for crate::NodeAttributeFlags {
30462 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributeFlags) -> Self {
30463 Self::from_bits_retain(value.bits())
30464 }
30465 }
30466
30467 impl ::fidl_next::CompatFrom<crate::NodeQueryFilesystemResponse>
30468 for ::fidl_fuchsia_io::NodeQueryFilesystemResponse
30469 {
30470 #[inline]
30471 fn compat_from(value: crate::NodeQueryFilesystemResponse) -> Self {
30472 Self {
30473 s: ::fidl_next::CompatFrom::compat_from(value.s),
30474
30475 info: ::fidl_next::CompatFrom::compat_from(value.info),
30476 }
30477 }
30478 }
30479
30480 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeQueryFilesystemResponse>
30481 for crate::NodeQueryFilesystemResponse
30482 {
30483 #[inline]
30484 fn compat_from(value: ::fidl_fuchsia_io::NodeQueryFilesystemResponse) -> Self {
30485 Self {
30486 s: ::fidl_next::CompatFrom::compat_from(value.s),
30487
30488 info: ::fidl_next::CompatFrom::compat_from(value.info),
30489 }
30490 }
30491 }
30492
30493 impl ::fidl_next::CompatFrom<crate::ModeType> for ::fidl_fuchsia_io::ModeType {
30494 fn compat_from(value: crate::ModeType) -> Self {
30495 Self::from_bits_retain(value.bits())
30496 }
30497 }
30498
30499 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ModeType> for crate::ModeType {
30500 fn compat_from(value: ::fidl_fuchsia_io::ModeType) -> Self {
30501 Self::from_bits_retain(value.bits())
30502 }
30503 }
30504
30505 impl ::fidl_next::CompatFrom<crate::DirectoryReadDirentsRequest>
30506 for ::fidl_fuchsia_io::DirectoryReadDirentsRequest
30507 {
30508 #[inline]
30509 fn compat_from(value: crate::DirectoryReadDirentsRequest) -> Self {
30510 Self { max_bytes: ::fidl_next::CompatFrom::compat_from(value.max_bytes) }
30511 }
30512 }
30513
30514 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryReadDirentsRequest>
30515 for crate::DirectoryReadDirentsRequest
30516 {
30517 #[inline]
30518 fn compat_from(value: ::fidl_fuchsia_io::DirectoryReadDirentsRequest) -> Self {
30519 Self { max_bytes: ::fidl_next::CompatFrom::compat_from(value.max_bytes) }
30520 }
30521 }
30522
30523 impl ::fidl_next::CompatFrom<crate::DirectoryReadDirentsResponse>
30524 for ::fidl_fuchsia_io::DirectoryReadDirentsResponse
30525 {
30526 #[inline]
30527 fn compat_from(value: crate::DirectoryReadDirentsResponse) -> Self {
30528 Self {
30529 s: ::fidl_next::CompatFrom::compat_from(value.s),
30530
30531 dirents: ::fidl_next::CompatFrom::compat_from(value.dirents),
30532 }
30533 }
30534 }
30535
30536 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryReadDirentsResponse>
30537 for crate::DirectoryReadDirentsResponse
30538 {
30539 #[inline]
30540 fn compat_from(value: ::fidl_fuchsia_io::DirectoryReadDirentsResponse) -> Self {
30541 Self {
30542 s: ::fidl_next::CompatFrom::compat_from(value.s),
30543
30544 dirents: ::fidl_next::CompatFrom::compat_from(value.dirents),
30545 }
30546 }
30547 }
30548
30549 impl ::fidl_next::CompatFrom<crate::DirectoryRewindResponse>
30550 for ::fidl_fuchsia_io::DirectoryRewindResponse
30551 {
30552 #[inline]
30553 fn compat_from(value: crate::DirectoryRewindResponse) -> Self {
30554 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30555 }
30556 }
30557
30558 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryRewindResponse>
30559 for crate::DirectoryRewindResponse
30560 {
30561 #[inline]
30562 fn compat_from(value: ::fidl_fuchsia_io::DirectoryRewindResponse) -> Self {
30563 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30564 }
30565 }
30566
30567 impl ::fidl_next::CompatFrom<crate::DirectoryGetTokenResponse>
30568 for ::fidl_fuchsia_io::DirectoryGetTokenResponse
30569 {
30570 #[inline]
30571 fn compat_from(value: crate::DirectoryGetTokenResponse) -> Self {
30572 Self {
30573 s: ::fidl_next::CompatFrom::compat_from(value.s),
30574
30575 token: ::fidl_next::CompatFrom::compat_from(value.token),
30576 }
30577 }
30578 }
30579
30580 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryGetTokenResponse>
30581 for crate::DirectoryGetTokenResponse
30582 {
30583 #[inline]
30584 fn compat_from(value: ::fidl_fuchsia_io::DirectoryGetTokenResponse) -> Self {
30585 Self {
30586 s: ::fidl_next::CompatFrom::compat_from(value.s),
30587
30588 token: ::fidl_next::CompatFrom::compat_from(value.token),
30589 }
30590 }
30591 }
30592
30593 impl ::fidl_next::CompatFrom<crate::DirectoryLinkRequest>
30594 for ::fidl_fuchsia_io::DirectoryLinkRequest
30595 {
30596 #[inline]
30597 fn compat_from(value: crate::DirectoryLinkRequest) -> Self {
30598 Self {
30599 src: ::fidl_next::CompatFrom::compat_from(value.src),
30600
30601 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
30602
30603 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
30604 }
30605 }
30606 }
30607
30608 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryLinkRequest>
30609 for crate::DirectoryLinkRequest
30610 {
30611 #[inline]
30612 fn compat_from(value: ::fidl_fuchsia_io::DirectoryLinkRequest) -> Self {
30613 Self {
30614 src: ::fidl_next::CompatFrom::compat_from(value.src),
30615
30616 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
30617
30618 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
30619 }
30620 }
30621 }
30622
30623 impl ::fidl_next::CompatFrom<crate::DirectoryLinkResponse>
30624 for ::fidl_fuchsia_io::DirectoryLinkResponse
30625 {
30626 #[inline]
30627 fn compat_from(value: crate::DirectoryLinkResponse) -> Self {
30628 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30629 }
30630 }
30631
30632 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryLinkResponse>
30633 for crate::DirectoryLinkResponse
30634 {
30635 #[inline]
30636 fn compat_from(value: ::fidl_fuchsia_io::DirectoryLinkResponse) -> Self {
30637 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30638 }
30639 }
30640
30641 impl ::fidl_next::CompatFrom<crate::UnlinkFlags> for ::fidl_fuchsia_io::UnlinkFlags {
30642 fn compat_from(value: crate::UnlinkFlags) -> Self {
30643 Self::from_bits_retain(value.bits())
30644 }
30645 }
30646
30647 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::UnlinkFlags> for crate::UnlinkFlags {
30648 fn compat_from(value: ::fidl_fuchsia_io::UnlinkFlags) -> Self {
30649 Self::from_bits_retain(value.bits())
30650 }
30651 }
30652
30653 impl ::fidl_next::CompatFrom<crate::UnlinkOptions> for ::fidl_fuchsia_io::UnlinkOptions {
30654 fn compat_from(value: crate::UnlinkOptions) -> Self {
30655 Self {
30656 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
30657
30658 __source_breaking: ::fidl::marker::SourceBreaking,
30659 }
30660 }
30661 }
30662
30663 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::UnlinkOptions> for crate::UnlinkOptions {
30664 fn compat_from(value: ::fidl_fuchsia_io::UnlinkOptions) -> Self {
30665 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
30666 }
30667 }
30668
30669 impl ::fidl_next::CompatFrom<crate::DirectoryUnlinkRequest>
30670 for ::fidl_fuchsia_io::DirectoryUnlinkRequest
30671 {
30672 #[inline]
30673 fn compat_from(value: crate::DirectoryUnlinkRequest) -> Self {
30674 Self {
30675 name: ::fidl_next::CompatFrom::compat_from(value.name),
30676
30677 options: ::fidl_next::CompatFrom::compat_from(value.options),
30678 }
30679 }
30680 }
30681
30682 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryUnlinkRequest>
30683 for crate::DirectoryUnlinkRequest
30684 {
30685 #[inline]
30686 fn compat_from(value: ::fidl_fuchsia_io::DirectoryUnlinkRequest) -> Self {
30687 Self {
30688 name: ::fidl_next::CompatFrom::compat_from(value.name),
30689
30690 options: ::fidl_next::CompatFrom::compat_from(value.options),
30691 }
30692 }
30693 }
30694
30695 impl ::fidl_next::CompatFrom<crate::DirectoryRenameRequest>
30696 for ::fidl_fuchsia_io::DirectoryRenameRequest
30697 {
30698 #[inline]
30699 fn compat_from(value: crate::DirectoryRenameRequest) -> Self {
30700 Self {
30701 src: ::fidl_next::CompatFrom::compat_from(value.src),
30702
30703 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
30704
30705 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
30706 }
30707 }
30708 }
30709
30710 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryRenameRequest>
30711 for crate::DirectoryRenameRequest
30712 {
30713 #[inline]
30714 fn compat_from(value: ::fidl_fuchsia_io::DirectoryRenameRequest) -> Self {
30715 Self {
30716 src: ::fidl_next::CompatFrom::compat_from(value.src),
30717
30718 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
30719
30720 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
30721 }
30722 }
30723 }
30724
30725 impl ::fidl_next::CompatFrom<crate::WatchMask> for ::fidl_fuchsia_io::WatchMask {
30726 fn compat_from(value: crate::WatchMask) -> Self {
30727 Self::from_bits_retain(value.bits())
30728 }
30729 }
30730
30731 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WatchMask> for crate::WatchMask {
30732 fn compat_from(value: ::fidl_fuchsia_io::WatchMask) -> Self {
30733 Self::from_bits_retain(value.bits())
30734 }
30735 }
30736
30737 impl ::fidl_next::CompatFrom<crate::DirectoryWatchRequest>
30738 for ::fidl_fuchsia_io::DirectoryWatchRequest
30739 {
30740 #[inline]
30741 fn compat_from(value: crate::DirectoryWatchRequest) -> Self {
30742 Self {
30743 mask: ::fidl_next::CompatFrom::compat_from(value.mask),
30744
30745 options: ::fidl_next::CompatFrom::compat_from(value.options),
30746
30747 watcher: ::fidl_next::CompatFrom::compat_from(value.watcher),
30748 }
30749 }
30750 }
30751
30752 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatchRequest>
30753 for crate::DirectoryWatchRequest
30754 {
30755 #[inline]
30756 fn compat_from(value: ::fidl_fuchsia_io::DirectoryWatchRequest) -> Self {
30757 Self {
30758 mask: ::fidl_next::CompatFrom::compat_from(value.mask),
30759
30760 options: ::fidl_next::CompatFrom::compat_from(value.options),
30761
30762 watcher: ::fidl_next::CompatFrom::compat_from(value.watcher),
30763 }
30764 }
30765 }
30766
30767 impl ::fidl_next::CompatFrom<crate::DirectoryWatchResponse>
30768 for ::fidl_fuchsia_io::DirectoryWatchResponse
30769 {
30770 #[inline]
30771 fn compat_from(value: crate::DirectoryWatchResponse) -> Self {
30772 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30773 }
30774 }
30775
30776 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatchResponse>
30777 for crate::DirectoryWatchResponse
30778 {
30779 #[inline]
30780 fn compat_from(value: ::fidl_fuchsia_io::DirectoryWatchResponse) -> Self {
30781 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
30782 }
30783 }
30784
30785 impl ::fidl_next::CompatFrom<crate::NodeOnOpenRequest> for ::fidl_fuchsia_io::NodeOnOpenRequest {
30786 #[inline]
30787 fn compat_from(value: crate::NodeOnOpenRequest) -> Self {
30788 Self {
30789 s: ::fidl_next::CompatFrom::compat_from(value.s),
30790
30791 info: ::fidl_next::CompatFrom::compat_from(value.info),
30792 }
30793 }
30794 }
30795
30796 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeOnOpenRequest> for crate::NodeOnOpenRequest {
30797 #[inline]
30798 fn compat_from(value: ::fidl_fuchsia_io::NodeOnOpenRequest) -> Self {
30799 Self {
30800 s: ::fidl_next::CompatFrom::compat_from(value.s),
30801
30802 info: ::fidl_next::CompatFrom::compat_from(value.info),
30803 }
30804 }
30805 }
30806
30807 impl ::fidl_next::CompatFrom<crate::NodeListExtendedAttributesRequest>
30808 for ::fidl_fuchsia_io::NodeListExtendedAttributesRequest
30809 {
30810 #[inline]
30811 fn compat_from(value: crate::NodeListExtendedAttributesRequest) -> Self {
30812 Self { iterator: ::fidl_next::CompatFrom::compat_from(value.iterator) }
30813 }
30814 }
30815
30816 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeListExtendedAttributesRequest>
30817 for crate::NodeListExtendedAttributesRequest
30818 {
30819 #[inline]
30820 fn compat_from(value: ::fidl_fuchsia_io::NodeListExtendedAttributesRequest) -> Self {
30821 Self { iterator: ::fidl_next::CompatFrom::compat_from(value.iterator) }
30822 }
30823 }
30824
30825 impl ::fidl_next::CompatFrom<crate::NodeGetExtendedAttributeRequest>
30826 for ::fidl_fuchsia_io::NodeGetExtendedAttributeRequest
30827 {
30828 #[inline]
30829 fn compat_from(value: crate::NodeGetExtendedAttributeRequest) -> Self {
30830 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
30831 }
30832 }
30833
30834 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetExtendedAttributeRequest>
30835 for crate::NodeGetExtendedAttributeRequest
30836 {
30837 #[inline]
30838 fn compat_from(value: ::fidl_fuchsia_io::NodeGetExtendedAttributeRequest) -> Self {
30839 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
30840 }
30841 }
30842
30843 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeValue>
30844 for ::fidl_fuchsia_io::ExtendedAttributeValue
30845 {
30846 fn compat_from(value: crate::ExtendedAttributeValue) -> Self {
30847 match value {
30848 crate::ExtendedAttributeValue::Bytes(value) => {
30849 Self::Bytes(::fidl_next::CompatFrom::compat_from(value))
30850 }
30851
30852 crate::ExtendedAttributeValue::Buffer(value) => {
30853 Self::Buffer(::fidl_next::CompatFrom::compat_from(value))
30854 }
30855
30856 crate::ExtendedAttributeValue::UnknownOrdinal_(unknown_ordinal) => {
30857 Self::__SourceBreaking { unknown_ordinal }
30858 }
30859 }
30860 }
30861 }
30862
30863 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeValue>
30864 for crate::ExtendedAttributeValue
30865 {
30866 fn compat_from(value: ::fidl_fuchsia_io::ExtendedAttributeValue) -> Self {
30867 match value {
30868 ::fidl_fuchsia_io::ExtendedAttributeValue::Bytes(value) => {
30869 Self::Bytes(::fidl_next::CompatFrom::compat_from(value))
30870 }
30871
30872 ::fidl_fuchsia_io::ExtendedAttributeValue::Buffer(value) => {
30873 Self::Buffer(::fidl_next::CompatFrom::compat_from(value))
30874 }
30875
30876 ::fidl_fuchsia_io::ExtendedAttributeValue::__SourceBreaking { unknown_ordinal } => {
30877 Self::UnknownOrdinal_(unknown_ordinal)
30878 }
30879 }
30880 }
30881 }
30882
30883 impl ::fidl_next::CompatFrom<crate::SetExtendedAttributeMode>
30884 for ::fidl_fuchsia_io::SetExtendedAttributeMode
30885 {
30886 fn compat_from(value: crate::SetExtendedAttributeMode) -> Self {
30887 match value {
30888 crate::SetExtendedAttributeMode::Set => Self::Set,
30889
30890 crate::SetExtendedAttributeMode::Create => Self::Create,
30891
30892 crate::SetExtendedAttributeMode::Replace => Self::Replace,
30893 }
30894 }
30895 }
30896
30897 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SetExtendedAttributeMode>
30898 for crate::SetExtendedAttributeMode
30899 {
30900 fn compat_from(value: ::fidl_fuchsia_io::SetExtendedAttributeMode) -> Self {
30901 match value {
30902 ::fidl_fuchsia_io::SetExtendedAttributeMode::Set => Self::Set,
30903
30904 ::fidl_fuchsia_io::SetExtendedAttributeMode::Create => Self::Create,
30905
30906 ::fidl_fuchsia_io::SetExtendedAttributeMode::Replace => Self::Replace,
30907 }
30908 }
30909 }
30910
30911 impl ::fidl_next::CompatFrom<crate::NodeSetExtendedAttributeRequest>
30912 for ::fidl_fuchsia_io::NodeSetExtendedAttributeRequest
30913 {
30914 #[inline]
30915 fn compat_from(value: crate::NodeSetExtendedAttributeRequest) -> Self {
30916 Self {
30917 name: ::fidl_next::CompatFrom::compat_from(value.name),
30918
30919 value: ::fidl_next::CompatFrom::compat_from(value.value),
30920
30921 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30922 }
30923 }
30924 }
30925
30926 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeSetExtendedAttributeRequest>
30927 for crate::NodeSetExtendedAttributeRequest
30928 {
30929 #[inline]
30930 fn compat_from(value: ::fidl_fuchsia_io::NodeSetExtendedAttributeRequest) -> Self {
30931 Self {
30932 name: ::fidl_next::CompatFrom::compat_from(value.name),
30933
30934 value: ::fidl_next::CompatFrom::compat_from(value.value),
30935
30936 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30937 }
30938 }
30939 }
30940
30941 impl ::fidl_next::CompatFrom<crate::NodeRemoveExtendedAttributeRequest>
30942 for ::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest
30943 {
30944 #[inline]
30945 fn compat_from(value: crate::NodeRemoveExtendedAttributeRequest) -> Self {
30946 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
30947 }
30948 }
30949
30950 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest>
30951 for crate::NodeRemoveExtendedAttributeRequest
30952 {
30953 #[inline]
30954 fn compat_from(value: ::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest) -> Self {
30955 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
30956 }
30957 }
30958
30959 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedGetAttrResponse>
30960 for ::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse
30961 {
30962 #[inline]
30963 fn compat_from(value: crate::NodeDeprecatedGetAttrResponse) -> Self {
30964 Self {
30965 s: ::fidl_next::CompatFrom::compat_from(value.s),
30966
30967 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
30968 }
30969 }
30970 }
30971
30972 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse>
30973 for crate::NodeDeprecatedGetAttrResponse
30974 {
30975 #[inline]
30976 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse) -> Self {
30977 Self {
30978 s: ::fidl_next::CompatFrom::compat_from(value.s),
30979
30980 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
30981 }
30982 }
30983 }
30984
30985 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetAttrRequest>
30986 for ::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest
30987 {
30988 #[inline]
30989 fn compat_from(value: crate::NodeDeprecatedSetAttrRequest) -> Self {
30990 Self {
30991 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
30992
30993 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
30994 }
30995 }
30996 }
30997
30998 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest>
30999 for crate::NodeDeprecatedSetAttrRequest
31000 {
31001 #[inline]
31002 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest) -> Self {
31003 Self {
31004 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31005
31006 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31007 }
31008 }
31009 }
31010
31011 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetAttrResponse>
31012 for ::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse
31013 {
31014 #[inline]
31015 fn compat_from(value: crate::NodeDeprecatedSetAttrResponse) -> Self {
31016 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
31017 }
31018 }
31019
31020 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse>
31021 for crate::NodeDeprecatedSetAttrResponse
31022 {
31023 #[inline]
31024 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse) -> Self {
31025 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
31026 }
31027 }
31028
31029 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedGetFlagsResponse>
31030 for ::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse
31031 {
31032 #[inline]
31033 fn compat_from(value: crate::NodeDeprecatedGetFlagsResponse) -> Self {
31034 Self {
31035 s: ::fidl_next::CompatFrom::compat_from(value.s),
31036
31037 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31038 }
31039 }
31040 }
31041
31042 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse>
31043 for crate::NodeDeprecatedGetFlagsResponse
31044 {
31045 #[inline]
31046 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse) -> Self {
31047 Self {
31048 s: ::fidl_next::CompatFrom::compat_from(value.s),
31049
31050 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31051 }
31052 }
31053 }
31054
31055 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetFlagsRequest>
31056 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest
31057 {
31058 #[inline]
31059 fn compat_from(value: crate::NodeDeprecatedSetFlagsRequest) -> Self {
31060 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31061 }
31062 }
31063
31064 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest>
31065 for crate::NodeDeprecatedSetFlagsRequest
31066 {
31067 #[inline]
31068 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest) -> Self {
31069 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31070 }
31071 }
31072
31073 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetFlagsResponse>
31074 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse
31075 {
31076 #[inline]
31077 fn compat_from(value: crate::NodeDeprecatedSetFlagsResponse) -> Self {
31078 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
31079 }
31080 }
31081
31082 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse>
31083 for crate::NodeDeprecatedSetFlagsResponse
31084 {
31085 #[inline]
31086 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse) -> Self {
31087 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
31088 }
31089 }
31090
31091 impl ::fidl_next::CompatFrom<crate::Flags> for ::fidl_fuchsia_io::Flags {
31092 fn compat_from(value: crate::Flags) -> Self {
31093 Self::from_bits_retain(value.bits())
31094 }
31095 }
31096
31097 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Flags> for crate::Flags {
31098 fn compat_from(value: ::fidl_fuchsia_io::Flags) -> Self {
31099 Self::from_bits_retain(value.bits())
31100 }
31101 }
31102
31103 impl ::fidl_next::CompatFrom<crate::NodeGetFlagsResponse>
31104 for ::fidl_fuchsia_io::NodeGetFlagsResponse
31105 {
31106 #[inline]
31107 fn compat_from(value: crate::NodeGetFlagsResponse) -> Self {
31108 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31109 }
31110 }
31111
31112 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetFlagsResponse>
31113 for crate::NodeGetFlagsResponse
31114 {
31115 #[inline]
31116 fn compat_from(value: ::fidl_fuchsia_io::NodeGetFlagsResponse) -> Self {
31117 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31118 }
31119 }
31120
31121 impl ::fidl_next::CompatFrom<crate::NodeSetFlagsRequest>
31122 for ::fidl_fuchsia_io::NodeSetFlagsRequest
31123 {
31124 #[inline]
31125 fn compat_from(value: crate::NodeSetFlagsRequest) -> Self {
31126 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31127 }
31128 }
31129
31130 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeSetFlagsRequest>
31131 for crate::NodeSetFlagsRequest
31132 {
31133 #[inline]
31134 fn compat_from(value: ::fidl_fuchsia_io::NodeSetFlagsRequest) -> Self {
31135 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
31136 }
31137 }
31138
31139 impl ::fidl_next::CompatFrom<crate::EmptyStruct> for ::fidl_fuchsia_io::EmptyStruct {
31140 #[inline]
31141 fn compat_from(value: crate::EmptyStruct) -> Self {
31142 Self {}
31143 }
31144 }
31145
31146 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::EmptyStruct> for crate::EmptyStruct {
31147 #[inline]
31148 fn compat_from(value: ::fidl_fuchsia_io::EmptyStruct) -> Self {
31149 Self {}
31150 }
31151 }
31152
31153 impl ::fidl_next::CompatFrom<crate::SelinuxContext> for ::fidl_fuchsia_io::SelinuxContext {
31154 fn compat_from(value: crate::SelinuxContext) -> Self {
31155 match value {
31156 crate::SelinuxContext::Data(value) => {
31157 Self::Data(::fidl_next::CompatFrom::compat_from(value))
31158 }
31159
31160 crate::SelinuxContext::UseExtendedAttributes(value) => {
31161 Self::UseExtendedAttributes(::fidl_next::CompatFrom::compat_from(value))
31162 }
31163
31164 crate::SelinuxContext::UnknownOrdinal_(unknown_ordinal) => {
31165 Self::__SourceBreaking { unknown_ordinal }
31166 }
31167 }
31168 }
31169 }
31170
31171 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SelinuxContext> for crate::SelinuxContext {
31172 fn compat_from(value: ::fidl_fuchsia_io::SelinuxContext) -> Self {
31173 match value {
31174 ::fidl_fuchsia_io::SelinuxContext::Data(value) => {
31175 Self::Data(::fidl_next::CompatFrom::compat_from(value))
31176 }
31177
31178 ::fidl_fuchsia_io::SelinuxContext::UseExtendedAttributes(value) => {
31179 Self::UseExtendedAttributes(::fidl_next::CompatFrom::compat_from(value))
31180 }
31181
31182 ::fidl_fuchsia_io::SelinuxContext::__SourceBreaking { unknown_ordinal } => {
31183 Self::UnknownOrdinal_(unknown_ordinal)
31184 }
31185 }
31186 }
31187 }
31188
31189 impl ::fidl_next::CompatFrom<crate::MutableNodeAttributes>
31190 for ::fidl_fuchsia_io::MutableNodeAttributes
31191 {
31192 fn compat_from(value: crate::MutableNodeAttributes) -> Self {
31193 Self {
31194 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
31195
31196 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
31197
31198 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
31199
31200 uid: ::fidl_next::CompatFrom::compat_from(value.uid),
31201
31202 gid: ::fidl_next::CompatFrom::compat_from(value.gid),
31203
31204 rdev: ::fidl_next::CompatFrom::compat_from(value.rdev),
31205
31206 access_time: ::fidl_next::CompatFrom::compat_from(value.access_time),
31207
31208 casefold: ::fidl_next::CompatFrom::compat_from(value.casefold),
31209
31210 selinux_context: ::fidl_next::CompatFrom::compat_from(value.selinux_context),
31211
31212 wrapping_key_id: ::fidl_next::CompatFrom::compat_from(value.wrapping_key_id),
31213
31214 __source_breaking: ::fidl::marker::SourceBreaking,
31215 }
31216 }
31217 }
31218
31219 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::MutableNodeAttributes>
31220 for crate::MutableNodeAttributes
31221 {
31222 fn compat_from(value: ::fidl_fuchsia_io::MutableNodeAttributes) -> Self {
31223 Self {
31224 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
31225
31226 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
31227
31228 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
31229
31230 uid: ::fidl_next::CompatFrom::compat_from(value.uid),
31231
31232 gid: ::fidl_next::CompatFrom::compat_from(value.gid),
31233
31234 rdev: ::fidl_next::CompatFrom::compat_from(value.rdev),
31235
31236 access_time: ::fidl_next::CompatFrom::compat_from(value.access_time),
31237
31238 casefold: ::fidl_next::CompatFrom::compat_from(value.casefold),
31239
31240 selinux_context: ::fidl_next::CompatFrom::compat_from(value.selinux_context),
31241
31242 wrapping_key_id: ::fidl_next::CompatFrom::compat_from(value.wrapping_key_id),
31243 }
31244 }
31245 }
31246
31247 impl ::fidl_next::CompatFrom<crate::NodeProtocolKinds> for ::fidl_fuchsia_io::NodeProtocolKinds {
31248 fn compat_from(value: crate::NodeProtocolKinds) -> Self {
31249 Self::from_bits_retain(value.bits())
31250 }
31251 }
31252
31253 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeProtocolKinds> for crate::NodeProtocolKinds {
31254 fn compat_from(value: ::fidl_fuchsia_io::NodeProtocolKinds) -> Self {
31255 Self::from_bits_retain(value.bits())
31256 }
31257 }
31258
31259 impl ::fidl_next::CompatFrom<crate::HashAlgorithm> for ::fidl_fuchsia_io::HashAlgorithm {
31260 fn compat_from(value: crate::HashAlgorithm) -> Self {
31261 match value {
31262 crate::HashAlgorithm::Sha256 => Self::Sha256,
31263
31264 crate::HashAlgorithm::Sha512 => Self::Sha512,
31265
31266 crate::HashAlgorithm::UnknownOrdinal_(unknown_ordinal) => {
31267 Self::__SourceBreaking { unknown_ordinal }
31268 }
31269 }
31270 }
31271 }
31272
31273 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::HashAlgorithm> for crate::HashAlgorithm {
31274 fn compat_from(value: ::fidl_fuchsia_io::HashAlgorithm) -> Self {
31275 match value {
31276 ::fidl_fuchsia_io::HashAlgorithm::Sha256 => Self::Sha256,
31277
31278 ::fidl_fuchsia_io::HashAlgorithm::Sha512 => Self::Sha512,
31279
31280 ::fidl_fuchsia_io::HashAlgorithm::__SourceBreaking { unknown_ordinal: value } => {
31281 Self::UnknownOrdinal_(value)
31282 }
31283 }
31284 }
31285 }
31286
31287 impl ::fidl_next::CompatFrom<crate::VerificationOptions>
31288 for ::fidl_fuchsia_io::VerificationOptions
31289 {
31290 fn compat_from(value: crate::VerificationOptions) -> Self {
31291 Self {
31292 hash_algorithm: ::fidl_next::CompatFrom::compat_from(value.hash_algorithm),
31293
31294 salt: ::fidl_next::CompatFrom::compat_from(value.salt),
31295
31296 __source_breaking: ::fidl::marker::SourceBreaking,
31297 }
31298 }
31299 }
31300
31301 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::VerificationOptions>
31302 for crate::VerificationOptions
31303 {
31304 fn compat_from(value: ::fidl_fuchsia_io::VerificationOptions) -> Self {
31305 Self {
31306 hash_algorithm: ::fidl_next::CompatFrom::compat_from(value.hash_algorithm),
31307
31308 salt: ::fidl_next::CompatFrom::compat_from(value.salt),
31309 }
31310 }
31311 }
31312
31313 impl ::fidl_next::CompatFrom<crate::ImmutableNodeAttributes>
31314 for ::fidl_fuchsia_io::ImmutableNodeAttributes
31315 {
31316 fn compat_from(value: crate::ImmutableNodeAttributes) -> Self {
31317 Self {
31318 protocols: ::fidl_next::CompatFrom::compat_from(value.protocols),
31319
31320 abilities: ::fidl_next::CompatFrom::compat_from(value.abilities),
31321
31322 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
31323
31324 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
31325
31326 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
31327
31328 id: ::fidl_next::CompatFrom::compat_from(value.id),
31329
31330 change_time: ::fidl_next::CompatFrom::compat_from(value.change_time),
31331
31332 options: ::fidl_next::CompatFrom::compat_from(value.options),
31333
31334 root_hash: ::fidl_next::CompatFrom::compat_from(value.root_hash),
31335
31336 verity_enabled: ::fidl_next::CompatFrom::compat_from(value.verity_enabled),
31337
31338 __source_breaking: ::fidl::marker::SourceBreaking,
31339 }
31340 }
31341 }
31342
31343 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ImmutableNodeAttributes>
31344 for crate::ImmutableNodeAttributes
31345 {
31346 fn compat_from(value: ::fidl_fuchsia_io::ImmutableNodeAttributes) -> Self {
31347 Self {
31348 protocols: ::fidl_next::CompatFrom::compat_from(value.protocols),
31349
31350 abilities: ::fidl_next::CompatFrom::compat_from(value.abilities),
31351
31352 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
31353
31354 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
31355
31356 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
31357
31358 id: ::fidl_next::CompatFrom::compat_from(value.id),
31359
31360 change_time: ::fidl_next::CompatFrom::compat_from(value.change_time),
31361
31362 options: ::fidl_next::CompatFrom::compat_from(value.options),
31363
31364 root_hash: ::fidl_next::CompatFrom::compat_from(value.root_hash),
31365
31366 verity_enabled: ::fidl_next::CompatFrom::compat_from(value.verity_enabled),
31367 }
31368 }
31369 }
31370
31371 impl ::fidl_next::CompatFrom<crate::NodeAttributes2> for ::fidl_fuchsia_io::NodeAttributes2 {
31372 #[inline]
31373 fn compat_from(value: crate::NodeAttributes2) -> Self {
31374 Self {
31375 mutable_attributes: ::fidl_next::CompatFrom::compat_from(value.mutable_attributes),
31376
31377 immutable_attributes: ::fidl_next::CompatFrom::compat_from(
31378 value.immutable_attributes,
31379 ),
31380 }
31381 }
31382 }
31383
31384 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributes2> for crate::NodeAttributes2 {
31385 #[inline]
31386 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributes2) -> Self {
31387 Self {
31388 mutable_attributes: ::fidl_next::CompatFrom::compat_from(value.mutable_attributes),
31389
31390 immutable_attributes: ::fidl_next::CompatFrom::compat_from(
31391 value.immutable_attributes,
31392 ),
31393 }
31394 }
31395 }
31396
31397 impl ::fidl_next::CompatFrom<crate::NodeInfo> for ::fidl_fuchsia_io::NodeInfo {
31398 fn compat_from(value: crate::NodeInfo) -> Self {
31399 Self {
31400 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31401
31402 __source_breaking: ::fidl::marker::SourceBreaking,
31403 }
31404 }
31405 }
31406
31407 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeInfo> for crate::NodeInfo {
31408 fn compat_from(value: ::fidl_fuchsia_io::NodeInfo) -> Self {
31409 Self { attributes: ::fidl_next::CompatFrom::compat_from(value.attributes) }
31410 }
31411 }
31412
31413 impl ::fidl_next::CompatFrom<crate::DirectoryInfo> for ::fidl_fuchsia_io::DirectoryInfo {
31414 fn compat_from(value: crate::DirectoryInfo) -> Self {
31415 Self {
31416 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31417
31418 __source_breaking: ::fidl::marker::SourceBreaking,
31419 }
31420 }
31421 }
31422
31423 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryInfo> for crate::DirectoryInfo {
31424 fn compat_from(value: ::fidl_fuchsia_io::DirectoryInfo) -> Self {
31425 Self { attributes: ::fidl_next::CompatFrom::compat_from(value.attributes) }
31426 }
31427 }
31428
31429 impl ::fidl_next::CompatFrom<crate::FileInfo> for ::fidl_fuchsia_io::FileInfo {
31430 fn compat_from(value: crate::FileInfo) -> Self {
31431 Self {
31432 is_append: ::fidl_next::CompatFrom::compat_from(value.is_append),
31433
31434 observer: ::fidl_next::CompatFrom::compat_from(value.observer),
31435
31436 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
31437
31438 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31439
31440 __source_breaking: ::fidl::marker::SourceBreaking,
31441 }
31442 }
31443 }
31444
31445 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileInfo> for crate::FileInfo {
31446 fn compat_from(value: ::fidl_fuchsia_io::FileInfo) -> Self {
31447 Self {
31448 is_append: ::fidl_next::CompatFrom::compat_from(value.is_append),
31449
31450 observer: ::fidl_next::CompatFrom::compat_from(value.observer),
31451
31452 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
31453
31454 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31455 }
31456 }
31457 }
31458
31459 impl ::fidl_next::CompatFrom<crate::SymlinkInfo> for ::fidl_fuchsia_io::SymlinkInfo {
31460 fn compat_from(value: crate::SymlinkInfo) -> Self {
31461 Self {
31462 target: ::fidl_next::CompatFrom::compat_from(value.target),
31463
31464 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31465
31466 __source_breaking: ::fidl::marker::SourceBreaking,
31467 }
31468 }
31469 }
31470
31471 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkInfo> for crate::SymlinkInfo {
31472 fn compat_from(value: ::fidl_fuchsia_io::SymlinkInfo) -> Self {
31473 Self {
31474 target: ::fidl_next::CompatFrom::compat_from(value.target),
31475
31476 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31477 }
31478 }
31479 }
31480
31481 impl ::fidl_next::CompatFrom<crate::Representation> for ::fidl_fuchsia_io::Representation {
31482 fn compat_from(value: crate::Representation) -> Self {
31483 match value {
31484 crate::Representation::Node(value) => {
31485 Self::Node(::fidl_next::CompatFrom::compat_from(value))
31486 }
31487
31488 crate::Representation::Directory(value) => {
31489 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
31490 }
31491
31492 crate::Representation::File(value) => {
31493 Self::File(::fidl_next::CompatFrom::compat_from(value))
31494 }
31495
31496 crate::Representation::Symlink(value) => {
31497 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
31498 }
31499
31500 crate::Representation::UnknownOrdinal_(unknown_ordinal) => {
31501 Self::__SourceBreaking { unknown_ordinal }
31502 }
31503 }
31504 }
31505 }
31506
31507 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Representation> for crate::Representation {
31508 fn compat_from(value: ::fidl_fuchsia_io::Representation) -> Self {
31509 match value {
31510 ::fidl_fuchsia_io::Representation::Node(value) => {
31511 Self::Node(::fidl_next::CompatFrom::compat_from(value))
31512 }
31513
31514 ::fidl_fuchsia_io::Representation::Directory(value) => {
31515 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
31516 }
31517
31518 ::fidl_fuchsia_io::Representation::File(value) => {
31519 Self::File(::fidl_next::CompatFrom::compat_from(value))
31520 }
31521
31522 ::fidl_fuchsia_io::Representation::Symlink(value) => {
31523 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
31524 }
31525
31526 ::fidl_fuchsia_io::Representation::__SourceBreaking { unknown_ordinal } => {
31527 Self::UnknownOrdinal_(unknown_ordinal)
31528 }
31529 }
31530 }
31531 }
31532
31533 impl ::fidl_next::CompatFrom<crate::NodeAttributesQuery>
31534 for ::fidl_fuchsia_io::NodeAttributesQuery
31535 {
31536 fn compat_from(value: crate::NodeAttributesQuery) -> Self {
31537 Self::from_bits_retain(value.bits())
31538 }
31539 }
31540
31541 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributesQuery>
31542 for crate::NodeAttributesQuery
31543 {
31544 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributesQuery) -> Self {
31545 Self::from_bits_retain(value.bits())
31546 }
31547 }
31548
31549 impl ::fidl_next::CompatFrom<crate::NodeGetAttributesRequest>
31550 for ::fidl_fuchsia_io::NodeGetAttributesRequest
31551 {
31552 #[inline]
31553 fn compat_from(value: crate::NodeGetAttributesRequest) -> Self {
31554 Self { query: ::fidl_next::CompatFrom::compat_from(value.query) }
31555 }
31556 }
31557
31558 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetAttributesRequest>
31559 for crate::NodeGetAttributesRequest
31560 {
31561 #[inline]
31562 fn compat_from(value: ::fidl_fuchsia_io::NodeGetAttributesRequest) -> Self {
31563 Self { query: ::fidl_next::CompatFrom::compat_from(value.query) }
31564 }
31565 }
31566
31567 impl ::fidl_next::CompatFrom<crate::Options> for ::fidl_fuchsia_io::Options {
31568 fn compat_from(value: crate::Options) -> Self {
31569 Self {
31570 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31571
31572 create_attributes: ::fidl_next::CompatFrom::compat_from(value.create_attributes),
31573
31574 __source_breaking: ::fidl::marker::SourceBreaking,
31575 }
31576 }
31577 }
31578
31579 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Options> for crate::Options {
31580 fn compat_from(value: ::fidl_fuchsia_io::Options) -> Self {
31581 Self {
31582 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31583
31584 create_attributes: ::fidl_next::CompatFrom::compat_from(value.create_attributes),
31585 }
31586 }
31587 }
31588
31589 impl ::fidl_next::CompatFrom<crate::DirectoryOpenRequest>
31590 for ::fidl_fuchsia_io::DirectoryOpenRequest
31591 {
31592 #[inline]
31593 fn compat_from(value: crate::DirectoryOpenRequest) -> Self {
31594 Self {
31595 path: ::fidl_next::CompatFrom::compat_from(value.path),
31596
31597 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31598
31599 options: ::fidl_next::CompatFrom::compat_from(value.options),
31600
31601 object: ::fidl_next::CompatFrom::compat_from(value.object),
31602 }
31603 }
31604 }
31605
31606 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryOpenRequest>
31607 for crate::DirectoryOpenRequest
31608 {
31609 #[inline]
31610 fn compat_from(value: ::fidl_fuchsia_io::DirectoryOpenRequest) -> Self {
31611 Self {
31612 path: ::fidl_next::CompatFrom::compat_from(value.path),
31613
31614 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31615
31616 options: ::fidl_next::CompatFrom::compat_from(value.options),
31617
31618 object: ::fidl_next::CompatFrom::compat_from(value.object),
31619 }
31620 }
31621 }
31622
31623 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedCloneRequest>
31624 for ::fidl_fuchsia_io::NodeDeprecatedCloneRequest
31625 {
31626 #[inline]
31627 fn compat_from(value: crate::NodeDeprecatedCloneRequest) -> Self {
31628 Self {
31629 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31630
31631 object: ::fidl_next::CompatFrom::compat_from(value.object),
31632 }
31633 }
31634 }
31635
31636 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedCloneRequest>
31637 for crate::NodeDeprecatedCloneRequest
31638 {
31639 #[inline]
31640 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedCloneRequest) -> Self {
31641 Self {
31642 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31643
31644 object: ::fidl_next::CompatFrom::compat_from(value.object),
31645 }
31646 }
31647 }
31648
31649 #[cfg(target_os = "fuchsia")]
31650 pub type NodeProxy = ::fidl_next::Client<crate::Node>;
31653
31654 impl ::fidl_next::CompatFrom<crate::Node> for ::fidl_fuchsia_io::NodeMarker {
31655 fn compat_from(_: crate::Node) -> Self {
31656 Self
31657 }
31658 }
31659
31660 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeMarker> for crate::Node {
31661 fn compat_from(_: ::fidl_fuchsia_io::NodeMarker) -> Self {
31662 Self
31663 }
31664 }
31665
31666 #[cfg(target_os = "fuchsia")]
31667
31668 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::NodeProxy> for crate::Node {
31669 fn client_compat_from(
31670 proxy: ::fidl_fuchsia_io::NodeProxy,
31671 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
31672 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
31673 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
31674 ::fidl_next::ClientDispatcher::new(client_end)
31675 }
31676 }
31677
31678 impl ::fidl_next::CompatFrom<crate::DirectoryDeprecatedOpenRequest>
31679 for ::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest
31680 {
31681 #[inline]
31682 fn compat_from(value: crate::DirectoryDeprecatedOpenRequest) -> Self {
31683 Self {
31684 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31685
31686 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
31687
31688 path: ::fidl_next::CompatFrom::compat_from(value.path),
31689
31690 object: ::fidl_next::CompatFrom::compat_from(value.object),
31691 }
31692 }
31693 }
31694
31695 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest>
31696 for crate::DirectoryDeprecatedOpenRequest
31697 {
31698 #[inline]
31699 fn compat_from(value: ::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest) -> Self {
31700 Self {
31701 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
31702
31703 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
31704
31705 path: ::fidl_next::CompatFrom::compat_from(value.path),
31706
31707 object: ::fidl_next::CompatFrom::compat_from(value.object),
31708 }
31709 }
31710 }
31711
31712 impl ::fidl_next::CompatFrom<crate::DirectoryCreateSymlinkRequest>
31713 for ::fidl_fuchsia_io::DirectoryCreateSymlinkRequest
31714 {
31715 #[inline]
31716 fn compat_from(value: crate::DirectoryCreateSymlinkRequest) -> Self {
31717 Self {
31718 name: ::fidl_next::CompatFrom::compat_from(value.name),
31719
31720 target: ::fidl_next::CompatFrom::compat_from(value.target),
31721
31722 connection: ::fidl_next::CompatFrom::compat_from(value.connection),
31723 }
31724 }
31725 }
31726
31727 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryCreateSymlinkRequest>
31728 for crate::DirectoryCreateSymlinkRequest
31729 {
31730 #[inline]
31731 fn compat_from(value: ::fidl_fuchsia_io::DirectoryCreateSymlinkRequest) -> Self {
31732 Self {
31733 name: ::fidl_next::CompatFrom::compat_from(value.name),
31734
31735 target: ::fidl_next::CompatFrom::compat_from(value.target),
31736
31737 connection: ::fidl_next::CompatFrom::compat_from(value.connection),
31738 }
31739 }
31740 }
31741
31742 #[cfg(target_os = "fuchsia")]
31743 pub type DirectoryProxy = ::fidl_next::Client<crate::Directory>;
31746
31747 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_io::DirectoryMarker {
31748 fn compat_from(_: crate::Directory) -> Self {
31749 Self
31750 }
31751 }
31752
31753 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryMarker> for crate::Directory {
31754 fn compat_from(_: ::fidl_fuchsia_io::DirectoryMarker) -> Self {
31755 Self
31756 }
31757 }
31758
31759 #[cfg(target_os = "fuchsia")]
31760
31761 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::DirectoryProxy> for crate::Directory {
31762 fn client_compat_from(
31763 proxy: ::fidl_fuchsia_io::DirectoryProxy,
31764 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
31765 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
31766 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
31767 ::fidl_next::ClientDispatcher::new(client_end)
31768 }
31769 }
31770
31771 impl ::fidl_next::CompatFrom<crate::DirectoryObject> for ::fidl_fuchsia_io::DirectoryObject {
31772 #[inline]
31773 fn compat_from(value: crate::DirectoryObject) -> Self {
31774 Self {}
31775 }
31776 }
31777
31778 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryObject> for crate::DirectoryObject {
31779 #[inline]
31780 fn compat_from(value: ::fidl_fuchsia_io::DirectoryObject) -> Self {
31781 Self {}
31782 }
31783 }
31784
31785 #[cfg(target_os = "fuchsia")]
31786 pub type DirectoryWatcherProxy = ::fidl_next::Client<crate::DirectoryWatcher>;
31789
31790 impl ::fidl_next::CompatFrom<crate::DirectoryWatcher>
31791 for ::fidl_fuchsia_io::DirectoryWatcherMarker
31792 {
31793 fn compat_from(_: crate::DirectoryWatcher) -> Self {
31794 Self
31795 }
31796 }
31797
31798 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatcherMarker>
31799 for crate::DirectoryWatcher
31800 {
31801 fn compat_from(_: ::fidl_fuchsia_io::DirectoryWatcherMarker) -> Self {
31802 Self
31803 }
31804 }
31805
31806 #[cfg(target_os = "fuchsia")]
31807
31808 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::DirectoryWatcherProxy>
31809 for crate::DirectoryWatcher
31810 {
31811 fn client_compat_from(
31812 proxy: ::fidl_fuchsia_io::DirectoryWatcherProxy,
31813 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
31814 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
31815 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
31816 ::fidl_next::ClientDispatcher::new(client_end)
31817 }
31818 }
31819
31820 impl ::fidl_next::CompatFrom<crate::DirentType> for ::fidl_fuchsia_io::DirentType {
31821 fn compat_from(value: crate::DirentType) -> Self {
31822 match value {
31823 crate::DirentType::Unknown => Self::Unknown,
31824
31825 crate::DirentType::Directory => Self::Directory,
31826
31827 crate::DirentType::BlockDevice => Self::BlockDevice,
31828
31829 crate::DirentType::File => Self::File,
31830
31831 crate::DirentType::Symlink => Self::Symlink,
31832
31833 crate::DirentType::Service => Self::Service,
31834
31835 crate::DirentType::UnknownOrdinal_(unknown_ordinal) => {
31836 Self::__SourceBreaking { unknown_ordinal }
31837 }
31838 }
31839 }
31840 }
31841
31842 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirentType> for crate::DirentType {
31843 fn compat_from(value: ::fidl_fuchsia_io::DirentType) -> Self {
31844 match value {
31845 ::fidl_fuchsia_io::DirentType::Unknown => Self::Unknown,
31846
31847 ::fidl_fuchsia_io::DirentType::Directory => Self::Directory,
31848
31849 ::fidl_fuchsia_io::DirentType::BlockDevice => Self::BlockDevice,
31850
31851 ::fidl_fuchsia_io::DirentType::File => Self::File,
31852
31853 ::fidl_fuchsia_io::DirentType::Symlink => Self::Symlink,
31854
31855 ::fidl_fuchsia_io::DirentType::Service => Self::Service,
31856
31857 ::fidl_fuchsia_io::DirentType::__SourceBreaking { unknown_ordinal: value } => {
31858 Self::UnknownOrdinal_(value)
31859 }
31860 }
31861 }
31862 }
31863
31864 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeIteratorGetNextResponse>
31865 for ::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse
31866 {
31867 #[inline]
31868 fn compat_from(value: crate::ExtendedAttributeIteratorGetNextResponse) -> Self {
31869 Self {
31870 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31871
31872 last: ::fidl_next::CompatFrom::compat_from(value.last),
31873 }
31874 }
31875 }
31876
31877 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse>
31878 for crate::ExtendedAttributeIteratorGetNextResponse
31879 {
31880 #[inline]
31881 fn compat_from(value: ::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse) -> Self {
31882 Self {
31883 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
31884
31885 last: ::fidl_next::CompatFrom::compat_from(value.last),
31886 }
31887 }
31888 }
31889
31890 #[cfg(target_os = "fuchsia")]
31891 pub type ExtendedAttributeIteratorProxy = ::fidl_next::Client<crate::ExtendedAttributeIterator>;
31894
31895 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeIterator>
31896 for ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker
31897 {
31898 fn compat_from(_: crate::ExtendedAttributeIterator) -> Self {
31899 Self
31900 }
31901 }
31902
31903 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorMarker>
31904 for crate::ExtendedAttributeIterator
31905 {
31906 fn compat_from(_: ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker) -> Self {
31907 Self
31908 }
31909 }
31910
31911 #[cfg(target_os = "fuchsia")]
31912
31913 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorProxy>
31914 for crate::ExtendedAttributeIterator
31915 {
31916 fn client_compat_from(
31917 proxy: ::fidl_fuchsia_io::ExtendedAttributeIteratorProxy,
31918 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
31919 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
31920 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
31921 ::fidl_next::ClientDispatcher::new(client_end)
31922 }
31923 }
31924
31925 impl ::fidl_next::CompatFrom<crate::ReadableReadRequest>
31926 for ::fidl_fuchsia_io::ReadableReadRequest
31927 {
31928 #[inline]
31929 fn compat_from(value: crate::ReadableReadRequest) -> Self {
31930 Self { count: ::fidl_next::CompatFrom::compat_from(value.count) }
31931 }
31932 }
31933
31934 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableReadRequest>
31935 for crate::ReadableReadRequest
31936 {
31937 #[inline]
31938 fn compat_from(value: ::fidl_fuchsia_io::ReadableReadRequest) -> Self {
31939 Self { count: ::fidl_next::CompatFrom::compat_from(value.count) }
31940 }
31941 }
31942
31943 impl ::fidl_next::CompatFrom<crate::ReadableReadResponse>
31944 for ::fidl_fuchsia_io::ReadableReadResponse
31945 {
31946 #[inline]
31947 fn compat_from(value: crate::ReadableReadResponse) -> Self {
31948 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
31949 }
31950 }
31951
31952 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableReadResponse>
31953 for crate::ReadableReadResponse
31954 {
31955 #[inline]
31956 fn compat_from(value: ::fidl_fuchsia_io::ReadableReadResponse) -> Self {
31957 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
31958 }
31959 }
31960
31961 #[cfg(target_os = "fuchsia")]
31962 pub type ReadableProxy = ::fidl_next::Client<crate::Readable>;
31965
31966 impl ::fidl_next::CompatFrom<crate::Readable> for ::fidl_fuchsia_io::ReadableMarker {
31967 fn compat_from(_: crate::Readable) -> Self {
31968 Self
31969 }
31970 }
31971
31972 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableMarker> for crate::Readable {
31973 fn compat_from(_: ::fidl_fuchsia_io::ReadableMarker) -> Self {
31974 Self
31975 }
31976 }
31977
31978 #[cfg(target_os = "fuchsia")]
31979
31980 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::ReadableProxy> for crate::Readable {
31981 fn client_compat_from(
31982 proxy: ::fidl_fuchsia_io::ReadableProxy,
31983 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
31984 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
31985 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
31986 ::fidl_next::ClientDispatcher::new(client_end)
31987 }
31988 }
31989
31990 impl ::fidl_next::CompatFrom<crate::WritableWriteRequest>
31991 for ::fidl_fuchsia_io::WritableWriteRequest
31992 {
31993 #[inline]
31994 fn compat_from(value: crate::WritableWriteRequest) -> Self {
31995 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
31996 }
31997 }
31998
31999 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableWriteRequest>
32000 for crate::WritableWriteRequest
32001 {
32002 #[inline]
32003 fn compat_from(value: ::fidl_fuchsia_io::WritableWriteRequest) -> Self {
32004 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
32005 }
32006 }
32007
32008 impl ::fidl_next::CompatFrom<crate::WritableWriteResponse>
32009 for ::fidl_fuchsia_io::WritableWriteResponse
32010 {
32011 #[inline]
32012 fn compat_from(value: crate::WritableWriteResponse) -> Self {
32013 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
32014 }
32015 }
32016
32017 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableWriteResponse>
32018 for crate::WritableWriteResponse
32019 {
32020 #[inline]
32021 fn compat_from(value: ::fidl_fuchsia_io::WritableWriteResponse) -> Self {
32022 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
32023 }
32024 }
32025
32026 #[cfg(target_os = "fuchsia")]
32027 pub type WritableProxy = ::fidl_next::Client<crate::Writable>;
32030
32031 impl ::fidl_next::CompatFrom<crate::Writable> for ::fidl_fuchsia_io::WritableMarker {
32032 fn compat_from(_: crate::Writable) -> Self {
32033 Self
32034 }
32035 }
32036
32037 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableMarker> for crate::Writable {
32038 fn compat_from(_: ::fidl_fuchsia_io::WritableMarker) -> Self {
32039 Self
32040 }
32041 }
32042
32043 #[cfg(target_os = "fuchsia")]
32044
32045 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::WritableProxy> for crate::Writable {
32046 fn client_compat_from(
32047 proxy: ::fidl_fuchsia_io::WritableProxy,
32048 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
32049 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
32050 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
32051 ::fidl_next::ClientDispatcher::new(client_end)
32052 }
32053 }
32054
32055 impl ::fidl_next::CompatFrom<crate::FileSeekRequest> for ::fidl_fuchsia_io::FileSeekRequest {
32056 #[inline]
32057 fn compat_from(value: crate::FileSeekRequest) -> Self {
32058 Self {
32059 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
32060
32061 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32062 }
32063 }
32064 }
32065
32066 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSeekRequest> for crate::FileSeekRequest {
32067 #[inline]
32068 fn compat_from(value: ::fidl_fuchsia_io::FileSeekRequest) -> Self {
32069 Self {
32070 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
32071
32072 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32073 }
32074 }
32075 }
32076
32077 impl ::fidl_next::CompatFrom<crate::FileSeekResponse> for ::fidl_fuchsia_io::FileSeekResponse {
32078 #[inline]
32079 fn compat_from(value: crate::FileSeekResponse) -> Self {
32080 Self {
32081 offset_from_start: ::fidl_next::CompatFrom::compat_from(value.offset_from_start),
32082 }
32083 }
32084 }
32085
32086 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSeekResponse> for crate::FileSeekResponse {
32087 #[inline]
32088 fn compat_from(value: ::fidl_fuchsia_io::FileSeekResponse) -> Self {
32089 Self {
32090 offset_from_start: ::fidl_next::CompatFrom::compat_from(value.offset_from_start),
32091 }
32092 }
32093 }
32094
32095 impl ::fidl_next::CompatFrom<crate::FileReadAtRequest> for ::fidl_fuchsia_io::FileReadAtRequest {
32096 #[inline]
32097 fn compat_from(value: crate::FileReadAtRequest) -> Self {
32098 Self {
32099 count: ::fidl_next::CompatFrom::compat_from(value.count),
32100
32101 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32102 }
32103 }
32104 }
32105
32106 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileReadAtRequest> for crate::FileReadAtRequest {
32107 #[inline]
32108 fn compat_from(value: ::fidl_fuchsia_io::FileReadAtRequest) -> Self {
32109 Self {
32110 count: ::fidl_next::CompatFrom::compat_from(value.count),
32111
32112 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32113 }
32114 }
32115 }
32116
32117 impl ::fidl_next::CompatFrom<crate::FileReadAtResponse> for ::fidl_fuchsia_io::FileReadAtResponse {
32118 #[inline]
32119 fn compat_from(value: crate::FileReadAtResponse) -> Self {
32120 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
32121 }
32122 }
32123
32124 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileReadAtResponse> for crate::FileReadAtResponse {
32125 #[inline]
32126 fn compat_from(value: ::fidl_fuchsia_io::FileReadAtResponse) -> Self {
32127 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
32128 }
32129 }
32130
32131 impl ::fidl_next::CompatFrom<crate::FileWriteAtRequest> for ::fidl_fuchsia_io::FileWriteAtRequest {
32132 #[inline]
32133 fn compat_from(value: crate::FileWriteAtRequest) -> Self {
32134 Self {
32135 data: ::fidl_next::CompatFrom::compat_from(value.data),
32136
32137 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32138 }
32139 }
32140 }
32141
32142 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileWriteAtRequest> for crate::FileWriteAtRequest {
32143 #[inline]
32144 fn compat_from(value: ::fidl_fuchsia_io::FileWriteAtRequest) -> Self {
32145 Self {
32146 data: ::fidl_next::CompatFrom::compat_from(value.data),
32147
32148 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32149 }
32150 }
32151 }
32152
32153 impl ::fidl_next::CompatFrom<crate::FileWriteAtResponse>
32154 for ::fidl_fuchsia_io::FileWriteAtResponse
32155 {
32156 #[inline]
32157 fn compat_from(value: crate::FileWriteAtResponse) -> Self {
32158 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
32159 }
32160 }
32161
32162 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileWriteAtResponse>
32163 for crate::FileWriteAtResponse
32164 {
32165 #[inline]
32166 fn compat_from(value: ::fidl_fuchsia_io::FileWriteAtResponse) -> Self {
32167 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
32168 }
32169 }
32170
32171 impl ::fidl_next::CompatFrom<crate::FileResizeRequest> for ::fidl_fuchsia_io::FileResizeRequest {
32172 #[inline]
32173 fn compat_from(value: crate::FileResizeRequest) -> Self {
32174 Self { length: ::fidl_next::CompatFrom::compat_from(value.length) }
32175 }
32176 }
32177
32178 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileResizeRequest> for crate::FileResizeRequest {
32179 #[inline]
32180 fn compat_from(value: ::fidl_fuchsia_io::FileResizeRequest) -> Self {
32181 Self { length: ::fidl_next::CompatFrom::compat_from(value.length) }
32182 }
32183 }
32184
32185 impl ::fidl_next::CompatFrom<crate::VmoFlags> for ::fidl_fuchsia_io::VmoFlags {
32186 fn compat_from(value: crate::VmoFlags) -> Self {
32187 Self::from_bits_retain(value.bits())
32188 }
32189 }
32190
32191 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::VmoFlags> for crate::VmoFlags {
32192 fn compat_from(value: ::fidl_fuchsia_io::VmoFlags) -> Self {
32193 Self::from_bits_retain(value.bits())
32194 }
32195 }
32196
32197 impl ::fidl_next::CompatFrom<crate::FileGetBackingMemoryRequest>
32198 for ::fidl_fuchsia_io::FileGetBackingMemoryRequest
32199 {
32200 #[inline]
32201 fn compat_from(value: crate::FileGetBackingMemoryRequest) -> Self {
32202 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
32203 }
32204 }
32205
32206 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileGetBackingMemoryRequest>
32207 for crate::FileGetBackingMemoryRequest
32208 {
32209 #[inline]
32210 fn compat_from(value: ::fidl_fuchsia_io::FileGetBackingMemoryRequest) -> Self {
32211 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
32212 }
32213 }
32214
32215 impl ::fidl_next::CompatFrom<crate::FileGetBackingMemoryResponse>
32216 for ::fidl_fuchsia_io::FileGetBackingMemoryResponse
32217 {
32218 #[inline]
32219 fn compat_from(value: crate::FileGetBackingMemoryResponse) -> Self {
32220 Self { vmo: ::fidl_next::CompatFrom::compat_from(value.vmo) }
32221 }
32222 }
32223
32224 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileGetBackingMemoryResponse>
32225 for crate::FileGetBackingMemoryResponse
32226 {
32227 #[inline]
32228 fn compat_from(value: ::fidl_fuchsia_io::FileGetBackingMemoryResponse) -> Self {
32229 Self { vmo: ::fidl_next::CompatFrom::compat_from(value.vmo) }
32230 }
32231 }
32232
32233 impl ::fidl_next::CompatFrom<crate::LinkableLinkIntoRequest>
32234 for ::fidl_fuchsia_io::LinkableLinkIntoRequest
32235 {
32236 #[inline]
32237 fn compat_from(value: crate::LinkableLinkIntoRequest) -> Self {
32238 Self {
32239 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
32240
32241 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
32242 }
32243 }
32244 }
32245
32246 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::LinkableLinkIntoRequest>
32247 for crate::LinkableLinkIntoRequest
32248 {
32249 #[inline]
32250 fn compat_from(value: ::fidl_fuchsia_io::LinkableLinkIntoRequest) -> Self {
32251 Self {
32252 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
32253
32254 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
32255 }
32256 }
32257 }
32258
32259 #[cfg(target_os = "fuchsia")]
32260 pub type LinkableProxy = ::fidl_next::Client<crate::Linkable>;
32263
32264 impl ::fidl_next::CompatFrom<crate::Linkable> for ::fidl_fuchsia_io::LinkableMarker {
32265 fn compat_from(_: crate::Linkable) -> Self {
32266 Self
32267 }
32268 }
32269
32270 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::LinkableMarker> for crate::Linkable {
32271 fn compat_from(_: ::fidl_fuchsia_io::LinkableMarker) -> Self {
32272 Self
32273 }
32274 }
32275
32276 #[cfg(target_os = "fuchsia")]
32277
32278 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::LinkableProxy> for crate::Linkable {
32279 fn client_compat_from(
32280 proxy: ::fidl_fuchsia_io::LinkableProxy,
32281 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
32282 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
32283 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
32284 ::fidl_next::ClientDispatcher::new(client_end)
32285 }
32286 }
32287
32288 impl ::fidl_next::CompatFrom<crate::FileAllocateRequest>
32289 for ::fidl_fuchsia_io::FileAllocateRequest
32290 {
32291 #[inline]
32292 fn compat_from(value: crate::FileAllocateRequest) -> Self {
32293 Self {
32294 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32295
32296 length: ::fidl_next::CompatFrom::compat_from(value.length),
32297
32298 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
32299 }
32300 }
32301 }
32302
32303 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileAllocateRequest>
32304 for crate::FileAllocateRequest
32305 {
32306 #[inline]
32307 fn compat_from(value: ::fidl_fuchsia_io::FileAllocateRequest) -> Self {
32308 Self {
32309 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
32310
32311 length: ::fidl_next::CompatFrom::compat_from(value.length),
32312
32313 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
32314 }
32315 }
32316 }
32317
32318 impl ::fidl_next::CompatFrom<crate::FileEnableVerityRequest>
32319 for ::fidl_fuchsia_io::FileEnableVerityRequest
32320 {
32321 #[inline]
32322 fn compat_from(value: crate::FileEnableVerityRequest) -> Self {
32323 Self { options: ::fidl_next::CompatFrom::compat_from(value.options) }
32324 }
32325 }
32326
32327 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileEnableVerityRequest>
32328 for crate::FileEnableVerityRequest
32329 {
32330 #[inline]
32331 fn compat_from(value: ::fidl_fuchsia_io::FileEnableVerityRequest) -> Self {
32332 Self { options: ::fidl_next::CompatFrom::compat_from(value.options) }
32333 }
32334 }
32335
32336 #[cfg(target_os = "fuchsia")]
32337 pub type FileProxy = ::fidl_next::Client<crate::File>;
32340
32341 impl ::fidl_next::CompatFrom<crate::File> for ::fidl_fuchsia_io::FileMarker {
32342 fn compat_from(_: crate::File) -> Self {
32343 Self
32344 }
32345 }
32346
32347 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileMarker> for crate::File {
32348 fn compat_from(_: ::fidl_fuchsia_io::FileMarker) -> Self {
32349 Self
32350 }
32351 }
32352
32353 #[cfg(target_os = "fuchsia")]
32354
32355 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::FileProxy> for crate::File {
32356 fn client_compat_from(
32357 proxy: ::fidl_fuchsia_io::FileProxy,
32358 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
32359 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
32360 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
32361 ::fidl_next::ClientDispatcher::new(client_end)
32362 }
32363 }
32364
32365 impl ::fidl_next::CompatFrom<crate::FileObject> for ::fidl_fuchsia_io::FileObject {
32366 #[inline]
32367 fn compat_from(value: crate::FileObject) -> Self {
32368 Self {
32369 event: ::fidl_next::CompatFrom::compat_from(value.event),
32370
32371 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
32372 }
32373 }
32374 }
32375
32376 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileObject> for crate::FileObject {
32377 #[inline]
32378 fn compat_from(value: ::fidl_fuchsia_io::FileObject) -> Self {
32379 Self {
32380 event: ::fidl_next::CompatFrom::compat_from(value.event),
32381
32382 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
32383 }
32384 }
32385 }
32386
32387 impl ::fidl_next::CompatFrom<crate::FileSignal> for ::fidl_fuchsia_io::FileSignal {
32388 fn compat_from(value: crate::FileSignal) -> Self {
32389 Self::from_bits_retain(value.bits())
32390 }
32391 }
32392
32393 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSignal> for crate::FileSignal {
32394 fn compat_from(value: ::fidl_fuchsia_io::FileSignal) -> Self {
32395 Self::from_bits_retain(value.bits())
32396 }
32397 }
32398
32399 impl ::fidl_next::CompatFrom<crate::FilesystemInfo> for ::fidl_fuchsia_io::FilesystemInfo {
32400 #[inline]
32401 fn compat_from(value: crate::FilesystemInfo) -> Self {
32402 Self {
32403 total_bytes: ::fidl_next::CompatFrom::compat_from(value.total_bytes),
32404
32405 used_bytes: ::fidl_next::CompatFrom::compat_from(value.used_bytes),
32406
32407 total_nodes: ::fidl_next::CompatFrom::compat_from(value.total_nodes),
32408
32409 used_nodes: ::fidl_next::CompatFrom::compat_from(value.used_nodes),
32410
32411 free_shared_pool_bytes: ::fidl_next::CompatFrom::compat_from(
32412 value.free_shared_pool_bytes,
32413 ),
32414
32415 fs_id: ::fidl_next::CompatFrom::compat_from(value.fs_id),
32416
32417 block_size: ::fidl_next::CompatFrom::compat_from(value.block_size),
32418
32419 max_filename_size: ::fidl_next::CompatFrom::compat_from(value.max_filename_size),
32420
32421 fs_type: ::fidl_next::CompatFrom::compat_from(value.fs_type),
32422
32423 padding: ::fidl_next::CompatFrom::compat_from(value.padding),
32424
32425 name: ::fidl_next::CompatFrom::compat_from(value.name),
32426 }
32427 }
32428 }
32429
32430 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FilesystemInfo> for crate::FilesystemInfo {
32431 #[inline]
32432 fn compat_from(value: ::fidl_fuchsia_io::FilesystemInfo) -> Self {
32433 Self {
32434 total_bytes: ::fidl_next::CompatFrom::compat_from(value.total_bytes),
32435
32436 used_bytes: ::fidl_next::CompatFrom::compat_from(value.used_bytes),
32437
32438 total_nodes: ::fidl_next::CompatFrom::compat_from(value.total_nodes),
32439
32440 used_nodes: ::fidl_next::CompatFrom::compat_from(value.used_nodes),
32441
32442 free_shared_pool_bytes: ::fidl_next::CompatFrom::compat_from(
32443 value.free_shared_pool_bytes,
32444 ),
32445
32446 fs_id: ::fidl_next::CompatFrom::compat_from(value.fs_id),
32447
32448 block_size: ::fidl_next::CompatFrom::compat_from(value.block_size),
32449
32450 max_filename_size: ::fidl_next::CompatFrom::compat_from(value.max_filename_size),
32451
32452 fs_type: ::fidl_next::CompatFrom::compat_from(value.fs_type),
32453
32454 padding: ::fidl_next::CompatFrom::compat_from(value.padding),
32455
32456 name: ::fidl_next::CompatFrom::compat_from(value.name),
32457 }
32458 }
32459 }
32460
32461 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_io::Service {
32462 #[inline]
32463 fn compat_from(value: crate::Service) -> Self {
32464 Self {}
32465 }
32466 }
32467
32468 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Service> for crate::Service {
32469 #[inline]
32470 fn compat_from(value: ::fidl_fuchsia_io::Service) -> Self {
32471 Self {}
32472 }
32473 }
32474
32475 impl ::fidl_next::CompatFrom<crate::SymlinkObject> for ::fidl_fuchsia_io::SymlinkObject {
32476 #[inline]
32477 fn compat_from(value: crate::SymlinkObject) -> Self {
32478 Self { target: ::fidl_next::CompatFrom::compat_from(value.target) }
32479 }
32480 }
32481
32482 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkObject> for crate::SymlinkObject {
32483 #[inline]
32484 fn compat_from(value: ::fidl_fuchsia_io::SymlinkObject) -> Self {
32485 Self { target: ::fidl_next::CompatFrom::compat_from(value.target) }
32486 }
32487 }
32488
32489 impl ::fidl_next::CompatFrom<crate::NodeInfoDeprecated> for ::fidl_fuchsia_io::NodeInfoDeprecated {
32490 fn compat_from(value: crate::NodeInfoDeprecated) -> Self {
32491 match value {
32492 crate::NodeInfoDeprecated::Service(value) => {
32493 Self::Service(::fidl_next::CompatFrom::compat_from(value))
32494 }
32495
32496 crate::NodeInfoDeprecated::File(value) => {
32497 Self::File(::fidl_next::CompatFrom::compat_from(value))
32498 }
32499
32500 crate::NodeInfoDeprecated::Directory(value) => {
32501 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
32502 }
32503
32504 crate::NodeInfoDeprecated::Symlink(value) => {
32505 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
32506 }
32507 }
32508 }
32509 }
32510
32511 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeInfoDeprecated> for crate::NodeInfoDeprecated {
32512 fn compat_from(value: ::fidl_fuchsia_io::NodeInfoDeprecated) -> Self {
32513 match value {
32514 ::fidl_fuchsia_io::NodeInfoDeprecated::Service(value) => {
32515 Self::Service(::fidl_next::CompatFrom::compat_from(value))
32516 }
32517
32518 ::fidl_fuchsia_io::NodeInfoDeprecated::File(value) => {
32519 Self::File(::fidl_next::CompatFrom::compat_from(value))
32520 }
32521
32522 ::fidl_fuchsia_io::NodeInfoDeprecated::Directory(value) => {
32523 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
32524 }
32525
32526 ::fidl_fuchsia_io::NodeInfoDeprecated::Symlink(value) => {
32527 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
32528 }
32529 }
32530 }
32531 }
32532
32533 #[cfg(target_os = "fuchsia")]
32534 pub type SymlinkProxy = ::fidl_next::Client<crate::Symlink>;
32537
32538 impl ::fidl_next::CompatFrom<crate::Symlink> for ::fidl_fuchsia_io::SymlinkMarker {
32539 fn compat_from(_: crate::Symlink) -> Self {
32540 Self
32541 }
32542 }
32543
32544 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkMarker> for crate::Symlink {
32545 fn compat_from(_: ::fidl_fuchsia_io::SymlinkMarker) -> Self {
32546 Self
32547 }
32548 }
32549
32550 #[cfg(target_os = "fuchsia")]
32551
32552 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::SymlinkProxy> for crate::Symlink {
32553 fn client_compat_from(
32554 proxy: ::fidl_fuchsia_io::SymlinkProxy,
32555 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
32556 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
32557 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
32558 ::fidl_next::ClientDispatcher::new(client_end)
32559 }
32560 }
32561
32562 impl ::fidl_next::CompatFrom<crate::WatchEvent> for ::fidl_fuchsia_io::WatchEvent {
32563 fn compat_from(value: crate::WatchEvent) -> Self {
32564 match value {
32565 crate::WatchEvent::Deleted => Self::Deleted,
32566
32567 crate::WatchEvent::Added => Self::Added,
32568
32569 crate::WatchEvent::Removed => Self::Removed,
32570
32571 crate::WatchEvent::Existing => Self::Existing,
32572
32573 crate::WatchEvent::Idle => Self::Idle,
32574 }
32575 }
32576 }
32577
32578 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WatchEvent> for crate::WatchEvent {
32579 fn compat_from(value: ::fidl_fuchsia_io::WatchEvent) -> Self {
32580 match value {
32581 ::fidl_fuchsia_io::WatchEvent::Deleted => Self::Deleted,
32582
32583 ::fidl_fuchsia_io::WatchEvent::Added => Self::Added,
32584
32585 ::fidl_fuchsia_io::WatchEvent::Removed => Self::Removed,
32586
32587 ::fidl_fuchsia_io::WatchEvent::Existing => Self::Existing,
32588
32589 ::fidl_fuchsia_io::WatchEvent::Idle => Self::Idle,
32590 }
32591 }
32592 }
32593}