1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5::fidl_next::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 ) -> 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 ) -> Result<(), ::fidl_next::EncodeError> {
56 ::fidl_next::munge!(let WireOperations { value } = out);
57 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
58 Ok(())
59 }
60}
61
62impl ::core::convert::From<WireOperations> for Operations {
63 fn from(wire: WireOperations) -> Self {
64 Self::from_bits_retain(u64::from(wire.value))
65 }
66}
67
68impl ::fidl_next::FromWire<WireOperations> for Operations {
69 #[inline]
70 fn from_wire(wire: WireOperations) -> Self {
71 Self::from(wire)
72 }
73}
74
75impl ::fidl_next::FromWireRef<WireOperations> for Operations {
76 #[inline]
77 fn from_wire_ref(wire: &WireOperations) -> Self {
78 Self::from(*wire)
79 }
80}
81
82#[derive(Clone, Copy, Debug)]
84#[repr(transparent)]
85pub struct WireOperations {
86 value: ::fidl_next::WireU64,
87}
88
89unsafe impl ::fidl_next::Wire for WireOperations {
90 type Decoded<'de> = Self;
91
92 #[inline]
93 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
94 }
96}
97
98unsafe impl<___D> ::fidl_next::Decode<___D> for WireOperations
99where
100 ___D: ?Sized,
101{
102 fn decode(
103 slot: ::fidl_next::Slot<'_, Self>,
104 _: &mut ___D,
105 ) -> Result<(), ::fidl_next::DecodeError> {
106 ::fidl_next::munge!(let Self { value } = slot);
107 let set = u64::from(*value);
108 if set & !Operations::all().bits() != 0 {
109 return Err(::fidl_next::DecodeError::InvalidBits {
110 expected: Operations::all().bits() as usize,
111 actual: set as usize,
112 });
113 }
114
115 Ok(())
116 }
117}
118
119impl ::core::convert::From<Operations> for WireOperations {
120 fn from(natural: Operations) -> Self {
121 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
122 }
123}
124
125#[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"]
126pub type Abilities = crate::Operations;
127
128pub type WireAbilities = crate::WireOperations;
130
131#[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"]
132#[derive(Clone, Copy, Debug, PartialEq, Eq)]
133#[repr(u32)]
134pub enum SeekOrigin {
135 Start = 0,
136 Current = 1,
137 End = 2,
138}
139
140impl ::fidl_next::Encodable for SeekOrigin {
141 type Encoded = WireSeekOrigin;
142}
143impl ::std::convert::TryFrom<u32> for SeekOrigin {
144 type Error = ::fidl_next::UnknownStrictEnumMemberError;
145 fn try_from(value: u32) -> Result<Self, Self::Error> {
146 match value {
147 0 => Ok(Self::Start),
148 1 => Ok(Self::Current),
149 2 => Ok(Self::End),
150
151 _ => Err(Self::Error::new(value.into())),
152 }
153 }
154}
155
156unsafe impl<___E> ::fidl_next::Encode<___E> for SeekOrigin
157where
158 ___E: ?Sized,
159{
160 #[inline]
161 fn encode(
162 self,
163 encoder: &mut ___E,
164 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
165 ) -> Result<(), ::fidl_next::EncodeError> {
166 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
167 }
168}
169
170unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SeekOrigin
171where
172 ___E: ?Sized,
173{
174 #[inline]
175 fn encode_ref(
176 &self,
177 encoder: &mut ___E,
178 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
179 ) -> Result<(), ::fidl_next::EncodeError> {
180 ::fidl_next::munge!(let WireSeekOrigin { value } = out);
181 let _ = value.write(::fidl_next::WireU32::from(match *self {
182 Self::Start => 0,
183
184 Self::Current => 1,
185
186 Self::End => 2,
187 }));
188
189 Ok(())
190 }
191}
192
193impl ::core::convert::From<WireSeekOrigin> for SeekOrigin {
194 fn from(wire: WireSeekOrigin) -> Self {
195 match u32::from(wire.value) {
196 0 => Self::Start,
197
198 1 => Self::Current,
199
200 2 => Self::End,
201
202 _ => unsafe { ::core::hint::unreachable_unchecked() },
203 }
204 }
205}
206
207impl ::fidl_next::FromWire<WireSeekOrigin> for SeekOrigin {
208 #[inline]
209 fn from_wire(wire: WireSeekOrigin) -> Self {
210 Self::from(wire)
211 }
212}
213
214impl ::fidl_next::FromWireRef<WireSeekOrigin> for SeekOrigin {
215 #[inline]
216 fn from_wire_ref(wire: &WireSeekOrigin) -> Self {
217 Self::from(*wire)
218 }
219}
220
221#[derive(Clone, Copy, Debug, PartialEq, Eq)]
223#[repr(transparent)]
224pub struct WireSeekOrigin {
225 value: ::fidl_next::WireU32,
226}
227
228unsafe impl ::fidl_next::Wire for WireSeekOrigin {
229 type Decoded<'de> = Self;
230
231 #[inline]
232 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
233 }
235}
236
237impl WireSeekOrigin {
238 pub const START: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(0) };
239
240 pub const CURRENT: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(1) };
241
242 pub const END: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(2) };
243}
244
245unsafe impl<___D> ::fidl_next::Decode<___D> for WireSeekOrigin
246where
247 ___D: ?Sized,
248{
249 fn decode(
250 slot: ::fidl_next::Slot<'_, Self>,
251 _: &mut ___D,
252 ) -> Result<(), ::fidl_next::DecodeError> {
253 ::fidl_next::munge!(let Self { value } = slot);
254
255 match u32::from(*value) {
256 0 | 1 | 2 => (),
257 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
258 }
259
260 Ok(())
261 }
262}
263
264impl ::core::convert::From<SeekOrigin> for WireSeekOrigin {
265 fn from(natural: SeekOrigin) -> Self {
266 match natural {
267 SeekOrigin::Start => WireSeekOrigin::START,
268
269 SeekOrigin::Current => WireSeekOrigin::CURRENT,
270
271 SeekOrigin::End => WireSeekOrigin::END,
272 }
273 }
274}
275
276#[derive(Clone, Debug)]
277pub struct AdvisoryLockRange {
278 pub origin: crate::SeekOrigin,
279
280 pub offset: i64,
281
282 pub length: i64,
283}
284
285impl ::fidl_next::Encodable for AdvisoryLockRange {
286 type Encoded = WireAdvisoryLockRange;
287}
288
289unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRange
290where
291 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
292{
293 #[inline]
294 fn encode(
295 self,
296 encoder: &mut ___E,
297 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
298 ) -> Result<(), ::fidl_next::EncodeError> {
299 ::fidl_next::munge! {
300 let Self::Encoded {
301 origin,
302 offset,
303 length,
304
305 } = out;
306 }
307
308 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
309
310 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
311
312 ::fidl_next::Encode::encode(self.length, encoder, length)?;
313
314 Ok(())
315 }
316}
317
318unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRange
319where
320 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
321{
322 #[inline]
323 fn encode_ref(
324 &self,
325 encoder: &mut ___E,
326 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
327 ) -> Result<(), ::fidl_next::EncodeError> {
328 ::fidl_next::munge! {
329 let Self::Encoded {
330 origin,
331 offset,
332 length,
333
334 } = out;
335 }
336
337 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder, origin)?;
338
339 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
340
341 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder, length)?;
342
343 Ok(())
344 }
345}
346
347impl ::fidl_next::EncodableOption for AdvisoryLockRange {
348 type EncodedOption = ::fidl_next::WireBox<'static, WireAdvisoryLockRange>;
349}
350
351unsafe impl<___E> ::fidl_next::EncodeOption<___E> for AdvisoryLockRange
352where
353 ___E: ::fidl_next::Encoder + ?Sized,
354 AdvisoryLockRange: ::fidl_next::Encode<___E>,
355{
356 #[inline]
357 fn encode_option(
358 this: Option<Self>,
359 encoder: &mut ___E,
360 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
361 ) -> Result<(), ::fidl_next::EncodeError> {
362 if let Some(inner) = this {
363 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
364 ::fidl_next::WireBox::encode_present(out);
365 } else {
366 ::fidl_next::WireBox::encode_absent(out);
367 }
368
369 Ok(())
370 }
371}
372
373unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for AdvisoryLockRange
374where
375 ___E: ::fidl_next::Encoder + ?Sized,
376 AdvisoryLockRange: ::fidl_next::EncodeRef<___E>,
377{
378 #[inline]
379 fn encode_option_ref(
380 this: Option<&Self>,
381 encoder: &mut ___E,
382 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
383 ) -> Result<(), ::fidl_next::EncodeError> {
384 if let Some(inner) = this {
385 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
386 ::fidl_next::WireBox::encode_present(out);
387 } else {
388 ::fidl_next::WireBox::encode_absent(out);
389 }
390
391 Ok(())
392 }
393}
394
395impl ::fidl_next::FromWire<WireAdvisoryLockRange> for AdvisoryLockRange {
396 #[inline]
397 fn from_wire(wire: WireAdvisoryLockRange) -> Self {
398 Self {
399 origin: ::fidl_next::FromWire::from_wire(wire.origin),
400
401 offset: ::fidl_next::FromWire::from_wire(wire.offset),
402
403 length: ::fidl_next::FromWire::from_wire(wire.length),
404 }
405 }
406}
407
408impl ::fidl_next::FromWireRef<WireAdvisoryLockRange> for AdvisoryLockRange {
409 #[inline]
410 fn from_wire_ref(wire: &WireAdvisoryLockRange) -> Self {
411 Self {
412 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
413
414 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
415
416 length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length),
417 }
418 }
419}
420
421#[derive(Clone, Debug)]
423#[repr(C)]
424pub struct WireAdvisoryLockRange {
425 pub origin: crate::WireSeekOrigin,
426
427 pub offset: ::fidl_next::WireI64,
428
429 pub length: ::fidl_next::WireI64,
430}
431
432unsafe impl ::fidl_next::Wire for WireAdvisoryLockRange {
433 type Decoded<'de> = WireAdvisoryLockRange;
434
435 #[inline]
436 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
437 unsafe {
438 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
439 }
440 }
441}
442
443unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRange
444where
445 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
446{
447 fn decode(
448 slot: ::fidl_next::Slot<'_, Self>,
449 decoder: &mut ___D,
450 ) -> Result<(), ::fidl_next::DecodeError> {
451 ::fidl_next::munge! {
452 let Self {
453 mut origin,
454 mut offset,
455 mut length,
456
457 } = slot;
458 }
459
460 ::fidl_next::Decode::decode(origin.as_mut(), decoder)?;
461
462 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
463
464 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
465
466 Ok(())
467 }
468}
469
470#[derive(Clone, Copy, Debug, PartialEq, Eq)]
471#[repr(u32)]
472pub enum AdvisoryLockType {
473 Read = 1,
474 Write = 2,
475 Unlock = 3,
476}
477
478impl ::fidl_next::Encodable for AdvisoryLockType {
479 type Encoded = WireAdvisoryLockType;
480}
481impl ::std::convert::TryFrom<u32> for AdvisoryLockType {
482 type Error = ::fidl_next::UnknownStrictEnumMemberError;
483 fn try_from(value: u32) -> Result<Self, Self::Error> {
484 match value {
485 1 => Ok(Self::Read),
486 2 => Ok(Self::Write),
487 3 => Ok(Self::Unlock),
488
489 _ => Err(Self::Error::new(value.into())),
490 }
491 }
492}
493
494unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockType
495where
496 ___E: ?Sized,
497{
498 #[inline]
499 fn encode(
500 self,
501 encoder: &mut ___E,
502 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
503 ) -> Result<(), ::fidl_next::EncodeError> {
504 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
505 }
506}
507
508unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockType
509where
510 ___E: ?Sized,
511{
512 #[inline]
513 fn encode_ref(
514 &self,
515 encoder: &mut ___E,
516 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
517 ) -> Result<(), ::fidl_next::EncodeError> {
518 ::fidl_next::munge!(let WireAdvisoryLockType { value } = out);
519 let _ = value.write(::fidl_next::WireU32::from(match *self {
520 Self::Read => 1,
521
522 Self::Write => 2,
523
524 Self::Unlock => 3,
525 }));
526
527 Ok(())
528 }
529}
530
531impl ::core::convert::From<WireAdvisoryLockType> for AdvisoryLockType {
532 fn from(wire: WireAdvisoryLockType) -> Self {
533 match u32::from(wire.value) {
534 1 => Self::Read,
535
536 2 => Self::Write,
537
538 3 => Self::Unlock,
539
540 _ => unsafe { ::core::hint::unreachable_unchecked() },
541 }
542 }
543}
544
545impl ::fidl_next::FromWire<WireAdvisoryLockType> for AdvisoryLockType {
546 #[inline]
547 fn from_wire(wire: WireAdvisoryLockType) -> Self {
548 Self::from(wire)
549 }
550}
551
552impl ::fidl_next::FromWireRef<WireAdvisoryLockType> for AdvisoryLockType {
553 #[inline]
554 fn from_wire_ref(wire: &WireAdvisoryLockType) -> Self {
555 Self::from(*wire)
556 }
557}
558
559#[derive(Clone, Copy, Debug, PartialEq, Eq)]
561#[repr(transparent)]
562pub struct WireAdvisoryLockType {
563 value: ::fidl_next::WireU32,
564}
565
566unsafe impl ::fidl_next::Wire for WireAdvisoryLockType {
567 type Decoded<'de> = Self;
568
569 #[inline]
570 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
571 }
573}
574
575impl WireAdvisoryLockType {
576 pub const READ: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(1) };
577
578 pub const WRITE: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(2) };
579
580 pub const UNLOCK: WireAdvisoryLockType =
581 WireAdvisoryLockType { value: ::fidl_next::WireU32(3) };
582}
583
584unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockType
585where
586 ___D: ?Sized,
587{
588 fn decode(
589 slot: ::fidl_next::Slot<'_, Self>,
590 _: &mut ___D,
591 ) -> Result<(), ::fidl_next::DecodeError> {
592 ::fidl_next::munge!(let Self { value } = slot);
593
594 match u32::from(*value) {
595 1 | 2 | 3 => (),
596 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
597 }
598
599 Ok(())
600 }
601}
602
603impl ::core::convert::From<AdvisoryLockType> for WireAdvisoryLockType {
604 fn from(natural: AdvisoryLockType) -> Self {
605 match natural {
606 AdvisoryLockType::Read => WireAdvisoryLockType::READ,
607
608 AdvisoryLockType::Write => WireAdvisoryLockType::WRITE,
609
610 AdvisoryLockType::Unlock => WireAdvisoryLockType::UNLOCK,
611 }
612 }
613}
614
615#[derive(Clone, Debug, Default)]
616pub struct AdvisoryLockRequest {
617 pub type_: Option<crate::AdvisoryLockType>,
618
619 pub range: Option<crate::AdvisoryLockRange>,
620
621 pub wait: Option<bool>,
622}
623
624impl AdvisoryLockRequest {
625 fn __max_ordinal(&self) -> usize {
626 if self.wait.is_some() {
627 return 3;
628 }
629
630 if self.range.is_some() {
631 return 2;
632 }
633
634 if self.type_.is_some() {
635 return 1;
636 }
637
638 0
639 }
640}
641
642impl ::fidl_next::Encodable for AdvisoryLockRequest {
643 type Encoded = WireAdvisoryLockRequest<'static>;
644}
645
646unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRequest
647where
648 ___E: ::fidl_next::Encoder + ?Sized,
649{
650 #[inline]
651 fn encode(
652 mut self,
653 encoder: &mut ___E,
654 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
655 ) -> Result<(), ::fidl_next::EncodeError> {
656 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
657
658 let max_ord = self.__max_ordinal();
659
660 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
661 ::fidl_next::Wire::zero_padding(&mut out);
662
663 let mut preallocated =
664 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
665
666 for i in 1..=max_ord {
667 match i {
668 3 => {
669 if let Some(wait) = self.wait.take() {
670 ::fidl_next::WireEnvelope::encode_value(
671 wait,
672 preallocated.encoder,
673 &mut out,
674 )?;
675 } else {
676 ::fidl_next::WireEnvelope::encode_zero(&mut out)
677 }
678 }
679
680 2 => {
681 if let Some(range) = self.range.take() {
682 ::fidl_next::WireEnvelope::encode_value(
683 range,
684 preallocated.encoder,
685 &mut out,
686 )?;
687 } else {
688 ::fidl_next::WireEnvelope::encode_zero(&mut out)
689 }
690 }
691
692 1 => {
693 if let Some(type_) = self.type_.take() {
694 ::fidl_next::WireEnvelope::encode_value(
695 type_,
696 preallocated.encoder,
697 &mut out,
698 )?;
699 } else {
700 ::fidl_next::WireEnvelope::encode_zero(&mut out)
701 }
702 }
703
704 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
705 }
706 unsafe {
707 preallocated.write_next(out.assume_init_ref());
708 }
709 }
710
711 ::fidl_next::WireTable::encode_len(table, max_ord);
712
713 Ok(())
714 }
715}
716
717unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRequest
718where
719 ___E: ::fidl_next::Encoder + ?Sized,
720{
721 #[inline]
722 fn encode_ref(
723 &self,
724 encoder: &mut ___E,
725 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
726 ) -> Result<(), ::fidl_next::EncodeError> {
727 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
728
729 let max_ord = self.__max_ordinal();
730
731 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
732 ::fidl_next::Wire::zero_padding(&mut out);
733
734 let mut preallocated =
735 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
736
737 for i in 1..=max_ord {
738 match i {
739 3 => {
740 if let Some(wait) = &self.wait {
741 ::fidl_next::WireEnvelope::encode_value(
742 wait,
743 preallocated.encoder,
744 &mut out,
745 )?;
746 } else {
747 ::fidl_next::WireEnvelope::encode_zero(&mut out)
748 }
749 }
750
751 2 => {
752 if let Some(range) = &self.range {
753 ::fidl_next::WireEnvelope::encode_value(
754 range,
755 preallocated.encoder,
756 &mut out,
757 )?;
758 } else {
759 ::fidl_next::WireEnvelope::encode_zero(&mut out)
760 }
761 }
762
763 1 => {
764 if let Some(type_) = &self.type_ {
765 ::fidl_next::WireEnvelope::encode_value(
766 type_,
767 preallocated.encoder,
768 &mut out,
769 )?;
770 } else {
771 ::fidl_next::WireEnvelope::encode_zero(&mut out)
772 }
773 }
774
775 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
776 }
777 unsafe {
778 preallocated.write_next(out.assume_init_ref());
779 }
780 }
781
782 ::fidl_next::WireTable::encode_len(table, max_ord);
783
784 Ok(())
785 }
786}
787
788impl<'de> ::fidl_next::FromWire<WireAdvisoryLockRequest<'de>> for AdvisoryLockRequest {
789 #[inline]
790 fn from_wire(wire: WireAdvisoryLockRequest<'de>) -> Self {
791 let wire = ::core::mem::ManuallyDrop::new(wire);
792
793 let type_ = wire.table.get(1);
794
795 let range = wire.table.get(2);
796
797 let wait = wire.table.get(3);
798
799 Self {
800 type_: type_.map(|envelope| {
801 ::fidl_next::FromWire::from_wire(unsafe {
802 envelope.read_unchecked::<crate::WireAdvisoryLockType>()
803 })
804 }),
805
806 range: range.map(|envelope| {
807 ::fidl_next::FromWire::from_wire(unsafe {
808 envelope.read_unchecked::<crate::WireAdvisoryLockRange>()
809 })
810 }),
811
812 wait: wait.map(|envelope| {
813 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
814 }),
815 }
816 }
817}
818
819impl<'de> ::fidl_next::FromWireRef<WireAdvisoryLockRequest<'de>> for AdvisoryLockRequest {
820 #[inline]
821 fn from_wire_ref(wire: &WireAdvisoryLockRequest<'de>) -> Self {
822 Self {
823 type_: wire.table.get(1).map(|envelope| {
824 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
825 envelope.deref_unchecked::<crate::WireAdvisoryLockType>()
826 })
827 }),
828
829 range: wire.table.get(2).map(|envelope| {
830 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
831 envelope.deref_unchecked::<crate::WireAdvisoryLockRange>()
832 })
833 }),
834
835 wait: wire.table.get(3).map(|envelope| {
836 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
837 envelope.deref_unchecked::<bool>()
838 })
839 }),
840 }
841 }
842}
843
844#[repr(C)]
846pub struct WireAdvisoryLockRequest<'de> {
847 table: ::fidl_next::WireTable<'de>,
848}
849
850impl<'de> Drop for WireAdvisoryLockRequest<'de> {
851 fn drop(&mut self) {
852 let _ = self
853 .table
854 .get(1)
855 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAdvisoryLockType>() });
856
857 let _ = self
858 .table
859 .get(2)
860 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAdvisoryLockRange>() });
861
862 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
863 }
864}
865
866unsafe impl ::fidl_next::Wire for WireAdvisoryLockRequest<'static> {
867 type Decoded<'de> = WireAdvisoryLockRequest<'de>;
868
869 #[inline]
870 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
871 ::fidl_next::munge!(let Self { table } = out);
872 ::fidl_next::WireTable::zero_padding(table);
873 }
874}
875
876unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRequest<'static>
877where
878 ___D: ::fidl_next::Decoder + ?Sized,
879{
880 fn decode(
881 slot: ::fidl_next::Slot<'_, Self>,
882 decoder: &mut ___D,
883 ) -> Result<(), ::fidl_next::DecodeError> {
884 ::fidl_next::munge!(let Self { table } = slot);
885
886 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
887 match ordinal {
888 0 => unsafe { ::core::hint::unreachable_unchecked() },
889
890 1 => {
891 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockType>(
892 slot.as_mut(),
893 decoder,
894 )?;
895
896 Ok(())
897 }
898
899 2 => {
900 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockRange>(
901 slot.as_mut(),
902 decoder,
903 )?;
904
905 Ok(())
906 }
907
908 3 => {
909 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
910
911 Ok(())
912 }
913
914 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
915 }
916 })
917 }
918}
919
920impl<'de> WireAdvisoryLockRequest<'de> {
921 pub fn type_(&self) -> Option<&crate::WireAdvisoryLockType> {
922 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
923 }
924
925 pub fn range(&self) -> Option<&crate::WireAdvisoryLockRange> {
926 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
927 }
928
929 pub fn wait(&self) -> Option<&bool> {
930 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
931 }
932}
933
934impl<'de> ::core::fmt::Debug for WireAdvisoryLockRequest<'de> {
935 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
936 f.debug_struct("AdvisoryLockRequest")
937 .field("type_", &self.type_())
938 .field("range", &self.range())
939 .field("wait", &self.wait())
940 .finish()
941 }
942}
943
944#[derive(Clone, Debug)]
945pub struct AdvisoryLockingAdvisoryLockRequest {
946 pub request: crate::AdvisoryLockRequest,
947}
948
949impl ::fidl_next::Encodable for AdvisoryLockingAdvisoryLockRequest {
950 type Encoded = WireAdvisoryLockingAdvisoryLockRequest<'static>;
951}
952
953unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockingAdvisoryLockRequest
954where
955 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
956
957 ___E: ::fidl_next::Encoder,
958{
959 #[inline]
960 fn encode(
961 self,
962 encoder: &mut ___E,
963 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
964 ) -> Result<(), ::fidl_next::EncodeError> {
965 ::fidl_next::munge! {
966 let Self::Encoded {
967 request,
968
969 } = out;
970 }
971
972 ::fidl_next::Encode::encode(self.request, encoder, request)?;
973
974 Ok(())
975 }
976}
977
978unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockingAdvisoryLockRequest
979where
980 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
981
982 ___E: ::fidl_next::Encoder,
983{
984 #[inline]
985 fn encode_ref(
986 &self,
987 encoder: &mut ___E,
988 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
989 ) -> Result<(), ::fidl_next::EncodeError> {
990 ::fidl_next::munge! {
991 let Self::Encoded {
992 request,
993
994 } = out;
995 }
996
997 ::fidl_next::EncodeRef::encode_ref(&self.request, encoder, request)?;
998
999 Ok(())
1000 }
1001}
1002
1003impl ::fidl_next::EncodableOption for AdvisoryLockingAdvisoryLockRequest {
1004 type EncodedOption =
1005 ::fidl_next::WireBox<'static, WireAdvisoryLockingAdvisoryLockRequest<'static>>;
1006}
1007
1008unsafe impl<___E> ::fidl_next::EncodeOption<___E> for AdvisoryLockingAdvisoryLockRequest
1009where
1010 ___E: ::fidl_next::Encoder + ?Sized,
1011 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::Encode<___E>,
1012{
1013 #[inline]
1014 fn encode_option(
1015 this: Option<Self>,
1016 encoder: &mut ___E,
1017 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1018 ) -> Result<(), ::fidl_next::EncodeError> {
1019 if let Some(inner) = this {
1020 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1021 ::fidl_next::WireBox::encode_present(out);
1022 } else {
1023 ::fidl_next::WireBox::encode_absent(out);
1024 }
1025
1026 Ok(())
1027 }
1028}
1029
1030unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for AdvisoryLockingAdvisoryLockRequest
1031where
1032 ___E: ::fidl_next::Encoder + ?Sized,
1033 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::EncodeRef<___E>,
1034{
1035 #[inline]
1036 fn encode_option_ref(
1037 this: Option<&Self>,
1038 encoder: &mut ___E,
1039 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1040 ) -> Result<(), ::fidl_next::EncodeError> {
1041 if let Some(inner) = this {
1042 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1043 ::fidl_next::WireBox::encode_present(out);
1044 } else {
1045 ::fidl_next::WireBox::encode_absent(out);
1046 }
1047
1048 Ok(())
1049 }
1050}
1051
1052impl<'de> ::fidl_next::FromWire<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1053 for AdvisoryLockingAdvisoryLockRequest
1054{
1055 #[inline]
1056 fn from_wire(wire: WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1057 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
1058 }
1059}
1060
1061impl<'de> ::fidl_next::FromWireRef<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1062 for AdvisoryLockingAdvisoryLockRequest
1063{
1064 #[inline]
1065 fn from_wire_ref(wire: &WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1066 Self { request: ::fidl_next::FromWireRef::from_wire_ref(&wire.request) }
1067 }
1068}
1069
1070#[derive(Debug)]
1072#[repr(C)]
1073pub struct WireAdvisoryLockingAdvisoryLockRequest<'de> {
1074 pub request: crate::WireAdvisoryLockRequest<'de>,
1075}
1076
1077unsafe impl ::fidl_next::Wire for WireAdvisoryLockingAdvisoryLockRequest<'static> {
1078 type Decoded<'de> = WireAdvisoryLockingAdvisoryLockRequest<'de>;
1079
1080 #[inline]
1081 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1082}
1083
1084unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockingAdvisoryLockRequest<'static>
1085where
1086 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1087
1088 ___D: ::fidl_next::Decoder,
1089{
1090 fn decode(
1091 slot: ::fidl_next::Slot<'_, Self>,
1092 decoder: &mut ___D,
1093 ) -> Result<(), ::fidl_next::DecodeError> {
1094 ::fidl_next::munge! {
1095 let Self {
1096 mut request,
1097
1098 } = slot;
1099 }
1100
1101 ::fidl_next::Decode::decode(request.as_mut(), decoder)?;
1102
1103 Ok(())
1104 }
1105}
1106
1107pub type AdvisoryLockingAdvisoryLockResponse = ();
1108
1109pub type WireAdvisoryLockingAdvisoryLockResponse = ();
1111
1112#[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"]
1114#[derive(Debug)]
1115pub struct AdvisoryLocking;
1116
1117pub mod advisory_locking {
1118 pub mod prelude {
1119 pub use crate::{
1120 advisory_locking, AdvisoryLocking, AdvisoryLockingClientHandler,
1121 AdvisoryLockingServerHandler,
1122 };
1123
1124 pub use crate::AdvisoryLockingAdvisoryLockRequest;
1125
1126 pub use crate::AdvisoryLockingAdvisoryLockResponse;
1127 }
1128
1129 pub struct AdvisoryLock;
1130
1131 impl ::fidl_next::Method for AdvisoryLock {
1132 const ORDINAL: u64 = 7992130864415541162;
1133
1134 type Protocol = crate::AdvisoryLocking;
1135
1136 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1137
1138 type Response = ::fidl_next::WireResult<
1139 'static,
1140 crate::WireAdvisoryLockingAdvisoryLockResponse,
1141 ::fidl_next::WireI32,
1142 >;
1143 }
1144
1145 mod ___detail {
1146
1147 pub struct AdvisoryLock<T0> {
1148 request: T0,
1149 }
1150
1151 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
1152 where
1153 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
1154 {
1155 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1156 }
1157
1158 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
1159 where
1160 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1161
1162 ___E: ::fidl_next::Encoder,
1163
1164 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
1165 {
1166 #[inline]
1167 fn encode(
1168 self,
1169 encoder: &mut ___E,
1170 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1171 ) -> Result<(), ::fidl_next::EncodeError> {
1172 ::fidl_next::munge! {
1173 let Self::Encoded {
1174 request,
1175
1176 } = out;
1177 }
1178
1179 ::fidl_next::Encode::encode(self.request, encoder, request)?;
1180
1181 Ok(())
1182 }
1183 }
1184
1185 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::AdvisoryLocking
1186 where
1187 ___T: ::fidl_next::Transport,
1188 {
1189 type ClientSender = AdvisoryLockingClientSender<___T>;
1190 type ServerSender = AdvisoryLockingServerSender<___T>;
1191 }
1192
1193 pub struct AdvisoryLockingClientSender<___T: ::fidl_next::Transport> {
1195 #[allow(dead_code)]
1196 sender: ::fidl_next::protocol::ClientSender<___T>,
1197 }
1198
1199 impl<___T> AdvisoryLockingClientSender<___T>
1200 where
1201 ___T: ::fidl_next::Transport,
1202 {
1203 #[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"]
1204 pub fn advisory_lock(
1205 &self,
1206
1207 request: impl ::fidl_next::Encode<
1208 <___T as ::fidl_next::Transport>::SendBuffer,
1209 Encoded = crate::WireAdvisoryLockRequest<'static>,
1210 >,
1211 ) -> Result<
1212 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
1213 ::fidl_next::EncodeError,
1214 >
1215 where
1216 <___T as ::fidl_next::Transport>::SendBuffer:
1217 ::fidl_next::encoder::InternalHandleEncoder,
1218
1219 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1220 {
1221 self.advisory_lock_with(AdvisoryLock { request })
1222 }
1223
1224 #[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"]
1225 pub fn advisory_lock_with<___R>(
1226 &self,
1227 request: ___R,
1228 ) -> Result<
1229 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
1230 ::fidl_next::EncodeError,
1231 >
1232 where
1233 ___R: ::fidl_next::Encode<
1234 <___T as ::fidl_next::Transport>::SendBuffer,
1235 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
1236 >,
1237 {
1238 self.sender
1239 .send_two_way(7992130864415541162, request)
1240 .map(::fidl_next::ResponseFuture::from_untyped)
1241 }
1242 }
1243
1244 #[repr(transparent)]
1246 pub struct AdvisoryLockingServerSender<___T: ::fidl_next::Transport> {
1247 sender: ::fidl_next::protocol::ServerSender<___T>,
1248 }
1249
1250 impl<___T> AdvisoryLockingServerSender<___T> where ___T: ::fidl_next::Transport {}
1251 }
1252}
1253
1254pub trait AdvisoryLockingClientHandler<___T: ::fidl_next::Transport> {}
1258
1259impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for AdvisoryLocking
1260where
1261 ___H: AdvisoryLockingClientHandler<___T> + Send,
1262 ___T: ::fidl_next::Transport,
1263
1264 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Response:
1265 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1266{
1267 async fn on_event(
1268 handler: &mut ___H,
1269 sender: &::fidl_next::ClientSender<Self, ___T>,
1270 ordinal: u64,
1271 buffer: ___T::RecvBuffer,
1272 ) {
1273 match ordinal {
1274 ordinal => {
1275 sender.close();
1276 }
1277 }
1278 }
1279}
1280
1281pub trait AdvisoryLockingServerHandler<___T: ::fidl_next::Transport> {
1285 #[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"]
1286 fn advisory_lock(
1287 &mut self,
1288 sender: &::fidl_next::ServerSender<AdvisoryLocking, ___T>,
1289
1290 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
1291
1292 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock>,
1293 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1294}
1295
1296impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for AdvisoryLocking
1297where
1298 ___H: AdvisoryLockingServerHandler<___T> + Send,
1299 ___T: ::fidl_next::Transport,
1300
1301 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Request:
1302 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1303{
1304 async fn on_one_way(
1305 handler: &mut ___H,
1306 sender: &::fidl_next::ServerSender<Self, ___T>,
1307 ordinal: u64,
1308 buffer: ___T::RecvBuffer,
1309 ) {
1310 match ordinal {
1311 ordinal => {
1312 sender.close();
1313 }
1314 }
1315 }
1316
1317 async fn on_two_way(
1318 handler: &mut ___H,
1319 sender: &::fidl_next::ServerSender<Self, ___T>,
1320 ordinal: u64,
1321 buffer: ___T::RecvBuffer,
1322 responder: ::fidl_next::protocol::Responder,
1323 ) {
1324 match ordinal {
1325 7992130864415541162 => {
1326 let responder = ::fidl_next::Responder::from_untyped(responder);
1327
1328 match ::fidl_next::DecoderExt::decode(buffer) {
1329 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
1330 Err(e) => {
1331 sender.close();
1332 }
1333 }
1334 }
1335
1336 ordinal => {
1337 sender.close();
1338 }
1339 }
1340 }
1341}
1342
1343::fidl_next::bitflags! {
1344 #[derive(
1345 Clone,
1346 Copy,
1347 Debug,
1348 PartialEq,
1349 Eq,
1350 Hash,
1351 )]
1352 pub struct AllocateMode: u32 {
1353 const KEEP_SIZE = 1;
1354 const UNSHARE_RANGE = 2;
1355 const PUNCH_HOLE = 4;
1356 const COLLAPSE_RANGE = 8;
1357 const ZERO_RANGE = 16;
1358 const INSERT_RANGE = 32;
1359 const _ = !0;
1360 }
1361}
1362
1363impl ::fidl_next::Encodable for AllocateMode {
1364 type Encoded = WireAllocateMode;
1365}
1366
1367unsafe impl<___E> ::fidl_next::Encode<___E> for AllocateMode
1368where
1369 ___E: ?Sized,
1370{
1371 #[inline]
1372 fn encode(
1373 self,
1374 encoder: &mut ___E,
1375 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1376 ) -> Result<(), ::fidl_next::EncodeError> {
1377 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1378 }
1379}
1380
1381unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllocateMode
1382where
1383 ___E: ?Sized,
1384{
1385 #[inline]
1386 fn encode_ref(
1387 &self,
1388 _: &mut ___E,
1389 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1390 ) -> Result<(), ::fidl_next::EncodeError> {
1391 ::fidl_next::munge!(let WireAllocateMode { value } = out);
1392 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1393 Ok(())
1394 }
1395}
1396
1397impl ::core::convert::From<WireAllocateMode> for AllocateMode {
1398 fn from(wire: WireAllocateMode) -> Self {
1399 Self::from_bits_retain(u32::from(wire.value))
1400 }
1401}
1402
1403impl ::fidl_next::FromWire<WireAllocateMode> for AllocateMode {
1404 #[inline]
1405 fn from_wire(wire: WireAllocateMode) -> Self {
1406 Self::from(wire)
1407 }
1408}
1409
1410impl ::fidl_next::FromWireRef<WireAllocateMode> for AllocateMode {
1411 #[inline]
1412 fn from_wire_ref(wire: &WireAllocateMode) -> Self {
1413 Self::from(*wire)
1414 }
1415}
1416
1417#[derive(Clone, Copy, Debug)]
1419#[repr(transparent)]
1420pub struct WireAllocateMode {
1421 value: ::fidl_next::WireU32,
1422}
1423
1424unsafe impl ::fidl_next::Wire for WireAllocateMode {
1425 type Decoded<'de> = Self;
1426
1427 #[inline]
1428 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1429 }
1431}
1432
1433unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllocateMode
1434where
1435 ___D: ?Sized,
1436{
1437 fn decode(
1438 slot: ::fidl_next::Slot<'_, Self>,
1439 _: &mut ___D,
1440 ) -> Result<(), ::fidl_next::DecodeError> {
1441 Ok(())
1442 }
1443}
1444
1445impl ::core::convert::From<AllocateMode> for WireAllocateMode {
1446 fn from(natural: AllocateMode) -> Self {
1447 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1448 }
1449}
1450
1451#[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"]
1452pub type Rights = crate::Operations;
1453
1454pub type WireRights = crate::WireOperations;
1456
1457#[derive(Debug, Default)]
1458pub struct ConnectionInfo {
1459 pub rights: Option<crate::Operations>,
1460}
1461
1462impl ConnectionInfo {
1463 fn __max_ordinal(&self) -> usize {
1464 if self.rights.is_some() {
1465 return 1;
1466 }
1467
1468 0
1469 }
1470}
1471
1472impl ::fidl_next::Encodable for ConnectionInfo {
1473 type Encoded = WireConnectionInfo<'static>;
1474}
1475
1476unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectionInfo
1477where
1478 ___E: ::fidl_next::Encoder + ?Sized,
1479
1480 ___E: ::fidl_next::fuchsia::HandleEncoder,
1481{
1482 #[inline]
1483 fn encode(
1484 mut self,
1485 encoder: &mut ___E,
1486 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1487 ) -> Result<(), ::fidl_next::EncodeError> {
1488 ::fidl_next::munge!(let WireConnectionInfo { table } = out);
1489
1490 let max_ord = self.__max_ordinal();
1491
1492 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1493 ::fidl_next::Wire::zero_padding(&mut out);
1494
1495 let mut preallocated =
1496 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1497
1498 for i in 1..=max_ord {
1499 match i {
1500 1 => {
1501 if let Some(rights) = self.rights.take() {
1502 ::fidl_next::WireEnvelope::encode_value(
1503 rights,
1504 preallocated.encoder,
1505 &mut out,
1506 )?;
1507 } else {
1508 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1509 }
1510 }
1511
1512 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1513 }
1514 unsafe {
1515 preallocated.write_next(out.assume_init_ref());
1516 }
1517 }
1518
1519 ::fidl_next::WireTable::encode_len(table, max_ord);
1520
1521 Ok(())
1522 }
1523}
1524
1525impl<'de> ::fidl_next::FromWire<WireConnectionInfo<'de>> for ConnectionInfo {
1526 #[inline]
1527 fn from_wire(wire: WireConnectionInfo<'de>) -> Self {
1528 let wire = ::core::mem::ManuallyDrop::new(wire);
1529
1530 let rights = wire.table.get(1);
1531
1532 Self {
1533 rights: rights.map(|envelope| {
1534 ::fidl_next::FromWire::from_wire(unsafe {
1535 envelope.read_unchecked::<crate::WireOperations>()
1536 })
1537 }),
1538 }
1539 }
1540}
1541
1542#[repr(C)]
1544pub struct WireConnectionInfo<'de> {
1545 table: ::fidl_next::WireTable<'de>,
1546}
1547
1548impl<'de> Drop for WireConnectionInfo<'de> {
1549 fn drop(&mut self) {
1550 let _ = self
1551 .table
1552 .get(1)
1553 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
1554 }
1555}
1556
1557unsafe impl ::fidl_next::Wire for WireConnectionInfo<'static> {
1558 type Decoded<'de> = WireConnectionInfo<'de>;
1559
1560 #[inline]
1561 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1562 ::fidl_next::munge!(let Self { table } = out);
1563 ::fidl_next::WireTable::zero_padding(table);
1564 }
1565}
1566
1567unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectionInfo<'static>
1568where
1569 ___D: ::fidl_next::Decoder + ?Sized,
1570
1571 ___D: ::fidl_next::fuchsia::HandleDecoder,
1572{
1573 fn decode(
1574 slot: ::fidl_next::Slot<'_, Self>,
1575 decoder: &mut ___D,
1576 ) -> Result<(), ::fidl_next::DecodeError> {
1577 ::fidl_next::munge!(let Self { table } = slot);
1578
1579 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1580 match ordinal {
1581 0 => unsafe { ::core::hint::unreachable_unchecked() },
1582
1583 1 => {
1584 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
1585 slot.as_mut(),
1586 decoder,
1587 )?;
1588
1589 Ok(())
1590 }
1591
1592 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1593 }
1594 })
1595 }
1596}
1597
1598impl<'de> WireConnectionInfo<'de> {
1599 pub fn rights(&self) -> Option<&crate::WireOperations> {
1600 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1601 }
1602}
1603
1604impl<'de> ::core::fmt::Debug for WireConnectionInfo<'de> {
1605 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1606 f.debug_struct("ConnectionInfo").field("rights", &self.rights()).finish()
1607 }
1608}
1609
1610#[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"]
1611pub type Id = u64;
1612
1613pub type WireId = ::fidl_next::WireU64;
1615
1616pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
1617
1618::fidl_next::bitflags! {
1619 #[doc = " DEPRECATED - Use Flags instead.\n"]#[derive(
1620 Clone,
1621 Copy,
1622 Debug,
1623 PartialEq,
1624 Eq,
1625 Hash,
1626 )]
1627 pub struct OpenFlags: u32 {
1628 #[doc = " Can read from target object.\n"]const RIGHT_READABLE = 1;
1629 #[doc = " Can write to target object.\n"]const RIGHT_WRITABLE = 2;
1630 #[doc = " Connection can map target object executable.\n"]const RIGHT_EXECUTABLE = 8;
1631 #[doc = " Create the object if it doesn\'t exist.\n"]const CREATE = 65536;
1632 #[doc = " (with Create) Fail if the object already exists.\n"]const CREATE_IF_ABSENT = 131072;
1633 #[doc = " Truncate the object before usage.\n"]const TRUNCATE = 262144;
1634 #[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;
1635 #[doc = " Seek to the end of the object before all writes.\n"]const APPEND = 1048576;
1636 #[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;
1637 #[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;
1638 #[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;
1639 #[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;
1640 #[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;
1641 #[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;
1642 #[doc = " Open the target object as a block device.\n"]const BLOCK_DEVICE = 16777216;
1643
1644 }
1645}
1646
1647impl ::fidl_next::Encodable for OpenFlags {
1648 type Encoded = WireOpenFlags;
1649}
1650
1651unsafe impl<___E> ::fidl_next::Encode<___E> for OpenFlags
1652where
1653 ___E: ?Sized,
1654{
1655 #[inline]
1656 fn encode(
1657 self,
1658 encoder: &mut ___E,
1659 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1660 ) -> Result<(), ::fidl_next::EncodeError> {
1661 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1662 }
1663}
1664
1665unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OpenFlags
1666where
1667 ___E: ?Sized,
1668{
1669 #[inline]
1670 fn encode_ref(
1671 &self,
1672 _: &mut ___E,
1673 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1674 ) -> Result<(), ::fidl_next::EncodeError> {
1675 ::fidl_next::munge!(let WireOpenFlags { value } = out);
1676 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1677 Ok(())
1678 }
1679}
1680
1681impl ::core::convert::From<WireOpenFlags> for OpenFlags {
1682 fn from(wire: WireOpenFlags) -> Self {
1683 Self::from_bits_retain(u32::from(wire.value))
1684 }
1685}
1686
1687impl ::fidl_next::FromWire<WireOpenFlags> for OpenFlags {
1688 #[inline]
1689 fn from_wire(wire: WireOpenFlags) -> Self {
1690 Self::from(wire)
1691 }
1692}
1693
1694impl ::fidl_next::FromWireRef<WireOpenFlags> for OpenFlags {
1695 #[inline]
1696 fn from_wire_ref(wire: &WireOpenFlags) -> Self {
1697 Self::from(*wire)
1698 }
1699}
1700
1701#[derive(Clone, Copy, Debug)]
1703#[repr(transparent)]
1704pub struct WireOpenFlags {
1705 value: ::fidl_next::WireU32,
1706}
1707
1708unsafe impl ::fidl_next::Wire for WireOpenFlags {
1709 type Decoded<'de> = Self;
1710
1711 #[inline]
1712 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1713 }
1715}
1716
1717unsafe impl<___D> ::fidl_next::Decode<___D> for WireOpenFlags
1718where
1719 ___D: ?Sized,
1720{
1721 fn decode(
1722 slot: ::fidl_next::Slot<'_, Self>,
1723 _: &mut ___D,
1724 ) -> Result<(), ::fidl_next::DecodeError> {
1725 ::fidl_next::munge!(let Self { value } = slot);
1726 let set = u32::from(*value);
1727 if set & !OpenFlags::all().bits() != 0 {
1728 return Err(::fidl_next::DecodeError::InvalidBits {
1729 expected: OpenFlags::all().bits() as usize,
1730 actual: set as usize,
1731 });
1732 }
1733
1734 Ok(())
1735 }
1736}
1737
1738impl ::core::convert::From<OpenFlags> for WireOpenFlags {
1739 fn from(natural: OpenFlags) -> Self {
1740 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1741 }
1742}
1743
1744#[doc = " NodeAttributes defines generic information about a filesystem node.\n"]
1745#[derive(Clone, Debug)]
1746pub struct NodeAttributes {
1747 pub mode: u32,
1748
1749 pub id: u64,
1750
1751 pub content_size: u64,
1752
1753 pub storage_size: u64,
1754
1755 pub link_count: u64,
1756
1757 pub creation_time: u64,
1758
1759 pub modification_time: u64,
1760}
1761
1762impl ::fidl_next::Encodable for NodeAttributes {
1763 type Encoded = WireNodeAttributes;
1764}
1765
1766unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes
1767where
1768 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1769{
1770 #[inline]
1771 fn encode(
1772 self,
1773 encoder: &mut ___E,
1774 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1775 ) -> Result<(), ::fidl_next::EncodeError> {
1776 ::fidl_next::munge! {
1777 let Self::Encoded {
1778 mode,
1779 id,
1780 content_size,
1781 storage_size,
1782 link_count,
1783 creation_time,
1784 modification_time,
1785
1786 } = out;
1787 }
1788
1789 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
1790
1791 ::fidl_next::Encode::encode(self.id, encoder, id)?;
1792
1793 ::fidl_next::Encode::encode(self.content_size, encoder, content_size)?;
1794
1795 ::fidl_next::Encode::encode(self.storage_size, encoder, storage_size)?;
1796
1797 ::fidl_next::Encode::encode(self.link_count, encoder, link_count)?;
1798
1799 ::fidl_next::Encode::encode(self.creation_time, encoder, creation_time)?;
1800
1801 ::fidl_next::Encode::encode(self.modification_time, encoder, modification_time)?;
1802
1803 Ok(())
1804 }
1805}
1806
1807unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes
1808where
1809 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1810{
1811 #[inline]
1812 fn encode_ref(
1813 &self,
1814 encoder: &mut ___E,
1815 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1816 ) -> Result<(), ::fidl_next::EncodeError> {
1817 ::fidl_next::munge! {
1818 let Self::Encoded {
1819 mode,
1820 id,
1821 content_size,
1822 storage_size,
1823 link_count,
1824 creation_time,
1825 modification_time,
1826
1827 } = out;
1828 }
1829
1830 ::fidl_next::EncodeRef::encode_ref(&self.mode, encoder, mode)?;
1831
1832 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
1833
1834 ::fidl_next::EncodeRef::encode_ref(&self.content_size, encoder, content_size)?;
1835
1836 ::fidl_next::EncodeRef::encode_ref(&self.storage_size, encoder, storage_size)?;
1837
1838 ::fidl_next::EncodeRef::encode_ref(&self.link_count, encoder, link_count)?;
1839
1840 ::fidl_next::EncodeRef::encode_ref(&self.creation_time, encoder, creation_time)?;
1841
1842 ::fidl_next::EncodeRef::encode_ref(&self.modification_time, encoder, modification_time)?;
1843
1844 Ok(())
1845 }
1846}
1847
1848impl ::fidl_next::EncodableOption for NodeAttributes {
1849 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes>;
1850}
1851
1852unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes
1853where
1854 ___E: ::fidl_next::Encoder + ?Sized,
1855 NodeAttributes: ::fidl_next::Encode<___E>,
1856{
1857 #[inline]
1858 fn encode_option(
1859 this: Option<Self>,
1860 encoder: &mut ___E,
1861 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1862 ) -> Result<(), ::fidl_next::EncodeError> {
1863 if let Some(inner) = this {
1864 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1865 ::fidl_next::WireBox::encode_present(out);
1866 } else {
1867 ::fidl_next::WireBox::encode_absent(out);
1868 }
1869
1870 Ok(())
1871 }
1872}
1873
1874unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes
1875where
1876 ___E: ::fidl_next::Encoder + ?Sized,
1877 NodeAttributes: ::fidl_next::EncodeRef<___E>,
1878{
1879 #[inline]
1880 fn encode_option_ref(
1881 this: Option<&Self>,
1882 encoder: &mut ___E,
1883 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1884 ) -> Result<(), ::fidl_next::EncodeError> {
1885 if let Some(inner) = this {
1886 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1887 ::fidl_next::WireBox::encode_present(out);
1888 } else {
1889 ::fidl_next::WireBox::encode_absent(out);
1890 }
1891
1892 Ok(())
1893 }
1894}
1895
1896impl ::fidl_next::FromWire<WireNodeAttributes> for NodeAttributes {
1897 #[inline]
1898 fn from_wire(wire: WireNodeAttributes) -> Self {
1899 Self {
1900 mode: ::fidl_next::FromWire::from_wire(wire.mode),
1901
1902 id: ::fidl_next::FromWire::from_wire(wire.id),
1903
1904 content_size: ::fidl_next::FromWire::from_wire(wire.content_size),
1905
1906 storage_size: ::fidl_next::FromWire::from_wire(wire.storage_size),
1907
1908 link_count: ::fidl_next::FromWire::from_wire(wire.link_count),
1909
1910 creation_time: ::fidl_next::FromWire::from_wire(wire.creation_time),
1911
1912 modification_time: ::fidl_next::FromWire::from_wire(wire.modification_time),
1913 }
1914 }
1915}
1916
1917impl ::fidl_next::FromWireRef<WireNodeAttributes> for NodeAttributes {
1918 #[inline]
1919 fn from_wire_ref(wire: &WireNodeAttributes) -> Self {
1920 Self {
1921 mode: ::fidl_next::FromWireRef::from_wire_ref(&wire.mode),
1922
1923 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
1924
1925 content_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.content_size),
1926
1927 storage_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.storage_size),
1928
1929 link_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.link_count),
1930
1931 creation_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.creation_time),
1932
1933 modification_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.modification_time),
1934 }
1935 }
1936}
1937
1938#[derive(Clone, Debug)]
1940#[repr(C)]
1941pub struct WireNodeAttributes {
1942 pub mode: ::fidl_next::WireU32,
1943
1944 pub id: ::fidl_next::WireU64,
1945
1946 pub content_size: ::fidl_next::WireU64,
1947
1948 pub storage_size: ::fidl_next::WireU64,
1949
1950 pub link_count: ::fidl_next::WireU64,
1951
1952 pub creation_time: ::fidl_next::WireU64,
1953
1954 pub modification_time: ::fidl_next::WireU64,
1955}
1956
1957unsafe impl ::fidl_next::Wire for WireNodeAttributes {
1958 type Decoded<'de> = WireNodeAttributes;
1959
1960 #[inline]
1961 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1962 unsafe {
1963 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1964 }
1965 }
1966}
1967
1968unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes
1969where
1970 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1971{
1972 fn decode(
1973 slot: ::fidl_next::Slot<'_, Self>,
1974 decoder: &mut ___D,
1975 ) -> Result<(), ::fidl_next::DecodeError> {
1976 ::fidl_next::munge! {
1977 let Self {
1978 mut mode,
1979 mut id,
1980 mut content_size,
1981 mut storage_size,
1982 mut link_count,
1983 mut creation_time,
1984 mut modification_time,
1985
1986 } = slot;
1987 }
1988
1989 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
1990
1991 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
1992
1993 ::fidl_next::Decode::decode(content_size.as_mut(), decoder)?;
1994
1995 ::fidl_next::Decode::decode(storage_size.as_mut(), decoder)?;
1996
1997 ::fidl_next::Decode::decode(link_count.as_mut(), decoder)?;
1998
1999 ::fidl_next::Decode::decode(creation_time.as_mut(), decoder)?;
2000
2001 ::fidl_next::Decode::decode(modification_time.as_mut(), decoder)?;
2002
2003 Ok(())
2004 }
2005}
2006
2007::fidl_next::bitflags! {
2008 #[doc = " The fields of \'attributes\' which are used to update the Node are indicated\n by the \'flags\' argument.\n"]#[derive(
2009 Clone,
2010 Copy,
2011 Debug,
2012 PartialEq,
2013 Eq,
2014 Hash,
2015 )]
2016 pub struct NodeAttributeFlags: u32 {
2017 const CREATION_TIME = 1;
2018 const MODIFICATION_TIME = 2;
2019
2020 }
2021}
2022
2023impl ::fidl_next::Encodable for NodeAttributeFlags {
2024 type Encoded = WireNodeAttributeFlags;
2025}
2026
2027unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributeFlags
2028where
2029 ___E: ?Sized,
2030{
2031 #[inline]
2032 fn encode(
2033 self,
2034 encoder: &mut ___E,
2035 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2036 ) -> Result<(), ::fidl_next::EncodeError> {
2037 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2038 }
2039}
2040
2041unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributeFlags
2042where
2043 ___E: ?Sized,
2044{
2045 #[inline]
2046 fn encode_ref(
2047 &self,
2048 _: &mut ___E,
2049 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2050 ) -> Result<(), ::fidl_next::EncodeError> {
2051 ::fidl_next::munge!(let WireNodeAttributeFlags { value } = out);
2052 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2053 Ok(())
2054 }
2055}
2056
2057impl ::core::convert::From<WireNodeAttributeFlags> for NodeAttributeFlags {
2058 fn from(wire: WireNodeAttributeFlags) -> Self {
2059 Self::from_bits_retain(u32::from(wire.value))
2060 }
2061}
2062
2063impl ::fidl_next::FromWire<WireNodeAttributeFlags> for NodeAttributeFlags {
2064 #[inline]
2065 fn from_wire(wire: WireNodeAttributeFlags) -> Self {
2066 Self::from(wire)
2067 }
2068}
2069
2070impl ::fidl_next::FromWireRef<WireNodeAttributeFlags> for NodeAttributeFlags {
2071 #[inline]
2072 fn from_wire_ref(wire: &WireNodeAttributeFlags) -> Self {
2073 Self::from(*wire)
2074 }
2075}
2076
2077#[derive(Clone, Copy, Debug)]
2079#[repr(transparent)]
2080pub struct WireNodeAttributeFlags {
2081 value: ::fidl_next::WireU32,
2082}
2083
2084unsafe impl ::fidl_next::Wire for WireNodeAttributeFlags {
2085 type Decoded<'de> = Self;
2086
2087 #[inline]
2088 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2089 }
2091}
2092
2093unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributeFlags
2094where
2095 ___D: ?Sized,
2096{
2097 fn decode(
2098 slot: ::fidl_next::Slot<'_, Self>,
2099 _: &mut ___D,
2100 ) -> Result<(), ::fidl_next::DecodeError> {
2101 ::fidl_next::munge!(let Self { value } = slot);
2102 let set = u32::from(*value);
2103 if set & !NodeAttributeFlags::all().bits() != 0 {
2104 return Err(::fidl_next::DecodeError::InvalidBits {
2105 expected: NodeAttributeFlags::all().bits() as usize,
2106 actual: set as usize,
2107 });
2108 }
2109
2110 Ok(())
2111 }
2112}
2113
2114impl ::core::convert::From<NodeAttributeFlags> for WireNodeAttributeFlags {
2115 fn from(natural: NodeAttributeFlags) -> Self {
2116 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2117 }
2118}
2119
2120#[derive(Clone, Debug)]
2121pub struct NodeQueryFilesystemResponse {
2122 pub s: i32,
2123
2124 pub info: Option<Box<crate::FilesystemInfo>>,
2125}
2126
2127impl ::fidl_next::Encodable for NodeQueryFilesystemResponse {
2128 type Encoded = WireNodeQueryFilesystemResponse<'static>;
2129}
2130
2131unsafe impl<___E> ::fidl_next::Encode<___E> for NodeQueryFilesystemResponse
2132where
2133 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2134
2135 ___E: ::fidl_next::Encoder,
2136{
2137 #[inline]
2138 fn encode(
2139 self,
2140 encoder: &mut ___E,
2141 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2142 ) -> Result<(), ::fidl_next::EncodeError> {
2143 ::fidl_next::munge! {
2144 let Self::Encoded {
2145 s,
2146 info,
2147
2148 } = out;
2149 }
2150
2151 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2152
2153 ::fidl_next::Encode::encode(self.info, encoder, info)?;
2154
2155 Ok(())
2156 }
2157}
2158
2159unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeQueryFilesystemResponse
2160where
2161 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2162
2163 ___E: ::fidl_next::Encoder,
2164{
2165 #[inline]
2166 fn encode_ref(
2167 &self,
2168 encoder: &mut ___E,
2169 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2170 ) -> Result<(), ::fidl_next::EncodeError> {
2171 ::fidl_next::munge! {
2172 let Self::Encoded {
2173 s,
2174 info,
2175
2176 } = out;
2177 }
2178
2179 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2180
2181 ::fidl_next::EncodeRef::encode_ref(&self.info, encoder, info)?;
2182
2183 Ok(())
2184 }
2185}
2186
2187impl ::fidl_next::EncodableOption for NodeQueryFilesystemResponse {
2188 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeQueryFilesystemResponse<'static>>;
2189}
2190
2191unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeQueryFilesystemResponse
2192where
2193 ___E: ::fidl_next::Encoder + ?Sized,
2194 NodeQueryFilesystemResponse: ::fidl_next::Encode<___E>,
2195{
2196 #[inline]
2197 fn encode_option(
2198 this: Option<Self>,
2199 encoder: &mut ___E,
2200 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2201 ) -> Result<(), ::fidl_next::EncodeError> {
2202 if let Some(inner) = this {
2203 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2204 ::fidl_next::WireBox::encode_present(out);
2205 } else {
2206 ::fidl_next::WireBox::encode_absent(out);
2207 }
2208
2209 Ok(())
2210 }
2211}
2212
2213unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeQueryFilesystemResponse
2214where
2215 ___E: ::fidl_next::Encoder + ?Sized,
2216 NodeQueryFilesystemResponse: ::fidl_next::EncodeRef<___E>,
2217{
2218 #[inline]
2219 fn encode_option_ref(
2220 this: Option<&Self>,
2221 encoder: &mut ___E,
2222 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2223 ) -> Result<(), ::fidl_next::EncodeError> {
2224 if let Some(inner) = this {
2225 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2226 ::fidl_next::WireBox::encode_present(out);
2227 } else {
2228 ::fidl_next::WireBox::encode_absent(out);
2229 }
2230
2231 Ok(())
2232 }
2233}
2234
2235impl<'de> ::fidl_next::FromWire<WireNodeQueryFilesystemResponse<'de>>
2236 for NodeQueryFilesystemResponse
2237{
2238 #[inline]
2239 fn from_wire(wire: WireNodeQueryFilesystemResponse<'de>) -> Self {
2240 Self {
2241 s: ::fidl_next::FromWire::from_wire(wire.s),
2242
2243 info: ::fidl_next::FromWire::from_wire(wire.info),
2244 }
2245 }
2246}
2247
2248impl<'de> ::fidl_next::FromWireRef<WireNodeQueryFilesystemResponse<'de>>
2249 for NodeQueryFilesystemResponse
2250{
2251 #[inline]
2252 fn from_wire_ref(wire: &WireNodeQueryFilesystemResponse<'de>) -> Self {
2253 Self {
2254 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2255
2256 info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info),
2257 }
2258 }
2259}
2260
2261#[derive(Debug)]
2263#[repr(C)]
2264pub struct WireNodeQueryFilesystemResponse<'de> {
2265 pub s: ::fidl_next::WireI32,
2266
2267 pub info: ::fidl_next::WireBox<'de, crate::WireFilesystemInfo>,
2268}
2269
2270unsafe impl ::fidl_next::Wire for WireNodeQueryFilesystemResponse<'static> {
2271 type Decoded<'de> = WireNodeQueryFilesystemResponse<'de>;
2272
2273 #[inline]
2274 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2275 unsafe {
2276 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2277 }
2278 }
2279}
2280
2281unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeQueryFilesystemResponse<'static>
2282where
2283 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2284
2285 ___D: ::fidl_next::Decoder,
2286{
2287 fn decode(
2288 slot: ::fidl_next::Slot<'_, Self>,
2289 decoder: &mut ___D,
2290 ) -> Result<(), ::fidl_next::DecodeError> {
2291 ::fidl_next::munge! {
2292 let Self {
2293 mut s,
2294 mut info,
2295
2296 } = slot;
2297 }
2298
2299 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2300
2301 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
2302
2303 Ok(())
2304 }
2305}
2306
2307pub type NodeUpdateAttributesResponse = ();
2308
2309pub type WireNodeUpdateAttributesResponse = ();
2311
2312pub type NodeSyncResponse = ();
2313
2314pub type WireNodeSyncResponse = ();
2316
2317::fidl_next::bitflags! {
2318 #[derive(
2319 Clone,
2320 Copy,
2321 Debug,
2322 PartialEq,
2323 Eq,
2324 Hash,
2325 )]
2326 pub struct ModeType: u32 {
2327 const DO_NOT_USE = 2147483648;
2328
2329 }
2330}
2331
2332impl ::fidl_next::Encodable for ModeType {
2333 type Encoded = WireModeType;
2334}
2335
2336unsafe impl<___E> ::fidl_next::Encode<___E> for ModeType
2337where
2338 ___E: ?Sized,
2339{
2340 #[inline]
2341 fn encode(
2342 self,
2343 encoder: &mut ___E,
2344 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2345 ) -> Result<(), ::fidl_next::EncodeError> {
2346 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2347 }
2348}
2349
2350unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ModeType
2351where
2352 ___E: ?Sized,
2353{
2354 #[inline]
2355 fn encode_ref(
2356 &self,
2357 _: &mut ___E,
2358 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2359 ) -> Result<(), ::fidl_next::EncodeError> {
2360 ::fidl_next::munge!(let WireModeType { value } = out);
2361 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2362 Ok(())
2363 }
2364}
2365
2366impl ::core::convert::From<WireModeType> for ModeType {
2367 fn from(wire: WireModeType) -> Self {
2368 Self::from_bits_retain(u32::from(wire.value))
2369 }
2370}
2371
2372impl ::fidl_next::FromWire<WireModeType> for ModeType {
2373 #[inline]
2374 fn from_wire(wire: WireModeType) -> Self {
2375 Self::from(wire)
2376 }
2377}
2378
2379impl ::fidl_next::FromWireRef<WireModeType> for ModeType {
2380 #[inline]
2381 fn from_wire_ref(wire: &WireModeType) -> Self {
2382 Self::from(*wire)
2383 }
2384}
2385
2386#[derive(Clone, Copy, Debug)]
2388#[repr(transparent)]
2389pub struct WireModeType {
2390 value: ::fidl_next::WireU32,
2391}
2392
2393unsafe impl ::fidl_next::Wire for WireModeType {
2394 type Decoded<'de> = Self;
2395
2396 #[inline]
2397 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2398 }
2400}
2401
2402unsafe impl<___D> ::fidl_next::Decode<___D> for WireModeType
2403where
2404 ___D: ?Sized,
2405{
2406 fn decode(
2407 slot: ::fidl_next::Slot<'_, Self>,
2408 _: &mut ___D,
2409 ) -> Result<(), ::fidl_next::DecodeError> {
2410 ::fidl_next::munge!(let Self { value } = slot);
2411 let set = u32::from(*value);
2412 if set & !ModeType::all().bits() != 0 {
2413 return Err(::fidl_next::DecodeError::InvalidBits {
2414 expected: ModeType::all().bits() as usize,
2415 actual: set as usize,
2416 });
2417 }
2418
2419 Ok(())
2420 }
2421}
2422
2423impl ::core::convert::From<ModeType> for WireModeType {
2424 fn from(natural: ModeType) -> Self {
2425 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2426 }
2427}
2428
2429#[doc = " The maximum length, in bytes, of a filesystem path.\n"]
2430pub const MAX_PATH_LENGTH: u64 = 4095;
2431
2432#[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"]
2433pub type Path = String;
2434
2435pub type WirePath<'de> = ::fidl_next::WireString<'de>;
2437
2438#[derive(Clone, Debug)]
2439#[repr(C)]
2440pub struct DirectoryReadDirentsRequest {
2441 pub max_bytes: u64,
2442}
2443
2444impl ::fidl_next::Encodable for DirectoryReadDirentsRequest {
2445 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryReadDirentsRequest> = unsafe {
2446 ::fidl_next::CopyOptimization::enable_if(
2447 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2448 )
2449 };
2450
2451 type Encoded = WireDirectoryReadDirentsRequest;
2452}
2453
2454unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsRequest
2455where
2456 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2457{
2458 #[inline]
2459 fn encode(
2460 self,
2461 encoder: &mut ___E,
2462 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2463 ) -> Result<(), ::fidl_next::EncodeError> {
2464 ::fidl_next::munge! {
2465 let Self::Encoded {
2466 max_bytes,
2467
2468 } = out;
2469 }
2470
2471 ::fidl_next::Encode::encode(self.max_bytes, encoder, max_bytes)?;
2472
2473 Ok(())
2474 }
2475}
2476
2477unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsRequest
2478where
2479 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2480{
2481 #[inline]
2482 fn encode_ref(
2483 &self,
2484 encoder: &mut ___E,
2485 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2486 ) -> Result<(), ::fidl_next::EncodeError> {
2487 ::fidl_next::munge! {
2488 let Self::Encoded {
2489 max_bytes,
2490
2491 } = out;
2492 }
2493
2494 ::fidl_next::EncodeRef::encode_ref(&self.max_bytes, encoder, max_bytes)?;
2495
2496 Ok(())
2497 }
2498}
2499
2500impl ::fidl_next::EncodableOption for DirectoryReadDirentsRequest {
2501 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsRequest>;
2502}
2503
2504unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsRequest
2505where
2506 ___E: ::fidl_next::Encoder + ?Sized,
2507 DirectoryReadDirentsRequest: ::fidl_next::Encode<___E>,
2508{
2509 #[inline]
2510 fn encode_option(
2511 this: Option<Self>,
2512 encoder: &mut ___E,
2513 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2514 ) -> Result<(), ::fidl_next::EncodeError> {
2515 if let Some(inner) = this {
2516 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2517 ::fidl_next::WireBox::encode_present(out);
2518 } else {
2519 ::fidl_next::WireBox::encode_absent(out);
2520 }
2521
2522 Ok(())
2523 }
2524}
2525
2526unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsRequest
2527where
2528 ___E: ::fidl_next::Encoder + ?Sized,
2529 DirectoryReadDirentsRequest: ::fidl_next::EncodeRef<___E>,
2530{
2531 #[inline]
2532 fn encode_option_ref(
2533 this: Option<&Self>,
2534 encoder: &mut ___E,
2535 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2536 ) -> Result<(), ::fidl_next::EncodeError> {
2537 if let Some(inner) = this {
2538 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2539 ::fidl_next::WireBox::encode_present(out);
2540 } else {
2541 ::fidl_next::WireBox::encode_absent(out);
2542 }
2543
2544 Ok(())
2545 }
2546}
2547
2548impl ::fidl_next::FromWire<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2549 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryReadDirentsRequest, Self> = unsafe {
2550 ::fidl_next::CopyOptimization::enable_if(
2551 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2552 .is_enabled(),
2553 )
2554 };
2555
2556 #[inline]
2557 fn from_wire(wire: WireDirectoryReadDirentsRequest) -> Self {
2558 Self { max_bytes: ::fidl_next::FromWire::from_wire(wire.max_bytes) }
2559 }
2560}
2561
2562impl ::fidl_next::FromWireRef<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2563 #[inline]
2564 fn from_wire_ref(wire: &WireDirectoryReadDirentsRequest) -> Self {
2565 Self { max_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_bytes) }
2566 }
2567}
2568
2569#[derive(Clone, Debug)]
2571#[repr(C)]
2572pub struct WireDirectoryReadDirentsRequest {
2573 pub max_bytes: ::fidl_next::WireU64,
2574}
2575
2576unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsRequest {
2577 type Decoded<'de> = WireDirectoryReadDirentsRequest;
2578
2579 #[inline]
2580 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2581}
2582
2583unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsRequest
2584where
2585 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2586{
2587 fn decode(
2588 slot: ::fidl_next::Slot<'_, Self>,
2589 decoder: &mut ___D,
2590 ) -> Result<(), ::fidl_next::DecodeError> {
2591 ::fidl_next::munge! {
2592 let Self {
2593 mut max_bytes,
2594
2595 } = slot;
2596 }
2597
2598 ::fidl_next::Decode::decode(max_bytes.as_mut(), decoder)?;
2599
2600 Ok(())
2601 }
2602}
2603
2604#[doc = " The maximal buffer size which can be transmitted for buffered operations.\n This capacity is currently set somewhat arbitrarily.\n"]
2605pub const MAX_BUF: u64 = 8192;
2606
2607#[derive(Clone, Debug)]
2608pub struct DirectoryReadDirentsResponse {
2609 pub s: i32,
2610
2611 pub dirents: Vec<u8>,
2612}
2613
2614impl ::fidl_next::Encodable for DirectoryReadDirentsResponse {
2615 type Encoded = WireDirectoryReadDirentsResponse<'static>;
2616}
2617
2618unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsResponse
2619where
2620 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2621
2622 ___E: ::fidl_next::Encoder,
2623{
2624 #[inline]
2625 fn encode(
2626 self,
2627 encoder: &mut ___E,
2628 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2629 ) -> Result<(), ::fidl_next::EncodeError> {
2630 ::fidl_next::munge! {
2631 let Self::Encoded {
2632 s,
2633 dirents,
2634
2635 } = out;
2636 }
2637
2638 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2639
2640 ::fidl_next::Encode::encode(self.dirents, encoder, dirents)?;
2641
2642 Ok(())
2643 }
2644}
2645
2646unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsResponse
2647where
2648 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2649
2650 ___E: ::fidl_next::Encoder,
2651{
2652 #[inline]
2653 fn encode_ref(
2654 &self,
2655 encoder: &mut ___E,
2656 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2657 ) -> Result<(), ::fidl_next::EncodeError> {
2658 ::fidl_next::munge! {
2659 let Self::Encoded {
2660 s,
2661 dirents,
2662
2663 } = out;
2664 }
2665
2666 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2667
2668 ::fidl_next::EncodeRef::encode_ref(&self.dirents, encoder, dirents)?;
2669
2670 Ok(())
2671 }
2672}
2673
2674impl ::fidl_next::EncodableOption for DirectoryReadDirentsResponse {
2675 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsResponse<'static>>;
2676}
2677
2678unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsResponse
2679where
2680 ___E: ::fidl_next::Encoder + ?Sized,
2681 DirectoryReadDirentsResponse: ::fidl_next::Encode<___E>,
2682{
2683 #[inline]
2684 fn encode_option(
2685 this: Option<Self>,
2686 encoder: &mut ___E,
2687 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2688 ) -> Result<(), ::fidl_next::EncodeError> {
2689 if let Some(inner) = this {
2690 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2691 ::fidl_next::WireBox::encode_present(out);
2692 } else {
2693 ::fidl_next::WireBox::encode_absent(out);
2694 }
2695
2696 Ok(())
2697 }
2698}
2699
2700unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsResponse
2701where
2702 ___E: ::fidl_next::Encoder + ?Sized,
2703 DirectoryReadDirentsResponse: ::fidl_next::EncodeRef<___E>,
2704{
2705 #[inline]
2706 fn encode_option_ref(
2707 this: Option<&Self>,
2708 encoder: &mut ___E,
2709 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2710 ) -> Result<(), ::fidl_next::EncodeError> {
2711 if let Some(inner) = this {
2712 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2713 ::fidl_next::WireBox::encode_present(out);
2714 } else {
2715 ::fidl_next::WireBox::encode_absent(out);
2716 }
2717
2718 Ok(())
2719 }
2720}
2721
2722impl<'de> ::fidl_next::FromWire<WireDirectoryReadDirentsResponse<'de>>
2723 for DirectoryReadDirentsResponse
2724{
2725 #[inline]
2726 fn from_wire(wire: WireDirectoryReadDirentsResponse<'de>) -> Self {
2727 Self {
2728 s: ::fidl_next::FromWire::from_wire(wire.s),
2729
2730 dirents: ::fidl_next::FromWire::from_wire(wire.dirents),
2731 }
2732 }
2733}
2734
2735impl<'de> ::fidl_next::FromWireRef<WireDirectoryReadDirentsResponse<'de>>
2736 for DirectoryReadDirentsResponse
2737{
2738 #[inline]
2739 fn from_wire_ref(wire: &WireDirectoryReadDirentsResponse<'de>) -> Self {
2740 Self {
2741 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2742
2743 dirents: ::fidl_next::FromWireRef::from_wire_ref(&wire.dirents),
2744 }
2745 }
2746}
2747
2748#[derive(Debug)]
2750#[repr(C)]
2751pub struct WireDirectoryReadDirentsResponse<'de> {
2752 pub s: ::fidl_next::WireI32,
2753
2754 pub dirents: ::fidl_next::WireVector<'de, u8>,
2755}
2756
2757unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsResponse<'static> {
2758 type Decoded<'de> = WireDirectoryReadDirentsResponse<'de>;
2759
2760 #[inline]
2761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2762 unsafe {
2763 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2764 }
2765 }
2766}
2767
2768unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsResponse<'static>
2769where
2770 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2771
2772 ___D: ::fidl_next::Decoder,
2773{
2774 fn decode(
2775 slot: ::fidl_next::Slot<'_, Self>,
2776 decoder: &mut ___D,
2777 ) -> Result<(), ::fidl_next::DecodeError> {
2778 ::fidl_next::munge! {
2779 let Self {
2780 mut s,
2781 mut dirents,
2782
2783 } = slot;
2784 }
2785
2786 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2787
2788 ::fidl_next::Decode::decode(dirents.as_mut(), decoder)?;
2789
2790 let dirents = unsafe { dirents.deref_unchecked() };
2791
2792 if dirents.len() > 8192 {
2793 return Err(::fidl_next::DecodeError::VectorTooLong {
2794 size: dirents.len() as u64,
2795 limit: 8192,
2796 });
2797 }
2798
2799 Ok(())
2800 }
2801}
2802
2803#[derive(Clone, Debug)]
2804#[repr(C)]
2805pub struct DirectoryRewindResponse {
2806 pub s: i32,
2807}
2808
2809impl ::fidl_next::Encodable for DirectoryRewindResponse {
2810 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryRewindResponse> = unsafe {
2811 ::fidl_next::CopyOptimization::enable_if(
2812 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2813 )
2814 };
2815
2816 type Encoded = WireDirectoryRewindResponse;
2817}
2818
2819unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRewindResponse
2820where
2821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2822{
2823 #[inline]
2824 fn encode(
2825 self,
2826 encoder: &mut ___E,
2827 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2828 ) -> Result<(), ::fidl_next::EncodeError> {
2829 ::fidl_next::munge! {
2830 let Self::Encoded {
2831 s,
2832
2833 } = out;
2834 }
2835
2836 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2837
2838 Ok(())
2839 }
2840}
2841
2842unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryRewindResponse
2843where
2844 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2845{
2846 #[inline]
2847 fn encode_ref(
2848 &self,
2849 encoder: &mut ___E,
2850 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2851 ) -> Result<(), ::fidl_next::EncodeError> {
2852 ::fidl_next::munge! {
2853 let Self::Encoded {
2854 s,
2855
2856 } = out;
2857 }
2858
2859 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2860
2861 Ok(())
2862 }
2863}
2864
2865impl ::fidl_next::EncodableOption for DirectoryRewindResponse {
2866 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRewindResponse>;
2867}
2868
2869unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRewindResponse
2870where
2871 ___E: ::fidl_next::Encoder + ?Sized,
2872 DirectoryRewindResponse: ::fidl_next::Encode<___E>,
2873{
2874 #[inline]
2875 fn encode_option(
2876 this: Option<Self>,
2877 encoder: &mut ___E,
2878 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2879 ) -> Result<(), ::fidl_next::EncodeError> {
2880 if let Some(inner) = this {
2881 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2882 ::fidl_next::WireBox::encode_present(out);
2883 } else {
2884 ::fidl_next::WireBox::encode_absent(out);
2885 }
2886
2887 Ok(())
2888 }
2889}
2890
2891unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryRewindResponse
2892where
2893 ___E: ::fidl_next::Encoder + ?Sized,
2894 DirectoryRewindResponse: ::fidl_next::EncodeRef<___E>,
2895{
2896 #[inline]
2897 fn encode_option_ref(
2898 this: Option<&Self>,
2899 encoder: &mut ___E,
2900 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2901 ) -> Result<(), ::fidl_next::EncodeError> {
2902 if let Some(inner) = this {
2903 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2904 ::fidl_next::WireBox::encode_present(out);
2905 } else {
2906 ::fidl_next::WireBox::encode_absent(out);
2907 }
2908
2909 Ok(())
2910 }
2911}
2912
2913impl ::fidl_next::FromWire<WireDirectoryRewindResponse> for DirectoryRewindResponse {
2914 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryRewindResponse, Self> = unsafe {
2915 ::fidl_next::CopyOptimization::enable_if(
2916 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
2917 .is_enabled(),
2918 )
2919 };
2920
2921 #[inline]
2922 fn from_wire(wire: WireDirectoryRewindResponse) -> Self {
2923 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
2924 }
2925}
2926
2927impl ::fidl_next::FromWireRef<WireDirectoryRewindResponse> for DirectoryRewindResponse {
2928 #[inline]
2929 fn from_wire_ref(wire: &WireDirectoryRewindResponse) -> Self {
2930 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
2931 }
2932}
2933
2934#[derive(Clone, Debug)]
2936#[repr(C)]
2937pub struct WireDirectoryRewindResponse {
2938 pub s: ::fidl_next::WireI32,
2939}
2940
2941unsafe impl ::fidl_next::Wire for WireDirectoryRewindResponse {
2942 type Decoded<'de> = WireDirectoryRewindResponse;
2943
2944 #[inline]
2945 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2946}
2947
2948unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRewindResponse
2949where
2950 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2951{
2952 fn decode(
2953 slot: ::fidl_next::Slot<'_, Self>,
2954 decoder: &mut ___D,
2955 ) -> Result<(), ::fidl_next::DecodeError> {
2956 ::fidl_next::munge! {
2957 let Self {
2958 mut s,
2959
2960 } = slot;
2961 }
2962
2963 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2964
2965 Ok(())
2966 }
2967}
2968
2969#[derive(Debug)]
2970#[repr(C)]
2971pub struct DirectoryGetTokenResponse {
2972 pub s: i32,
2973
2974 pub token: Option<::fidl_next::fuchsia::zx::Handle>,
2975}
2976
2977impl ::fidl_next::Encodable for DirectoryGetTokenResponse {
2978 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryGetTokenResponse> = unsafe {
2979 ::fidl_next::CopyOptimization::enable_if(
2980 true
2981
2982 && <
2983 i32 as ::fidl_next::Encodable
2984 >::COPY_OPTIMIZATION.is_enabled()
2985
2986 && <
2987 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
2988 >::COPY_OPTIMIZATION.is_enabled()
2989
2990 )
2991 };
2992
2993 type Encoded = WireDirectoryGetTokenResponse;
2994}
2995
2996unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryGetTokenResponse
2997where
2998 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2999
3000 ___E: ::fidl_next::fuchsia::HandleEncoder,
3001{
3002 #[inline]
3003 fn encode(
3004 self,
3005 encoder: &mut ___E,
3006 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3007 ) -> Result<(), ::fidl_next::EncodeError> {
3008 ::fidl_next::munge! {
3009 let Self::Encoded {
3010 s,
3011 token,
3012
3013 } = out;
3014 }
3015
3016 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3017
3018 ::fidl_next::Encode::encode(self.token, encoder, token)?;
3019
3020 Ok(())
3021 }
3022}
3023
3024impl ::fidl_next::EncodableOption for DirectoryGetTokenResponse {
3025 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryGetTokenResponse>;
3026}
3027
3028unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryGetTokenResponse
3029where
3030 ___E: ::fidl_next::Encoder + ?Sized,
3031 DirectoryGetTokenResponse: ::fidl_next::Encode<___E>,
3032{
3033 #[inline]
3034 fn encode_option(
3035 this: Option<Self>,
3036 encoder: &mut ___E,
3037 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3038 ) -> Result<(), ::fidl_next::EncodeError> {
3039 if let Some(inner) = this {
3040 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3041 ::fidl_next::WireBox::encode_present(out);
3042 } else {
3043 ::fidl_next::WireBox::encode_absent(out);
3044 }
3045
3046 Ok(())
3047 }
3048}
3049
3050impl ::fidl_next::FromWire<WireDirectoryGetTokenResponse> for DirectoryGetTokenResponse {
3051 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryGetTokenResponse, Self> = unsafe {
3052 ::fidl_next::CopyOptimization::enable_if(
3053 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3054 .is_enabled()
3055 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
3056 ::fidl_next::fuchsia::WireOptionalHandle,
3057 >>::COPY_OPTIMIZATION
3058 .is_enabled(),
3059 )
3060 };
3061
3062 #[inline]
3063 fn from_wire(wire: WireDirectoryGetTokenResponse) -> Self {
3064 Self {
3065 s: ::fidl_next::FromWire::from_wire(wire.s),
3066
3067 token: ::fidl_next::FromWire::from_wire(wire.token),
3068 }
3069 }
3070}
3071
3072#[derive(Debug)]
3074#[repr(C)]
3075pub struct WireDirectoryGetTokenResponse {
3076 pub s: ::fidl_next::WireI32,
3077
3078 pub token: ::fidl_next::fuchsia::WireOptionalHandle,
3079}
3080
3081unsafe impl ::fidl_next::Wire for WireDirectoryGetTokenResponse {
3082 type Decoded<'de> = WireDirectoryGetTokenResponse;
3083
3084 #[inline]
3085 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3086}
3087
3088unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryGetTokenResponse
3089where
3090 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3091
3092 ___D: ::fidl_next::fuchsia::HandleDecoder,
3093{
3094 fn decode(
3095 slot: ::fidl_next::Slot<'_, Self>,
3096 decoder: &mut ___D,
3097 ) -> Result<(), ::fidl_next::DecodeError> {
3098 ::fidl_next::munge! {
3099 let Self {
3100 mut s,
3101 mut token,
3102
3103 } = slot;
3104 }
3105
3106 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3107
3108 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
3109
3110 Ok(())
3111 }
3112}
3113
3114#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
3115pub const MAX_NAME_LENGTH: u64 = 255;
3116
3117#[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"]
3118pub type Name = String;
3119
3120pub type WireName<'de> = ::fidl_next::WireString<'de>;
3122
3123#[derive(Debug)]
3124pub struct DirectoryLinkRequest {
3125 pub src: String,
3126
3127 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
3128
3129 pub dst: String,
3130}
3131
3132impl ::fidl_next::Encodable for DirectoryLinkRequest {
3133 type Encoded = WireDirectoryLinkRequest<'static>;
3134}
3135
3136unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkRequest
3137where
3138 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3139
3140 ___E: ::fidl_next::Encoder,
3141
3142 ___E: ::fidl_next::fuchsia::HandleEncoder,
3143{
3144 #[inline]
3145 fn encode(
3146 self,
3147 encoder: &mut ___E,
3148 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3149 ) -> Result<(), ::fidl_next::EncodeError> {
3150 ::fidl_next::munge! {
3151 let Self::Encoded {
3152 src,
3153 dst_parent_token,
3154 dst,
3155
3156 } = out;
3157 }
3158
3159 ::fidl_next::Encode::encode(self.src, encoder, src)?;
3160
3161 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
3162
3163 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
3164
3165 Ok(())
3166 }
3167}
3168
3169impl ::fidl_next::EncodableOption for DirectoryLinkRequest {
3170 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkRequest<'static>>;
3171}
3172
3173unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkRequest
3174where
3175 ___E: ::fidl_next::Encoder + ?Sized,
3176 DirectoryLinkRequest: ::fidl_next::Encode<___E>,
3177{
3178 #[inline]
3179 fn encode_option(
3180 this: Option<Self>,
3181 encoder: &mut ___E,
3182 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3183 ) -> Result<(), ::fidl_next::EncodeError> {
3184 if let Some(inner) = this {
3185 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3186 ::fidl_next::WireBox::encode_present(out);
3187 } else {
3188 ::fidl_next::WireBox::encode_absent(out);
3189 }
3190
3191 Ok(())
3192 }
3193}
3194
3195impl<'de> ::fidl_next::FromWire<WireDirectoryLinkRequest<'de>> for DirectoryLinkRequest {
3196 #[inline]
3197 fn from_wire(wire: WireDirectoryLinkRequest<'de>) -> Self {
3198 Self {
3199 src: ::fidl_next::FromWire::from_wire(wire.src),
3200
3201 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
3202
3203 dst: ::fidl_next::FromWire::from_wire(wire.dst),
3204 }
3205 }
3206}
3207
3208#[derive(Debug)]
3210#[repr(C)]
3211pub struct WireDirectoryLinkRequest<'de> {
3212 pub src: ::fidl_next::WireString<'de>,
3213
3214 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
3215
3216 pub dst: ::fidl_next::WireString<'de>,
3217}
3218
3219unsafe impl ::fidl_next::Wire for WireDirectoryLinkRequest<'static> {
3220 type Decoded<'de> = WireDirectoryLinkRequest<'de>;
3221
3222 #[inline]
3223 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3224 unsafe {
3225 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
3226 }
3227 }
3228}
3229
3230unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkRequest<'static>
3231where
3232 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3233
3234 ___D: ::fidl_next::Decoder,
3235
3236 ___D: ::fidl_next::fuchsia::HandleDecoder,
3237{
3238 fn decode(
3239 slot: ::fidl_next::Slot<'_, Self>,
3240 decoder: &mut ___D,
3241 ) -> Result<(), ::fidl_next::DecodeError> {
3242 ::fidl_next::munge! {
3243 let Self {
3244 mut src,
3245 mut dst_parent_token,
3246 mut dst,
3247
3248 } = slot;
3249 }
3250
3251 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
3252
3253 let src = unsafe { src.deref_unchecked() };
3254
3255 if src.len() > 255 {
3256 return Err(::fidl_next::DecodeError::VectorTooLong {
3257 size: src.len() as u64,
3258 limit: 255,
3259 });
3260 }
3261
3262 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
3263
3264 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
3265
3266 let dst = unsafe { dst.deref_unchecked() };
3267
3268 if dst.len() > 255 {
3269 return Err(::fidl_next::DecodeError::VectorTooLong {
3270 size: dst.len() as u64,
3271 limit: 255,
3272 });
3273 }
3274
3275 Ok(())
3276 }
3277}
3278
3279#[derive(Clone, Debug)]
3280#[repr(C)]
3281pub struct DirectoryLinkResponse {
3282 pub s: i32,
3283}
3284
3285impl ::fidl_next::Encodable for DirectoryLinkResponse {
3286 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryLinkResponse> = unsafe {
3287 ::fidl_next::CopyOptimization::enable_if(
3288 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3289 )
3290 };
3291
3292 type Encoded = WireDirectoryLinkResponse;
3293}
3294
3295unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkResponse
3296where
3297 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3298{
3299 #[inline]
3300 fn encode(
3301 self,
3302 encoder: &mut ___E,
3303 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3304 ) -> Result<(), ::fidl_next::EncodeError> {
3305 ::fidl_next::munge! {
3306 let Self::Encoded {
3307 s,
3308
3309 } = out;
3310 }
3311
3312 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3313
3314 Ok(())
3315 }
3316}
3317
3318unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryLinkResponse
3319where
3320 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3321{
3322 #[inline]
3323 fn encode_ref(
3324 &self,
3325 encoder: &mut ___E,
3326 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3327 ) -> Result<(), ::fidl_next::EncodeError> {
3328 ::fidl_next::munge! {
3329 let Self::Encoded {
3330 s,
3331
3332 } = out;
3333 }
3334
3335 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
3336
3337 Ok(())
3338 }
3339}
3340
3341impl ::fidl_next::EncodableOption for DirectoryLinkResponse {
3342 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkResponse>;
3343}
3344
3345unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkResponse
3346where
3347 ___E: ::fidl_next::Encoder + ?Sized,
3348 DirectoryLinkResponse: ::fidl_next::Encode<___E>,
3349{
3350 #[inline]
3351 fn encode_option(
3352 this: Option<Self>,
3353 encoder: &mut ___E,
3354 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3355 ) -> Result<(), ::fidl_next::EncodeError> {
3356 if let Some(inner) = this {
3357 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3358 ::fidl_next::WireBox::encode_present(out);
3359 } else {
3360 ::fidl_next::WireBox::encode_absent(out);
3361 }
3362
3363 Ok(())
3364 }
3365}
3366
3367unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryLinkResponse
3368where
3369 ___E: ::fidl_next::Encoder + ?Sized,
3370 DirectoryLinkResponse: ::fidl_next::EncodeRef<___E>,
3371{
3372 #[inline]
3373 fn encode_option_ref(
3374 this: Option<&Self>,
3375 encoder: &mut ___E,
3376 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3377 ) -> Result<(), ::fidl_next::EncodeError> {
3378 if let Some(inner) = this {
3379 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3380 ::fidl_next::WireBox::encode_present(out);
3381 } else {
3382 ::fidl_next::WireBox::encode_absent(out);
3383 }
3384
3385 Ok(())
3386 }
3387}
3388
3389impl ::fidl_next::FromWire<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3390 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryLinkResponse, Self> = unsafe {
3391 ::fidl_next::CopyOptimization::enable_if(
3392 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3393 .is_enabled(),
3394 )
3395 };
3396
3397 #[inline]
3398 fn from_wire(wire: WireDirectoryLinkResponse) -> Self {
3399 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
3400 }
3401}
3402
3403impl ::fidl_next::FromWireRef<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3404 #[inline]
3405 fn from_wire_ref(wire: &WireDirectoryLinkResponse) -> Self {
3406 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
3407 }
3408}
3409
3410#[derive(Clone, Debug)]
3412#[repr(C)]
3413pub struct WireDirectoryLinkResponse {
3414 pub s: ::fidl_next::WireI32,
3415}
3416
3417unsafe impl ::fidl_next::Wire for WireDirectoryLinkResponse {
3418 type Decoded<'de> = WireDirectoryLinkResponse;
3419
3420 #[inline]
3421 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3422}
3423
3424unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkResponse
3425where
3426 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3427{
3428 fn decode(
3429 slot: ::fidl_next::Slot<'_, Self>,
3430 decoder: &mut ___D,
3431 ) -> Result<(), ::fidl_next::DecodeError> {
3432 ::fidl_next::munge! {
3433 let Self {
3434 mut s,
3435
3436 } = slot;
3437 }
3438
3439 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3440
3441 Ok(())
3442 }
3443}
3444
3445::fidl_next::bitflags! {
3446 #[derive(
3447 Clone,
3448 Copy,
3449 Debug,
3450 PartialEq,
3451 Eq,
3452 Hash,
3453 )]
3454 pub struct UnlinkFlags: u64 {
3455 #[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;
3456 const _ = !0;
3457 }
3458}
3459
3460impl ::fidl_next::Encodable for UnlinkFlags {
3461 type Encoded = WireUnlinkFlags;
3462}
3463
3464unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkFlags
3465where
3466 ___E: ?Sized,
3467{
3468 #[inline]
3469 fn encode(
3470 self,
3471 encoder: &mut ___E,
3472 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3473 ) -> Result<(), ::fidl_next::EncodeError> {
3474 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
3475 }
3476}
3477
3478unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkFlags
3479where
3480 ___E: ?Sized,
3481{
3482 #[inline]
3483 fn encode_ref(
3484 &self,
3485 _: &mut ___E,
3486 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3487 ) -> Result<(), ::fidl_next::EncodeError> {
3488 ::fidl_next::munge!(let WireUnlinkFlags { value } = out);
3489 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
3490 Ok(())
3491 }
3492}
3493
3494impl ::core::convert::From<WireUnlinkFlags> for UnlinkFlags {
3495 fn from(wire: WireUnlinkFlags) -> Self {
3496 Self::from_bits_retain(u64::from(wire.value))
3497 }
3498}
3499
3500impl ::fidl_next::FromWire<WireUnlinkFlags> for UnlinkFlags {
3501 #[inline]
3502 fn from_wire(wire: WireUnlinkFlags) -> Self {
3503 Self::from(wire)
3504 }
3505}
3506
3507impl ::fidl_next::FromWireRef<WireUnlinkFlags> for UnlinkFlags {
3508 #[inline]
3509 fn from_wire_ref(wire: &WireUnlinkFlags) -> Self {
3510 Self::from(*wire)
3511 }
3512}
3513
3514#[derive(Clone, Copy, Debug)]
3516#[repr(transparent)]
3517pub struct WireUnlinkFlags {
3518 value: ::fidl_next::WireU64,
3519}
3520
3521unsafe impl ::fidl_next::Wire for WireUnlinkFlags {
3522 type Decoded<'de> = Self;
3523
3524 #[inline]
3525 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3526 }
3528}
3529
3530unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkFlags
3531where
3532 ___D: ?Sized,
3533{
3534 fn decode(
3535 slot: ::fidl_next::Slot<'_, Self>,
3536 _: &mut ___D,
3537 ) -> Result<(), ::fidl_next::DecodeError> {
3538 Ok(())
3539 }
3540}
3541
3542impl ::core::convert::From<UnlinkFlags> for WireUnlinkFlags {
3543 fn from(natural: UnlinkFlags) -> Self {
3544 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
3545 }
3546}
3547
3548#[derive(Clone, Debug, Default)]
3549pub struct UnlinkOptions {
3550 pub flags: Option<crate::UnlinkFlags>,
3551}
3552
3553impl UnlinkOptions {
3554 fn __max_ordinal(&self) -> usize {
3555 if self.flags.is_some() {
3556 return 1;
3557 }
3558
3559 0
3560 }
3561}
3562
3563impl ::fidl_next::Encodable for UnlinkOptions {
3564 type Encoded = WireUnlinkOptions<'static>;
3565}
3566
3567unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkOptions
3568where
3569 ___E: ::fidl_next::Encoder + ?Sized,
3570{
3571 #[inline]
3572 fn encode(
3573 mut self,
3574 encoder: &mut ___E,
3575 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3576 ) -> Result<(), ::fidl_next::EncodeError> {
3577 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3578
3579 let max_ord = self.__max_ordinal();
3580
3581 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3582 ::fidl_next::Wire::zero_padding(&mut out);
3583
3584 let mut preallocated =
3585 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3586
3587 for i in 1..=max_ord {
3588 match i {
3589 1 => {
3590 if let Some(flags) = self.flags.take() {
3591 ::fidl_next::WireEnvelope::encode_value(
3592 flags,
3593 preallocated.encoder,
3594 &mut out,
3595 )?;
3596 } else {
3597 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3598 }
3599 }
3600
3601 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3602 }
3603 unsafe {
3604 preallocated.write_next(out.assume_init_ref());
3605 }
3606 }
3607
3608 ::fidl_next::WireTable::encode_len(table, max_ord);
3609
3610 Ok(())
3611 }
3612}
3613
3614unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkOptions
3615where
3616 ___E: ::fidl_next::Encoder + ?Sized,
3617{
3618 #[inline]
3619 fn encode_ref(
3620 &self,
3621 encoder: &mut ___E,
3622 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3623 ) -> Result<(), ::fidl_next::EncodeError> {
3624 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3625
3626 let max_ord = self.__max_ordinal();
3627
3628 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3629 ::fidl_next::Wire::zero_padding(&mut out);
3630
3631 let mut preallocated =
3632 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3633
3634 for i in 1..=max_ord {
3635 match i {
3636 1 => {
3637 if let Some(flags) = &self.flags {
3638 ::fidl_next::WireEnvelope::encode_value(
3639 flags,
3640 preallocated.encoder,
3641 &mut out,
3642 )?;
3643 } else {
3644 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3645 }
3646 }
3647
3648 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3649 }
3650 unsafe {
3651 preallocated.write_next(out.assume_init_ref());
3652 }
3653 }
3654
3655 ::fidl_next::WireTable::encode_len(table, max_ord);
3656
3657 Ok(())
3658 }
3659}
3660
3661impl<'de> ::fidl_next::FromWire<WireUnlinkOptions<'de>> for UnlinkOptions {
3662 #[inline]
3663 fn from_wire(wire: WireUnlinkOptions<'de>) -> Self {
3664 let wire = ::core::mem::ManuallyDrop::new(wire);
3665
3666 let flags = wire.table.get(1);
3667
3668 Self {
3669 flags: flags.map(|envelope| {
3670 ::fidl_next::FromWire::from_wire(unsafe {
3671 envelope.read_unchecked::<crate::WireUnlinkFlags>()
3672 })
3673 }),
3674 }
3675 }
3676}
3677
3678impl<'de> ::fidl_next::FromWireRef<WireUnlinkOptions<'de>> for UnlinkOptions {
3679 #[inline]
3680 fn from_wire_ref(wire: &WireUnlinkOptions<'de>) -> Self {
3681 Self {
3682 flags: wire.table.get(1).map(|envelope| {
3683 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3684 envelope.deref_unchecked::<crate::WireUnlinkFlags>()
3685 })
3686 }),
3687 }
3688 }
3689}
3690
3691#[repr(C)]
3693pub struct WireUnlinkOptions<'de> {
3694 table: ::fidl_next::WireTable<'de>,
3695}
3696
3697impl<'de> Drop for WireUnlinkOptions<'de> {
3698 fn drop(&mut self) {
3699 let _ = self
3700 .table
3701 .get(1)
3702 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireUnlinkFlags>() });
3703 }
3704}
3705
3706unsafe impl ::fidl_next::Wire for WireUnlinkOptions<'static> {
3707 type Decoded<'de> = WireUnlinkOptions<'de>;
3708
3709 #[inline]
3710 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3711 ::fidl_next::munge!(let Self { table } = out);
3712 ::fidl_next::WireTable::zero_padding(table);
3713 }
3714}
3715
3716unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkOptions<'static>
3717where
3718 ___D: ::fidl_next::Decoder + ?Sized,
3719{
3720 fn decode(
3721 slot: ::fidl_next::Slot<'_, Self>,
3722 decoder: &mut ___D,
3723 ) -> Result<(), ::fidl_next::DecodeError> {
3724 ::fidl_next::munge!(let Self { table } = slot);
3725
3726 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3727 match ordinal {
3728 0 => unsafe { ::core::hint::unreachable_unchecked() },
3729
3730 1 => {
3731 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireUnlinkFlags>(
3732 slot.as_mut(),
3733 decoder,
3734 )?;
3735
3736 Ok(())
3737 }
3738
3739 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3740 }
3741 })
3742 }
3743}
3744
3745impl<'de> WireUnlinkOptions<'de> {
3746 pub fn flags(&self) -> Option<&crate::WireUnlinkFlags> {
3747 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3748 }
3749}
3750
3751impl<'de> ::core::fmt::Debug for WireUnlinkOptions<'de> {
3752 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3753 f.debug_struct("UnlinkOptions").field("flags", &self.flags()).finish()
3754 }
3755}
3756
3757#[derive(Clone, Debug)]
3758pub struct DirectoryUnlinkRequest {
3759 pub name: String,
3760
3761 pub options: crate::UnlinkOptions,
3762}
3763
3764impl ::fidl_next::Encodable for DirectoryUnlinkRequest {
3765 type Encoded = WireDirectoryUnlinkRequest<'static>;
3766}
3767
3768unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryUnlinkRequest
3769where
3770 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3771
3772 ___E: ::fidl_next::Encoder,
3773{
3774 #[inline]
3775 fn encode(
3776 self,
3777 encoder: &mut ___E,
3778 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3779 ) -> Result<(), ::fidl_next::EncodeError> {
3780 ::fidl_next::munge! {
3781 let Self::Encoded {
3782 name,
3783 options,
3784
3785 } = out;
3786 }
3787
3788 ::fidl_next::Encode::encode(self.name, encoder, name)?;
3789
3790 ::fidl_next::Encode::encode(self.options, encoder, options)?;
3791
3792 Ok(())
3793 }
3794}
3795
3796unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryUnlinkRequest
3797where
3798 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3799
3800 ___E: ::fidl_next::Encoder,
3801{
3802 #[inline]
3803 fn encode_ref(
3804 &self,
3805 encoder: &mut ___E,
3806 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3807 ) -> Result<(), ::fidl_next::EncodeError> {
3808 ::fidl_next::munge! {
3809 let Self::Encoded {
3810 name,
3811 options,
3812
3813 } = out;
3814 }
3815
3816 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
3817
3818 ::fidl_next::EncodeRef::encode_ref(&self.options, encoder, options)?;
3819
3820 Ok(())
3821 }
3822}
3823
3824impl ::fidl_next::EncodableOption for DirectoryUnlinkRequest {
3825 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryUnlinkRequest<'static>>;
3826}
3827
3828unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryUnlinkRequest
3829where
3830 ___E: ::fidl_next::Encoder + ?Sized,
3831 DirectoryUnlinkRequest: ::fidl_next::Encode<___E>,
3832{
3833 #[inline]
3834 fn encode_option(
3835 this: Option<Self>,
3836 encoder: &mut ___E,
3837 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3838 ) -> Result<(), ::fidl_next::EncodeError> {
3839 if let Some(inner) = this {
3840 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3841 ::fidl_next::WireBox::encode_present(out);
3842 } else {
3843 ::fidl_next::WireBox::encode_absent(out);
3844 }
3845
3846 Ok(())
3847 }
3848}
3849
3850unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryUnlinkRequest
3851where
3852 ___E: ::fidl_next::Encoder + ?Sized,
3853 DirectoryUnlinkRequest: ::fidl_next::EncodeRef<___E>,
3854{
3855 #[inline]
3856 fn encode_option_ref(
3857 this: Option<&Self>,
3858 encoder: &mut ___E,
3859 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3860 ) -> Result<(), ::fidl_next::EncodeError> {
3861 if let Some(inner) = this {
3862 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3863 ::fidl_next::WireBox::encode_present(out);
3864 } else {
3865 ::fidl_next::WireBox::encode_absent(out);
3866 }
3867
3868 Ok(())
3869 }
3870}
3871
3872impl<'de> ::fidl_next::FromWire<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
3873 #[inline]
3874 fn from_wire(wire: WireDirectoryUnlinkRequest<'de>) -> Self {
3875 Self {
3876 name: ::fidl_next::FromWire::from_wire(wire.name),
3877
3878 options: ::fidl_next::FromWire::from_wire(wire.options),
3879 }
3880 }
3881}
3882
3883impl<'de> ::fidl_next::FromWireRef<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
3884 #[inline]
3885 fn from_wire_ref(wire: &WireDirectoryUnlinkRequest<'de>) -> Self {
3886 Self {
3887 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
3888
3889 options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options),
3890 }
3891 }
3892}
3893
3894#[derive(Debug)]
3896#[repr(C)]
3897pub struct WireDirectoryUnlinkRequest<'de> {
3898 pub name: ::fidl_next::WireString<'de>,
3899
3900 pub options: crate::WireUnlinkOptions<'de>,
3901}
3902
3903unsafe impl ::fidl_next::Wire for WireDirectoryUnlinkRequest<'static> {
3904 type Decoded<'de> = WireDirectoryUnlinkRequest<'de>;
3905
3906 #[inline]
3907 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3908}
3909
3910unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryUnlinkRequest<'static>
3911where
3912 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3913
3914 ___D: ::fidl_next::Decoder,
3915{
3916 fn decode(
3917 slot: ::fidl_next::Slot<'_, Self>,
3918 decoder: &mut ___D,
3919 ) -> Result<(), ::fidl_next::DecodeError> {
3920 ::fidl_next::munge! {
3921 let Self {
3922 mut name,
3923 mut options,
3924
3925 } = slot;
3926 }
3927
3928 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
3929
3930 let name = unsafe { name.deref_unchecked() };
3931
3932 if name.len() > 255 {
3933 return Err(::fidl_next::DecodeError::VectorTooLong {
3934 size: name.len() as u64,
3935 limit: 255,
3936 });
3937 }
3938
3939 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
3940
3941 Ok(())
3942 }
3943}
3944
3945pub type DirectoryUnlinkResponse = ();
3946
3947pub type WireDirectoryUnlinkResponse = ();
3949
3950#[doc = " The type to identify a connection to a node.\n It represents a capability: a reference to a node with associated rights.\n"]
3951pub type Token = ::fidl_next::fuchsia::zx::Handle;
3952
3953pub type WireToken = ::fidl_next::fuchsia::WireHandle;
3955
3956#[derive(Debug)]
3957pub struct DirectoryRenameRequest {
3958 pub src: String,
3959
3960 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
3961
3962 pub dst: String,
3963}
3964
3965impl ::fidl_next::Encodable for DirectoryRenameRequest {
3966 type Encoded = WireDirectoryRenameRequest<'static>;
3967}
3968
3969unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRenameRequest
3970where
3971 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3972
3973 ___E: ::fidl_next::Encoder,
3974
3975 ___E: ::fidl_next::fuchsia::HandleEncoder,
3976{
3977 #[inline]
3978 fn encode(
3979 self,
3980 encoder: &mut ___E,
3981 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3982 ) -> Result<(), ::fidl_next::EncodeError> {
3983 ::fidl_next::munge! {
3984 let Self::Encoded {
3985 src,
3986 dst_parent_token,
3987 dst,
3988
3989 } = out;
3990 }
3991
3992 ::fidl_next::Encode::encode(self.src, encoder, src)?;
3993
3994 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
3995
3996 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
3997
3998 Ok(())
3999 }
4000}
4001
4002impl ::fidl_next::EncodableOption for DirectoryRenameRequest {
4003 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRenameRequest<'static>>;
4004}
4005
4006unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRenameRequest
4007where
4008 ___E: ::fidl_next::Encoder + ?Sized,
4009 DirectoryRenameRequest: ::fidl_next::Encode<___E>,
4010{
4011 #[inline]
4012 fn encode_option(
4013 this: Option<Self>,
4014 encoder: &mut ___E,
4015 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4016 ) -> Result<(), ::fidl_next::EncodeError> {
4017 if let Some(inner) = this {
4018 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4019 ::fidl_next::WireBox::encode_present(out);
4020 } else {
4021 ::fidl_next::WireBox::encode_absent(out);
4022 }
4023
4024 Ok(())
4025 }
4026}
4027
4028impl<'de> ::fidl_next::FromWire<WireDirectoryRenameRequest<'de>> for DirectoryRenameRequest {
4029 #[inline]
4030 fn from_wire(wire: WireDirectoryRenameRequest<'de>) -> Self {
4031 Self {
4032 src: ::fidl_next::FromWire::from_wire(wire.src),
4033
4034 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
4035
4036 dst: ::fidl_next::FromWire::from_wire(wire.dst),
4037 }
4038 }
4039}
4040
4041#[derive(Debug)]
4043#[repr(C)]
4044pub struct WireDirectoryRenameRequest<'de> {
4045 pub src: ::fidl_next::WireString<'de>,
4046
4047 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
4048
4049 pub dst: ::fidl_next::WireString<'de>,
4050}
4051
4052unsafe impl ::fidl_next::Wire for WireDirectoryRenameRequest<'static> {
4053 type Decoded<'de> = WireDirectoryRenameRequest<'de>;
4054
4055 #[inline]
4056 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4057 unsafe {
4058 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
4059 }
4060 }
4061}
4062
4063unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRenameRequest<'static>
4064where
4065 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4066
4067 ___D: ::fidl_next::Decoder,
4068
4069 ___D: ::fidl_next::fuchsia::HandleDecoder,
4070{
4071 fn decode(
4072 slot: ::fidl_next::Slot<'_, Self>,
4073 decoder: &mut ___D,
4074 ) -> Result<(), ::fidl_next::DecodeError> {
4075 ::fidl_next::munge! {
4076 let Self {
4077 mut src,
4078 mut dst_parent_token,
4079 mut dst,
4080
4081 } = slot;
4082 }
4083
4084 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
4085
4086 let src = unsafe { src.deref_unchecked() };
4087
4088 if src.len() > 255 {
4089 return Err(::fidl_next::DecodeError::VectorTooLong {
4090 size: src.len() as u64,
4091 limit: 255,
4092 });
4093 }
4094
4095 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
4096
4097 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
4098
4099 let dst = unsafe { dst.deref_unchecked() };
4100
4101 if dst.len() > 255 {
4102 return Err(::fidl_next::DecodeError::VectorTooLong {
4103 size: dst.len() as u64,
4104 limit: 255,
4105 });
4106 }
4107
4108 Ok(())
4109 }
4110}
4111
4112pub type DirectoryRenameResponse = ();
4113
4114pub type WireDirectoryRenameResponse = ();
4116
4117::fidl_next::bitflags! {
4118 #[derive(
4119 Clone,
4120 Copy,
4121 Debug,
4122 PartialEq,
4123 Eq,
4124 Hash,
4125 )]
4126 pub struct WatchMask: u32 {
4127 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.\n"]const DELETED = 1;
4128 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.\n"]const ADDED = 2;
4129 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.\n"]const REMOVED = 4;
4130 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.\n"]const EXISTING = 8;
4131 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.\n"]const IDLE = 16;
4132
4133 }
4134}
4135
4136impl ::fidl_next::Encodable for WatchMask {
4137 type Encoded = WireWatchMask;
4138}
4139
4140unsafe impl<___E> ::fidl_next::Encode<___E> for WatchMask
4141where
4142 ___E: ?Sized,
4143{
4144 #[inline]
4145 fn encode(
4146 self,
4147 encoder: &mut ___E,
4148 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4149 ) -> Result<(), ::fidl_next::EncodeError> {
4150 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
4151 }
4152}
4153
4154unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchMask
4155where
4156 ___E: ?Sized,
4157{
4158 #[inline]
4159 fn encode_ref(
4160 &self,
4161 _: &mut ___E,
4162 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4163 ) -> Result<(), ::fidl_next::EncodeError> {
4164 ::fidl_next::munge!(let WireWatchMask { value } = out);
4165 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
4166 Ok(())
4167 }
4168}
4169
4170impl ::core::convert::From<WireWatchMask> for WatchMask {
4171 fn from(wire: WireWatchMask) -> Self {
4172 Self::from_bits_retain(u32::from(wire.value))
4173 }
4174}
4175
4176impl ::fidl_next::FromWire<WireWatchMask> for WatchMask {
4177 #[inline]
4178 fn from_wire(wire: WireWatchMask) -> Self {
4179 Self::from(wire)
4180 }
4181}
4182
4183impl ::fidl_next::FromWireRef<WireWatchMask> for WatchMask {
4184 #[inline]
4185 fn from_wire_ref(wire: &WireWatchMask) -> Self {
4186 Self::from(*wire)
4187 }
4188}
4189
4190#[derive(Clone, Copy, Debug)]
4192#[repr(transparent)]
4193pub struct WireWatchMask {
4194 value: ::fidl_next::WireU32,
4195}
4196
4197unsafe impl ::fidl_next::Wire for WireWatchMask {
4198 type Decoded<'de> = Self;
4199
4200 #[inline]
4201 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4202 }
4204}
4205
4206unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchMask
4207where
4208 ___D: ?Sized,
4209{
4210 fn decode(
4211 slot: ::fidl_next::Slot<'_, Self>,
4212 _: &mut ___D,
4213 ) -> Result<(), ::fidl_next::DecodeError> {
4214 ::fidl_next::munge!(let Self { value } = slot);
4215 let set = u32::from(*value);
4216 if set & !WatchMask::all().bits() != 0 {
4217 return Err(::fidl_next::DecodeError::InvalidBits {
4218 expected: WatchMask::all().bits() as usize,
4219 actual: set as usize,
4220 });
4221 }
4222
4223 Ok(())
4224 }
4225}
4226
4227impl ::core::convert::From<WatchMask> for WireWatchMask {
4228 fn from(natural: WatchMask) -> Self {
4229 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
4230 }
4231}
4232
4233#[derive(Debug)]
4234#[repr(C)]
4235pub struct DirectoryWatchRequest {
4236 pub mask: crate::WatchMask,
4237
4238 pub options: u32,
4239
4240 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel>,
4241}
4242
4243impl ::fidl_next::Encodable for DirectoryWatchRequest {
4244 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchRequest> = unsafe {
4245 ::fidl_next::CopyOptimization::enable_if(
4246 true && <crate::WatchMask as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4247 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4248 && <::fidl_next::ServerEnd<
4249 crate::DirectoryWatcher,
4250 ::fidl_next::fuchsia::zx::Channel,
4251 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4252 .is_enabled(),
4253 )
4254 };
4255
4256 type Encoded = WireDirectoryWatchRequest;
4257}
4258
4259unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchRequest
4260where
4261 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4262
4263 ___E: ::fidl_next::fuchsia::HandleEncoder,
4264{
4265 #[inline]
4266 fn encode(
4267 self,
4268 encoder: &mut ___E,
4269 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4270 ) -> Result<(), ::fidl_next::EncodeError> {
4271 ::fidl_next::munge! {
4272 let Self::Encoded {
4273 mask,
4274 options,
4275 watcher,
4276
4277 } = out;
4278 }
4279
4280 ::fidl_next::Encode::encode(self.mask, encoder, mask)?;
4281
4282 ::fidl_next::Encode::encode(self.options, encoder, options)?;
4283
4284 ::fidl_next::Encode::encode(self.watcher, encoder, watcher)?;
4285
4286 Ok(())
4287 }
4288}
4289
4290impl ::fidl_next::EncodableOption for DirectoryWatchRequest {
4291 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchRequest>;
4292}
4293
4294unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchRequest
4295where
4296 ___E: ::fidl_next::Encoder + ?Sized,
4297 DirectoryWatchRequest: ::fidl_next::Encode<___E>,
4298{
4299 #[inline]
4300 fn encode_option(
4301 this: Option<Self>,
4302 encoder: &mut ___E,
4303 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4304 ) -> Result<(), ::fidl_next::EncodeError> {
4305 if let Some(inner) = this {
4306 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4307 ::fidl_next::WireBox::encode_present(out);
4308 } else {
4309 ::fidl_next::WireBox::encode_absent(out);
4310 }
4311
4312 Ok(())
4313 }
4314}
4315
4316impl ::fidl_next::FromWire<WireDirectoryWatchRequest> for DirectoryWatchRequest {
4317 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchRequest, Self> = unsafe {
4318 ::fidl_next::CopyOptimization::enable_if(
4319 true
4320
4321 && <
4322 crate::WatchMask as ::fidl_next::FromWire<crate::WireWatchMask>
4323 >::COPY_OPTIMIZATION.is_enabled()
4324
4325 && <
4326 u32 as ::fidl_next::FromWire<::fidl_next::WireU32>
4327 >::COPY_OPTIMIZATION.is_enabled()
4328
4329 && <
4330 ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>>
4331 >::COPY_OPTIMIZATION.is_enabled()
4332
4333 )
4334 };
4335
4336 #[inline]
4337 fn from_wire(wire: WireDirectoryWatchRequest) -> Self {
4338 Self {
4339 mask: ::fidl_next::FromWire::from_wire(wire.mask),
4340
4341 options: ::fidl_next::FromWire::from_wire(wire.options),
4342
4343 watcher: ::fidl_next::FromWire::from_wire(wire.watcher),
4344 }
4345 }
4346}
4347
4348#[derive(Debug)]
4350#[repr(C)]
4351pub struct WireDirectoryWatchRequest {
4352 pub mask: crate::WireWatchMask,
4353
4354 pub options: ::fidl_next::WireU32,
4355
4356 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>,
4357}
4358
4359unsafe impl ::fidl_next::Wire for WireDirectoryWatchRequest {
4360 type Decoded<'de> = WireDirectoryWatchRequest;
4361
4362 #[inline]
4363 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4364}
4365
4366unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchRequest
4367where
4368 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4369
4370 ___D: ::fidl_next::fuchsia::HandleDecoder,
4371{
4372 fn decode(
4373 slot: ::fidl_next::Slot<'_, Self>,
4374 decoder: &mut ___D,
4375 ) -> Result<(), ::fidl_next::DecodeError> {
4376 ::fidl_next::munge! {
4377 let Self {
4378 mut mask,
4379 mut options,
4380 mut watcher,
4381
4382 } = slot;
4383 }
4384
4385 ::fidl_next::Decode::decode(mask.as_mut(), decoder)?;
4386
4387 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
4388
4389 ::fidl_next::Decode::decode(watcher.as_mut(), decoder)?;
4390
4391 Ok(())
4392 }
4393}
4394
4395#[derive(Clone, Debug)]
4396#[repr(C)]
4397pub struct DirectoryWatchResponse {
4398 pub s: i32,
4399}
4400
4401impl ::fidl_next::Encodable for DirectoryWatchResponse {
4402 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchResponse> = unsafe {
4403 ::fidl_next::CopyOptimization::enable_if(
4404 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4405 )
4406 };
4407
4408 type Encoded = WireDirectoryWatchResponse;
4409}
4410
4411unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchResponse
4412where
4413 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4414{
4415 #[inline]
4416 fn encode(
4417 self,
4418 encoder: &mut ___E,
4419 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4420 ) -> Result<(), ::fidl_next::EncodeError> {
4421 ::fidl_next::munge! {
4422 let Self::Encoded {
4423 s,
4424
4425 } = out;
4426 }
4427
4428 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4429
4430 Ok(())
4431 }
4432}
4433
4434unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryWatchResponse
4435where
4436 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4437{
4438 #[inline]
4439 fn encode_ref(
4440 &self,
4441 encoder: &mut ___E,
4442 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4443 ) -> Result<(), ::fidl_next::EncodeError> {
4444 ::fidl_next::munge! {
4445 let Self::Encoded {
4446 s,
4447
4448 } = out;
4449 }
4450
4451 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
4452
4453 Ok(())
4454 }
4455}
4456
4457impl ::fidl_next::EncodableOption for DirectoryWatchResponse {
4458 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchResponse>;
4459}
4460
4461unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchResponse
4462where
4463 ___E: ::fidl_next::Encoder + ?Sized,
4464 DirectoryWatchResponse: ::fidl_next::Encode<___E>,
4465{
4466 #[inline]
4467 fn encode_option(
4468 this: Option<Self>,
4469 encoder: &mut ___E,
4470 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4471 ) -> Result<(), ::fidl_next::EncodeError> {
4472 if let Some(inner) = this {
4473 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4474 ::fidl_next::WireBox::encode_present(out);
4475 } else {
4476 ::fidl_next::WireBox::encode_absent(out);
4477 }
4478
4479 Ok(())
4480 }
4481}
4482
4483unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryWatchResponse
4484where
4485 ___E: ::fidl_next::Encoder + ?Sized,
4486 DirectoryWatchResponse: ::fidl_next::EncodeRef<___E>,
4487{
4488 #[inline]
4489 fn encode_option_ref(
4490 this: Option<&Self>,
4491 encoder: &mut ___E,
4492 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4493 ) -> Result<(), ::fidl_next::EncodeError> {
4494 if let Some(inner) = this {
4495 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4496 ::fidl_next::WireBox::encode_present(out);
4497 } else {
4498 ::fidl_next::WireBox::encode_absent(out);
4499 }
4500
4501 Ok(())
4502 }
4503}
4504
4505impl ::fidl_next::FromWire<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4506 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchResponse, Self> = unsafe {
4507 ::fidl_next::CopyOptimization::enable_if(
4508 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
4509 .is_enabled(),
4510 )
4511 };
4512
4513 #[inline]
4514 fn from_wire(wire: WireDirectoryWatchResponse) -> Self {
4515 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
4516 }
4517}
4518
4519impl ::fidl_next::FromWireRef<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4520 #[inline]
4521 fn from_wire_ref(wire: &WireDirectoryWatchResponse) -> Self {
4522 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
4523 }
4524}
4525
4526#[derive(Clone, Debug)]
4528#[repr(C)]
4529pub struct WireDirectoryWatchResponse {
4530 pub s: ::fidl_next::WireI32,
4531}
4532
4533unsafe impl ::fidl_next::Wire for WireDirectoryWatchResponse {
4534 type Decoded<'de> = WireDirectoryWatchResponse;
4535
4536 #[inline]
4537 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4538}
4539
4540unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchResponse
4541where
4542 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4543{
4544 fn decode(
4545 slot: ::fidl_next::Slot<'_, Self>,
4546 decoder: &mut ___D,
4547 ) -> Result<(), ::fidl_next::DecodeError> {
4548 ::fidl_next::munge! {
4549 let Self {
4550 mut s,
4551
4552 } = slot;
4553 }
4554
4555 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4556
4557 Ok(())
4558 }
4559}
4560
4561#[derive(Debug)]
4562pub struct NodeOnOpenRequest {
4563 pub s: i32,
4564
4565 pub info: Option<Box<crate::NodeInfoDeprecated>>,
4566}
4567
4568impl ::fidl_next::Encodable for NodeOnOpenRequest {
4569 type Encoded = WireNodeOnOpenRequest<'static>;
4570}
4571
4572unsafe impl<___E> ::fidl_next::Encode<___E> for NodeOnOpenRequest
4573where
4574 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4575
4576 ___E: ::fidl_next::Encoder,
4577
4578 ___E: ::fidl_next::fuchsia::HandleEncoder,
4579{
4580 #[inline]
4581 fn encode(
4582 self,
4583 encoder: &mut ___E,
4584 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4585 ) -> Result<(), ::fidl_next::EncodeError> {
4586 ::fidl_next::munge! {
4587 let Self::Encoded {
4588 s,
4589 info,
4590
4591 } = out;
4592 }
4593
4594 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4595
4596 ::fidl_next::Encode::encode(self.info, encoder, info)?;
4597
4598 Ok(())
4599 }
4600}
4601
4602impl ::fidl_next::EncodableOption for NodeOnOpenRequest {
4603 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeOnOpenRequest<'static>>;
4604}
4605
4606unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeOnOpenRequest
4607where
4608 ___E: ::fidl_next::Encoder + ?Sized,
4609 NodeOnOpenRequest: ::fidl_next::Encode<___E>,
4610{
4611 #[inline]
4612 fn encode_option(
4613 this: Option<Self>,
4614 encoder: &mut ___E,
4615 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4616 ) -> Result<(), ::fidl_next::EncodeError> {
4617 if let Some(inner) = this {
4618 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4619 ::fidl_next::WireBox::encode_present(out);
4620 } else {
4621 ::fidl_next::WireBox::encode_absent(out);
4622 }
4623
4624 Ok(())
4625 }
4626}
4627
4628impl<'de> ::fidl_next::FromWire<WireNodeOnOpenRequest<'de>> for NodeOnOpenRequest {
4629 #[inline]
4630 fn from_wire(wire: WireNodeOnOpenRequest<'de>) -> Self {
4631 Self {
4632 s: ::fidl_next::FromWire::from_wire(wire.s),
4633
4634 info: ::fidl_next::FromWire::from_wire(wire.info),
4635 }
4636 }
4637}
4638
4639#[derive(Debug)]
4641#[repr(C)]
4642pub struct WireNodeOnOpenRequest<'de> {
4643 pub s: ::fidl_next::WireI32,
4644
4645 pub info: crate::WireOptionalNodeInfoDeprecated<'de>,
4646}
4647
4648unsafe impl ::fidl_next::Wire for WireNodeOnOpenRequest<'static> {
4649 type Decoded<'de> = WireNodeOnOpenRequest<'de>;
4650
4651 #[inline]
4652 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4653 unsafe {
4654 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
4655 }
4656 }
4657}
4658
4659unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeOnOpenRequest<'static>
4660where
4661 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4662
4663 ___D: ::fidl_next::Decoder,
4664
4665 ___D: ::fidl_next::fuchsia::HandleDecoder,
4666{
4667 fn decode(
4668 slot: ::fidl_next::Slot<'_, Self>,
4669 decoder: &mut ___D,
4670 ) -> Result<(), ::fidl_next::DecodeError> {
4671 ::fidl_next::munge! {
4672 let Self {
4673 mut s,
4674 mut info,
4675
4676 } = slot;
4677 }
4678
4679 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4680
4681 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
4682
4683 Ok(())
4684 }
4685}
4686
4687pub type SymlinkTarget = Vec<u8>;
4688
4689pub type WireSymlinkTarget<'de> = ::fidl_next::WireVector<'de, u8>;
4691
4692#[derive(Debug)]
4693#[repr(C)]
4694pub struct NodeListExtendedAttributesRequest {
4695 pub iterator:
4696 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::zx::Channel>,
4697}
4698
4699impl ::fidl_next::Encodable for NodeListExtendedAttributesRequest {
4700 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4701 Self,
4702 WireNodeListExtendedAttributesRequest,
4703 > = unsafe {
4704 ::fidl_next::CopyOptimization::enable_if(
4705 true && <::fidl_next::ServerEnd<
4706 crate::ExtendedAttributeIterator,
4707 ::fidl_next::fuchsia::zx::Channel,
4708 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4709 .is_enabled(),
4710 )
4711 };
4712
4713 type Encoded = WireNodeListExtendedAttributesRequest;
4714}
4715
4716unsafe impl<___E> ::fidl_next::Encode<___E> for NodeListExtendedAttributesRequest
4717where
4718 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4719
4720 ___E: ::fidl_next::fuchsia::HandleEncoder,
4721{
4722 #[inline]
4723 fn encode(
4724 self,
4725 encoder: &mut ___E,
4726 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4727 ) -> Result<(), ::fidl_next::EncodeError> {
4728 ::fidl_next::munge! {
4729 let Self::Encoded {
4730 iterator,
4731
4732 } = out;
4733 }
4734
4735 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
4736
4737 Ok(())
4738 }
4739}
4740
4741impl ::fidl_next::EncodableOption for NodeListExtendedAttributesRequest {
4742 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeListExtendedAttributesRequest>;
4743}
4744
4745unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeListExtendedAttributesRequest
4746where
4747 ___E: ::fidl_next::Encoder + ?Sized,
4748 NodeListExtendedAttributesRequest: ::fidl_next::Encode<___E>,
4749{
4750 #[inline]
4751 fn encode_option(
4752 this: Option<Self>,
4753 encoder: &mut ___E,
4754 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4755 ) -> Result<(), ::fidl_next::EncodeError> {
4756 if let Some(inner) = this {
4757 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4758 ::fidl_next::WireBox::encode_present(out);
4759 } else {
4760 ::fidl_next::WireBox::encode_absent(out);
4761 }
4762
4763 Ok(())
4764 }
4765}
4766
4767impl ::fidl_next::FromWire<WireNodeListExtendedAttributesRequest>
4768 for NodeListExtendedAttributesRequest
4769{
4770 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4771 WireNodeListExtendedAttributesRequest,
4772 Self,
4773 > = unsafe {
4774 ::fidl_next::CopyOptimization::enable_if(
4775 true && <::fidl_next::ServerEnd<
4776 crate::ExtendedAttributeIterator,
4777 ::fidl_next::fuchsia::zx::Channel,
4778 > as ::fidl_next::FromWire<
4779 ::fidl_next::ServerEnd<
4780 crate::ExtendedAttributeIterator,
4781 ::fidl_next::fuchsia::WireChannel,
4782 >,
4783 >>::COPY_OPTIMIZATION
4784 .is_enabled(),
4785 )
4786 };
4787
4788 #[inline]
4789 fn from_wire(wire: WireNodeListExtendedAttributesRequest) -> Self {
4790 Self { iterator: ::fidl_next::FromWire::from_wire(wire.iterator) }
4791 }
4792}
4793
4794#[derive(Debug)]
4796#[repr(C)]
4797pub struct WireNodeListExtendedAttributesRequest {
4798 pub iterator:
4799 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::WireChannel>,
4800}
4801
4802unsafe impl ::fidl_next::Wire for WireNodeListExtendedAttributesRequest {
4803 type Decoded<'de> = WireNodeListExtendedAttributesRequest;
4804
4805 #[inline]
4806 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4807}
4808
4809unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeListExtendedAttributesRequest
4810where
4811 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4812
4813 ___D: ::fidl_next::fuchsia::HandleDecoder,
4814{
4815 fn decode(
4816 slot: ::fidl_next::Slot<'_, Self>,
4817 decoder: &mut ___D,
4818 ) -> Result<(), ::fidl_next::DecodeError> {
4819 ::fidl_next::munge! {
4820 let Self {
4821 mut iterator,
4822
4823 } = slot;
4824 }
4825
4826 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
4827
4828 Ok(())
4829 }
4830}
4831
4832#[doc = " The maximum size for an extended attribute name.\n"]
4833pub const MAX_ATTRIBUTE_NAME: u64 = 255;
4834
4835#[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"]
4836pub type ExtendedAttributeName = Vec<u8>;
4837
4838pub type WireExtendedAttributeName<'de> = ::fidl_next::WireVector<'de, u8>;
4840
4841#[derive(Clone, Debug)]
4842pub struct NodeGetExtendedAttributeRequest {
4843 pub name: Vec<u8>,
4844}
4845
4846impl ::fidl_next::Encodable for NodeGetExtendedAttributeRequest {
4847 type Encoded = WireNodeGetExtendedAttributeRequest<'static>;
4848}
4849
4850unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetExtendedAttributeRequest
4851where
4852 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4853
4854 ___E: ::fidl_next::Encoder,
4855{
4856 #[inline]
4857 fn encode(
4858 self,
4859 encoder: &mut ___E,
4860 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4861 ) -> Result<(), ::fidl_next::EncodeError> {
4862 ::fidl_next::munge! {
4863 let Self::Encoded {
4864 name,
4865
4866 } = out;
4867 }
4868
4869 ::fidl_next::Encode::encode(self.name, encoder, name)?;
4870
4871 Ok(())
4872 }
4873}
4874
4875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetExtendedAttributeRequest
4876where
4877 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4878
4879 ___E: ::fidl_next::Encoder,
4880{
4881 #[inline]
4882 fn encode_ref(
4883 &self,
4884 encoder: &mut ___E,
4885 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4886 ) -> Result<(), ::fidl_next::EncodeError> {
4887 ::fidl_next::munge! {
4888 let Self::Encoded {
4889 name,
4890
4891 } = out;
4892 }
4893
4894 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
4895
4896 Ok(())
4897 }
4898}
4899
4900impl ::fidl_next::EncodableOption for NodeGetExtendedAttributeRequest {
4901 type EncodedOption =
4902 ::fidl_next::WireBox<'static, WireNodeGetExtendedAttributeRequest<'static>>;
4903}
4904
4905unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetExtendedAttributeRequest
4906where
4907 ___E: ::fidl_next::Encoder + ?Sized,
4908 NodeGetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
4909{
4910 #[inline]
4911 fn encode_option(
4912 this: Option<Self>,
4913 encoder: &mut ___E,
4914 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4915 ) -> Result<(), ::fidl_next::EncodeError> {
4916 if let Some(inner) = this {
4917 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4918 ::fidl_next::WireBox::encode_present(out);
4919 } else {
4920 ::fidl_next::WireBox::encode_absent(out);
4921 }
4922
4923 Ok(())
4924 }
4925}
4926
4927unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetExtendedAttributeRequest
4928where
4929 ___E: ::fidl_next::Encoder + ?Sized,
4930 NodeGetExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
4931{
4932 #[inline]
4933 fn encode_option_ref(
4934 this: Option<&Self>,
4935 encoder: &mut ___E,
4936 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4937 ) -> Result<(), ::fidl_next::EncodeError> {
4938 if let Some(inner) = this {
4939 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4940 ::fidl_next::WireBox::encode_present(out);
4941 } else {
4942 ::fidl_next::WireBox::encode_absent(out);
4943 }
4944
4945 Ok(())
4946 }
4947}
4948
4949impl<'de> ::fidl_next::FromWire<WireNodeGetExtendedAttributeRequest<'de>>
4950 for NodeGetExtendedAttributeRequest
4951{
4952 #[inline]
4953 fn from_wire(wire: WireNodeGetExtendedAttributeRequest<'de>) -> Self {
4954 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
4955 }
4956}
4957
4958impl<'de> ::fidl_next::FromWireRef<WireNodeGetExtendedAttributeRequest<'de>>
4959 for NodeGetExtendedAttributeRequest
4960{
4961 #[inline]
4962 fn from_wire_ref(wire: &WireNodeGetExtendedAttributeRequest<'de>) -> Self {
4963 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
4964 }
4965}
4966
4967#[derive(Debug)]
4969#[repr(C)]
4970pub struct WireNodeGetExtendedAttributeRequest<'de> {
4971 pub name: ::fidl_next::WireVector<'de, u8>,
4972}
4973
4974unsafe impl ::fidl_next::Wire for WireNodeGetExtendedAttributeRequest<'static> {
4975 type Decoded<'de> = WireNodeGetExtendedAttributeRequest<'de>;
4976
4977 #[inline]
4978 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4979}
4980
4981unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetExtendedAttributeRequest<'static>
4982where
4983 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4984
4985 ___D: ::fidl_next::Decoder,
4986{
4987 fn decode(
4988 slot: ::fidl_next::Slot<'_, Self>,
4989 decoder: &mut ___D,
4990 ) -> Result<(), ::fidl_next::DecodeError> {
4991 ::fidl_next::munge! {
4992 let Self {
4993 mut name,
4994
4995 } = slot;
4996 }
4997
4998 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
4999
5000 let name = unsafe { name.deref_unchecked() };
5001
5002 if name.len() > 255 {
5003 return Err(::fidl_next::DecodeError::VectorTooLong {
5004 size: name.len() as u64,
5005 limit: 255,
5006 });
5007 }
5008
5009 Ok(())
5010 }
5011}
5012
5013#[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"]
5014pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768;
5015
5016#[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"]
5017#[derive(Debug)]
5018pub enum ExtendedAttributeValue {
5019 Bytes(Vec<u8>),
5020
5021 Buffer(::fidl_next::fuchsia::zx::Handle),
5022
5023 UnknownOrdinal_(u64),
5024}
5025
5026impl ::fidl_next::Encodable for ExtendedAttributeValue {
5027 type Encoded = WireExtendedAttributeValue<'static>;
5028}
5029
5030unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeValue
5031where
5032 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5033
5034 ___E: ::fidl_next::Encoder,
5035
5036 ___E: ::fidl_next::fuchsia::HandleEncoder,
5037{
5038 #[inline]
5039 fn encode(
5040 self,
5041 encoder: &mut ___E,
5042 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5043 ) -> Result<(), ::fidl_next::EncodeError> {
5044 ::fidl_next::munge!(let WireExtendedAttributeValue { raw, _phantom: _ } = out);
5045
5046 match self {
5047 Self::Bytes(value) => {
5048 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
5049 }
5050
5051 Self::Buffer(value) => ::fidl_next::RawWireUnion::encode_as::<
5052 ___E,
5053 ::fidl_next::fuchsia::zx::Handle,
5054 >(value, 2, encoder, raw)?,
5055
5056 Self::UnknownOrdinal_(ordinal) => {
5057 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
5058 }
5059 }
5060
5061 Ok(())
5062 }
5063}
5064
5065impl ::fidl_next::EncodableOption for ExtendedAttributeValue {
5066 type EncodedOption = WireOptionalExtendedAttributeValue<'static>;
5067}
5068
5069unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeValue
5070where
5071 ___E: ?Sized,
5072 ExtendedAttributeValue: ::fidl_next::Encode<___E>,
5073{
5074 #[inline]
5075 fn encode_option(
5076 this: Option<Self>,
5077 encoder: &mut ___E,
5078 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5079 ) -> Result<(), ::fidl_next::EncodeError> {
5080 ::fidl_next::munge!(let WireOptionalExtendedAttributeValue { raw, _phantom: _ } = &mut *out);
5081
5082 if let Some(inner) = this {
5083 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5084 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
5085 } else {
5086 ::fidl_next::RawWireUnion::encode_absent(raw);
5087 }
5088
5089 Ok(())
5090 }
5091}
5092
5093impl<'de> ::fidl_next::FromWire<WireExtendedAttributeValue<'de>> for ExtendedAttributeValue {
5094 #[inline]
5095 fn from_wire(wire: WireExtendedAttributeValue<'de>) -> Self {
5096 let wire = ::core::mem::ManuallyDrop::new(wire);
5097 match wire.raw.ordinal() {
5098 1 => Self::Bytes(::fidl_next::FromWire::from_wire(unsafe {
5099 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
5100 })),
5101
5102 2 => Self::Buffer(::fidl_next::FromWire::from_wire(unsafe {
5103 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireHandle>()
5104 })),
5105
5106 _ => unsafe { ::core::hint::unreachable_unchecked() },
5107 }
5108 }
5109}
5110
5111impl<'de> ::fidl_next::FromWireOption<WireOptionalExtendedAttributeValue<'de>>
5112 for Box<ExtendedAttributeValue>
5113{
5114 #[inline]
5115 fn from_wire_option(wire: WireOptionalExtendedAttributeValue<'de>) -> Option<Self> {
5116 if let Some(inner) = wire.into_option() {
5117 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
5118 } else {
5119 None
5120 }
5121 }
5122}
5123
5124#[repr(transparent)]
5126pub struct WireExtendedAttributeValue<'de> {
5127 raw: ::fidl_next::RawWireUnion,
5128 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5129}
5130
5131impl<'de> Drop for WireExtendedAttributeValue<'de> {
5132 fn drop(&mut self) {
5133 match self.raw.ordinal() {
5134 1 => {
5135 let _ =
5136 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
5137 }
5138
5139 2 => {
5140 let _ =
5141 unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireHandle>() };
5142 }
5143
5144 _ => (),
5145 }
5146 }
5147}
5148
5149unsafe impl ::fidl_next::Wire for WireExtendedAttributeValue<'static> {
5150 type Decoded<'de> = WireExtendedAttributeValue<'de>;
5151
5152 #[inline]
5153 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5154 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5155 ::fidl_next::RawWireUnion::zero_padding(raw);
5156 }
5157}
5158
5159pub mod extended_attribute_value {
5160 pub enum Ref<'de> {
5161 Bytes(&'de ::fidl_next::WireVector<'de, u8>),
5162
5163 Buffer(&'de ::fidl_next::fuchsia::WireHandle),
5164
5165 UnknownOrdinal_(u64),
5166 }
5167}
5168
5169impl<'de> WireExtendedAttributeValue<'de> {
5170 pub fn as_ref(&self) -> crate::extended_attribute_value::Ref<'_> {
5171 match self.raw.ordinal() {
5172 1 => crate::extended_attribute_value::Ref::Bytes(unsafe {
5173 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
5174 }),
5175
5176 2 => crate::extended_attribute_value::Ref::Buffer(unsafe {
5177 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
5178 }),
5179
5180 unknown => crate::extended_attribute_value::Ref::UnknownOrdinal_(unknown),
5181 }
5182 }
5183}
5184
5185unsafe impl<___D> ::fidl_next::Decode<___D> for WireExtendedAttributeValue<'static>
5186where
5187 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5188
5189 ___D: ::fidl_next::Decoder,
5190
5191 ___D: ::fidl_next::fuchsia::HandleDecoder,
5192{
5193 fn decode(
5194 mut slot: ::fidl_next::Slot<'_, Self>,
5195 decoder: &mut ___D,
5196 ) -> Result<(), ::fidl_next::DecodeError> {
5197 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5198 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5199 1 => {
5200 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5201 raw, decoder,
5202 )?
5203 }
5204
5205 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5206 raw, decoder,
5207 )?,
5208
5209 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5210 }
5211
5212 Ok(())
5213 }
5214}
5215
5216impl<'de> ::core::fmt::Debug for WireExtendedAttributeValue<'de> {
5217 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5218 match self.raw.ordinal() {
5219 1 => unsafe {
5220 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
5221 },
5222 2 => unsafe {
5223 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
5224 },
5225 _ => unsafe { ::core::hint::unreachable_unchecked() },
5226 }
5227 }
5228}
5229
5230#[repr(transparent)]
5231pub struct WireOptionalExtendedAttributeValue<'de> {
5232 raw: ::fidl_next::RawWireUnion,
5233 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5234}
5235
5236unsafe impl ::fidl_next::Wire for WireOptionalExtendedAttributeValue<'static> {
5237 type Decoded<'de> = WireOptionalExtendedAttributeValue<'de>;
5238
5239 #[inline]
5240 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5241 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5242 ::fidl_next::RawWireUnion::zero_padding(raw);
5243 }
5244}
5245
5246impl<'de> WireOptionalExtendedAttributeValue<'de> {
5247 pub fn is_some(&self) -> bool {
5248 self.raw.is_some()
5249 }
5250
5251 pub fn is_none(&self) -> bool {
5252 self.raw.is_none()
5253 }
5254
5255 pub fn as_ref(&self) -> Option<&WireExtendedAttributeValue<'de>> {
5256 if self.is_some() {
5257 Some(unsafe { &*(self as *const Self).cast() })
5258 } else {
5259 None
5260 }
5261 }
5262
5263 pub fn into_option(self) -> Option<WireExtendedAttributeValue<'de>> {
5264 if self.is_some() {
5265 Some(WireExtendedAttributeValue {
5266 raw: self.raw,
5267 _phantom: ::core::marker::PhantomData,
5268 })
5269 } else {
5270 None
5271 }
5272 }
5273}
5274
5275unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExtendedAttributeValue<'static>
5276where
5277 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5278
5279 ___D: ::fidl_next::Decoder,
5280
5281 ___D: ::fidl_next::fuchsia::HandleDecoder,
5282{
5283 fn decode(
5284 mut slot: ::fidl_next::Slot<'_, Self>,
5285 decoder: &mut ___D,
5286 ) -> Result<(), ::fidl_next::DecodeError> {
5287 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5288 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5289 1 => {
5290 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5291 raw, decoder,
5292 )?
5293 }
5294
5295 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5296 raw, decoder,
5297 )?,
5298
5299 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5300 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5301 }
5302
5303 Ok(())
5304 }
5305}
5306
5307impl<'de> ::core::fmt::Debug for WireOptionalExtendedAttributeValue<'de> {
5308 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5309 self.as_ref().fmt(f)
5310 }
5311}
5312
5313#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5314#[repr(u32)]
5315pub enum SetExtendedAttributeMode {
5316 Set = 1,
5317 Create = 2,
5318 Replace = 3,
5319}
5320
5321impl ::fidl_next::Encodable for SetExtendedAttributeMode {
5322 type Encoded = WireSetExtendedAttributeMode;
5323}
5324impl ::std::convert::TryFrom<u32> for SetExtendedAttributeMode {
5325 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5326 fn try_from(value: u32) -> Result<Self, Self::Error> {
5327 match value {
5328 1 => Ok(Self::Set),
5329 2 => Ok(Self::Create),
5330 3 => Ok(Self::Replace),
5331
5332 _ => Err(Self::Error::new(value.into())),
5333 }
5334 }
5335}
5336
5337unsafe impl<___E> ::fidl_next::Encode<___E> for SetExtendedAttributeMode
5338where
5339 ___E: ?Sized,
5340{
5341 #[inline]
5342 fn encode(
5343 self,
5344 encoder: &mut ___E,
5345 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5346 ) -> Result<(), ::fidl_next::EncodeError> {
5347 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5348 }
5349}
5350
5351unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SetExtendedAttributeMode
5352where
5353 ___E: ?Sized,
5354{
5355 #[inline]
5356 fn encode_ref(
5357 &self,
5358 encoder: &mut ___E,
5359 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5360 ) -> Result<(), ::fidl_next::EncodeError> {
5361 ::fidl_next::munge!(let WireSetExtendedAttributeMode { value } = out);
5362 let _ = value.write(::fidl_next::WireU32::from(match *self {
5363 Self::Set => 1,
5364
5365 Self::Create => 2,
5366
5367 Self::Replace => 3,
5368 }));
5369
5370 Ok(())
5371 }
5372}
5373
5374impl ::core::convert::From<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5375 fn from(wire: WireSetExtendedAttributeMode) -> Self {
5376 match u32::from(wire.value) {
5377 1 => Self::Set,
5378
5379 2 => Self::Create,
5380
5381 3 => Self::Replace,
5382
5383 _ => unsafe { ::core::hint::unreachable_unchecked() },
5384 }
5385 }
5386}
5387
5388impl ::fidl_next::FromWire<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5389 #[inline]
5390 fn from_wire(wire: WireSetExtendedAttributeMode) -> Self {
5391 Self::from(wire)
5392 }
5393}
5394
5395impl ::fidl_next::FromWireRef<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5396 #[inline]
5397 fn from_wire_ref(wire: &WireSetExtendedAttributeMode) -> Self {
5398 Self::from(*wire)
5399 }
5400}
5401
5402#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5404#[repr(transparent)]
5405pub struct WireSetExtendedAttributeMode {
5406 value: ::fidl_next::WireU32,
5407}
5408
5409unsafe impl ::fidl_next::Wire for WireSetExtendedAttributeMode {
5410 type Decoded<'de> = Self;
5411
5412 #[inline]
5413 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5414 }
5416}
5417
5418impl WireSetExtendedAttributeMode {
5419 pub const SET: WireSetExtendedAttributeMode =
5420 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(1) };
5421
5422 pub const CREATE: WireSetExtendedAttributeMode =
5423 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(2) };
5424
5425 pub const REPLACE: WireSetExtendedAttributeMode =
5426 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(3) };
5427}
5428
5429unsafe impl<___D> ::fidl_next::Decode<___D> for WireSetExtendedAttributeMode
5430where
5431 ___D: ?Sized,
5432{
5433 fn decode(
5434 slot: ::fidl_next::Slot<'_, Self>,
5435 _: &mut ___D,
5436 ) -> Result<(), ::fidl_next::DecodeError> {
5437 ::fidl_next::munge!(let Self { value } = slot);
5438
5439 match u32::from(*value) {
5440 1 | 2 | 3 => (),
5441 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
5442 }
5443
5444 Ok(())
5445 }
5446}
5447
5448impl ::core::convert::From<SetExtendedAttributeMode> for WireSetExtendedAttributeMode {
5449 fn from(natural: SetExtendedAttributeMode) -> Self {
5450 match natural {
5451 SetExtendedAttributeMode::Set => WireSetExtendedAttributeMode::SET,
5452
5453 SetExtendedAttributeMode::Create => WireSetExtendedAttributeMode::CREATE,
5454
5455 SetExtendedAttributeMode::Replace => WireSetExtendedAttributeMode::REPLACE,
5456 }
5457 }
5458}
5459
5460#[derive(Debug)]
5461pub struct NodeSetExtendedAttributeRequest {
5462 pub name: Vec<u8>,
5463
5464 pub value: crate::ExtendedAttributeValue,
5465
5466 pub mode: crate::SetExtendedAttributeMode,
5467}
5468
5469impl ::fidl_next::Encodable for NodeSetExtendedAttributeRequest {
5470 type Encoded = WireNodeSetExtendedAttributeRequest<'static>;
5471}
5472
5473unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetExtendedAttributeRequest
5474where
5475 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5476
5477 ___E: ::fidl_next::Encoder,
5478
5479 ___E: ::fidl_next::fuchsia::HandleEncoder,
5480{
5481 #[inline]
5482 fn encode(
5483 self,
5484 encoder: &mut ___E,
5485 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5486 ) -> Result<(), ::fidl_next::EncodeError> {
5487 ::fidl_next::munge! {
5488 let Self::Encoded {
5489 name,
5490 value,
5491 mode,
5492
5493 } = out;
5494 }
5495
5496 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5497
5498 ::fidl_next::Encode::encode(self.value, encoder, value)?;
5499
5500 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
5501
5502 Ok(())
5503 }
5504}
5505
5506impl ::fidl_next::EncodableOption for NodeSetExtendedAttributeRequest {
5507 type EncodedOption =
5508 ::fidl_next::WireBox<'static, WireNodeSetExtendedAttributeRequest<'static>>;
5509}
5510
5511unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetExtendedAttributeRequest
5512where
5513 ___E: ::fidl_next::Encoder + ?Sized,
5514 NodeSetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5515{
5516 #[inline]
5517 fn encode_option(
5518 this: Option<Self>,
5519 encoder: &mut ___E,
5520 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5521 ) -> Result<(), ::fidl_next::EncodeError> {
5522 if let Some(inner) = this {
5523 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5524 ::fidl_next::WireBox::encode_present(out);
5525 } else {
5526 ::fidl_next::WireBox::encode_absent(out);
5527 }
5528
5529 Ok(())
5530 }
5531}
5532
5533impl<'de> ::fidl_next::FromWire<WireNodeSetExtendedAttributeRequest<'de>>
5534 for NodeSetExtendedAttributeRequest
5535{
5536 #[inline]
5537 fn from_wire(wire: WireNodeSetExtendedAttributeRequest<'de>) -> Self {
5538 Self {
5539 name: ::fidl_next::FromWire::from_wire(wire.name),
5540
5541 value: ::fidl_next::FromWire::from_wire(wire.value),
5542
5543 mode: ::fidl_next::FromWire::from_wire(wire.mode),
5544 }
5545 }
5546}
5547
5548#[derive(Debug)]
5550#[repr(C)]
5551pub struct WireNodeSetExtendedAttributeRequest<'de> {
5552 pub name: ::fidl_next::WireVector<'de, u8>,
5553
5554 pub value: crate::WireExtendedAttributeValue<'de>,
5555
5556 pub mode: crate::WireSetExtendedAttributeMode,
5557}
5558
5559unsafe impl ::fidl_next::Wire for WireNodeSetExtendedAttributeRequest<'static> {
5560 type Decoded<'de> = WireNodeSetExtendedAttributeRequest<'de>;
5561
5562 #[inline]
5563 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5564 unsafe {
5565 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
5566 }
5567 }
5568}
5569
5570unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetExtendedAttributeRequest<'static>
5571where
5572 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5573
5574 ___D: ::fidl_next::Decoder,
5575
5576 ___D: ::fidl_next::fuchsia::HandleDecoder,
5577{
5578 fn decode(
5579 slot: ::fidl_next::Slot<'_, Self>,
5580 decoder: &mut ___D,
5581 ) -> Result<(), ::fidl_next::DecodeError> {
5582 ::fidl_next::munge! {
5583 let Self {
5584 mut name,
5585 mut value,
5586 mut mode,
5587
5588 } = slot;
5589 }
5590
5591 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5592
5593 let name = unsafe { name.deref_unchecked() };
5594
5595 if name.len() > 255 {
5596 return Err(::fidl_next::DecodeError::VectorTooLong {
5597 size: name.len() as u64,
5598 limit: 255,
5599 });
5600 }
5601
5602 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
5603
5604 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
5605
5606 Ok(())
5607 }
5608}
5609
5610pub type NodeSetExtendedAttributeResponse = ();
5611
5612pub type WireNodeSetExtendedAttributeResponse = ();
5614
5615#[derive(Clone, Debug)]
5616pub struct NodeRemoveExtendedAttributeRequest {
5617 pub name: Vec<u8>,
5618}
5619
5620impl ::fidl_next::Encodable for NodeRemoveExtendedAttributeRequest {
5621 type Encoded = WireNodeRemoveExtendedAttributeRequest<'static>;
5622}
5623
5624unsafe impl<___E> ::fidl_next::Encode<___E> for NodeRemoveExtendedAttributeRequest
5625where
5626 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5627
5628 ___E: ::fidl_next::Encoder,
5629{
5630 #[inline]
5631 fn encode(
5632 self,
5633 encoder: &mut ___E,
5634 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5635 ) -> Result<(), ::fidl_next::EncodeError> {
5636 ::fidl_next::munge! {
5637 let Self::Encoded {
5638 name,
5639
5640 } = out;
5641 }
5642
5643 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5644
5645 Ok(())
5646 }
5647}
5648
5649unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeRemoveExtendedAttributeRequest
5650where
5651 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5652
5653 ___E: ::fidl_next::Encoder,
5654{
5655 #[inline]
5656 fn encode_ref(
5657 &self,
5658 encoder: &mut ___E,
5659 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5660 ) -> Result<(), ::fidl_next::EncodeError> {
5661 ::fidl_next::munge! {
5662 let Self::Encoded {
5663 name,
5664
5665 } = out;
5666 }
5667
5668 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
5669
5670 Ok(())
5671 }
5672}
5673
5674impl ::fidl_next::EncodableOption for NodeRemoveExtendedAttributeRequest {
5675 type EncodedOption =
5676 ::fidl_next::WireBox<'static, WireNodeRemoveExtendedAttributeRequest<'static>>;
5677}
5678
5679unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeRemoveExtendedAttributeRequest
5680where
5681 ___E: ::fidl_next::Encoder + ?Sized,
5682 NodeRemoveExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5683{
5684 #[inline]
5685 fn encode_option(
5686 this: Option<Self>,
5687 encoder: &mut ___E,
5688 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5689 ) -> Result<(), ::fidl_next::EncodeError> {
5690 if let Some(inner) = this {
5691 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5692 ::fidl_next::WireBox::encode_present(out);
5693 } else {
5694 ::fidl_next::WireBox::encode_absent(out);
5695 }
5696
5697 Ok(())
5698 }
5699}
5700
5701unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeRemoveExtendedAttributeRequest
5702where
5703 ___E: ::fidl_next::Encoder + ?Sized,
5704 NodeRemoveExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
5705{
5706 #[inline]
5707 fn encode_option_ref(
5708 this: Option<&Self>,
5709 encoder: &mut ___E,
5710 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5711 ) -> Result<(), ::fidl_next::EncodeError> {
5712 if let Some(inner) = this {
5713 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5714 ::fidl_next::WireBox::encode_present(out);
5715 } else {
5716 ::fidl_next::WireBox::encode_absent(out);
5717 }
5718
5719 Ok(())
5720 }
5721}
5722
5723impl<'de> ::fidl_next::FromWire<WireNodeRemoveExtendedAttributeRequest<'de>>
5724 for NodeRemoveExtendedAttributeRequest
5725{
5726 #[inline]
5727 fn from_wire(wire: WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
5728 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
5729 }
5730}
5731
5732impl<'de> ::fidl_next::FromWireRef<WireNodeRemoveExtendedAttributeRequest<'de>>
5733 for NodeRemoveExtendedAttributeRequest
5734{
5735 #[inline]
5736 fn from_wire_ref(wire: &WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
5737 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
5738 }
5739}
5740
5741#[derive(Debug)]
5743#[repr(C)]
5744pub struct WireNodeRemoveExtendedAttributeRequest<'de> {
5745 pub name: ::fidl_next::WireVector<'de, u8>,
5746}
5747
5748unsafe impl ::fidl_next::Wire for WireNodeRemoveExtendedAttributeRequest<'static> {
5749 type Decoded<'de> = WireNodeRemoveExtendedAttributeRequest<'de>;
5750
5751 #[inline]
5752 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5753}
5754
5755unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeRemoveExtendedAttributeRequest<'static>
5756where
5757 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5758
5759 ___D: ::fidl_next::Decoder,
5760{
5761 fn decode(
5762 slot: ::fidl_next::Slot<'_, Self>,
5763 decoder: &mut ___D,
5764 ) -> Result<(), ::fidl_next::DecodeError> {
5765 ::fidl_next::munge! {
5766 let Self {
5767 mut name,
5768
5769 } = slot;
5770 }
5771
5772 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5773
5774 let name = unsafe { name.deref_unchecked() };
5775
5776 if name.len() > 255 {
5777 return Err(::fidl_next::DecodeError::VectorTooLong {
5778 size: name.len() as u64,
5779 limit: 255,
5780 });
5781 }
5782
5783 Ok(())
5784 }
5785}
5786
5787pub type NodeRemoveExtendedAttributeResponse = ();
5788
5789pub type WireNodeRemoveExtendedAttributeResponse = ();
5791
5792pub type DirectoryCreateSymlinkResponse = ();
5793
5794pub type WireDirectoryCreateSymlinkResponse = ();
5796
5797pub type NodeSetFlagsResponse = ();
5798
5799pub type WireNodeSetFlagsResponse = ();
5801
5802#[derive(Debug)]
5803#[repr(C)]
5804pub struct NodeDeprecatedCloneRequest {
5805 pub flags: crate::OpenFlags,
5806
5807 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
5808}
5809
5810impl ::fidl_next::Encodable for NodeDeprecatedCloneRequest {
5811 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeDeprecatedCloneRequest> = unsafe {
5812 ::fidl_next::CopyOptimization::enable_if(
5813 true
5814
5815 && <
5816 crate::OpenFlags as ::fidl_next::Encodable
5817 >::COPY_OPTIMIZATION.is_enabled()
5818
5819 && <
5820 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
5821 >::COPY_OPTIMIZATION.is_enabled()
5822
5823 )
5824 };
5825
5826 type Encoded = WireNodeDeprecatedCloneRequest;
5827}
5828
5829unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedCloneRequest
5830where
5831 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5832
5833 ___E: ::fidl_next::fuchsia::HandleEncoder,
5834{
5835 #[inline]
5836 fn encode(
5837 self,
5838 encoder: &mut ___E,
5839 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5840 ) -> Result<(), ::fidl_next::EncodeError> {
5841 ::fidl_next::munge! {
5842 let Self::Encoded {
5843 flags,
5844 object,
5845
5846 } = out;
5847 }
5848
5849 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
5850
5851 ::fidl_next::Encode::encode(self.object, encoder, object)?;
5852
5853 Ok(())
5854 }
5855}
5856
5857impl ::fidl_next::EncodableOption for NodeDeprecatedCloneRequest {
5858 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedCloneRequest>;
5859}
5860
5861unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedCloneRequest
5862where
5863 ___E: ::fidl_next::Encoder + ?Sized,
5864 NodeDeprecatedCloneRequest: ::fidl_next::Encode<___E>,
5865{
5866 #[inline]
5867 fn encode_option(
5868 this: Option<Self>,
5869 encoder: &mut ___E,
5870 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5871 ) -> Result<(), ::fidl_next::EncodeError> {
5872 if let Some(inner) = this {
5873 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5874 ::fidl_next::WireBox::encode_present(out);
5875 } else {
5876 ::fidl_next::WireBox::encode_absent(out);
5877 }
5878
5879 Ok(())
5880 }
5881}
5882
5883impl ::fidl_next::FromWire<WireNodeDeprecatedCloneRequest> for NodeDeprecatedCloneRequest {
5884 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeDeprecatedCloneRequest, Self> = unsafe {
5885 ::fidl_next::CopyOptimization::enable_if(
5886 true
5887
5888 && <
5889 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
5890 >::COPY_OPTIMIZATION.is_enabled()
5891
5892 && <
5893 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>
5894 >::COPY_OPTIMIZATION.is_enabled()
5895
5896 )
5897 };
5898
5899 #[inline]
5900 fn from_wire(wire: WireNodeDeprecatedCloneRequest) -> Self {
5901 Self {
5902 flags: ::fidl_next::FromWire::from_wire(wire.flags),
5903
5904 object: ::fidl_next::FromWire::from_wire(wire.object),
5905 }
5906 }
5907}
5908
5909#[derive(Debug)]
5911#[repr(C)]
5912pub struct WireNodeDeprecatedCloneRequest {
5913 pub flags: crate::WireOpenFlags,
5914
5915 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
5916}
5917
5918unsafe impl ::fidl_next::Wire for WireNodeDeprecatedCloneRequest {
5919 type Decoded<'de> = WireNodeDeprecatedCloneRequest;
5920
5921 #[inline]
5922 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5923}
5924
5925unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedCloneRequest
5926where
5927 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5928
5929 ___D: ::fidl_next::fuchsia::HandleDecoder,
5930{
5931 fn decode(
5932 slot: ::fidl_next::Slot<'_, Self>,
5933 decoder: &mut ___D,
5934 ) -> Result<(), ::fidl_next::DecodeError> {
5935 ::fidl_next::munge! {
5936 let Self {
5937 mut flags,
5938 mut object,
5939
5940 } = slot;
5941 }
5942
5943 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
5944
5945 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
5946
5947 Ok(())
5948 }
5949}
5950
5951#[derive(Clone, Debug)]
5952pub struct NodeDeprecatedGetAttrResponse {
5953 pub s: i32,
5954
5955 pub attributes: crate::NodeAttributes,
5956}
5957
5958impl ::fidl_next::Encodable for NodeDeprecatedGetAttrResponse {
5959 type Encoded = WireNodeDeprecatedGetAttrResponse;
5960}
5961
5962unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetAttrResponse
5963where
5964 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5965{
5966 #[inline]
5967 fn encode(
5968 self,
5969 encoder: &mut ___E,
5970 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5971 ) -> Result<(), ::fidl_next::EncodeError> {
5972 ::fidl_next::munge! {
5973 let Self::Encoded {
5974 s,
5975 attributes,
5976
5977 } = out;
5978 }
5979
5980 ::fidl_next::Encode::encode(self.s, encoder, s)?;
5981
5982 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
5983
5984 Ok(())
5985 }
5986}
5987
5988unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetAttrResponse
5989where
5990 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5991{
5992 #[inline]
5993 fn encode_ref(
5994 &self,
5995 encoder: &mut ___E,
5996 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5997 ) -> Result<(), ::fidl_next::EncodeError> {
5998 ::fidl_next::munge! {
5999 let Self::Encoded {
6000 s,
6001 attributes,
6002
6003 } = out;
6004 }
6005
6006 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6007
6008 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
6009
6010 Ok(())
6011 }
6012}
6013
6014impl ::fidl_next::EncodableOption for NodeDeprecatedGetAttrResponse {
6015 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetAttrResponse>;
6016}
6017
6018unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetAttrResponse
6019where
6020 ___E: ::fidl_next::Encoder + ?Sized,
6021 NodeDeprecatedGetAttrResponse: ::fidl_next::Encode<___E>,
6022{
6023 #[inline]
6024 fn encode_option(
6025 this: Option<Self>,
6026 encoder: &mut ___E,
6027 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6028 ) -> Result<(), ::fidl_next::EncodeError> {
6029 if let Some(inner) = this {
6030 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6031 ::fidl_next::WireBox::encode_present(out);
6032 } else {
6033 ::fidl_next::WireBox::encode_absent(out);
6034 }
6035
6036 Ok(())
6037 }
6038}
6039
6040unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetAttrResponse
6041where
6042 ___E: ::fidl_next::Encoder + ?Sized,
6043 NodeDeprecatedGetAttrResponse: ::fidl_next::EncodeRef<___E>,
6044{
6045 #[inline]
6046 fn encode_option_ref(
6047 this: Option<&Self>,
6048 encoder: &mut ___E,
6049 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6050 ) -> Result<(), ::fidl_next::EncodeError> {
6051 if let Some(inner) = this {
6052 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6053 ::fidl_next::WireBox::encode_present(out);
6054 } else {
6055 ::fidl_next::WireBox::encode_absent(out);
6056 }
6057
6058 Ok(())
6059 }
6060}
6061
6062impl ::fidl_next::FromWire<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
6063 #[inline]
6064 fn from_wire(wire: WireNodeDeprecatedGetAttrResponse) -> Self {
6065 Self {
6066 s: ::fidl_next::FromWire::from_wire(wire.s),
6067
6068 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
6069 }
6070 }
6071}
6072
6073impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
6074 #[inline]
6075 fn from_wire_ref(wire: &WireNodeDeprecatedGetAttrResponse) -> Self {
6076 Self {
6077 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
6078
6079 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
6080 }
6081 }
6082}
6083
6084#[derive(Clone, Debug)]
6086#[repr(C)]
6087pub struct WireNodeDeprecatedGetAttrResponse {
6088 pub s: ::fidl_next::WireI32,
6089
6090 pub attributes: crate::WireNodeAttributes,
6091}
6092
6093unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetAttrResponse {
6094 type Decoded<'de> = WireNodeDeprecatedGetAttrResponse;
6095
6096 #[inline]
6097 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6098 unsafe {
6099 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
6100 }
6101 }
6102}
6103
6104unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetAttrResponse
6105where
6106 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6107{
6108 fn decode(
6109 slot: ::fidl_next::Slot<'_, Self>,
6110 decoder: &mut ___D,
6111 ) -> Result<(), ::fidl_next::DecodeError> {
6112 ::fidl_next::munge! {
6113 let Self {
6114 mut s,
6115 mut attributes,
6116
6117 } = slot;
6118 }
6119
6120 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6121
6122 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
6123
6124 Ok(())
6125 }
6126}
6127
6128#[derive(Clone, Debug)]
6129pub struct NodeDeprecatedSetAttrRequest {
6130 pub flags: crate::NodeAttributeFlags,
6131
6132 pub attributes: crate::NodeAttributes,
6133}
6134
6135impl ::fidl_next::Encodable for NodeDeprecatedSetAttrRequest {
6136 type Encoded = WireNodeDeprecatedSetAttrRequest;
6137}
6138
6139unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrRequest
6140where
6141 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6142{
6143 #[inline]
6144 fn encode(
6145 self,
6146 encoder: &mut ___E,
6147 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6148 ) -> Result<(), ::fidl_next::EncodeError> {
6149 ::fidl_next::munge! {
6150 let Self::Encoded {
6151 flags,
6152 attributes,
6153
6154 } = out;
6155 }
6156
6157 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6158
6159 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
6160
6161 Ok(())
6162 }
6163}
6164
6165unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrRequest
6166where
6167 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6168{
6169 #[inline]
6170 fn encode_ref(
6171 &self,
6172 encoder: &mut ___E,
6173 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6174 ) -> Result<(), ::fidl_next::EncodeError> {
6175 ::fidl_next::munge! {
6176 let Self::Encoded {
6177 flags,
6178 attributes,
6179
6180 } = out;
6181 }
6182
6183 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6184
6185 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
6186
6187 Ok(())
6188 }
6189}
6190
6191impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrRequest {
6192 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrRequest>;
6193}
6194
6195unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrRequest
6196where
6197 ___E: ::fidl_next::Encoder + ?Sized,
6198 NodeDeprecatedSetAttrRequest: ::fidl_next::Encode<___E>,
6199{
6200 #[inline]
6201 fn encode_option(
6202 this: Option<Self>,
6203 encoder: &mut ___E,
6204 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6205 ) -> Result<(), ::fidl_next::EncodeError> {
6206 if let Some(inner) = this {
6207 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6208 ::fidl_next::WireBox::encode_present(out);
6209 } else {
6210 ::fidl_next::WireBox::encode_absent(out);
6211 }
6212
6213 Ok(())
6214 }
6215}
6216
6217unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrRequest
6218where
6219 ___E: ::fidl_next::Encoder + ?Sized,
6220 NodeDeprecatedSetAttrRequest: ::fidl_next::EncodeRef<___E>,
6221{
6222 #[inline]
6223 fn encode_option_ref(
6224 this: Option<&Self>,
6225 encoder: &mut ___E,
6226 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6227 ) -> Result<(), ::fidl_next::EncodeError> {
6228 if let Some(inner) = this {
6229 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6230 ::fidl_next::WireBox::encode_present(out);
6231 } else {
6232 ::fidl_next::WireBox::encode_absent(out);
6233 }
6234
6235 Ok(())
6236 }
6237}
6238
6239impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6240 #[inline]
6241 fn from_wire(wire: WireNodeDeprecatedSetAttrRequest) -> Self {
6242 Self {
6243 flags: ::fidl_next::FromWire::from_wire(wire.flags),
6244
6245 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
6246 }
6247 }
6248}
6249
6250impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6251 #[inline]
6252 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrRequest) -> Self {
6253 Self {
6254 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
6255
6256 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
6257 }
6258 }
6259}
6260
6261#[derive(Clone, Debug)]
6263#[repr(C)]
6264pub struct WireNodeDeprecatedSetAttrRequest {
6265 pub flags: crate::WireNodeAttributeFlags,
6266
6267 pub attributes: crate::WireNodeAttributes,
6268}
6269
6270unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrRequest {
6271 type Decoded<'de> = WireNodeDeprecatedSetAttrRequest;
6272
6273 #[inline]
6274 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6275 unsafe {
6276 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
6277 }
6278 }
6279}
6280
6281unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrRequest
6282where
6283 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6284{
6285 fn decode(
6286 slot: ::fidl_next::Slot<'_, Self>,
6287 decoder: &mut ___D,
6288 ) -> Result<(), ::fidl_next::DecodeError> {
6289 ::fidl_next::munge! {
6290 let Self {
6291 mut flags,
6292 mut attributes,
6293
6294 } = slot;
6295 }
6296
6297 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6298
6299 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
6300
6301 Ok(())
6302 }
6303}
6304
6305#[derive(Clone, Debug)]
6306#[repr(C)]
6307pub struct NodeDeprecatedSetAttrResponse {
6308 pub s: i32,
6309}
6310
6311impl ::fidl_next::Encodable for NodeDeprecatedSetAttrResponse {
6312 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6313 Self,
6314 WireNodeDeprecatedSetAttrResponse,
6315 > = unsafe {
6316 ::fidl_next::CopyOptimization::enable_if(
6317 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6318 )
6319 };
6320
6321 type Encoded = WireNodeDeprecatedSetAttrResponse;
6322}
6323
6324unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrResponse
6325where
6326 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6327{
6328 #[inline]
6329 fn encode(
6330 self,
6331 encoder: &mut ___E,
6332 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6333 ) -> Result<(), ::fidl_next::EncodeError> {
6334 ::fidl_next::munge! {
6335 let Self::Encoded {
6336 s,
6337
6338 } = out;
6339 }
6340
6341 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6342
6343 Ok(())
6344 }
6345}
6346
6347unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrResponse
6348where
6349 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6350{
6351 #[inline]
6352 fn encode_ref(
6353 &self,
6354 encoder: &mut ___E,
6355 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6356 ) -> Result<(), ::fidl_next::EncodeError> {
6357 ::fidl_next::munge! {
6358 let Self::Encoded {
6359 s,
6360
6361 } = out;
6362 }
6363
6364 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6365
6366 Ok(())
6367 }
6368}
6369
6370impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrResponse {
6371 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrResponse>;
6372}
6373
6374unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrResponse
6375where
6376 ___E: ::fidl_next::Encoder + ?Sized,
6377 NodeDeprecatedSetAttrResponse: ::fidl_next::Encode<___E>,
6378{
6379 #[inline]
6380 fn encode_option(
6381 this: Option<Self>,
6382 encoder: &mut ___E,
6383 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6384 ) -> Result<(), ::fidl_next::EncodeError> {
6385 if let Some(inner) = this {
6386 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6387 ::fidl_next::WireBox::encode_present(out);
6388 } else {
6389 ::fidl_next::WireBox::encode_absent(out);
6390 }
6391
6392 Ok(())
6393 }
6394}
6395
6396unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrResponse
6397where
6398 ___E: ::fidl_next::Encoder + ?Sized,
6399 NodeDeprecatedSetAttrResponse: ::fidl_next::EncodeRef<___E>,
6400{
6401 #[inline]
6402 fn encode_option_ref(
6403 this: Option<&Self>,
6404 encoder: &mut ___E,
6405 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6406 ) -> Result<(), ::fidl_next::EncodeError> {
6407 if let Some(inner) = this {
6408 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6409 ::fidl_next::WireBox::encode_present(out);
6410 } else {
6411 ::fidl_next::WireBox::encode_absent(out);
6412 }
6413
6414 Ok(())
6415 }
6416}
6417
6418impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6419 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6420 WireNodeDeprecatedSetAttrResponse,
6421 Self,
6422 > = unsafe {
6423 ::fidl_next::CopyOptimization::enable_if(
6424 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
6425 .is_enabled(),
6426 )
6427 };
6428
6429 #[inline]
6430 fn from_wire(wire: WireNodeDeprecatedSetAttrResponse) -> Self {
6431 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
6432 }
6433}
6434
6435impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6436 #[inline]
6437 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrResponse) -> Self {
6438 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
6439 }
6440}
6441
6442#[derive(Clone, Debug)]
6444#[repr(C)]
6445pub struct WireNodeDeprecatedSetAttrResponse {
6446 pub s: ::fidl_next::WireI32,
6447}
6448
6449unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrResponse {
6450 type Decoded<'de> = WireNodeDeprecatedSetAttrResponse;
6451
6452 #[inline]
6453 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6454}
6455
6456unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrResponse
6457where
6458 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6459{
6460 fn decode(
6461 slot: ::fidl_next::Slot<'_, Self>,
6462 decoder: &mut ___D,
6463 ) -> Result<(), ::fidl_next::DecodeError> {
6464 ::fidl_next::munge! {
6465 let Self {
6466 mut s,
6467
6468 } = slot;
6469 }
6470
6471 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6472
6473 Ok(())
6474 }
6475}
6476
6477#[derive(Clone, Debug)]
6478#[repr(C)]
6479pub struct NodeDeprecatedGetFlagsResponse {
6480 pub s: i32,
6481
6482 pub flags: crate::OpenFlags,
6483}
6484
6485impl ::fidl_next::Encodable for NodeDeprecatedGetFlagsResponse {
6486 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6487 Self,
6488 WireNodeDeprecatedGetFlagsResponse,
6489 > = unsafe {
6490 ::fidl_next::CopyOptimization::enable_if(
6491 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
6492 && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6493 )
6494 };
6495
6496 type Encoded = WireNodeDeprecatedGetFlagsResponse;
6497}
6498
6499unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetFlagsResponse
6500where
6501 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6502{
6503 #[inline]
6504 fn encode(
6505 self,
6506 encoder: &mut ___E,
6507 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6508 ) -> Result<(), ::fidl_next::EncodeError> {
6509 ::fidl_next::munge! {
6510 let Self::Encoded {
6511 s,
6512 flags,
6513
6514 } = out;
6515 }
6516
6517 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6518
6519 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6520
6521 Ok(())
6522 }
6523}
6524
6525unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetFlagsResponse
6526where
6527 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6528{
6529 #[inline]
6530 fn encode_ref(
6531 &self,
6532 encoder: &mut ___E,
6533 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6534 ) -> Result<(), ::fidl_next::EncodeError> {
6535 ::fidl_next::munge! {
6536 let Self::Encoded {
6537 s,
6538 flags,
6539
6540 } = out;
6541 }
6542
6543 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6544
6545 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6546
6547 Ok(())
6548 }
6549}
6550
6551impl ::fidl_next::EncodableOption for NodeDeprecatedGetFlagsResponse {
6552 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetFlagsResponse>;
6553}
6554
6555unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetFlagsResponse
6556where
6557 ___E: ::fidl_next::Encoder + ?Sized,
6558 NodeDeprecatedGetFlagsResponse: ::fidl_next::Encode<___E>,
6559{
6560 #[inline]
6561 fn encode_option(
6562 this: Option<Self>,
6563 encoder: &mut ___E,
6564 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6565 ) -> Result<(), ::fidl_next::EncodeError> {
6566 if let Some(inner) = this {
6567 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6568 ::fidl_next::WireBox::encode_present(out);
6569 } else {
6570 ::fidl_next::WireBox::encode_absent(out);
6571 }
6572
6573 Ok(())
6574 }
6575}
6576
6577unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetFlagsResponse
6578where
6579 ___E: ::fidl_next::Encoder + ?Sized,
6580 NodeDeprecatedGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6581{
6582 #[inline]
6583 fn encode_option_ref(
6584 this: Option<&Self>,
6585 encoder: &mut ___E,
6586 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6587 ) -> Result<(), ::fidl_next::EncodeError> {
6588 if let Some(inner) = this {
6589 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6590 ::fidl_next::WireBox::encode_present(out);
6591 } else {
6592 ::fidl_next::WireBox::encode_absent(out);
6593 }
6594
6595 Ok(())
6596 }
6597}
6598
6599impl ::fidl_next::FromWire<WireNodeDeprecatedGetFlagsResponse> for NodeDeprecatedGetFlagsResponse {
6600 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6601 WireNodeDeprecatedGetFlagsResponse,
6602 Self,
6603 > = unsafe {
6604 ::fidl_next::CopyOptimization::enable_if(
6605 true
6606
6607 && <
6608 i32 as ::fidl_next::FromWire<::fidl_next::WireI32>
6609 >::COPY_OPTIMIZATION.is_enabled()
6610
6611 && <
6612 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
6613 >::COPY_OPTIMIZATION.is_enabled()
6614
6615 )
6616 };
6617
6618 #[inline]
6619 fn from_wire(wire: WireNodeDeprecatedGetFlagsResponse) -> Self {
6620 Self {
6621 s: ::fidl_next::FromWire::from_wire(wire.s),
6622
6623 flags: ::fidl_next::FromWire::from_wire(wire.flags),
6624 }
6625 }
6626}
6627
6628impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetFlagsResponse>
6629 for NodeDeprecatedGetFlagsResponse
6630{
6631 #[inline]
6632 fn from_wire_ref(wire: &WireNodeDeprecatedGetFlagsResponse) -> Self {
6633 Self {
6634 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
6635
6636 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
6637 }
6638 }
6639}
6640
6641#[derive(Clone, Debug)]
6643#[repr(C)]
6644pub struct WireNodeDeprecatedGetFlagsResponse {
6645 pub s: ::fidl_next::WireI32,
6646
6647 pub flags: crate::WireOpenFlags,
6648}
6649
6650unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetFlagsResponse {
6651 type Decoded<'de> = WireNodeDeprecatedGetFlagsResponse;
6652
6653 #[inline]
6654 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6655}
6656
6657unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetFlagsResponse
6658where
6659 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6660{
6661 fn decode(
6662 slot: ::fidl_next::Slot<'_, Self>,
6663 decoder: &mut ___D,
6664 ) -> Result<(), ::fidl_next::DecodeError> {
6665 ::fidl_next::munge! {
6666 let Self {
6667 mut s,
6668 mut flags,
6669
6670 } = slot;
6671 }
6672
6673 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6674
6675 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6676
6677 Ok(())
6678 }
6679}
6680
6681#[derive(Clone, Debug)]
6682#[repr(C)]
6683pub struct NodeDeprecatedSetFlagsRequest {
6684 pub flags: crate::OpenFlags,
6685}
6686
6687impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsRequest {
6688 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6689 Self,
6690 WireNodeDeprecatedSetFlagsRequest,
6691 > = unsafe {
6692 ::fidl_next::CopyOptimization::enable_if(
6693 true && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6694 )
6695 };
6696
6697 type Encoded = WireNodeDeprecatedSetFlagsRequest;
6698}
6699
6700unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsRequest
6701where
6702 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6703{
6704 #[inline]
6705 fn encode(
6706 self,
6707 encoder: &mut ___E,
6708 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6709 ) -> Result<(), ::fidl_next::EncodeError> {
6710 ::fidl_next::munge! {
6711 let Self::Encoded {
6712 flags,
6713
6714 } = out;
6715 }
6716
6717 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6718
6719 Ok(())
6720 }
6721}
6722
6723unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsRequest
6724where
6725 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6726{
6727 #[inline]
6728 fn encode_ref(
6729 &self,
6730 encoder: &mut ___E,
6731 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6732 ) -> Result<(), ::fidl_next::EncodeError> {
6733 ::fidl_next::munge! {
6734 let Self::Encoded {
6735 flags,
6736
6737 } = out;
6738 }
6739
6740 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6741
6742 Ok(())
6743 }
6744}
6745
6746impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsRequest {
6747 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsRequest>;
6748}
6749
6750unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsRequest
6751where
6752 ___E: ::fidl_next::Encoder + ?Sized,
6753 NodeDeprecatedSetFlagsRequest: ::fidl_next::Encode<___E>,
6754{
6755 #[inline]
6756 fn encode_option(
6757 this: Option<Self>,
6758 encoder: &mut ___E,
6759 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6760 ) -> Result<(), ::fidl_next::EncodeError> {
6761 if let Some(inner) = this {
6762 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6763 ::fidl_next::WireBox::encode_present(out);
6764 } else {
6765 ::fidl_next::WireBox::encode_absent(out);
6766 }
6767
6768 Ok(())
6769 }
6770}
6771
6772unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsRequest
6773where
6774 ___E: ::fidl_next::Encoder + ?Sized,
6775 NodeDeprecatedSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
6776{
6777 #[inline]
6778 fn encode_option_ref(
6779 this: Option<&Self>,
6780 encoder: &mut ___E,
6781 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6782 ) -> Result<(), ::fidl_next::EncodeError> {
6783 if let Some(inner) = this {
6784 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6785 ::fidl_next::WireBox::encode_present(out);
6786 } else {
6787 ::fidl_next::WireBox::encode_absent(out);
6788 }
6789
6790 Ok(())
6791 }
6792}
6793
6794impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
6795 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6796 WireNodeDeprecatedSetFlagsRequest,
6797 Self,
6798 > = unsafe {
6799 ::fidl_next::CopyOptimization::enable_if(
6800 true
6801
6802 && <
6803 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
6804 >::COPY_OPTIMIZATION.is_enabled()
6805
6806 )
6807 };
6808
6809 #[inline]
6810 fn from_wire(wire: WireNodeDeprecatedSetFlagsRequest) -> Self {
6811 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
6812 }
6813}
6814
6815impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
6816 #[inline]
6817 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsRequest) -> Self {
6818 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
6819 }
6820}
6821
6822#[derive(Clone, Debug)]
6824#[repr(C)]
6825pub struct WireNodeDeprecatedSetFlagsRequest {
6826 pub flags: crate::WireOpenFlags,
6827}
6828
6829unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsRequest {
6830 type Decoded<'de> = WireNodeDeprecatedSetFlagsRequest;
6831
6832 #[inline]
6833 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6834}
6835
6836unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsRequest
6837where
6838 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6839{
6840 fn decode(
6841 slot: ::fidl_next::Slot<'_, Self>,
6842 decoder: &mut ___D,
6843 ) -> Result<(), ::fidl_next::DecodeError> {
6844 ::fidl_next::munge! {
6845 let Self {
6846 mut flags,
6847
6848 } = slot;
6849 }
6850
6851 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6852
6853 Ok(())
6854 }
6855}
6856
6857#[derive(Clone, Debug)]
6858#[repr(C)]
6859pub struct NodeDeprecatedSetFlagsResponse {
6860 pub s: i32,
6861}
6862
6863impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsResponse {
6864 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6865 Self,
6866 WireNodeDeprecatedSetFlagsResponse,
6867 > = unsafe {
6868 ::fidl_next::CopyOptimization::enable_if(
6869 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6870 )
6871 };
6872
6873 type Encoded = WireNodeDeprecatedSetFlagsResponse;
6874}
6875
6876unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsResponse
6877where
6878 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6879{
6880 #[inline]
6881 fn encode(
6882 self,
6883 encoder: &mut ___E,
6884 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6885 ) -> Result<(), ::fidl_next::EncodeError> {
6886 ::fidl_next::munge! {
6887 let Self::Encoded {
6888 s,
6889
6890 } = out;
6891 }
6892
6893 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6894
6895 Ok(())
6896 }
6897}
6898
6899unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsResponse
6900where
6901 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6902{
6903 #[inline]
6904 fn encode_ref(
6905 &self,
6906 encoder: &mut ___E,
6907 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6908 ) -> Result<(), ::fidl_next::EncodeError> {
6909 ::fidl_next::munge! {
6910 let Self::Encoded {
6911 s,
6912
6913 } = out;
6914 }
6915
6916 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6917
6918 Ok(())
6919 }
6920}
6921
6922impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsResponse {
6923 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsResponse>;
6924}
6925
6926unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsResponse
6927where
6928 ___E: ::fidl_next::Encoder + ?Sized,
6929 NodeDeprecatedSetFlagsResponse: ::fidl_next::Encode<___E>,
6930{
6931 #[inline]
6932 fn encode_option(
6933 this: Option<Self>,
6934 encoder: &mut ___E,
6935 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6936 ) -> Result<(), ::fidl_next::EncodeError> {
6937 if let Some(inner) = this {
6938 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6939 ::fidl_next::WireBox::encode_present(out);
6940 } else {
6941 ::fidl_next::WireBox::encode_absent(out);
6942 }
6943
6944 Ok(())
6945 }
6946}
6947
6948unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsResponse
6949where
6950 ___E: ::fidl_next::Encoder + ?Sized,
6951 NodeDeprecatedSetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6952{
6953 #[inline]
6954 fn encode_option_ref(
6955 this: Option<&Self>,
6956 encoder: &mut ___E,
6957 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6958 ) -> Result<(), ::fidl_next::EncodeError> {
6959 if let Some(inner) = this {
6960 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6961 ::fidl_next::WireBox::encode_present(out);
6962 } else {
6963 ::fidl_next::WireBox::encode_absent(out);
6964 }
6965
6966 Ok(())
6967 }
6968}
6969
6970impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsResponse> for NodeDeprecatedSetFlagsResponse {
6971 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6972 WireNodeDeprecatedSetFlagsResponse,
6973 Self,
6974 > = unsafe {
6975 ::fidl_next::CopyOptimization::enable_if(
6976 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
6977 .is_enabled(),
6978 )
6979 };
6980
6981 #[inline]
6982 fn from_wire(wire: WireNodeDeprecatedSetFlagsResponse) -> Self {
6983 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
6984 }
6985}
6986
6987impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsResponse>
6988 for NodeDeprecatedSetFlagsResponse
6989{
6990 #[inline]
6991 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsResponse) -> Self {
6992 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
6993 }
6994}
6995
6996#[derive(Clone, Debug)]
6998#[repr(C)]
6999pub struct WireNodeDeprecatedSetFlagsResponse {
7000 pub s: ::fidl_next::WireI32,
7001}
7002
7003unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsResponse {
7004 type Decoded<'de> = WireNodeDeprecatedSetFlagsResponse;
7005
7006 #[inline]
7007 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7008}
7009
7010unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsResponse
7011where
7012 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7013{
7014 fn decode(
7015 slot: ::fidl_next::Slot<'_, Self>,
7016 decoder: &mut ___D,
7017 ) -> Result<(), ::fidl_next::DecodeError> {
7018 ::fidl_next::munge! {
7019 let Self {
7020 mut s,
7021
7022 } = slot;
7023 }
7024
7025 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
7026
7027 Ok(())
7028 }
7029}
7030
7031::fidl_next::bitflags! {
7032 #[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(
7033 Clone,
7034 Copy,
7035 Debug,
7036 PartialEq,
7037 Eq,
7038 Hash,
7039 )]
7040 pub struct Flags: u64 {
7041 #[doc = " Allows opening child nodes with [`PROTOCOL_SERVICE`].\n"]const PERM_CONNECT = 1;
7042 #[doc = " Read byte contents of a file.\n"]const PERM_READ_BYTES = 2;
7043 #[doc = " Write byte contents to a file.\n"]const PERM_WRITE_BYTES = 4;
7044 #[doc = " Execute byte contents of a file.\n"]const PERM_EXECUTE = 8;
7045 #[doc = " Get/query attributes of a node.\n"]const PERM_GET_ATTRIBUTES = 16;
7046 #[doc = " Set/update attributes of a node.\n"]const PERM_UPDATE_ATTRIBUTES = 32;
7047 #[doc = " Enumerate (list) directory entries.\n"]const PERM_ENUMERATE = 64;
7048 #[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;
7049 #[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;
7050 #[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;
7051 #[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;
7052 #[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;
7053 #[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;
7054 #[doc = " Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.\n"]const PROTOCOL_DIRECTORY = 524288;
7055 #[doc = " Caller accepts [`fuchsia.io/File`] protocol.\n"]const PROTOCOL_FILE = 8589934592;
7056 #[doc = " Caller accepts [`fuchsia.io/Symlink`] protocol.\n"]const PROTOCOL_SYMLINK = 17179869184;
7057 #[doc = " Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.\n"]const FLAG_SEND_REPRESENTATION = 1099511627776;
7058 #[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;
7059 #[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;
7060 #[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;
7061 #[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;
7062 #[doc = " Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.\n"]const FILE_TRUNCATE = 262144;
7063 const _ = !0;
7064 }
7065}
7066
7067impl ::fidl_next::Encodable for Flags {
7068 type Encoded = WireFlags;
7069}
7070
7071unsafe impl<___E> ::fidl_next::Encode<___E> for Flags
7072where
7073 ___E: ?Sized,
7074{
7075 #[inline]
7076 fn encode(
7077 self,
7078 encoder: &mut ___E,
7079 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7080 ) -> Result<(), ::fidl_next::EncodeError> {
7081 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
7082 }
7083}
7084
7085unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Flags
7086where
7087 ___E: ?Sized,
7088{
7089 #[inline]
7090 fn encode_ref(
7091 &self,
7092 _: &mut ___E,
7093 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7094 ) -> Result<(), ::fidl_next::EncodeError> {
7095 ::fidl_next::munge!(let WireFlags { value } = out);
7096 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
7097 Ok(())
7098 }
7099}
7100
7101impl ::core::convert::From<WireFlags> for Flags {
7102 fn from(wire: WireFlags) -> Self {
7103 Self::from_bits_retain(u64::from(wire.value))
7104 }
7105}
7106
7107impl ::fidl_next::FromWire<WireFlags> for Flags {
7108 #[inline]
7109 fn from_wire(wire: WireFlags) -> Self {
7110 Self::from(wire)
7111 }
7112}
7113
7114impl ::fidl_next::FromWireRef<WireFlags> for Flags {
7115 #[inline]
7116 fn from_wire_ref(wire: &WireFlags) -> Self {
7117 Self::from(*wire)
7118 }
7119}
7120
7121#[derive(Clone, Copy, Debug)]
7123#[repr(transparent)]
7124pub struct WireFlags {
7125 value: ::fidl_next::WireU64,
7126}
7127
7128unsafe impl ::fidl_next::Wire for WireFlags {
7129 type Decoded<'de> = Self;
7130
7131 #[inline]
7132 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7133 }
7135}
7136
7137unsafe impl<___D> ::fidl_next::Decode<___D> for WireFlags
7138where
7139 ___D: ?Sized,
7140{
7141 fn decode(
7142 slot: ::fidl_next::Slot<'_, Self>,
7143 _: &mut ___D,
7144 ) -> Result<(), ::fidl_next::DecodeError> {
7145 Ok(())
7146 }
7147}
7148
7149impl ::core::convert::From<Flags> for WireFlags {
7150 fn from(natural: Flags) -> Self {
7151 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
7152 }
7153}
7154
7155#[derive(Clone, Debug)]
7156#[repr(C)]
7157pub struct NodeGetFlagsResponse {
7158 pub flags: crate::Flags,
7159}
7160
7161impl ::fidl_next::Encodable for NodeGetFlagsResponse {
7162 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetFlagsResponse> = unsafe {
7163 ::fidl_next::CopyOptimization::enable_if(
7164 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7165 )
7166 };
7167
7168 type Encoded = WireNodeGetFlagsResponse;
7169}
7170
7171unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetFlagsResponse
7172where
7173 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7174{
7175 #[inline]
7176 fn encode(
7177 self,
7178 encoder: &mut ___E,
7179 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7180 ) -> Result<(), ::fidl_next::EncodeError> {
7181 ::fidl_next::munge! {
7182 let Self::Encoded {
7183 flags,
7184
7185 } = out;
7186 }
7187
7188 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
7189
7190 Ok(())
7191 }
7192}
7193
7194unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetFlagsResponse
7195where
7196 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7197{
7198 #[inline]
7199 fn encode_ref(
7200 &self,
7201 encoder: &mut ___E,
7202 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7203 ) -> Result<(), ::fidl_next::EncodeError> {
7204 ::fidl_next::munge! {
7205 let Self::Encoded {
7206 flags,
7207
7208 } = out;
7209 }
7210
7211 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
7212
7213 Ok(())
7214 }
7215}
7216
7217impl ::fidl_next::EncodableOption for NodeGetFlagsResponse {
7218 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetFlagsResponse>;
7219}
7220
7221unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetFlagsResponse
7222where
7223 ___E: ::fidl_next::Encoder + ?Sized,
7224 NodeGetFlagsResponse: ::fidl_next::Encode<___E>,
7225{
7226 #[inline]
7227 fn encode_option(
7228 this: Option<Self>,
7229 encoder: &mut ___E,
7230 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7231 ) -> Result<(), ::fidl_next::EncodeError> {
7232 if let Some(inner) = this {
7233 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7234 ::fidl_next::WireBox::encode_present(out);
7235 } else {
7236 ::fidl_next::WireBox::encode_absent(out);
7237 }
7238
7239 Ok(())
7240 }
7241}
7242
7243unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetFlagsResponse
7244where
7245 ___E: ::fidl_next::Encoder + ?Sized,
7246 NodeGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
7247{
7248 #[inline]
7249 fn encode_option_ref(
7250 this: Option<&Self>,
7251 encoder: &mut ___E,
7252 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7253 ) -> Result<(), ::fidl_next::EncodeError> {
7254 if let Some(inner) = this {
7255 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7256 ::fidl_next::WireBox::encode_present(out);
7257 } else {
7258 ::fidl_next::WireBox::encode_absent(out);
7259 }
7260
7261 Ok(())
7262 }
7263}
7264
7265impl ::fidl_next::FromWire<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7266 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetFlagsResponse, Self> = unsafe {
7267 ::fidl_next::CopyOptimization::enable_if(
7268 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
7269 .is_enabled(),
7270 )
7271 };
7272
7273 #[inline]
7274 fn from_wire(wire: WireNodeGetFlagsResponse) -> Self {
7275 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7276 }
7277}
7278
7279impl ::fidl_next::FromWireRef<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7280 #[inline]
7281 fn from_wire_ref(wire: &WireNodeGetFlagsResponse) -> Self {
7282 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7283 }
7284}
7285
7286#[derive(Clone, Debug)]
7288#[repr(C)]
7289pub struct WireNodeGetFlagsResponse {
7290 pub flags: crate::WireFlags,
7291}
7292
7293unsafe impl ::fidl_next::Wire for WireNodeGetFlagsResponse {
7294 type Decoded<'de> = WireNodeGetFlagsResponse;
7295
7296 #[inline]
7297 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7298}
7299
7300unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetFlagsResponse
7301where
7302 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7303{
7304 fn decode(
7305 slot: ::fidl_next::Slot<'_, Self>,
7306 decoder: &mut ___D,
7307 ) -> Result<(), ::fidl_next::DecodeError> {
7308 ::fidl_next::munge! {
7309 let Self {
7310 mut flags,
7311
7312 } = slot;
7313 }
7314
7315 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
7316
7317 Ok(())
7318 }
7319}
7320
7321#[derive(Clone, Debug)]
7322#[repr(C)]
7323pub struct NodeSetFlagsRequest {
7324 pub flags: crate::Flags,
7325}
7326
7327impl ::fidl_next::Encodable for NodeSetFlagsRequest {
7328 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeSetFlagsRequest> = unsafe {
7329 ::fidl_next::CopyOptimization::enable_if(
7330 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7331 )
7332 };
7333
7334 type Encoded = WireNodeSetFlagsRequest;
7335}
7336
7337unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetFlagsRequest
7338where
7339 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7340{
7341 #[inline]
7342 fn encode(
7343 self,
7344 encoder: &mut ___E,
7345 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7346 ) -> Result<(), ::fidl_next::EncodeError> {
7347 ::fidl_next::munge! {
7348 let Self::Encoded {
7349 flags,
7350
7351 } = out;
7352 }
7353
7354 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
7355
7356 Ok(())
7357 }
7358}
7359
7360unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetFlagsRequest
7361where
7362 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7363{
7364 #[inline]
7365 fn encode_ref(
7366 &self,
7367 encoder: &mut ___E,
7368 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7369 ) -> Result<(), ::fidl_next::EncodeError> {
7370 ::fidl_next::munge! {
7371 let Self::Encoded {
7372 flags,
7373
7374 } = out;
7375 }
7376
7377 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
7378
7379 Ok(())
7380 }
7381}
7382
7383impl ::fidl_next::EncodableOption for NodeSetFlagsRequest {
7384 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeSetFlagsRequest>;
7385}
7386
7387unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetFlagsRequest
7388where
7389 ___E: ::fidl_next::Encoder + ?Sized,
7390 NodeSetFlagsRequest: ::fidl_next::Encode<___E>,
7391{
7392 #[inline]
7393 fn encode_option(
7394 this: Option<Self>,
7395 encoder: &mut ___E,
7396 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7397 ) -> Result<(), ::fidl_next::EncodeError> {
7398 if let Some(inner) = this {
7399 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7400 ::fidl_next::WireBox::encode_present(out);
7401 } else {
7402 ::fidl_next::WireBox::encode_absent(out);
7403 }
7404
7405 Ok(())
7406 }
7407}
7408
7409unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeSetFlagsRequest
7410where
7411 ___E: ::fidl_next::Encoder + ?Sized,
7412 NodeSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
7413{
7414 #[inline]
7415 fn encode_option_ref(
7416 this: Option<&Self>,
7417 encoder: &mut ___E,
7418 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7419 ) -> Result<(), ::fidl_next::EncodeError> {
7420 if let Some(inner) = this {
7421 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7422 ::fidl_next::WireBox::encode_present(out);
7423 } else {
7424 ::fidl_next::WireBox::encode_absent(out);
7425 }
7426
7427 Ok(())
7428 }
7429}
7430
7431impl ::fidl_next::FromWire<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
7432 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeSetFlagsRequest, Self> = unsafe {
7433 ::fidl_next::CopyOptimization::enable_if(
7434 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
7435 .is_enabled(),
7436 )
7437 };
7438
7439 #[inline]
7440 fn from_wire(wire: WireNodeSetFlagsRequest) -> Self {
7441 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7442 }
7443}
7444
7445impl ::fidl_next::FromWireRef<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
7446 #[inline]
7447 fn from_wire_ref(wire: &WireNodeSetFlagsRequest) -> Self {
7448 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7449 }
7450}
7451
7452#[derive(Clone, Debug)]
7454#[repr(C)]
7455pub struct WireNodeSetFlagsRequest {
7456 pub flags: crate::WireFlags,
7457}
7458
7459unsafe impl ::fidl_next::Wire for WireNodeSetFlagsRequest {
7460 type Decoded<'de> = WireNodeSetFlagsRequest;
7461
7462 #[inline]
7463 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7464}
7465
7466unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetFlagsRequest
7467where
7468 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7469{
7470 fn decode(
7471 slot: ::fidl_next::Slot<'_, Self>,
7472 decoder: &mut ___D,
7473 ) -> Result<(), ::fidl_next::DecodeError> {
7474 ::fidl_next::munge! {
7475 let Self {
7476 mut flags,
7477
7478 } = slot;
7479 }
7480
7481 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
7482
7483 Ok(())
7484 }
7485}
7486
7487#[doc = " The maximum size for passing the SELinux context as an attribute.\n"]
7488pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256;
7489
7490#[doc = " Used in places where empty structs are needed, such as empty union members, to avoid creating\n new struct types.\n"]
7491#[derive(Clone, Debug)]
7492#[repr(C)]
7493pub struct EmptyStruct {}
7494
7495impl ::fidl_next::Encodable for EmptyStruct {
7496 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireEmptyStruct> =
7497 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
7498
7499 type Encoded = WireEmptyStruct;
7500}
7501
7502unsafe impl<___E> ::fidl_next::Encode<___E> for EmptyStruct
7503where
7504 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7505{
7506 #[inline]
7507 fn encode(
7508 self,
7509 encoder: &mut ___E,
7510 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7511 ) -> Result<(), ::fidl_next::EncodeError> {
7512 ::fidl_next::munge! {
7513 let Self::Encoded {
7514
7515 } = out;
7516 }
7517
7518 Ok(())
7519 }
7520}
7521
7522unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EmptyStruct
7523where
7524 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7525{
7526 #[inline]
7527 fn encode_ref(
7528 &self,
7529 encoder: &mut ___E,
7530 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7531 ) -> Result<(), ::fidl_next::EncodeError> {
7532 ::fidl_next::munge! {
7533 let Self::Encoded {
7534
7535 } = out;
7536 }
7537
7538 Ok(())
7539 }
7540}
7541
7542impl ::fidl_next::EncodableOption for EmptyStruct {
7543 type EncodedOption = ::fidl_next::WireBox<'static, WireEmptyStruct>;
7544}
7545
7546unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EmptyStruct
7547where
7548 ___E: ::fidl_next::Encoder + ?Sized,
7549 EmptyStruct: ::fidl_next::Encode<___E>,
7550{
7551 #[inline]
7552 fn encode_option(
7553 this: Option<Self>,
7554 encoder: &mut ___E,
7555 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7556 ) -> Result<(), ::fidl_next::EncodeError> {
7557 if let Some(inner) = this {
7558 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7559 ::fidl_next::WireBox::encode_present(out);
7560 } else {
7561 ::fidl_next::WireBox::encode_absent(out);
7562 }
7563
7564 Ok(())
7565 }
7566}
7567
7568unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for EmptyStruct
7569where
7570 ___E: ::fidl_next::Encoder + ?Sized,
7571 EmptyStruct: ::fidl_next::EncodeRef<___E>,
7572{
7573 #[inline]
7574 fn encode_option_ref(
7575 this: Option<&Self>,
7576 encoder: &mut ___E,
7577 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7578 ) -> Result<(), ::fidl_next::EncodeError> {
7579 if let Some(inner) = this {
7580 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7581 ::fidl_next::WireBox::encode_present(out);
7582 } else {
7583 ::fidl_next::WireBox::encode_absent(out);
7584 }
7585
7586 Ok(())
7587 }
7588}
7589
7590impl ::fidl_next::FromWire<WireEmptyStruct> for EmptyStruct {
7591 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireEmptyStruct, Self> =
7592 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
7593
7594 #[inline]
7595 fn from_wire(wire: WireEmptyStruct) -> Self {
7596 Self {}
7597 }
7598}
7599
7600impl ::fidl_next::FromWireRef<WireEmptyStruct> for EmptyStruct {
7601 #[inline]
7602 fn from_wire_ref(wire: &WireEmptyStruct) -> Self {
7603 Self {}
7604 }
7605}
7606
7607#[derive(Clone, Debug)]
7609#[repr(C)]
7610pub struct WireEmptyStruct {}
7611
7612unsafe impl ::fidl_next::Wire for WireEmptyStruct {
7613 type Decoded<'de> = WireEmptyStruct;
7614
7615 #[inline]
7616 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7617}
7618
7619unsafe impl<___D> ::fidl_next::Decode<___D> for WireEmptyStruct
7620where
7621 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7622{
7623 fn decode(
7624 slot: ::fidl_next::Slot<'_, Self>,
7625 decoder: &mut ___D,
7626 ) -> Result<(), ::fidl_next::DecodeError> {
7627 ::fidl_next::munge! {
7628 let Self {
7629
7630 } = slot;
7631 }
7632
7633 Ok(())
7634 }
7635}
7636
7637#[derive(Clone, Debug)]
7638pub enum SelinuxContext {
7639 Data(Vec<u8>),
7640
7641 UseExtendedAttributes(crate::EmptyStruct),
7642
7643 UnknownOrdinal_(u64),
7644}
7645
7646impl ::fidl_next::Encodable for SelinuxContext {
7647 type Encoded = WireSelinuxContext<'static>;
7648}
7649
7650unsafe impl<___E> ::fidl_next::Encode<___E> for SelinuxContext
7651where
7652 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7653
7654 ___E: ::fidl_next::Encoder,
7655{
7656 #[inline]
7657 fn encode(
7658 self,
7659 encoder: &mut ___E,
7660 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7661 ) -> Result<(), ::fidl_next::EncodeError> {
7662 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
7663
7664 match self {
7665 Self::Data(value) => {
7666 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
7667 }
7668
7669 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7670 ___E,
7671 crate::EmptyStruct,
7672 >(value, 2, encoder, raw)?,
7673
7674 Self::UnknownOrdinal_(ordinal) => {
7675 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
7676 }
7677 }
7678
7679 Ok(())
7680 }
7681}
7682
7683unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelinuxContext
7684where
7685 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7686
7687 ___E: ::fidl_next::Encoder,
7688{
7689 #[inline]
7690 fn encode_ref(
7691 &self,
7692 encoder: &mut ___E,
7693 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7694 ) -> Result<(), ::fidl_next::EncodeError> {
7695 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
7696
7697 match self {
7698 Self::Data(value) => {
7699 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 1, encoder, raw)?
7700 }
7701
7702 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7703 ___E,
7704 &crate::EmptyStruct,
7705 >(value, 2, encoder, raw)?,
7706
7707 Self::UnknownOrdinal_(ordinal) => {
7708 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
7709 }
7710 }
7711
7712 Ok(())
7713 }
7714}
7715
7716impl ::fidl_next::EncodableOption for SelinuxContext {
7717 type EncodedOption = WireOptionalSelinuxContext<'static>;
7718}
7719
7720unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SelinuxContext
7721where
7722 ___E: ?Sized,
7723 SelinuxContext: ::fidl_next::Encode<___E>,
7724{
7725 #[inline]
7726 fn encode_option(
7727 this: Option<Self>,
7728 encoder: &mut ___E,
7729 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7730 ) -> Result<(), ::fidl_next::EncodeError> {
7731 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
7732
7733 if let Some(inner) = this {
7734 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7735 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7736 } else {
7737 ::fidl_next::RawWireUnion::encode_absent(raw);
7738 }
7739
7740 Ok(())
7741 }
7742}
7743
7744unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SelinuxContext
7745where
7746 ___E: ?Sized,
7747 SelinuxContext: ::fidl_next::EncodeRef<___E>,
7748{
7749 #[inline]
7750 fn encode_option_ref(
7751 this: Option<&Self>,
7752 encoder: &mut ___E,
7753 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7754 ) -> Result<(), ::fidl_next::EncodeError> {
7755 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
7756
7757 if let Some(inner) = this {
7758 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7759 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7760 } else {
7761 ::fidl_next::RawWireUnion::encode_absent(raw);
7762 }
7763
7764 Ok(())
7765 }
7766}
7767
7768impl<'de> ::fidl_next::FromWire<WireSelinuxContext<'de>> for SelinuxContext {
7769 #[inline]
7770 fn from_wire(wire: WireSelinuxContext<'de>) -> Self {
7771 let wire = ::core::mem::ManuallyDrop::new(wire);
7772 match wire.raw.ordinal() {
7773 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
7774 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
7775 })),
7776
7777 2 => Self::UseExtendedAttributes(::fidl_next::FromWire::from_wire(unsafe {
7778 wire.raw.get().read_unchecked::<crate::WireEmptyStruct>()
7779 })),
7780
7781 _ => unsafe { ::core::hint::unreachable_unchecked() },
7782 }
7783 }
7784}
7785
7786impl<'de> ::fidl_next::FromWireRef<WireSelinuxContext<'de>> for SelinuxContext {
7787 #[inline]
7788 fn from_wire_ref(wire: &WireSelinuxContext<'de>) -> Self {
7789 match wire.raw.ordinal() {
7790 1 => Self::Data(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7791 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
7792 })),
7793
7794 2 => Self::UseExtendedAttributes(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7795 wire.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7796 })),
7797
7798 _ => unsafe { ::core::hint::unreachable_unchecked() },
7799 }
7800 }
7801}
7802
7803impl<'de> ::fidl_next::FromWireOption<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
7804 #[inline]
7805 fn from_wire_option(wire: WireOptionalSelinuxContext<'de>) -> Option<Self> {
7806 if let Some(inner) = wire.into_option() {
7807 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
7808 } else {
7809 None
7810 }
7811 }
7812}
7813
7814impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
7815 #[inline]
7816 fn from_wire_option_ref(wire: &WireOptionalSelinuxContext<'de>) -> Option<Self> {
7817 if let Some(inner) = wire.as_ref() {
7818 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7819 } else {
7820 None
7821 }
7822 }
7823}
7824
7825#[repr(transparent)]
7827pub struct WireSelinuxContext<'de> {
7828 raw: ::fidl_next::RawWireUnion,
7829 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7830}
7831
7832impl<'de> Drop for WireSelinuxContext<'de> {
7833 fn drop(&mut self) {
7834 match self.raw.ordinal() {
7835 1 => {
7836 let _ =
7837 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
7838 }
7839
7840 2 => {
7841 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEmptyStruct>() };
7842 }
7843
7844 _ => (),
7845 }
7846 }
7847}
7848
7849unsafe impl ::fidl_next::Wire for WireSelinuxContext<'static> {
7850 type Decoded<'de> = WireSelinuxContext<'de>;
7851
7852 #[inline]
7853 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7854 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7855 ::fidl_next::RawWireUnion::zero_padding(raw);
7856 }
7857}
7858
7859pub mod selinux_context {
7860 pub enum Ref<'de> {
7861 Data(&'de ::fidl_next::WireVector<'de, u8>),
7862
7863 UseExtendedAttributes(&'de crate::WireEmptyStruct),
7864
7865 UnknownOrdinal_(u64),
7866 }
7867}
7868
7869impl<'de> WireSelinuxContext<'de> {
7870 pub fn as_ref(&self) -> crate::selinux_context::Ref<'_> {
7871 match self.raw.ordinal() {
7872 1 => crate::selinux_context::Ref::Data(unsafe {
7873 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
7874 }),
7875
7876 2 => crate::selinux_context::Ref::UseExtendedAttributes(unsafe {
7877 self.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7878 }),
7879
7880 unknown => crate::selinux_context::Ref::UnknownOrdinal_(unknown),
7881 }
7882 }
7883}
7884
7885unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelinuxContext<'static>
7886where
7887 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7888
7889 ___D: ::fidl_next::Decoder,
7890{
7891 fn decode(
7892 mut slot: ::fidl_next::Slot<'_, Self>,
7893 decoder: &mut ___D,
7894 ) -> Result<(), ::fidl_next::DecodeError> {
7895 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7896 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7897 1 => {
7898 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
7899 raw, decoder,
7900 )?
7901 }
7902
7903 2 => {
7904 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7905 }
7906
7907 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7908 }
7909
7910 Ok(())
7911 }
7912}
7913
7914impl<'de> ::core::fmt::Debug for WireSelinuxContext<'de> {
7915 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7916 match self.raw.ordinal() {
7917 1 => unsafe {
7918 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
7919 },
7920 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireEmptyStruct>().fmt(f) },
7921 _ => unsafe { ::core::hint::unreachable_unchecked() },
7922 }
7923 }
7924}
7925
7926#[repr(transparent)]
7927pub struct WireOptionalSelinuxContext<'de> {
7928 raw: ::fidl_next::RawWireUnion,
7929 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7930}
7931
7932unsafe impl ::fidl_next::Wire for WireOptionalSelinuxContext<'static> {
7933 type Decoded<'de> = WireOptionalSelinuxContext<'de>;
7934
7935 #[inline]
7936 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7937 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7938 ::fidl_next::RawWireUnion::zero_padding(raw);
7939 }
7940}
7941
7942impl<'de> WireOptionalSelinuxContext<'de> {
7943 pub fn is_some(&self) -> bool {
7944 self.raw.is_some()
7945 }
7946
7947 pub fn is_none(&self) -> bool {
7948 self.raw.is_none()
7949 }
7950
7951 pub fn as_ref(&self) -> Option<&WireSelinuxContext<'de>> {
7952 if self.is_some() {
7953 Some(unsafe { &*(self as *const Self).cast() })
7954 } else {
7955 None
7956 }
7957 }
7958
7959 pub fn into_option(self) -> Option<WireSelinuxContext<'de>> {
7960 if self.is_some() {
7961 Some(WireSelinuxContext { raw: self.raw, _phantom: ::core::marker::PhantomData })
7962 } else {
7963 None
7964 }
7965 }
7966}
7967
7968unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalSelinuxContext<'static>
7969where
7970 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7971
7972 ___D: ::fidl_next::Decoder,
7973{
7974 fn decode(
7975 mut slot: ::fidl_next::Slot<'_, Self>,
7976 decoder: &mut ___D,
7977 ) -> Result<(), ::fidl_next::DecodeError> {
7978 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7979 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7980 1 => {
7981 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
7982 raw, decoder,
7983 )?
7984 }
7985
7986 2 => {
7987 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7988 }
7989
7990 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7991 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7992 }
7993
7994 Ok(())
7995 }
7996}
7997
7998impl<'de> ::core::fmt::Debug for WireOptionalSelinuxContext<'de> {
7999 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8000 self.as_ref().fmt(f)
8001 }
8002}
8003
8004#[derive(Clone, Debug, Default)]
8005pub struct MutableNodeAttributes {
8006 pub creation_time: Option<u64>,
8007
8008 pub modification_time: Option<u64>,
8009
8010 pub mode: Option<u32>,
8011
8012 pub uid: Option<u32>,
8013
8014 pub gid: Option<u32>,
8015
8016 pub rdev: Option<u64>,
8017
8018 pub access_time: Option<u64>,
8019
8020 pub casefold: Option<bool>,
8021
8022 pub selinux_context: Option<crate::SelinuxContext>,
8023
8024 pub wrapping_key_id: Option<[u8; 16]>,
8025}
8026
8027impl MutableNodeAttributes {
8028 fn __max_ordinal(&self) -> usize {
8029 if self.wrapping_key_id.is_some() {
8030 return 10;
8031 }
8032
8033 if self.selinux_context.is_some() {
8034 return 9;
8035 }
8036
8037 if self.casefold.is_some() {
8038 return 8;
8039 }
8040
8041 if self.access_time.is_some() {
8042 return 7;
8043 }
8044
8045 if self.rdev.is_some() {
8046 return 6;
8047 }
8048
8049 if self.gid.is_some() {
8050 return 5;
8051 }
8052
8053 if self.uid.is_some() {
8054 return 4;
8055 }
8056
8057 if self.mode.is_some() {
8058 return 3;
8059 }
8060
8061 if self.modification_time.is_some() {
8062 return 2;
8063 }
8064
8065 if self.creation_time.is_some() {
8066 return 1;
8067 }
8068
8069 0
8070 }
8071}
8072
8073impl ::fidl_next::Encodable for MutableNodeAttributes {
8074 type Encoded = WireMutableNodeAttributes<'static>;
8075}
8076
8077unsafe impl<___E> ::fidl_next::Encode<___E> for MutableNodeAttributes
8078where
8079 ___E: ::fidl_next::Encoder + ?Sized,
8080{
8081 #[inline]
8082 fn encode(
8083 mut self,
8084 encoder: &mut ___E,
8085 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8086 ) -> Result<(), ::fidl_next::EncodeError> {
8087 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
8088
8089 let max_ord = self.__max_ordinal();
8090
8091 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8092 ::fidl_next::Wire::zero_padding(&mut out);
8093
8094 let mut preallocated =
8095 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8096
8097 for i in 1..=max_ord {
8098 match i {
8099 10 => {
8100 if let Some(wrapping_key_id) = self.wrapping_key_id.take() {
8101 ::fidl_next::WireEnvelope::encode_value(
8102 wrapping_key_id,
8103 preallocated.encoder,
8104 &mut out,
8105 )?;
8106 } else {
8107 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8108 }
8109 }
8110
8111 9 => {
8112 if let Some(selinux_context) = self.selinux_context.take() {
8113 ::fidl_next::WireEnvelope::encode_value(
8114 selinux_context,
8115 preallocated.encoder,
8116 &mut out,
8117 )?;
8118 } else {
8119 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8120 }
8121 }
8122
8123 8 => {
8124 if let Some(casefold) = self.casefold.take() {
8125 ::fidl_next::WireEnvelope::encode_value(
8126 casefold,
8127 preallocated.encoder,
8128 &mut out,
8129 )?;
8130 } else {
8131 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8132 }
8133 }
8134
8135 7 => {
8136 if let Some(access_time) = self.access_time.take() {
8137 ::fidl_next::WireEnvelope::encode_value(
8138 access_time,
8139 preallocated.encoder,
8140 &mut out,
8141 )?;
8142 } else {
8143 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8144 }
8145 }
8146
8147 6 => {
8148 if let Some(rdev) = self.rdev.take() {
8149 ::fidl_next::WireEnvelope::encode_value(
8150 rdev,
8151 preallocated.encoder,
8152 &mut out,
8153 )?;
8154 } else {
8155 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8156 }
8157 }
8158
8159 5 => {
8160 if let Some(gid) = self.gid.take() {
8161 ::fidl_next::WireEnvelope::encode_value(
8162 gid,
8163 preallocated.encoder,
8164 &mut out,
8165 )?;
8166 } else {
8167 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8168 }
8169 }
8170
8171 4 => {
8172 if let Some(uid) = self.uid.take() {
8173 ::fidl_next::WireEnvelope::encode_value(
8174 uid,
8175 preallocated.encoder,
8176 &mut out,
8177 )?;
8178 } else {
8179 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8180 }
8181 }
8182
8183 3 => {
8184 if let Some(mode) = self.mode.take() {
8185 ::fidl_next::WireEnvelope::encode_value(
8186 mode,
8187 preallocated.encoder,
8188 &mut out,
8189 )?;
8190 } else {
8191 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8192 }
8193 }
8194
8195 2 => {
8196 if let Some(modification_time) = self.modification_time.take() {
8197 ::fidl_next::WireEnvelope::encode_value(
8198 modification_time,
8199 preallocated.encoder,
8200 &mut out,
8201 )?;
8202 } else {
8203 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8204 }
8205 }
8206
8207 1 => {
8208 if let Some(creation_time) = self.creation_time.take() {
8209 ::fidl_next::WireEnvelope::encode_value(
8210 creation_time,
8211 preallocated.encoder,
8212 &mut out,
8213 )?;
8214 } else {
8215 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8216 }
8217 }
8218
8219 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8220 }
8221 unsafe {
8222 preallocated.write_next(out.assume_init_ref());
8223 }
8224 }
8225
8226 ::fidl_next::WireTable::encode_len(table, max_ord);
8227
8228 Ok(())
8229 }
8230}
8231
8232unsafe impl<___E> ::fidl_next::EncodeRef<___E> for MutableNodeAttributes
8233where
8234 ___E: ::fidl_next::Encoder + ?Sized,
8235{
8236 #[inline]
8237 fn encode_ref(
8238 &self,
8239 encoder: &mut ___E,
8240 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8241 ) -> Result<(), ::fidl_next::EncodeError> {
8242 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
8243
8244 let max_ord = self.__max_ordinal();
8245
8246 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8247 ::fidl_next::Wire::zero_padding(&mut out);
8248
8249 let mut preallocated =
8250 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8251
8252 for i in 1..=max_ord {
8253 match i {
8254 10 => {
8255 if let Some(wrapping_key_id) = &self.wrapping_key_id {
8256 ::fidl_next::WireEnvelope::encode_value(
8257 wrapping_key_id,
8258 preallocated.encoder,
8259 &mut out,
8260 )?;
8261 } else {
8262 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8263 }
8264 }
8265
8266 9 => {
8267 if let Some(selinux_context) = &self.selinux_context {
8268 ::fidl_next::WireEnvelope::encode_value(
8269 selinux_context,
8270 preallocated.encoder,
8271 &mut out,
8272 )?;
8273 } else {
8274 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8275 }
8276 }
8277
8278 8 => {
8279 if let Some(casefold) = &self.casefold {
8280 ::fidl_next::WireEnvelope::encode_value(
8281 casefold,
8282 preallocated.encoder,
8283 &mut out,
8284 )?;
8285 } else {
8286 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8287 }
8288 }
8289
8290 7 => {
8291 if let Some(access_time) = &self.access_time {
8292 ::fidl_next::WireEnvelope::encode_value(
8293 access_time,
8294 preallocated.encoder,
8295 &mut out,
8296 )?;
8297 } else {
8298 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8299 }
8300 }
8301
8302 6 => {
8303 if let Some(rdev) = &self.rdev {
8304 ::fidl_next::WireEnvelope::encode_value(
8305 rdev,
8306 preallocated.encoder,
8307 &mut out,
8308 )?;
8309 } else {
8310 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8311 }
8312 }
8313
8314 5 => {
8315 if let Some(gid) = &self.gid {
8316 ::fidl_next::WireEnvelope::encode_value(
8317 gid,
8318 preallocated.encoder,
8319 &mut out,
8320 )?;
8321 } else {
8322 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8323 }
8324 }
8325
8326 4 => {
8327 if let Some(uid) = &self.uid {
8328 ::fidl_next::WireEnvelope::encode_value(
8329 uid,
8330 preallocated.encoder,
8331 &mut out,
8332 )?;
8333 } else {
8334 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8335 }
8336 }
8337
8338 3 => {
8339 if let Some(mode) = &self.mode {
8340 ::fidl_next::WireEnvelope::encode_value(
8341 mode,
8342 preallocated.encoder,
8343 &mut out,
8344 )?;
8345 } else {
8346 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8347 }
8348 }
8349
8350 2 => {
8351 if let Some(modification_time) = &self.modification_time {
8352 ::fidl_next::WireEnvelope::encode_value(
8353 modification_time,
8354 preallocated.encoder,
8355 &mut out,
8356 )?;
8357 } else {
8358 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8359 }
8360 }
8361
8362 1 => {
8363 if let Some(creation_time) = &self.creation_time {
8364 ::fidl_next::WireEnvelope::encode_value(
8365 creation_time,
8366 preallocated.encoder,
8367 &mut out,
8368 )?;
8369 } else {
8370 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8371 }
8372 }
8373
8374 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8375 }
8376 unsafe {
8377 preallocated.write_next(out.assume_init_ref());
8378 }
8379 }
8380
8381 ::fidl_next::WireTable::encode_len(table, max_ord);
8382
8383 Ok(())
8384 }
8385}
8386
8387impl<'de> ::fidl_next::FromWire<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
8388 #[inline]
8389 fn from_wire(wire: WireMutableNodeAttributes<'de>) -> Self {
8390 let wire = ::core::mem::ManuallyDrop::new(wire);
8391
8392 let creation_time = wire.table.get(1);
8393
8394 let modification_time = wire.table.get(2);
8395
8396 let mode = wire.table.get(3);
8397
8398 let uid = wire.table.get(4);
8399
8400 let gid = wire.table.get(5);
8401
8402 let rdev = wire.table.get(6);
8403
8404 let access_time = wire.table.get(7);
8405
8406 let casefold = wire.table.get(8);
8407
8408 let selinux_context = wire.table.get(9);
8409
8410 let wrapping_key_id = wire.table.get(10);
8411
8412 Self {
8413 creation_time: creation_time.map(|envelope| {
8414 ::fidl_next::FromWire::from_wire(unsafe {
8415 envelope.read_unchecked::<::fidl_next::WireU64>()
8416 })
8417 }),
8418
8419 modification_time: modification_time.map(|envelope| {
8420 ::fidl_next::FromWire::from_wire(unsafe {
8421 envelope.read_unchecked::<::fidl_next::WireU64>()
8422 })
8423 }),
8424
8425 mode: mode.map(|envelope| {
8426 ::fidl_next::FromWire::from_wire(unsafe {
8427 envelope.read_unchecked::<::fidl_next::WireU32>()
8428 })
8429 }),
8430
8431 uid: uid.map(|envelope| {
8432 ::fidl_next::FromWire::from_wire(unsafe {
8433 envelope.read_unchecked::<::fidl_next::WireU32>()
8434 })
8435 }),
8436
8437 gid: gid.map(|envelope| {
8438 ::fidl_next::FromWire::from_wire(unsafe {
8439 envelope.read_unchecked::<::fidl_next::WireU32>()
8440 })
8441 }),
8442
8443 rdev: rdev.map(|envelope| {
8444 ::fidl_next::FromWire::from_wire(unsafe {
8445 envelope.read_unchecked::<::fidl_next::WireU64>()
8446 })
8447 }),
8448
8449 access_time: access_time.map(|envelope| {
8450 ::fidl_next::FromWire::from_wire(unsafe {
8451 envelope.read_unchecked::<::fidl_next::WireU64>()
8452 })
8453 }),
8454
8455 casefold: casefold.map(|envelope| {
8456 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
8457 }),
8458
8459 selinux_context: selinux_context.map(|envelope| {
8460 ::fidl_next::FromWire::from_wire(unsafe {
8461 envelope.read_unchecked::<crate::WireSelinuxContext<'de>>()
8462 })
8463 }),
8464
8465 wrapping_key_id: wrapping_key_id.map(|envelope| {
8466 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<[u8; 16]>() })
8467 }),
8468 }
8469 }
8470}
8471
8472impl<'de> ::fidl_next::FromWireRef<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
8473 #[inline]
8474 fn from_wire_ref(wire: &WireMutableNodeAttributes<'de>) -> Self {
8475 Self {
8476 creation_time: wire.table.get(1).map(|envelope| {
8477 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8478 envelope.deref_unchecked::<::fidl_next::WireU64>()
8479 })
8480 }),
8481
8482 modification_time: wire.table.get(2).map(|envelope| {
8483 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8484 envelope.deref_unchecked::<::fidl_next::WireU64>()
8485 })
8486 }),
8487
8488 mode: wire.table.get(3).map(|envelope| {
8489 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8490 envelope.deref_unchecked::<::fidl_next::WireU32>()
8491 })
8492 }),
8493
8494 uid: wire.table.get(4).map(|envelope| {
8495 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8496 envelope.deref_unchecked::<::fidl_next::WireU32>()
8497 })
8498 }),
8499
8500 gid: wire.table.get(5).map(|envelope| {
8501 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8502 envelope.deref_unchecked::<::fidl_next::WireU32>()
8503 })
8504 }),
8505
8506 rdev: wire.table.get(6).map(|envelope| {
8507 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8508 envelope.deref_unchecked::<::fidl_next::WireU64>()
8509 })
8510 }),
8511
8512 access_time: wire.table.get(7).map(|envelope| {
8513 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8514 envelope.deref_unchecked::<::fidl_next::WireU64>()
8515 })
8516 }),
8517
8518 casefold: wire.table.get(8).map(|envelope| {
8519 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8520 envelope.deref_unchecked::<bool>()
8521 })
8522 }),
8523
8524 selinux_context: wire.table.get(9).map(|envelope| {
8525 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8526 envelope.deref_unchecked::<crate::WireSelinuxContext<'de>>()
8527 })
8528 }),
8529
8530 wrapping_key_id: wire.table.get(10).map(|envelope| {
8531 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8532 envelope.deref_unchecked::<[u8; 16]>()
8533 })
8534 }),
8535 }
8536 }
8537}
8538
8539#[repr(C)]
8541pub struct WireMutableNodeAttributes<'de> {
8542 table: ::fidl_next::WireTable<'de>,
8543}
8544
8545impl<'de> Drop for WireMutableNodeAttributes<'de> {
8546 fn drop(&mut self) {
8547 let _ = self
8548 .table
8549 .get(1)
8550 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8551
8552 let _ = self
8553 .table
8554 .get(2)
8555 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8556
8557 let _ = self
8558 .table
8559 .get(3)
8560 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8561
8562 let _ = self
8563 .table
8564 .get(4)
8565 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8566
8567 let _ = self
8568 .table
8569 .get(5)
8570 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8571
8572 let _ = self
8573 .table
8574 .get(6)
8575 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8576
8577 let _ = self
8578 .table
8579 .get(7)
8580 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8581
8582 let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
8583
8584 let _ = self
8585 .table
8586 .get(9)
8587 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireSelinuxContext<'de>>() });
8588
8589 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<[u8; 16]>() });
8590 }
8591}
8592
8593unsafe impl ::fidl_next::Wire for WireMutableNodeAttributes<'static> {
8594 type Decoded<'de> = WireMutableNodeAttributes<'de>;
8595
8596 #[inline]
8597 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8598 ::fidl_next::munge!(let Self { table } = out);
8599 ::fidl_next::WireTable::zero_padding(table);
8600 }
8601}
8602
8603unsafe impl<___D> ::fidl_next::Decode<___D> for WireMutableNodeAttributes<'static>
8604where
8605 ___D: ::fidl_next::Decoder + ?Sized,
8606{
8607 fn decode(
8608 slot: ::fidl_next::Slot<'_, Self>,
8609 decoder: &mut ___D,
8610 ) -> Result<(), ::fidl_next::DecodeError> {
8611 ::fidl_next::munge!(let Self { table } = slot);
8612
8613 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8614 match ordinal {
8615 0 => unsafe { ::core::hint::unreachable_unchecked() },
8616
8617 1 => {
8618 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8619 slot.as_mut(),
8620 decoder,
8621 )?;
8622
8623 Ok(())
8624 }
8625
8626 2 => {
8627 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8628 slot.as_mut(),
8629 decoder,
8630 )?;
8631
8632 Ok(())
8633 }
8634
8635 3 => {
8636 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8637 slot.as_mut(),
8638 decoder,
8639 )?;
8640
8641 Ok(())
8642 }
8643
8644 4 => {
8645 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8646 slot.as_mut(),
8647 decoder,
8648 )?;
8649
8650 Ok(())
8651 }
8652
8653 5 => {
8654 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8655 slot.as_mut(),
8656 decoder,
8657 )?;
8658
8659 Ok(())
8660 }
8661
8662 6 => {
8663 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8664 slot.as_mut(),
8665 decoder,
8666 )?;
8667
8668 Ok(())
8669 }
8670
8671 7 => {
8672 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8673 slot.as_mut(),
8674 decoder,
8675 )?;
8676
8677 Ok(())
8678 }
8679
8680 8 => {
8681 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
8682
8683 Ok(())
8684 }
8685
8686 9 => {
8687 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireSelinuxContext<'static>>(
8688 slot.as_mut(),
8689 decoder,
8690 )?;
8691
8692 Ok(())
8693 }
8694
8695 10 => {
8696 ::fidl_next::WireEnvelope::decode_as::<___D, [u8; 16]>(slot.as_mut(), decoder)?;
8697
8698 Ok(())
8699 }
8700
8701 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8702 }
8703 })
8704 }
8705}
8706
8707impl<'de> WireMutableNodeAttributes<'de> {
8708 pub fn creation_time(&self) -> Option<&::fidl_next::WireU64> {
8709 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8710 }
8711
8712 pub fn modification_time(&self) -> Option<&::fidl_next::WireU64> {
8713 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8714 }
8715
8716 pub fn mode(&self) -> Option<&::fidl_next::WireU32> {
8717 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8718 }
8719
8720 pub fn uid(&self) -> Option<&::fidl_next::WireU32> {
8721 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8722 }
8723
8724 pub fn gid(&self) -> Option<&::fidl_next::WireU32> {
8725 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8726 }
8727
8728 pub fn rdev(&self) -> Option<&::fidl_next::WireU64> {
8729 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8730 }
8731
8732 pub fn access_time(&self) -> Option<&::fidl_next::WireU64> {
8733 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
8734 }
8735
8736 pub fn casefold(&self) -> Option<&bool> {
8737 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
8738 }
8739
8740 pub fn selinux_context(&self) -> Option<&crate::WireSelinuxContext<'de>> {
8741 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
8742 }
8743
8744 pub fn wrapping_key_id(&self) -> Option<&[u8; 16]> {
8745 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
8746 }
8747}
8748
8749impl<'de> ::core::fmt::Debug for WireMutableNodeAttributes<'de> {
8750 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8751 f.debug_struct("MutableNodeAttributes")
8752 .field("creation_time", &self.creation_time())
8753 .field("modification_time", &self.modification_time())
8754 .field("mode", &self.mode())
8755 .field("uid", &self.uid())
8756 .field("gid", &self.gid())
8757 .field("rdev", &self.rdev())
8758 .field("access_time", &self.access_time())
8759 .field("casefold", &self.casefold())
8760 .field("selinux_context", &self.selinux_context())
8761 .field("wrapping_key_id", &self.wrapping_key_id())
8762 .finish()
8763 }
8764}
8765
8766::fidl_next::bitflags! {
8767 #[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(
8768 Clone,
8769 Copy,
8770 Debug,
8771 PartialEq,
8772 Eq,
8773 Hash,
8774 )]
8775 pub struct NodeProtocolKinds: u64 {
8776 #[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;
8777 #[doc = " The directory representation of a node.\n\n The connection will speak the [`Directory`] protocol.\n"]const DIRECTORY = 2;
8778 #[doc = " The file representation of a node.\n\n The connection will speak the [`File`] protocol.\n"]const FILE = 4;
8779 #[doc = " The symlink representation of a node.\n\n The connection will speak the [`Symlink`] protocol.\n"]const SYMLINK = 8;
8780 const _ = !0;
8781 }
8782}
8783
8784impl ::fidl_next::Encodable for NodeProtocolKinds {
8785 type Encoded = WireNodeProtocolKinds;
8786}
8787
8788unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProtocolKinds
8789where
8790 ___E: ?Sized,
8791{
8792 #[inline]
8793 fn encode(
8794 self,
8795 encoder: &mut ___E,
8796 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8797 ) -> Result<(), ::fidl_next::EncodeError> {
8798 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8799 }
8800}
8801
8802unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProtocolKinds
8803where
8804 ___E: ?Sized,
8805{
8806 #[inline]
8807 fn encode_ref(
8808 &self,
8809 _: &mut ___E,
8810 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8811 ) -> Result<(), ::fidl_next::EncodeError> {
8812 ::fidl_next::munge!(let WireNodeProtocolKinds { value } = out);
8813 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
8814 Ok(())
8815 }
8816}
8817
8818impl ::core::convert::From<WireNodeProtocolKinds> for NodeProtocolKinds {
8819 fn from(wire: WireNodeProtocolKinds) -> Self {
8820 Self::from_bits_retain(u64::from(wire.value))
8821 }
8822}
8823
8824impl ::fidl_next::FromWire<WireNodeProtocolKinds> for NodeProtocolKinds {
8825 #[inline]
8826 fn from_wire(wire: WireNodeProtocolKinds) -> Self {
8827 Self::from(wire)
8828 }
8829}
8830
8831impl ::fidl_next::FromWireRef<WireNodeProtocolKinds> for NodeProtocolKinds {
8832 #[inline]
8833 fn from_wire_ref(wire: &WireNodeProtocolKinds) -> Self {
8834 Self::from(*wire)
8835 }
8836}
8837
8838#[derive(Clone, Copy, Debug)]
8840#[repr(transparent)]
8841pub struct WireNodeProtocolKinds {
8842 value: ::fidl_next::WireU64,
8843}
8844
8845unsafe impl ::fidl_next::Wire for WireNodeProtocolKinds {
8846 type Decoded<'de> = Self;
8847
8848 #[inline]
8849 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8850 }
8852}
8853
8854unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProtocolKinds
8855where
8856 ___D: ?Sized,
8857{
8858 fn decode(
8859 slot: ::fidl_next::Slot<'_, Self>,
8860 _: &mut ___D,
8861 ) -> Result<(), ::fidl_next::DecodeError> {
8862 Ok(())
8863 }
8864}
8865
8866impl ::core::convert::From<NodeProtocolKinds> for WireNodeProtocolKinds {
8867 fn from(natural: NodeProtocolKinds) -> Self {
8868 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
8869 }
8870}
8871
8872#[doc = " Denotes which hash algorithm is used to build the merkle tree for\n fsverity-enabled files.\n"]
8873#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8874#[repr(u8)]
8875pub enum HashAlgorithm {
8876 Sha256 = 1,
8877 Sha512 = 2,
8878 UnknownOrdinal_(u8),
8879}
8880
8881impl ::fidl_next::Encodable for HashAlgorithm {
8882 type Encoded = WireHashAlgorithm;
8883}
8884impl ::std::convert::From<u8> for HashAlgorithm {
8885 fn from(value: u8) -> Self {
8886 match value {
8887 1 => Self::Sha256,
8888 2 => Self::Sha512,
8889
8890 _ => Self::UnknownOrdinal_(value),
8891 }
8892 }
8893}
8894
8895unsafe impl<___E> ::fidl_next::Encode<___E> for HashAlgorithm
8896where
8897 ___E: ?Sized,
8898{
8899 #[inline]
8900 fn encode(
8901 self,
8902 encoder: &mut ___E,
8903 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8904 ) -> Result<(), ::fidl_next::EncodeError> {
8905 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8906 }
8907}
8908
8909unsafe impl<___E> ::fidl_next::EncodeRef<___E> for HashAlgorithm
8910where
8911 ___E: ?Sized,
8912{
8913 #[inline]
8914 fn encode_ref(
8915 &self,
8916 encoder: &mut ___E,
8917 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8918 ) -> Result<(), ::fidl_next::EncodeError> {
8919 ::fidl_next::munge!(let WireHashAlgorithm { value } = out);
8920 let _ = value.write(u8::from(match *self {
8921 Self::Sha256 => 1,
8922
8923 Self::Sha512 => 2,
8924
8925 Self::UnknownOrdinal_(value) => value,
8926 }));
8927
8928 Ok(())
8929 }
8930}
8931
8932impl ::core::convert::From<WireHashAlgorithm> for HashAlgorithm {
8933 fn from(wire: WireHashAlgorithm) -> Self {
8934 match u8::from(wire.value) {
8935 1 => Self::Sha256,
8936
8937 2 => Self::Sha512,
8938
8939 value => Self::UnknownOrdinal_(value),
8940 }
8941 }
8942}
8943
8944impl ::fidl_next::FromWire<WireHashAlgorithm> for HashAlgorithm {
8945 #[inline]
8946 fn from_wire(wire: WireHashAlgorithm) -> Self {
8947 Self::from(wire)
8948 }
8949}
8950
8951impl ::fidl_next::FromWireRef<WireHashAlgorithm> for HashAlgorithm {
8952 #[inline]
8953 fn from_wire_ref(wire: &WireHashAlgorithm) -> Self {
8954 Self::from(*wire)
8955 }
8956}
8957
8958#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8960#[repr(transparent)]
8961pub struct WireHashAlgorithm {
8962 value: u8,
8963}
8964
8965unsafe impl ::fidl_next::Wire for WireHashAlgorithm {
8966 type Decoded<'de> = Self;
8967
8968 #[inline]
8969 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8970 }
8972}
8973
8974impl WireHashAlgorithm {
8975 pub const SHA256: WireHashAlgorithm = WireHashAlgorithm { value: 1 };
8976
8977 pub const SHA512: WireHashAlgorithm = WireHashAlgorithm { value: 2 };
8978}
8979
8980unsafe impl<___D> ::fidl_next::Decode<___D> for WireHashAlgorithm
8981where
8982 ___D: ?Sized,
8983{
8984 fn decode(
8985 slot: ::fidl_next::Slot<'_, Self>,
8986 _: &mut ___D,
8987 ) -> Result<(), ::fidl_next::DecodeError> {
8988 Ok(())
8989 }
8990}
8991
8992impl ::core::convert::From<HashAlgorithm> for WireHashAlgorithm {
8993 fn from(natural: HashAlgorithm) -> Self {
8994 match natural {
8995 HashAlgorithm::Sha256 => WireHashAlgorithm::SHA256,
8996
8997 HashAlgorithm::Sha512 => WireHashAlgorithm::SHA512,
8998
8999 HashAlgorithm::UnknownOrdinal_(value) => WireHashAlgorithm { value: u8::from(value) },
9000 }
9001 }
9002}
9003
9004#[doc = " Set of options used to enable verity on a file.\n"]
9005#[derive(Clone, Debug, Default)]
9006pub struct VerificationOptions {
9007 pub hash_algorithm: Option<crate::HashAlgorithm>,
9008
9009 pub salt: Option<Vec<u8>>,
9010}
9011
9012impl VerificationOptions {
9013 fn __max_ordinal(&self) -> usize {
9014 if self.salt.is_some() {
9015 return 2;
9016 }
9017
9018 if self.hash_algorithm.is_some() {
9019 return 1;
9020 }
9021
9022 0
9023 }
9024}
9025
9026impl ::fidl_next::Encodable for VerificationOptions {
9027 type Encoded = WireVerificationOptions<'static>;
9028}
9029
9030unsafe impl<___E> ::fidl_next::Encode<___E> for VerificationOptions
9031where
9032 ___E: ::fidl_next::Encoder + ?Sized,
9033{
9034 #[inline]
9035 fn encode(
9036 mut self,
9037 encoder: &mut ___E,
9038 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9039 ) -> Result<(), ::fidl_next::EncodeError> {
9040 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
9041
9042 let max_ord = self.__max_ordinal();
9043
9044 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9045 ::fidl_next::Wire::zero_padding(&mut out);
9046
9047 let mut preallocated =
9048 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9049
9050 for i in 1..=max_ord {
9051 match i {
9052 2 => {
9053 if let Some(salt) = self.salt.take() {
9054 ::fidl_next::WireEnvelope::encode_value(
9055 salt,
9056 preallocated.encoder,
9057 &mut out,
9058 )?;
9059 } else {
9060 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9061 }
9062 }
9063
9064 1 => {
9065 if let Some(hash_algorithm) = self.hash_algorithm.take() {
9066 ::fidl_next::WireEnvelope::encode_value(
9067 hash_algorithm,
9068 preallocated.encoder,
9069 &mut out,
9070 )?;
9071 } else {
9072 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9073 }
9074 }
9075
9076 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9077 }
9078 unsafe {
9079 preallocated.write_next(out.assume_init_ref());
9080 }
9081 }
9082
9083 ::fidl_next::WireTable::encode_len(table, max_ord);
9084
9085 Ok(())
9086 }
9087}
9088
9089unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VerificationOptions
9090where
9091 ___E: ::fidl_next::Encoder + ?Sized,
9092{
9093 #[inline]
9094 fn encode_ref(
9095 &self,
9096 encoder: &mut ___E,
9097 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9098 ) -> Result<(), ::fidl_next::EncodeError> {
9099 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
9100
9101 let max_ord = self.__max_ordinal();
9102
9103 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9104 ::fidl_next::Wire::zero_padding(&mut out);
9105
9106 let mut preallocated =
9107 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9108
9109 for i in 1..=max_ord {
9110 match i {
9111 2 => {
9112 if let Some(salt) = &self.salt {
9113 ::fidl_next::WireEnvelope::encode_value(
9114 salt,
9115 preallocated.encoder,
9116 &mut out,
9117 )?;
9118 } else {
9119 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9120 }
9121 }
9122
9123 1 => {
9124 if let Some(hash_algorithm) = &self.hash_algorithm {
9125 ::fidl_next::WireEnvelope::encode_value(
9126 hash_algorithm,
9127 preallocated.encoder,
9128 &mut out,
9129 )?;
9130 } else {
9131 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9132 }
9133 }
9134
9135 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9136 }
9137 unsafe {
9138 preallocated.write_next(out.assume_init_ref());
9139 }
9140 }
9141
9142 ::fidl_next::WireTable::encode_len(table, max_ord);
9143
9144 Ok(())
9145 }
9146}
9147
9148impl<'de> ::fidl_next::FromWire<WireVerificationOptions<'de>> for VerificationOptions {
9149 #[inline]
9150 fn from_wire(wire: WireVerificationOptions<'de>) -> Self {
9151 let wire = ::core::mem::ManuallyDrop::new(wire);
9152
9153 let hash_algorithm = wire.table.get(1);
9154
9155 let salt = wire.table.get(2);
9156
9157 Self {
9158 hash_algorithm: hash_algorithm.map(|envelope| {
9159 ::fidl_next::FromWire::from_wire(unsafe {
9160 envelope.read_unchecked::<crate::WireHashAlgorithm>()
9161 })
9162 }),
9163
9164 salt: salt.map(|envelope| {
9165 ::fidl_next::FromWire::from_wire(unsafe {
9166 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9167 })
9168 }),
9169 }
9170 }
9171}
9172
9173impl<'de> ::fidl_next::FromWireRef<WireVerificationOptions<'de>> for VerificationOptions {
9174 #[inline]
9175 fn from_wire_ref(wire: &WireVerificationOptions<'de>) -> Self {
9176 Self {
9177 hash_algorithm: wire.table.get(1).map(|envelope| {
9178 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9179 envelope.deref_unchecked::<crate::WireHashAlgorithm>()
9180 })
9181 }),
9182
9183 salt: wire.table.get(2).map(|envelope| {
9184 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9185 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
9186 })
9187 }),
9188 }
9189 }
9190}
9191
9192#[repr(C)]
9194pub struct WireVerificationOptions<'de> {
9195 table: ::fidl_next::WireTable<'de>,
9196}
9197
9198impl<'de> Drop for WireVerificationOptions<'de> {
9199 fn drop(&mut self) {
9200 let _ = self
9201 .table
9202 .get(1)
9203 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireHashAlgorithm>() });
9204
9205 let _ = self.table.get(2).map(|envelope| unsafe {
9206 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9207 });
9208 }
9209}
9210
9211unsafe impl ::fidl_next::Wire for WireVerificationOptions<'static> {
9212 type Decoded<'de> = WireVerificationOptions<'de>;
9213
9214 #[inline]
9215 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9216 ::fidl_next::munge!(let Self { table } = out);
9217 ::fidl_next::WireTable::zero_padding(table);
9218 }
9219}
9220
9221unsafe impl<___D> ::fidl_next::Decode<___D> for WireVerificationOptions<'static>
9222where
9223 ___D: ::fidl_next::Decoder + ?Sized,
9224{
9225 fn decode(
9226 slot: ::fidl_next::Slot<'_, Self>,
9227 decoder: &mut ___D,
9228 ) -> Result<(), ::fidl_next::DecodeError> {
9229 ::fidl_next::munge!(let Self { table } = slot);
9230
9231 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9232 match ordinal {
9233 0 => unsafe { ::core::hint::unreachable_unchecked() },
9234
9235 1 => {
9236 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireHashAlgorithm>(
9237 slot.as_mut(),
9238 decoder,
9239 )?;
9240
9241 Ok(())
9242 }
9243
9244 2 => {
9245 ::fidl_next::WireEnvelope::decode_as::<
9246 ___D,
9247 ::fidl_next::WireVector<'static, u8>,
9248 >(slot.as_mut(), decoder)?;
9249
9250 let salt = unsafe {
9251 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
9252 };
9253
9254 if salt.len() > 32 {
9255 return Err(::fidl_next::DecodeError::VectorTooLong {
9256 size: salt.len() as u64,
9257 limit: 32,
9258 });
9259 }
9260
9261 Ok(())
9262 }
9263
9264 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9265 }
9266 })
9267 }
9268}
9269
9270impl<'de> WireVerificationOptions<'de> {
9271 pub fn hash_algorithm(&self) -> Option<&crate::WireHashAlgorithm> {
9272 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9273 }
9274
9275 pub fn salt(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
9276 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9277 }
9278}
9279
9280impl<'de> ::core::fmt::Debug for WireVerificationOptions<'de> {
9281 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9282 f.debug_struct("VerificationOptions")
9283 .field("hash_algorithm", &self.hash_algorithm())
9284 .field("salt", &self.salt())
9285 .finish()
9286 }
9287}
9288
9289#[derive(Clone, Debug, Default)]
9290pub struct ImmutableNodeAttributes {
9291 pub protocols: Option<crate::NodeProtocolKinds>,
9292
9293 pub abilities: Option<crate::Operations>,
9294
9295 pub content_size: Option<u64>,
9296
9297 pub storage_size: Option<u64>,
9298
9299 pub link_count: Option<u64>,
9300
9301 pub id: Option<u64>,
9302
9303 pub change_time: Option<u64>,
9304
9305 pub options: Option<crate::VerificationOptions>,
9306
9307 pub root_hash: Option<Vec<u8>>,
9308
9309 pub verity_enabled: Option<bool>,
9310}
9311
9312impl ImmutableNodeAttributes {
9313 fn __max_ordinal(&self) -> usize {
9314 if self.verity_enabled.is_some() {
9315 return 10;
9316 }
9317
9318 if self.root_hash.is_some() {
9319 return 9;
9320 }
9321
9322 if self.options.is_some() {
9323 return 8;
9324 }
9325
9326 if self.change_time.is_some() {
9327 return 7;
9328 }
9329
9330 if self.id.is_some() {
9331 return 6;
9332 }
9333
9334 if self.link_count.is_some() {
9335 return 5;
9336 }
9337
9338 if self.storage_size.is_some() {
9339 return 4;
9340 }
9341
9342 if self.content_size.is_some() {
9343 return 3;
9344 }
9345
9346 if self.abilities.is_some() {
9347 return 2;
9348 }
9349
9350 if self.protocols.is_some() {
9351 return 1;
9352 }
9353
9354 0
9355 }
9356}
9357
9358impl ::fidl_next::Encodable for ImmutableNodeAttributes {
9359 type Encoded = WireImmutableNodeAttributes<'static>;
9360}
9361
9362unsafe impl<___E> ::fidl_next::Encode<___E> for ImmutableNodeAttributes
9363where
9364 ___E: ::fidl_next::Encoder + ?Sized,
9365{
9366 #[inline]
9367 fn encode(
9368 mut self,
9369 encoder: &mut ___E,
9370 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9371 ) -> Result<(), ::fidl_next::EncodeError> {
9372 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
9373
9374 let max_ord = self.__max_ordinal();
9375
9376 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9377 ::fidl_next::Wire::zero_padding(&mut out);
9378
9379 let mut preallocated =
9380 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9381
9382 for i in 1..=max_ord {
9383 match i {
9384 10 => {
9385 if let Some(verity_enabled) = self.verity_enabled.take() {
9386 ::fidl_next::WireEnvelope::encode_value(
9387 verity_enabled,
9388 preallocated.encoder,
9389 &mut out,
9390 )?;
9391 } else {
9392 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9393 }
9394 }
9395
9396 9 => {
9397 if let Some(root_hash) = self.root_hash.take() {
9398 ::fidl_next::WireEnvelope::encode_value(
9399 root_hash,
9400 preallocated.encoder,
9401 &mut out,
9402 )?;
9403 } else {
9404 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9405 }
9406 }
9407
9408 8 => {
9409 if let Some(options) = self.options.take() {
9410 ::fidl_next::WireEnvelope::encode_value(
9411 options,
9412 preallocated.encoder,
9413 &mut out,
9414 )?;
9415 } else {
9416 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9417 }
9418 }
9419
9420 7 => {
9421 if let Some(change_time) = self.change_time.take() {
9422 ::fidl_next::WireEnvelope::encode_value(
9423 change_time,
9424 preallocated.encoder,
9425 &mut out,
9426 )?;
9427 } else {
9428 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9429 }
9430 }
9431
9432 6 => {
9433 if let Some(id) = self.id.take() {
9434 ::fidl_next::WireEnvelope::encode_value(
9435 id,
9436 preallocated.encoder,
9437 &mut out,
9438 )?;
9439 } else {
9440 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9441 }
9442 }
9443
9444 5 => {
9445 if let Some(link_count) = self.link_count.take() {
9446 ::fidl_next::WireEnvelope::encode_value(
9447 link_count,
9448 preallocated.encoder,
9449 &mut out,
9450 )?;
9451 } else {
9452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9453 }
9454 }
9455
9456 4 => {
9457 if let Some(storage_size) = self.storage_size.take() {
9458 ::fidl_next::WireEnvelope::encode_value(
9459 storage_size,
9460 preallocated.encoder,
9461 &mut out,
9462 )?;
9463 } else {
9464 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9465 }
9466 }
9467
9468 3 => {
9469 if let Some(content_size) = self.content_size.take() {
9470 ::fidl_next::WireEnvelope::encode_value(
9471 content_size,
9472 preallocated.encoder,
9473 &mut out,
9474 )?;
9475 } else {
9476 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9477 }
9478 }
9479
9480 2 => {
9481 if let Some(abilities) = self.abilities.take() {
9482 ::fidl_next::WireEnvelope::encode_value(
9483 abilities,
9484 preallocated.encoder,
9485 &mut out,
9486 )?;
9487 } else {
9488 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9489 }
9490 }
9491
9492 1 => {
9493 if let Some(protocols) = self.protocols.take() {
9494 ::fidl_next::WireEnvelope::encode_value(
9495 protocols,
9496 preallocated.encoder,
9497 &mut out,
9498 )?;
9499 } else {
9500 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9501 }
9502 }
9503
9504 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9505 }
9506 unsafe {
9507 preallocated.write_next(out.assume_init_ref());
9508 }
9509 }
9510
9511 ::fidl_next::WireTable::encode_len(table, max_ord);
9512
9513 Ok(())
9514 }
9515}
9516
9517unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ImmutableNodeAttributes
9518where
9519 ___E: ::fidl_next::Encoder + ?Sized,
9520{
9521 #[inline]
9522 fn encode_ref(
9523 &self,
9524 encoder: &mut ___E,
9525 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9526 ) -> Result<(), ::fidl_next::EncodeError> {
9527 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
9528
9529 let max_ord = self.__max_ordinal();
9530
9531 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9532 ::fidl_next::Wire::zero_padding(&mut out);
9533
9534 let mut preallocated =
9535 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9536
9537 for i in 1..=max_ord {
9538 match i {
9539 10 => {
9540 if let Some(verity_enabled) = &self.verity_enabled {
9541 ::fidl_next::WireEnvelope::encode_value(
9542 verity_enabled,
9543 preallocated.encoder,
9544 &mut out,
9545 )?;
9546 } else {
9547 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9548 }
9549 }
9550
9551 9 => {
9552 if let Some(root_hash) = &self.root_hash {
9553 ::fidl_next::WireEnvelope::encode_value(
9554 root_hash,
9555 preallocated.encoder,
9556 &mut out,
9557 )?;
9558 } else {
9559 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9560 }
9561 }
9562
9563 8 => {
9564 if let Some(options) = &self.options {
9565 ::fidl_next::WireEnvelope::encode_value(
9566 options,
9567 preallocated.encoder,
9568 &mut out,
9569 )?;
9570 } else {
9571 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9572 }
9573 }
9574
9575 7 => {
9576 if let Some(change_time) = &self.change_time {
9577 ::fidl_next::WireEnvelope::encode_value(
9578 change_time,
9579 preallocated.encoder,
9580 &mut out,
9581 )?;
9582 } else {
9583 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9584 }
9585 }
9586
9587 6 => {
9588 if let Some(id) = &self.id {
9589 ::fidl_next::WireEnvelope::encode_value(
9590 id,
9591 preallocated.encoder,
9592 &mut out,
9593 )?;
9594 } else {
9595 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9596 }
9597 }
9598
9599 5 => {
9600 if let Some(link_count) = &self.link_count {
9601 ::fidl_next::WireEnvelope::encode_value(
9602 link_count,
9603 preallocated.encoder,
9604 &mut out,
9605 )?;
9606 } else {
9607 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9608 }
9609 }
9610
9611 4 => {
9612 if let Some(storage_size) = &self.storage_size {
9613 ::fidl_next::WireEnvelope::encode_value(
9614 storage_size,
9615 preallocated.encoder,
9616 &mut out,
9617 )?;
9618 } else {
9619 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9620 }
9621 }
9622
9623 3 => {
9624 if let Some(content_size) = &self.content_size {
9625 ::fidl_next::WireEnvelope::encode_value(
9626 content_size,
9627 preallocated.encoder,
9628 &mut out,
9629 )?;
9630 } else {
9631 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9632 }
9633 }
9634
9635 2 => {
9636 if let Some(abilities) = &self.abilities {
9637 ::fidl_next::WireEnvelope::encode_value(
9638 abilities,
9639 preallocated.encoder,
9640 &mut out,
9641 )?;
9642 } else {
9643 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9644 }
9645 }
9646
9647 1 => {
9648 if let Some(protocols) = &self.protocols {
9649 ::fidl_next::WireEnvelope::encode_value(
9650 protocols,
9651 preallocated.encoder,
9652 &mut out,
9653 )?;
9654 } else {
9655 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9656 }
9657 }
9658
9659 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9660 }
9661 unsafe {
9662 preallocated.write_next(out.assume_init_ref());
9663 }
9664 }
9665
9666 ::fidl_next::WireTable::encode_len(table, max_ord);
9667
9668 Ok(())
9669 }
9670}
9671
9672impl<'de> ::fidl_next::FromWire<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
9673 #[inline]
9674 fn from_wire(wire: WireImmutableNodeAttributes<'de>) -> Self {
9675 let wire = ::core::mem::ManuallyDrop::new(wire);
9676
9677 let protocols = wire.table.get(1);
9678
9679 let abilities = wire.table.get(2);
9680
9681 let content_size = wire.table.get(3);
9682
9683 let storage_size = wire.table.get(4);
9684
9685 let link_count = wire.table.get(5);
9686
9687 let id = wire.table.get(6);
9688
9689 let change_time = wire.table.get(7);
9690
9691 let options = wire.table.get(8);
9692
9693 let root_hash = wire.table.get(9);
9694
9695 let verity_enabled = wire.table.get(10);
9696
9697 Self {
9698 protocols: protocols.map(|envelope| {
9699 ::fidl_next::FromWire::from_wire(unsafe {
9700 envelope.read_unchecked::<crate::WireNodeProtocolKinds>()
9701 })
9702 }),
9703
9704 abilities: abilities.map(|envelope| {
9705 ::fidl_next::FromWire::from_wire(unsafe {
9706 envelope.read_unchecked::<crate::WireOperations>()
9707 })
9708 }),
9709
9710 content_size: content_size.map(|envelope| {
9711 ::fidl_next::FromWire::from_wire(unsafe {
9712 envelope.read_unchecked::<::fidl_next::WireU64>()
9713 })
9714 }),
9715
9716 storage_size: storage_size.map(|envelope| {
9717 ::fidl_next::FromWire::from_wire(unsafe {
9718 envelope.read_unchecked::<::fidl_next::WireU64>()
9719 })
9720 }),
9721
9722 link_count: link_count.map(|envelope| {
9723 ::fidl_next::FromWire::from_wire(unsafe {
9724 envelope.read_unchecked::<::fidl_next::WireU64>()
9725 })
9726 }),
9727
9728 id: id.map(|envelope| {
9729 ::fidl_next::FromWire::from_wire(unsafe {
9730 envelope.read_unchecked::<::fidl_next::WireU64>()
9731 })
9732 }),
9733
9734 change_time: change_time.map(|envelope| {
9735 ::fidl_next::FromWire::from_wire(unsafe {
9736 envelope.read_unchecked::<::fidl_next::WireU64>()
9737 })
9738 }),
9739
9740 options: options.map(|envelope| {
9741 ::fidl_next::FromWire::from_wire(unsafe {
9742 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
9743 })
9744 }),
9745
9746 root_hash: root_hash.map(|envelope| {
9747 ::fidl_next::FromWire::from_wire(unsafe {
9748 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9749 })
9750 }),
9751
9752 verity_enabled: verity_enabled.map(|envelope| {
9753 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
9754 }),
9755 }
9756 }
9757}
9758
9759impl<'de> ::fidl_next::FromWireRef<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
9760 #[inline]
9761 fn from_wire_ref(wire: &WireImmutableNodeAttributes<'de>) -> Self {
9762 Self {
9763 protocols: wire.table.get(1).map(|envelope| {
9764 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9765 envelope.deref_unchecked::<crate::WireNodeProtocolKinds>()
9766 })
9767 }),
9768
9769 abilities: wire.table.get(2).map(|envelope| {
9770 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9771 envelope.deref_unchecked::<crate::WireOperations>()
9772 })
9773 }),
9774
9775 content_size: wire.table.get(3).map(|envelope| {
9776 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9777 envelope.deref_unchecked::<::fidl_next::WireU64>()
9778 })
9779 }),
9780
9781 storage_size: wire.table.get(4).map(|envelope| {
9782 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9783 envelope.deref_unchecked::<::fidl_next::WireU64>()
9784 })
9785 }),
9786
9787 link_count: wire.table.get(5).map(|envelope| {
9788 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9789 envelope.deref_unchecked::<::fidl_next::WireU64>()
9790 })
9791 }),
9792
9793 id: wire.table.get(6).map(|envelope| {
9794 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9795 envelope.deref_unchecked::<::fidl_next::WireU64>()
9796 })
9797 }),
9798
9799 change_time: wire.table.get(7).map(|envelope| {
9800 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9801 envelope.deref_unchecked::<::fidl_next::WireU64>()
9802 })
9803 }),
9804
9805 options: wire.table.get(8).map(|envelope| {
9806 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9807 envelope.deref_unchecked::<crate::WireVerificationOptions<'de>>()
9808 })
9809 }),
9810
9811 root_hash: wire.table.get(9).map(|envelope| {
9812 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9813 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
9814 })
9815 }),
9816
9817 verity_enabled: wire.table.get(10).map(|envelope| {
9818 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9819 envelope.deref_unchecked::<bool>()
9820 })
9821 }),
9822 }
9823 }
9824}
9825
9826#[repr(C)]
9828pub struct WireImmutableNodeAttributes<'de> {
9829 table: ::fidl_next::WireTable<'de>,
9830}
9831
9832impl<'de> Drop for WireImmutableNodeAttributes<'de> {
9833 fn drop(&mut self) {
9834 let _ = self
9835 .table
9836 .get(1)
9837 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeProtocolKinds>() });
9838
9839 let _ = self
9840 .table
9841 .get(2)
9842 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
9843
9844 let _ = self
9845 .table
9846 .get(3)
9847 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9848
9849 let _ = self
9850 .table
9851 .get(4)
9852 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9853
9854 let _ = self
9855 .table
9856 .get(5)
9857 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9858
9859 let _ = self
9860 .table
9861 .get(6)
9862 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9863
9864 let _ = self
9865 .table
9866 .get(7)
9867 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9868
9869 let _ = self.table.get(8).map(|envelope| unsafe {
9870 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
9871 });
9872
9873 let _ = self.table.get(9).map(|envelope| unsafe {
9874 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9875 });
9876
9877 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9878 }
9879}
9880
9881unsafe impl ::fidl_next::Wire for WireImmutableNodeAttributes<'static> {
9882 type Decoded<'de> = WireImmutableNodeAttributes<'de>;
9883
9884 #[inline]
9885 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9886 ::fidl_next::munge!(let Self { table } = out);
9887 ::fidl_next::WireTable::zero_padding(table);
9888 }
9889}
9890
9891unsafe impl<___D> ::fidl_next::Decode<___D> for WireImmutableNodeAttributes<'static>
9892where
9893 ___D: ::fidl_next::Decoder + ?Sized,
9894{
9895 fn decode(
9896 slot: ::fidl_next::Slot<'_, Self>,
9897 decoder: &mut ___D,
9898 ) -> Result<(), ::fidl_next::DecodeError> {
9899 ::fidl_next::munge!(let Self { table } = slot);
9900
9901 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9902 match ordinal {
9903 0 => unsafe { ::core::hint::unreachable_unchecked() },
9904
9905 1 => {
9906 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeProtocolKinds>(
9907 slot.as_mut(),
9908 decoder,
9909 )?;
9910
9911 Ok(())
9912 }
9913
9914 2 => {
9915 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
9916 slot.as_mut(),
9917 decoder,
9918 )?;
9919
9920 Ok(())
9921 }
9922
9923 3 => {
9924 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9925 slot.as_mut(),
9926 decoder,
9927 )?;
9928
9929 Ok(())
9930 }
9931
9932 4 => {
9933 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9934 slot.as_mut(),
9935 decoder,
9936 )?;
9937
9938 Ok(())
9939 }
9940
9941 5 => {
9942 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9943 slot.as_mut(),
9944 decoder,
9945 )?;
9946
9947 Ok(())
9948 }
9949
9950 6 => {
9951 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9952 slot.as_mut(),
9953 decoder,
9954 )?;
9955
9956 Ok(())
9957 }
9958
9959 7 => {
9960 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9961 slot.as_mut(),
9962 decoder,
9963 )?;
9964
9965 Ok(())
9966 }
9967
9968 8 => {
9969 ::fidl_next::WireEnvelope::decode_as::<
9970 ___D,
9971 crate::WireVerificationOptions<'static>,
9972 >(slot.as_mut(), decoder)?;
9973
9974 Ok(())
9975 }
9976
9977 9 => {
9978 ::fidl_next::WireEnvelope::decode_as::<
9979 ___D,
9980 ::fidl_next::WireVector<'static, u8>,
9981 >(slot.as_mut(), decoder)?;
9982
9983 let root_hash = unsafe {
9984 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
9985 };
9986
9987 if root_hash.len() > 64 {
9988 return Err(::fidl_next::DecodeError::VectorTooLong {
9989 size: root_hash.len() as u64,
9990 limit: 64,
9991 });
9992 }
9993
9994 Ok(())
9995 }
9996
9997 10 => {
9998 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9999
10000 Ok(())
10001 }
10002
10003 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10004 }
10005 })
10006 }
10007}
10008
10009impl<'de> WireImmutableNodeAttributes<'de> {
10010 pub fn protocols(&self) -> Option<&crate::WireNodeProtocolKinds> {
10011 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10012 }
10013
10014 pub fn abilities(&self) -> Option<&crate::WireOperations> {
10015 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10016 }
10017
10018 pub fn content_size(&self) -> Option<&::fidl_next::WireU64> {
10019 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10020 }
10021
10022 pub fn storage_size(&self) -> Option<&::fidl_next::WireU64> {
10023 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10024 }
10025
10026 pub fn link_count(&self) -> Option<&::fidl_next::WireU64> {
10027 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10028 }
10029
10030 pub fn id(&self) -> Option<&::fidl_next::WireU64> {
10031 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10032 }
10033
10034 pub fn change_time(&self) -> Option<&::fidl_next::WireU64> {
10035 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10036 }
10037
10038 pub fn options(&self) -> Option<&crate::WireVerificationOptions<'de>> {
10039 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
10040 }
10041
10042 pub fn root_hash(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
10043 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
10044 }
10045
10046 pub fn verity_enabled(&self) -> Option<&bool> {
10047 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
10048 }
10049}
10050
10051impl<'de> ::core::fmt::Debug for WireImmutableNodeAttributes<'de> {
10052 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10053 f.debug_struct("ImmutableNodeAttributes")
10054 .field("protocols", &self.protocols())
10055 .field("abilities", &self.abilities())
10056 .field("content_size", &self.content_size())
10057 .field("storage_size", &self.storage_size())
10058 .field("link_count", &self.link_count())
10059 .field("id", &self.id())
10060 .field("change_time", &self.change_time())
10061 .field("options", &self.options())
10062 .field("root_hash", &self.root_hash())
10063 .field("verity_enabled", &self.verity_enabled())
10064 .finish()
10065 }
10066}
10067
10068#[derive(Clone, Debug)]
10069pub struct NodeAttributes2 {
10070 pub mutable_attributes: crate::MutableNodeAttributes,
10071
10072 pub immutable_attributes: crate::ImmutableNodeAttributes,
10073}
10074
10075impl ::fidl_next::Encodable for NodeAttributes2 {
10076 type Encoded = WireNodeAttributes2<'static>;
10077}
10078
10079unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes2
10080where
10081 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10082
10083 ___E: ::fidl_next::Encoder,
10084{
10085 #[inline]
10086 fn encode(
10087 self,
10088 encoder: &mut ___E,
10089 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10090 ) -> Result<(), ::fidl_next::EncodeError> {
10091 ::fidl_next::munge! {
10092 let Self::Encoded {
10093 mutable_attributes,
10094 immutable_attributes,
10095
10096 } = out;
10097 }
10098
10099 ::fidl_next::Encode::encode(self.mutable_attributes, encoder, mutable_attributes)?;
10100
10101 ::fidl_next::Encode::encode(self.immutable_attributes, encoder, immutable_attributes)?;
10102
10103 Ok(())
10104 }
10105}
10106
10107unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes2
10108where
10109 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10110
10111 ___E: ::fidl_next::Encoder,
10112{
10113 #[inline]
10114 fn encode_ref(
10115 &self,
10116 encoder: &mut ___E,
10117 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10118 ) -> Result<(), ::fidl_next::EncodeError> {
10119 ::fidl_next::munge! {
10120 let Self::Encoded {
10121 mutable_attributes,
10122 immutable_attributes,
10123
10124 } = out;
10125 }
10126
10127 ::fidl_next::EncodeRef::encode_ref(&self.mutable_attributes, encoder, mutable_attributes)?;
10128
10129 ::fidl_next::EncodeRef::encode_ref(
10130 &self.immutable_attributes,
10131 encoder,
10132 immutable_attributes,
10133 )?;
10134
10135 Ok(())
10136 }
10137}
10138
10139impl ::fidl_next::EncodableOption for NodeAttributes2 {
10140 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes2<'static>>;
10141}
10142
10143unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes2
10144where
10145 ___E: ::fidl_next::Encoder + ?Sized,
10146 NodeAttributes2: ::fidl_next::Encode<___E>,
10147{
10148 #[inline]
10149 fn encode_option(
10150 this: Option<Self>,
10151 encoder: &mut ___E,
10152 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10153 ) -> Result<(), ::fidl_next::EncodeError> {
10154 if let Some(inner) = this {
10155 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10156 ::fidl_next::WireBox::encode_present(out);
10157 } else {
10158 ::fidl_next::WireBox::encode_absent(out);
10159 }
10160
10161 Ok(())
10162 }
10163}
10164
10165unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes2
10166where
10167 ___E: ::fidl_next::Encoder + ?Sized,
10168 NodeAttributes2: ::fidl_next::EncodeRef<___E>,
10169{
10170 #[inline]
10171 fn encode_option_ref(
10172 this: Option<&Self>,
10173 encoder: &mut ___E,
10174 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10175 ) -> Result<(), ::fidl_next::EncodeError> {
10176 if let Some(inner) = this {
10177 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10178 ::fidl_next::WireBox::encode_present(out);
10179 } else {
10180 ::fidl_next::WireBox::encode_absent(out);
10181 }
10182
10183 Ok(())
10184 }
10185}
10186
10187impl<'de> ::fidl_next::FromWire<WireNodeAttributes2<'de>> for NodeAttributes2 {
10188 #[inline]
10189 fn from_wire(wire: WireNodeAttributes2<'de>) -> Self {
10190 Self {
10191 mutable_attributes: ::fidl_next::FromWire::from_wire(wire.mutable_attributes),
10192
10193 immutable_attributes: ::fidl_next::FromWire::from_wire(wire.immutable_attributes),
10194 }
10195 }
10196}
10197
10198impl<'de> ::fidl_next::FromWireRef<WireNodeAttributes2<'de>> for NodeAttributes2 {
10199 #[inline]
10200 fn from_wire_ref(wire: &WireNodeAttributes2<'de>) -> Self {
10201 Self {
10202 mutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.mutable_attributes),
10203
10204 immutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(
10205 &wire.immutable_attributes,
10206 ),
10207 }
10208 }
10209}
10210
10211#[derive(Debug)]
10213#[repr(C)]
10214pub struct WireNodeAttributes2<'de> {
10215 pub mutable_attributes: crate::WireMutableNodeAttributes<'de>,
10216
10217 pub immutable_attributes: crate::WireImmutableNodeAttributes<'de>,
10218}
10219
10220unsafe impl ::fidl_next::Wire for WireNodeAttributes2<'static> {
10221 type Decoded<'de> = WireNodeAttributes2<'de>;
10222
10223 #[inline]
10224 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10225}
10226
10227unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes2<'static>
10228where
10229 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10230
10231 ___D: ::fidl_next::Decoder,
10232{
10233 fn decode(
10234 slot: ::fidl_next::Slot<'_, Self>,
10235 decoder: &mut ___D,
10236 ) -> Result<(), ::fidl_next::DecodeError> {
10237 ::fidl_next::munge! {
10238 let Self {
10239 mut mutable_attributes,
10240 mut immutable_attributes,
10241
10242 } = slot;
10243 }
10244
10245 ::fidl_next::Decode::decode(mutable_attributes.as_mut(), decoder)?;
10246
10247 ::fidl_next::Decode::decode(immutable_attributes.as_mut(), decoder)?;
10248
10249 Ok(())
10250 }
10251}
10252
10253#[doc = " Information that describes the target node.\n"]
10254#[derive(Clone, Debug, Default)]
10255pub struct NodeInfo {
10256 pub attributes: Option<crate::NodeAttributes2>,
10257}
10258
10259impl NodeInfo {
10260 fn __max_ordinal(&self) -> usize {
10261 if self.attributes.is_some() {
10262 return 1;
10263 }
10264
10265 0
10266 }
10267}
10268
10269impl ::fidl_next::Encodable for NodeInfo {
10270 type Encoded = WireNodeInfo<'static>;
10271}
10272
10273unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfo
10274where
10275 ___E: ::fidl_next::Encoder + ?Sized,
10276{
10277 #[inline]
10278 fn encode(
10279 mut self,
10280 encoder: &mut ___E,
10281 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10282 ) -> Result<(), ::fidl_next::EncodeError> {
10283 ::fidl_next::munge!(let WireNodeInfo { table } = out);
10284
10285 let max_ord = self.__max_ordinal();
10286
10287 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10288 ::fidl_next::Wire::zero_padding(&mut out);
10289
10290 let mut preallocated =
10291 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10292
10293 for i in 1..=max_ord {
10294 match i {
10295 1 => {
10296 if let Some(attributes) = self.attributes.take() {
10297 ::fidl_next::WireEnvelope::encode_value(
10298 attributes,
10299 preallocated.encoder,
10300 &mut out,
10301 )?;
10302 } else {
10303 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10304 }
10305 }
10306
10307 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10308 }
10309 unsafe {
10310 preallocated.write_next(out.assume_init_ref());
10311 }
10312 }
10313
10314 ::fidl_next::WireTable::encode_len(table, max_ord);
10315
10316 Ok(())
10317 }
10318}
10319
10320unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeInfo
10321where
10322 ___E: ::fidl_next::Encoder + ?Sized,
10323{
10324 #[inline]
10325 fn encode_ref(
10326 &self,
10327 encoder: &mut ___E,
10328 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10329 ) -> Result<(), ::fidl_next::EncodeError> {
10330 ::fidl_next::munge!(let WireNodeInfo { table } = out);
10331
10332 let max_ord = self.__max_ordinal();
10333
10334 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10335 ::fidl_next::Wire::zero_padding(&mut out);
10336
10337 let mut preallocated =
10338 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10339
10340 for i in 1..=max_ord {
10341 match i {
10342 1 => {
10343 if let Some(attributes) = &self.attributes {
10344 ::fidl_next::WireEnvelope::encode_value(
10345 attributes,
10346 preallocated.encoder,
10347 &mut out,
10348 )?;
10349 } else {
10350 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10351 }
10352 }
10353
10354 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10355 }
10356 unsafe {
10357 preallocated.write_next(out.assume_init_ref());
10358 }
10359 }
10360
10361 ::fidl_next::WireTable::encode_len(table, max_ord);
10362
10363 Ok(())
10364 }
10365}
10366
10367impl<'de> ::fidl_next::FromWire<WireNodeInfo<'de>> for NodeInfo {
10368 #[inline]
10369 fn from_wire(wire: WireNodeInfo<'de>) -> Self {
10370 let wire = ::core::mem::ManuallyDrop::new(wire);
10371
10372 let attributes = wire.table.get(1);
10373
10374 Self {
10375 attributes: attributes.map(|envelope| {
10376 ::fidl_next::FromWire::from_wire(unsafe {
10377 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10378 })
10379 }),
10380 }
10381 }
10382}
10383
10384impl<'de> ::fidl_next::FromWireRef<WireNodeInfo<'de>> for NodeInfo {
10385 #[inline]
10386 fn from_wire_ref(wire: &WireNodeInfo<'de>) -> Self {
10387 Self {
10388 attributes: wire.table.get(1).map(|envelope| {
10389 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10390 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
10391 })
10392 }),
10393 }
10394 }
10395}
10396
10397#[repr(C)]
10399pub struct WireNodeInfo<'de> {
10400 table: ::fidl_next::WireTable<'de>,
10401}
10402
10403impl<'de> Drop for WireNodeInfo<'de> {
10404 fn drop(&mut self) {
10405 let _ = self.table.get(1).map(|envelope| unsafe {
10406 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10407 });
10408 }
10409}
10410
10411unsafe impl ::fidl_next::Wire for WireNodeInfo<'static> {
10412 type Decoded<'de> = WireNodeInfo<'de>;
10413
10414 #[inline]
10415 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10416 ::fidl_next::munge!(let Self { table } = out);
10417 ::fidl_next::WireTable::zero_padding(table);
10418 }
10419}
10420
10421unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfo<'static>
10422where
10423 ___D: ::fidl_next::Decoder + ?Sized,
10424{
10425 fn decode(
10426 slot: ::fidl_next::Slot<'_, Self>,
10427 decoder: &mut ___D,
10428 ) -> Result<(), ::fidl_next::DecodeError> {
10429 ::fidl_next::munge!(let Self { table } = slot);
10430
10431 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10432 match ordinal {
10433 0 => unsafe { ::core::hint::unreachable_unchecked() },
10434
10435 1 => {
10436 ::fidl_next::WireEnvelope::decode_as::<
10437 ___D,
10438 crate::WireNodeAttributes2<'static>,
10439 >(slot.as_mut(), decoder)?;
10440
10441 Ok(())
10442 }
10443
10444 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10445 }
10446 })
10447 }
10448}
10449
10450impl<'de> WireNodeInfo<'de> {
10451 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10452 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10453 }
10454}
10455
10456impl<'de> ::core::fmt::Debug for WireNodeInfo<'de> {
10457 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10458 f.debug_struct("NodeInfo").field("attributes", &self.attributes()).finish()
10459 }
10460}
10461
10462#[derive(Clone, Debug, Default)]
10463pub struct DirectoryInfo {
10464 pub attributes: Option<crate::NodeAttributes2>,
10465}
10466
10467impl DirectoryInfo {
10468 fn __max_ordinal(&self) -> usize {
10469 if self.attributes.is_some() {
10470 return 1;
10471 }
10472
10473 0
10474 }
10475}
10476
10477impl ::fidl_next::Encodable for DirectoryInfo {
10478 type Encoded = WireDirectoryInfo<'static>;
10479}
10480
10481unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryInfo
10482where
10483 ___E: ::fidl_next::Encoder + ?Sized,
10484{
10485 #[inline]
10486 fn encode(
10487 mut self,
10488 encoder: &mut ___E,
10489 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10490 ) -> Result<(), ::fidl_next::EncodeError> {
10491 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
10492
10493 let max_ord = self.__max_ordinal();
10494
10495 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10496 ::fidl_next::Wire::zero_padding(&mut out);
10497
10498 let mut preallocated =
10499 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10500
10501 for i in 1..=max_ord {
10502 match i {
10503 1 => {
10504 if let Some(attributes) = self.attributes.take() {
10505 ::fidl_next::WireEnvelope::encode_value(
10506 attributes,
10507 preallocated.encoder,
10508 &mut out,
10509 )?;
10510 } else {
10511 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10512 }
10513 }
10514
10515 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10516 }
10517 unsafe {
10518 preallocated.write_next(out.assume_init_ref());
10519 }
10520 }
10521
10522 ::fidl_next::WireTable::encode_len(table, max_ord);
10523
10524 Ok(())
10525 }
10526}
10527
10528unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryInfo
10529where
10530 ___E: ::fidl_next::Encoder + ?Sized,
10531{
10532 #[inline]
10533 fn encode_ref(
10534 &self,
10535 encoder: &mut ___E,
10536 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10537 ) -> Result<(), ::fidl_next::EncodeError> {
10538 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
10539
10540 let max_ord = self.__max_ordinal();
10541
10542 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10543 ::fidl_next::Wire::zero_padding(&mut out);
10544
10545 let mut preallocated =
10546 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10547
10548 for i in 1..=max_ord {
10549 match i {
10550 1 => {
10551 if let Some(attributes) = &self.attributes {
10552 ::fidl_next::WireEnvelope::encode_value(
10553 attributes,
10554 preallocated.encoder,
10555 &mut out,
10556 )?;
10557 } else {
10558 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10559 }
10560 }
10561
10562 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10563 }
10564 unsafe {
10565 preallocated.write_next(out.assume_init_ref());
10566 }
10567 }
10568
10569 ::fidl_next::WireTable::encode_len(table, max_ord);
10570
10571 Ok(())
10572 }
10573}
10574
10575impl<'de> ::fidl_next::FromWire<WireDirectoryInfo<'de>> for DirectoryInfo {
10576 #[inline]
10577 fn from_wire(wire: WireDirectoryInfo<'de>) -> Self {
10578 let wire = ::core::mem::ManuallyDrop::new(wire);
10579
10580 let attributes = wire.table.get(1);
10581
10582 Self {
10583 attributes: attributes.map(|envelope| {
10584 ::fidl_next::FromWire::from_wire(unsafe {
10585 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10586 })
10587 }),
10588 }
10589 }
10590}
10591
10592impl<'de> ::fidl_next::FromWireRef<WireDirectoryInfo<'de>> for DirectoryInfo {
10593 #[inline]
10594 fn from_wire_ref(wire: &WireDirectoryInfo<'de>) -> Self {
10595 Self {
10596 attributes: wire.table.get(1).map(|envelope| {
10597 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10598 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
10599 })
10600 }),
10601 }
10602 }
10603}
10604
10605#[repr(C)]
10607pub struct WireDirectoryInfo<'de> {
10608 table: ::fidl_next::WireTable<'de>,
10609}
10610
10611impl<'de> Drop for WireDirectoryInfo<'de> {
10612 fn drop(&mut self) {
10613 let _ = self.table.get(1).map(|envelope| unsafe {
10614 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10615 });
10616 }
10617}
10618
10619unsafe impl ::fidl_next::Wire for WireDirectoryInfo<'static> {
10620 type Decoded<'de> = WireDirectoryInfo<'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 WireDirectoryInfo<'static>
10630where
10631 ___D: ::fidl_next::Decoder + ?Sized,
10632{
10633 fn decode(
10634 slot: ::fidl_next::Slot<'_, Self>,
10635 decoder: &mut ___D,
10636 ) -> 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::<
10645 ___D,
10646 crate::WireNodeAttributes2<'static>,
10647 >(slot.as_mut(), decoder)?;
10648
10649 Ok(())
10650 }
10651
10652 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10653 }
10654 })
10655 }
10656}
10657
10658impl<'de> WireDirectoryInfo<'de> {
10659 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10660 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10661 }
10662}
10663
10664impl<'de> ::core::fmt::Debug for WireDirectoryInfo<'de> {
10665 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10666 f.debug_struct("DirectoryInfo").field("attributes", &self.attributes()).finish()
10667 }
10668}
10669
10670#[doc = " Auxiliary data for the file representation of a node.\n"]
10671#[derive(Debug, Default)]
10672pub struct FileInfo {
10673 pub is_append: Option<bool>,
10674
10675 pub observer: Option<::fidl_next::fuchsia::zx::Handle>,
10676
10677 pub stream: Option<::fidl_next::fuchsia::zx::Handle>,
10678
10679 pub attributes: Option<crate::NodeAttributes2>,
10680}
10681
10682impl FileInfo {
10683 fn __max_ordinal(&self) -> usize {
10684 if self.attributes.is_some() {
10685 return 4;
10686 }
10687
10688 if self.stream.is_some() {
10689 return 3;
10690 }
10691
10692 if self.observer.is_some() {
10693 return 2;
10694 }
10695
10696 if self.is_append.is_some() {
10697 return 1;
10698 }
10699
10700 0
10701 }
10702}
10703
10704impl ::fidl_next::Encodable for FileInfo {
10705 type Encoded = WireFileInfo<'static>;
10706}
10707
10708unsafe impl<___E> ::fidl_next::Encode<___E> for FileInfo
10709where
10710 ___E: ::fidl_next::Encoder + ?Sized,
10711
10712 ___E: ::fidl_next::fuchsia::HandleEncoder,
10713{
10714 #[inline]
10715 fn encode(
10716 mut self,
10717 encoder: &mut ___E,
10718 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10719 ) -> Result<(), ::fidl_next::EncodeError> {
10720 ::fidl_next::munge!(let WireFileInfo { table } = out);
10721
10722 let max_ord = self.__max_ordinal();
10723
10724 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10725 ::fidl_next::Wire::zero_padding(&mut out);
10726
10727 let mut preallocated =
10728 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10729
10730 for i in 1..=max_ord {
10731 match i {
10732 4 => {
10733 if let Some(attributes) = self.attributes.take() {
10734 ::fidl_next::WireEnvelope::encode_value(
10735 attributes,
10736 preallocated.encoder,
10737 &mut out,
10738 )?;
10739 } else {
10740 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10741 }
10742 }
10743
10744 3 => {
10745 if let Some(stream) = self.stream.take() {
10746 ::fidl_next::WireEnvelope::encode_value(
10747 stream,
10748 preallocated.encoder,
10749 &mut out,
10750 )?;
10751 } else {
10752 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10753 }
10754 }
10755
10756 2 => {
10757 if let Some(observer) = self.observer.take() {
10758 ::fidl_next::WireEnvelope::encode_value(
10759 observer,
10760 preallocated.encoder,
10761 &mut out,
10762 )?;
10763 } else {
10764 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10765 }
10766 }
10767
10768 1 => {
10769 if let Some(is_append) = self.is_append.take() {
10770 ::fidl_next::WireEnvelope::encode_value(
10771 is_append,
10772 preallocated.encoder,
10773 &mut out,
10774 )?;
10775 } else {
10776 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10777 }
10778 }
10779
10780 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10781 }
10782 unsafe {
10783 preallocated.write_next(out.assume_init_ref());
10784 }
10785 }
10786
10787 ::fidl_next::WireTable::encode_len(table, max_ord);
10788
10789 Ok(())
10790 }
10791}
10792
10793impl<'de> ::fidl_next::FromWire<WireFileInfo<'de>> for FileInfo {
10794 #[inline]
10795 fn from_wire(wire: WireFileInfo<'de>) -> Self {
10796 let wire = ::core::mem::ManuallyDrop::new(wire);
10797
10798 let is_append = wire.table.get(1);
10799
10800 let observer = wire.table.get(2);
10801
10802 let stream = wire.table.get(3);
10803
10804 let attributes = wire.table.get(4);
10805
10806 Self {
10807 is_append: is_append.map(|envelope| {
10808 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10809 }),
10810
10811 observer: observer.map(|envelope| {
10812 ::fidl_next::FromWire::from_wire(unsafe {
10813 envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
10814 })
10815 }),
10816
10817 stream: stream.map(|envelope| {
10818 ::fidl_next::FromWire::from_wire(unsafe {
10819 envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
10820 })
10821 }),
10822
10823 attributes: attributes.map(|envelope| {
10824 ::fidl_next::FromWire::from_wire(unsafe {
10825 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10826 })
10827 }),
10828 }
10829 }
10830}
10831
10832#[repr(C)]
10834pub struct WireFileInfo<'de> {
10835 table: ::fidl_next::WireTable<'de>,
10836}
10837
10838impl<'de> Drop for WireFileInfo<'de> {
10839 fn drop(&mut self) {
10840 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10841
10842 let _ = self.table.get(2).map(|envelope| unsafe {
10843 envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
10844 });
10845
10846 let _ = self.table.get(3).map(|envelope| unsafe {
10847 envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
10848 });
10849
10850 let _ = self.table.get(4).map(|envelope| unsafe {
10851 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10852 });
10853 }
10854}
10855
10856unsafe impl ::fidl_next::Wire for WireFileInfo<'static> {
10857 type Decoded<'de> = WireFileInfo<'de>;
10858
10859 #[inline]
10860 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10861 ::fidl_next::munge!(let Self { table } = out);
10862 ::fidl_next::WireTable::zero_padding(table);
10863 }
10864}
10865
10866unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileInfo<'static>
10867where
10868 ___D: ::fidl_next::Decoder + ?Sized,
10869
10870 ___D: ::fidl_next::fuchsia::HandleDecoder,
10871{
10872 fn decode(
10873 slot: ::fidl_next::Slot<'_, Self>,
10874 decoder: &mut ___D,
10875 ) -> Result<(), ::fidl_next::DecodeError> {
10876 ::fidl_next::munge!(let Self { table } = slot);
10877
10878 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10879 match ordinal {
10880 0 => unsafe { ::core::hint::unreachable_unchecked() },
10881
10882 1 => {
10883 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10884
10885 Ok(())
10886 }
10887
10888 2 => {
10889 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
10890 slot.as_mut(),
10891 decoder,
10892 )?;
10893
10894 Ok(())
10895 }
10896
10897 3 => {
10898 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
10899 slot.as_mut(),
10900 decoder,
10901 )?;
10902
10903 Ok(())
10904 }
10905
10906 4 => {
10907 ::fidl_next::WireEnvelope::decode_as::<
10908 ___D,
10909 crate::WireNodeAttributes2<'static>,
10910 >(slot.as_mut(), decoder)?;
10911
10912 Ok(())
10913 }
10914
10915 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10916 }
10917 })
10918 }
10919}
10920
10921impl<'de> WireFileInfo<'de> {
10922 pub fn is_append(&self) -> Option<&bool> {
10923 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10924 }
10925
10926 pub fn observer(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
10927 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10928 }
10929
10930 pub fn stream(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
10931 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10932 }
10933
10934 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10935 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10936 }
10937}
10938
10939impl<'de> ::core::fmt::Debug for WireFileInfo<'de> {
10940 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10941 f.debug_struct("FileInfo")
10942 .field("is_append", &self.is_append())
10943 .field("observer", &self.observer())
10944 .field("stream", &self.stream())
10945 .field("attributes", &self.attributes())
10946 .finish()
10947 }
10948}
10949
10950#[derive(Clone, Debug, Default)]
10951pub struct SymlinkInfo {
10952 pub target: Option<Vec<u8>>,
10953
10954 pub attributes: Option<crate::NodeAttributes2>,
10955}
10956
10957impl SymlinkInfo {
10958 fn __max_ordinal(&self) -> usize {
10959 if self.attributes.is_some() {
10960 return 2;
10961 }
10962
10963 if self.target.is_some() {
10964 return 1;
10965 }
10966
10967 0
10968 }
10969}
10970
10971impl ::fidl_next::Encodable for SymlinkInfo {
10972 type Encoded = WireSymlinkInfo<'static>;
10973}
10974
10975unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkInfo
10976where
10977 ___E: ::fidl_next::Encoder + ?Sized,
10978{
10979 #[inline]
10980 fn encode(
10981 mut self,
10982 encoder: &mut ___E,
10983 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10984 ) -> Result<(), ::fidl_next::EncodeError> {
10985 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
10986
10987 let max_ord = self.__max_ordinal();
10988
10989 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10990 ::fidl_next::Wire::zero_padding(&mut out);
10991
10992 let mut preallocated =
10993 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10994
10995 for i in 1..=max_ord {
10996 match i {
10997 2 => {
10998 if let Some(attributes) = self.attributes.take() {
10999 ::fidl_next::WireEnvelope::encode_value(
11000 attributes,
11001 preallocated.encoder,
11002 &mut out,
11003 )?;
11004 } else {
11005 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11006 }
11007 }
11008
11009 1 => {
11010 if let Some(target) = self.target.take() {
11011 ::fidl_next::WireEnvelope::encode_value(
11012 target,
11013 preallocated.encoder,
11014 &mut out,
11015 )?;
11016 } else {
11017 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11018 }
11019 }
11020
11021 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11022 }
11023 unsafe {
11024 preallocated.write_next(out.assume_init_ref());
11025 }
11026 }
11027
11028 ::fidl_next::WireTable::encode_len(table, max_ord);
11029
11030 Ok(())
11031 }
11032}
11033
11034unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkInfo
11035where
11036 ___E: ::fidl_next::Encoder + ?Sized,
11037{
11038 #[inline]
11039 fn encode_ref(
11040 &self,
11041 encoder: &mut ___E,
11042 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11043 ) -> Result<(), ::fidl_next::EncodeError> {
11044 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
11045
11046 let max_ord = self.__max_ordinal();
11047
11048 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11049 ::fidl_next::Wire::zero_padding(&mut out);
11050
11051 let mut preallocated =
11052 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11053
11054 for i in 1..=max_ord {
11055 match i {
11056 2 => {
11057 if let Some(attributes) = &self.attributes {
11058 ::fidl_next::WireEnvelope::encode_value(
11059 attributes,
11060 preallocated.encoder,
11061 &mut out,
11062 )?;
11063 } else {
11064 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11065 }
11066 }
11067
11068 1 => {
11069 if let Some(target) = &self.target {
11070 ::fidl_next::WireEnvelope::encode_value(
11071 target,
11072 preallocated.encoder,
11073 &mut out,
11074 )?;
11075 } else {
11076 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11077 }
11078 }
11079
11080 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11081 }
11082 unsafe {
11083 preallocated.write_next(out.assume_init_ref());
11084 }
11085 }
11086
11087 ::fidl_next::WireTable::encode_len(table, max_ord);
11088
11089 Ok(())
11090 }
11091}
11092
11093impl<'de> ::fidl_next::FromWire<WireSymlinkInfo<'de>> for SymlinkInfo {
11094 #[inline]
11095 fn from_wire(wire: WireSymlinkInfo<'de>) -> Self {
11096 let wire = ::core::mem::ManuallyDrop::new(wire);
11097
11098 let target = wire.table.get(1);
11099
11100 let attributes = wire.table.get(2);
11101
11102 Self {
11103 target: target.map(|envelope| {
11104 ::fidl_next::FromWire::from_wire(unsafe {
11105 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
11106 })
11107 }),
11108
11109 attributes: attributes.map(|envelope| {
11110 ::fidl_next::FromWire::from_wire(unsafe {
11111 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11112 })
11113 }),
11114 }
11115 }
11116}
11117
11118impl<'de> ::fidl_next::FromWireRef<WireSymlinkInfo<'de>> for SymlinkInfo {
11119 #[inline]
11120 fn from_wire_ref(wire: &WireSymlinkInfo<'de>) -> Self {
11121 Self {
11122 target: wire.table.get(1).map(|envelope| {
11123 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11124 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
11125 })
11126 }),
11127
11128 attributes: wire.table.get(2).map(|envelope| {
11129 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11130 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
11131 })
11132 }),
11133 }
11134 }
11135}
11136
11137#[repr(C)]
11139pub struct WireSymlinkInfo<'de> {
11140 table: ::fidl_next::WireTable<'de>,
11141}
11142
11143impl<'de> Drop for WireSymlinkInfo<'de> {
11144 fn drop(&mut self) {
11145 let _ = self.table.get(1).map(|envelope| unsafe {
11146 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
11147 });
11148
11149 let _ = self.table.get(2).map(|envelope| unsafe {
11150 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
11151 });
11152 }
11153}
11154
11155unsafe impl ::fidl_next::Wire for WireSymlinkInfo<'static> {
11156 type Decoded<'de> = WireSymlinkInfo<'de>;
11157
11158 #[inline]
11159 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11160 ::fidl_next::munge!(let Self { table } = out);
11161 ::fidl_next::WireTable::zero_padding(table);
11162 }
11163}
11164
11165unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkInfo<'static>
11166where
11167 ___D: ::fidl_next::Decoder + ?Sized,
11168{
11169 fn decode(
11170 slot: ::fidl_next::Slot<'_, Self>,
11171 decoder: &mut ___D,
11172 ) -> Result<(), ::fidl_next::DecodeError> {
11173 ::fidl_next::munge!(let Self { table } = slot);
11174
11175 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11176 match ordinal {
11177 0 => unsafe { ::core::hint::unreachable_unchecked() },
11178
11179 1 => {
11180 ::fidl_next::WireEnvelope::decode_as::<
11181 ___D,
11182 ::fidl_next::WireVector<'static, u8>,
11183 >(slot.as_mut(), decoder)?;
11184
11185 let target = unsafe {
11186 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
11187 };
11188
11189 if target.len() > 4095 {
11190 return Err(::fidl_next::DecodeError::VectorTooLong {
11191 size: target.len() as u64,
11192 limit: 4095,
11193 });
11194 }
11195
11196 Ok(())
11197 }
11198
11199 2 => {
11200 ::fidl_next::WireEnvelope::decode_as::<
11201 ___D,
11202 crate::WireNodeAttributes2<'static>,
11203 >(slot.as_mut(), decoder)?;
11204
11205 Ok(())
11206 }
11207
11208 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11209 }
11210 })
11211 }
11212}
11213
11214impl<'de> WireSymlinkInfo<'de> {
11215 pub fn target(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
11216 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11217 }
11218
11219 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
11220 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11221 }
11222}
11223
11224impl<'de> ::core::fmt::Debug for WireSymlinkInfo<'de> {
11225 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11226 f.debug_struct("SymlinkInfo")
11227 .field("target", &self.target())
11228 .field("attributes", &self.attributes())
11229 .finish()
11230 }
11231}
11232
11233#[derive(Debug)]
11234pub enum Representation {
11235 Node(crate::NodeInfo),
11236
11237 Directory(crate::DirectoryInfo),
11238
11239 File(crate::FileInfo),
11240
11241 Symlink(crate::SymlinkInfo),
11242
11243 UnknownOrdinal_(u64),
11244}
11245
11246impl ::fidl_next::Encodable for Representation {
11247 type Encoded = WireRepresentation<'static>;
11248}
11249
11250unsafe impl<___E> ::fidl_next::Encode<___E> for Representation
11251where
11252 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11253
11254 ___E: ::fidl_next::Encoder,
11255
11256 ___E: ::fidl_next::fuchsia::HandleEncoder,
11257{
11258 #[inline]
11259 fn encode(
11260 self,
11261 encoder: &mut ___E,
11262 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11263 ) -> Result<(), ::fidl_next::EncodeError> {
11264 ::fidl_next::munge!(let WireRepresentation { raw, _phantom: _ } = out);
11265
11266 match self {
11267 Self::Node(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::NodeInfo>(
11268 value, 1, encoder, raw,
11269 )?,
11270
11271 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
11272 ___E,
11273 crate::DirectoryInfo,
11274 >(value, 2, encoder, raw)?,
11275
11276 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileInfo>(
11277 value, 3, encoder, raw,
11278 )?,
11279
11280 Self::Symlink(value) => {
11281 ::fidl_next::RawWireUnion::encode_as::<___E, crate::SymlinkInfo>(
11282 value, 4, encoder, raw,
11283 )?
11284 }
11285
11286 Self::UnknownOrdinal_(ordinal) => {
11287 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
11288 }
11289 }
11290
11291 Ok(())
11292 }
11293}
11294
11295impl ::fidl_next::EncodableOption for Representation {
11296 type EncodedOption = WireOptionalRepresentation<'static>;
11297}
11298
11299unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Representation
11300where
11301 ___E: ?Sized,
11302 Representation: ::fidl_next::Encode<___E>,
11303{
11304 #[inline]
11305 fn encode_option(
11306 this: Option<Self>,
11307 encoder: &mut ___E,
11308 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11309 ) -> Result<(), ::fidl_next::EncodeError> {
11310 ::fidl_next::munge!(let WireOptionalRepresentation { raw, _phantom: _ } = &mut *out);
11311
11312 if let Some(inner) = this {
11313 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11314 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11315 } else {
11316 ::fidl_next::RawWireUnion::encode_absent(raw);
11317 }
11318
11319 Ok(())
11320 }
11321}
11322
11323impl<'de> ::fidl_next::FromWire<WireRepresentation<'de>> for Representation {
11324 #[inline]
11325 fn from_wire(wire: WireRepresentation<'de>) -> Self {
11326 let wire = ::core::mem::ManuallyDrop::new(wire);
11327 match wire.raw.ordinal() {
11328 1 => Self::Node(::fidl_next::FromWire::from_wire(unsafe {
11329 wire.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>()
11330 })),
11331
11332 2 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
11333 wire.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>()
11334 })),
11335
11336 3 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
11337 wire.raw.get().read_unchecked::<crate::WireFileInfo<'de>>()
11338 })),
11339
11340 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
11341 wire.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>()
11342 })),
11343
11344 _ => unsafe { ::core::hint::unreachable_unchecked() },
11345 }
11346 }
11347}
11348
11349impl<'de> ::fidl_next::FromWireOption<WireOptionalRepresentation<'de>> for Box<Representation> {
11350 #[inline]
11351 fn from_wire_option(wire: WireOptionalRepresentation<'de>) -> Option<Self> {
11352 if let Some(inner) = wire.into_option() {
11353 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
11354 } else {
11355 None
11356 }
11357 }
11358}
11359
11360#[repr(transparent)]
11362pub struct WireRepresentation<'de> {
11363 raw: ::fidl_next::RawWireUnion,
11364 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11365}
11366
11367impl<'de> Drop for WireRepresentation<'de> {
11368 fn drop(&mut self) {
11369 match self.raw.ordinal() {
11370 1 => {
11371 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>() };
11372 }
11373
11374 2 => {
11375 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>() };
11376 }
11377
11378 3 => {
11379 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileInfo<'de>>() };
11380 }
11381
11382 4 => {
11383 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>() };
11384 }
11385
11386 _ => (),
11387 }
11388 }
11389}
11390
11391unsafe impl ::fidl_next::Wire for WireRepresentation<'static> {
11392 type Decoded<'de> = WireRepresentation<'de>;
11393
11394 #[inline]
11395 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11396 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11397 ::fidl_next::RawWireUnion::zero_padding(raw);
11398 }
11399}
11400
11401pub mod representation {
11402 pub enum Ref<'de> {
11403 Node(&'de crate::WireNodeInfo<'de>),
11404
11405 Directory(&'de crate::WireDirectoryInfo<'de>),
11406
11407 File(&'de crate::WireFileInfo<'de>),
11408
11409 Symlink(&'de crate::WireSymlinkInfo<'de>),
11410
11411 UnknownOrdinal_(u64),
11412 }
11413}
11414
11415impl<'de> WireRepresentation<'de> {
11416 pub fn as_ref(&self) -> crate::representation::Ref<'_> {
11417 match self.raw.ordinal() {
11418 1 => crate::representation::Ref::Node(unsafe {
11419 self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>()
11420 }),
11421
11422 2 => crate::representation::Ref::Directory(unsafe {
11423 self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>()
11424 }),
11425
11426 3 => crate::representation::Ref::File(unsafe {
11427 self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>()
11428 }),
11429
11430 4 => crate::representation::Ref::Symlink(unsafe {
11431 self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>()
11432 }),
11433
11434 unknown => crate::representation::Ref::UnknownOrdinal_(unknown),
11435 }
11436 }
11437}
11438
11439unsafe impl<___D> ::fidl_next::Decode<___D> for WireRepresentation<'static>
11440where
11441 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11442
11443 ___D: ::fidl_next::Decoder,
11444
11445 ___D: ::fidl_next::fuchsia::HandleDecoder,
11446{
11447 fn decode(
11448 mut slot: ::fidl_next::Slot<'_, Self>,
11449 decoder: &mut ___D,
11450 ) -> Result<(), ::fidl_next::DecodeError> {
11451 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11452 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11453 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
11454 raw, decoder,
11455 )?,
11456
11457 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
11458 raw, decoder,
11459 )?,
11460
11461 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
11462 raw, decoder,
11463 )?,
11464
11465 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
11466 raw, decoder,
11467 )?,
11468
11469 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11470 }
11471
11472 Ok(())
11473 }
11474}
11475
11476impl<'de> ::core::fmt::Debug for WireRepresentation<'de> {
11477 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11478 match self.raw.ordinal() {
11479 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>().fmt(f) },
11480 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>().fmt(f) },
11481 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>().fmt(f) },
11482 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>().fmt(f) },
11483 _ => unsafe { ::core::hint::unreachable_unchecked() },
11484 }
11485 }
11486}
11487
11488#[repr(transparent)]
11489pub struct WireOptionalRepresentation<'de> {
11490 raw: ::fidl_next::RawWireUnion,
11491 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11492}
11493
11494unsafe impl ::fidl_next::Wire for WireOptionalRepresentation<'static> {
11495 type Decoded<'de> = WireOptionalRepresentation<'de>;
11496
11497 #[inline]
11498 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11499 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11500 ::fidl_next::RawWireUnion::zero_padding(raw);
11501 }
11502}
11503
11504impl<'de> WireOptionalRepresentation<'de> {
11505 pub fn is_some(&self) -> bool {
11506 self.raw.is_some()
11507 }
11508
11509 pub fn is_none(&self) -> bool {
11510 self.raw.is_none()
11511 }
11512
11513 pub fn as_ref(&self) -> Option<&WireRepresentation<'de>> {
11514 if self.is_some() {
11515 Some(unsafe { &*(self as *const Self).cast() })
11516 } else {
11517 None
11518 }
11519 }
11520
11521 pub fn into_option(self) -> Option<WireRepresentation<'de>> {
11522 if self.is_some() {
11523 Some(WireRepresentation { raw: self.raw, _phantom: ::core::marker::PhantomData })
11524 } else {
11525 None
11526 }
11527 }
11528}
11529
11530unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRepresentation<'static>
11531where
11532 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11533
11534 ___D: ::fidl_next::Decoder,
11535
11536 ___D: ::fidl_next::fuchsia::HandleDecoder,
11537{
11538 fn decode(
11539 mut slot: ::fidl_next::Slot<'_, Self>,
11540 decoder: &mut ___D,
11541 ) -> Result<(), ::fidl_next::DecodeError> {
11542 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11543 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11544 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
11545 raw, decoder,
11546 )?,
11547
11548 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
11549 raw, decoder,
11550 )?,
11551
11552 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
11553 raw, decoder,
11554 )?,
11555
11556 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
11557 raw, decoder,
11558 )?,
11559
11560 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11561 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11562 }
11563
11564 Ok(())
11565 }
11566}
11567
11568impl<'de> ::core::fmt::Debug for WireOptionalRepresentation<'de> {
11569 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11570 self.as_ref().fmt(f)
11571 }
11572}
11573
11574::fidl_next::bitflags! {
11575 #[derive(
11576 Clone,
11577 Copy,
11578 Debug,
11579 PartialEq,
11580 Eq,
11581 Hash,
11582 )]
11583 pub struct NodeAttributesQuery: u64 {
11584 #[doc = " Requests [`NodeAttributes.protocols`].\n"]const PROTOCOLS = 1;
11585 #[doc = " Requests [`NodeAttributes.abilities`].\n"]const ABILITIES = 2;
11586 #[doc = " Requests [`NodeAttributes.content_size`].\n"]const CONTENT_SIZE = 4;
11587 #[doc = " Requests [`NodeAttributes.storage_size`].\n"]const STORAGE_SIZE = 8;
11588 #[doc = " Requests [`NodeAttributes.link_count`].\n"]const LINK_COUNT = 16;
11589 #[doc = " Requests [`NodeAttributes.id`].\n"]const ID = 32;
11590 #[doc = " Requests [`NodeAttributes.creation_time`].\n"]const CREATION_TIME = 64;
11591 #[doc = " Requests [`NodeAttributes.modification_time`].\n"]const MODIFICATION_TIME = 128;
11592 #[doc = " Posix attributes.\n"]const MODE = 256;
11593 const UID = 512;
11594 const GID = 1024;
11595 const RDEV = 2048;
11596 const ACCESS_TIME = 4096;
11597 const CHANGE_TIME = 8192;
11598 #[doc = " Verity attributes.\n"]const OPTIONS = 16384;
11599 const ROOT_HASH = 32768;
11600 const VERITY_ENABLED = 65536;
11601 #[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;
11602 #[doc = " Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.\n"]const SELINUX_CONTEXT = 262144;
11603 #[doc = " fscrypt attribute.\n"]const WRAPPING_KEY_ID = 524288;
11604 #[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;
11605 const _ = !0;
11606 }
11607}
11608
11609impl ::fidl_next::Encodable for NodeAttributesQuery {
11610 type Encoded = WireNodeAttributesQuery;
11611}
11612
11613unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributesQuery
11614where
11615 ___E: ?Sized,
11616{
11617 #[inline]
11618 fn encode(
11619 self,
11620 encoder: &mut ___E,
11621 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11622 ) -> Result<(), ::fidl_next::EncodeError> {
11623 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
11624 }
11625}
11626
11627unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributesQuery
11628where
11629 ___E: ?Sized,
11630{
11631 #[inline]
11632 fn encode_ref(
11633 &self,
11634 _: &mut ___E,
11635 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11636 ) -> Result<(), ::fidl_next::EncodeError> {
11637 ::fidl_next::munge!(let WireNodeAttributesQuery { value } = out);
11638 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
11639 Ok(())
11640 }
11641}
11642
11643impl ::core::convert::From<WireNodeAttributesQuery> for NodeAttributesQuery {
11644 fn from(wire: WireNodeAttributesQuery) -> Self {
11645 Self::from_bits_retain(u64::from(wire.value))
11646 }
11647}
11648
11649impl ::fidl_next::FromWire<WireNodeAttributesQuery> for NodeAttributesQuery {
11650 #[inline]
11651 fn from_wire(wire: WireNodeAttributesQuery) -> Self {
11652 Self::from(wire)
11653 }
11654}
11655
11656impl ::fidl_next::FromWireRef<WireNodeAttributesQuery> for NodeAttributesQuery {
11657 #[inline]
11658 fn from_wire_ref(wire: &WireNodeAttributesQuery) -> Self {
11659 Self::from(*wire)
11660 }
11661}
11662
11663#[derive(Clone, Copy, Debug)]
11665#[repr(transparent)]
11666pub struct WireNodeAttributesQuery {
11667 value: ::fidl_next::WireU64,
11668}
11669
11670unsafe impl ::fidl_next::Wire for WireNodeAttributesQuery {
11671 type Decoded<'de> = Self;
11672
11673 #[inline]
11674 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11675 }
11677}
11678
11679unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributesQuery
11680where
11681 ___D: ?Sized,
11682{
11683 fn decode(
11684 slot: ::fidl_next::Slot<'_, Self>,
11685 _: &mut ___D,
11686 ) -> Result<(), ::fidl_next::DecodeError> {
11687 Ok(())
11688 }
11689}
11690
11691impl ::core::convert::From<NodeAttributesQuery> for WireNodeAttributesQuery {
11692 fn from(natural: NodeAttributesQuery) -> Self {
11693 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
11694 }
11695}
11696
11697#[derive(Clone, Debug)]
11698#[repr(C)]
11699pub struct NodeGetAttributesRequest {
11700 pub query: crate::NodeAttributesQuery,
11701}
11702
11703impl ::fidl_next::Encodable for NodeGetAttributesRequest {
11704 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetAttributesRequest> = unsafe {
11705 ::fidl_next::CopyOptimization::enable_if(
11706 true && <crate::NodeAttributesQuery as ::fidl_next::Encodable>::COPY_OPTIMIZATION
11707 .is_enabled(),
11708 )
11709 };
11710
11711 type Encoded = WireNodeGetAttributesRequest;
11712}
11713
11714unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetAttributesRequest
11715where
11716 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11717{
11718 #[inline]
11719 fn encode(
11720 self,
11721 encoder: &mut ___E,
11722 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11723 ) -> Result<(), ::fidl_next::EncodeError> {
11724 ::fidl_next::munge! {
11725 let Self::Encoded {
11726 query,
11727
11728 } = out;
11729 }
11730
11731 ::fidl_next::Encode::encode(self.query, encoder, query)?;
11732
11733 Ok(())
11734 }
11735}
11736
11737unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetAttributesRequest
11738where
11739 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11740{
11741 #[inline]
11742 fn encode_ref(
11743 &self,
11744 encoder: &mut ___E,
11745 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11746 ) -> Result<(), ::fidl_next::EncodeError> {
11747 ::fidl_next::munge! {
11748 let Self::Encoded {
11749 query,
11750
11751 } = out;
11752 }
11753
11754 ::fidl_next::EncodeRef::encode_ref(&self.query, encoder, query)?;
11755
11756 Ok(())
11757 }
11758}
11759
11760impl ::fidl_next::EncodableOption for NodeGetAttributesRequest {
11761 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetAttributesRequest>;
11762}
11763
11764unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetAttributesRequest
11765where
11766 ___E: ::fidl_next::Encoder + ?Sized,
11767 NodeGetAttributesRequest: ::fidl_next::Encode<___E>,
11768{
11769 #[inline]
11770 fn encode_option(
11771 this: Option<Self>,
11772 encoder: &mut ___E,
11773 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11774 ) -> Result<(), ::fidl_next::EncodeError> {
11775 if let Some(inner) = this {
11776 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11777 ::fidl_next::WireBox::encode_present(out);
11778 } else {
11779 ::fidl_next::WireBox::encode_absent(out);
11780 }
11781
11782 Ok(())
11783 }
11784}
11785
11786unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetAttributesRequest
11787where
11788 ___E: ::fidl_next::Encoder + ?Sized,
11789 NodeGetAttributesRequest: ::fidl_next::EncodeRef<___E>,
11790{
11791 #[inline]
11792 fn encode_option_ref(
11793 this: Option<&Self>,
11794 encoder: &mut ___E,
11795 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11796 ) -> Result<(), ::fidl_next::EncodeError> {
11797 if let Some(inner) = this {
11798 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11799 ::fidl_next::WireBox::encode_present(out);
11800 } else {
11801 ::fidl_next::WireBox::encode_absent(out);
11802 }
11803
11804 Ok(())
11805 }
11806}
11807
11808impl ::fidl_next::FromWire<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
11809 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetAttributesRequest, Self> = unsafe {
11810 ::fidl_next::CopyOptimization::enable_if(
11811 true && <crate::NodeAttributesQuery as ::fidl_next::FromWire<
11812 crate::WireNodeAttributesQuery,
11813 >>::COPY_OPTIMIZATION
11814 .is_enabled(),
11815 )
11816 };
11817
11818 #[inline]
11819 fn from_wire(wire: WireNodeGetAttributesRequest) -> Self {
11820 Self { query: ::fidl_next::FromWire::from_wire(wire.query) }
11821 }
11822}
11823
11824impl ::fidl_next::FromWireRef<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
11825 #[inline]
11826 fn from_wire_ref(wire: &WireNodeGetAttributesRequest) -> Self {
11827 Self { query: ::fidl_next::FromWireRef::from_wire_ref(&wire.query) }
11828 }
11829}
11830
11831#[derive(Clone, Debug)]
11833#[repr(C)]
11834pub struct WireNodeGetAttributesRequest {
11835 pub query: crate::WireNodeAttributesQuery,
11836}
11837
11838unsafe impl ::fidl_next::Wire for WireNodeGetAttributesRequest {
11839 type Decoded<'de> = WireNodeGetAttributesRequest;
11840
11841 #[inline]
11842 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
11843}
11844
11845unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetAttributesRequest
11846where
11847 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11848{
11849 fn decode(
11850 slot: ::fidl_next::Slot<'_, Self>,
11851 decoder: &mut ___D,
11852 ) -> Result<(), ::fidl_next::DecodeError> {
11853 ::fidl_next::munge! {
11854 let Self {
11855 mut query,
11856
11857 } = slot;
11858 }
11859
11860 ::fidl_next::Decode::decode(query.as_mut(), decoder)?;
11861
11862 Ok(())
11863 }
11864}
11865
11866#[doc = " Node defines the minimal interface for entities which can be accessed in a filesystem.\n"]
11868#[derive(Debug)]
11869pub struct Node;
11870
11871impl ::fidl_next::Discoverable for Node {
11872 const PROTOCOL_NAME: &'static str = "fuchsia.io.Node";
11873}
11874
11875pub mod node {
11876 pub mod prelude {
11877 pub use crate::{node, Node, NodeClientHandler, NodeServerHandler};
11878
11879 pub use crate::ExtendedAttributeValue;
11880
11881 pub use crate::MutableNodeAttributes;
11882
11883 pub use crate::NodeAttributes2;
11884
11885 pub use crate::NodeDeprecatedCloneRequest;
11886
11887 pub use crate::NodeDeprecatedGetAttrResponse;
11888
11889 pub use crate::NodeDeprecatedGetFlagsResponse;
11890
11891 pub use crate::NodeDeprecatedSetAttrRequest;
11892
11893 pub use crate::NodeDeprecatedSetAttrResponse;
11894
11895 pub use crate::NodeDeprecatedSetFlagsRequest;
11896
11897 pub use crate::NodeDeprecatedSetFlagsResponse;
11898
11899 pub use crate::NodeGetAttributesRequest;
11900
11901 pub use crate::NodeGetExtendedAttributeRequest;
11902
11903 pub use crate::NodeListExtendedAttributesRequest;
11904
11905 pub use crate::NodeOnOpenRequest;
11906
11907 pub use crate::NodeQueryFilesystemResponse;
11908
11909 pub use crate::NodeRemoveExtendedAttributeRequest;
11910
11911 pub use crate::NodeSetExtendedAttributeRequest;
11912
11913 pub use crate::NodeSetFlagsRequest;
11914
11915 pub use crate::NodeGetFlagsResponse;
11916
11917 pub use crate::NodeRemoveExtendedAttributeResponse;
11918
11919 pub use crate::NodeSetExtendedAttributeResponse;
11920
11921 pub use crate::NodeSetFlagsResponse;
11922
11923 pub use crate::NodeSyncResponse;
11924
11925 pub use crate::NodeUpdateAttributesResponse;
11926
11927 pub use crate::Representation;
11928
11929 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
11930
11931 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
11932
11933 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
11934 }
11935
11936 pub struct Clone;
11937
11938 impl ::fidl_next::Method for Clone {
11939 const ORDINAL: u64 = 2366825959783828089;
11940
11941 type Protocol = crate::Node;
11942
11943 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
11944
11945 type Response = ::fidl_next::Never;
11946 }
11947
11948 pub struct Close;
11949
11950 impl ::fidl_next::Method for Close {
11951 const ORDINAL: u64 = 6540867515453498750;
11952
11953 type Protocol = crate::Node;
11954
11955 type Request = ();
11956
11957 type Response = ::fidl_next::WireResult<
11958 'static,
11959 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
11960 ::fidl_next::WireI32,
11961 >;
11962 }
11963
11964 pub struct Query;
11965
11966 impl ::fidl_next::Method for Query {
11967 const ORDINAL: u64 = 2763219980499352582;
11968
11969 type Protocol = crate::Node;
11970
11971 type Request = ();
11972
11973 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
11974 }
11975
11976 pub struct DeprecatedClone;
11977
11978 impl ::fidl_next::Method for DeprecatedClone {
11979 const ORDINAL: u64 = 6512600400724287855;
11980
11981 type Protocol = crate::Node;
11982
11983 type Request = crate::WireNodeDeprecatedCloneRequest;
11984
11985 type Response = ::fidl_next::Never;
11986 }
11987
11988 pub struct OnOpen;
11989
11990 impl ::fidl_next::Method for OnOpen {
11991 const ORDINAL: u64 = 9207534335756671346;
11992
11993 type Protocol = crate::Node;
11994
11995 type Request = ::fidl_next::Never;
11996
11997 type Response = crate::WireNodeOnOpenRequest<'static>;
11998 }
11999
12000 pub struct DeprecatedGetAttr;
12001
12002 impl ::fidl_next::Method for DeprecatedGetAttr {
12003 const ORDINAL: u64 = 8689798978500614909;
12004
12005 type Protocol = crate::Node;
12006
12007 type Request = ();
12008
12009 type Response = crate::WireNodeDeprecatedGetAttrResponse;
12010 }
12011
12012 pub struct DeprecatedSetAttr;
12013
12014 impl ::fidl_next::Method for DeprecatedSetAttr {
12015 const ORDINAL: u64 = 4721673413776871238;
12016
12017 type Protocol = crate::Node;
12018
12019 type Request = crate::WireNodeDeprecatedSetAttrRequest;
12020
12021 type Response = crate::WireNodeDeprecatedSetAttrResponse;
12022 }
12023
12024 pub struct DeprecatedGetFlags;
12025
12026 impl ::fidl_next::Method for DeprecatedGetFlags {
12027 const ORDINAL: u64 = 6595803110182632097;
12028
12029 type Protocol = crate::Node;
12030
12031 type Request = ();
12032
12033 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
12034 }
12035
12036 pub struct DeprecatedSetFlags;
12037
12038 impl ::fidl_next::Method for DeprecatedSetFlags {
12039 const ORDINAL: u64 = 5950864159036794675;
12040
12041 type Protocol = crate::Node;
12042
12043 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
12044
12045 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
12046 }
12047
12048 pub struct GetFlags;
12049
12050 impl ::fidl_next::Method for GetFlags {
12051 const ORDINAL: u64 = 105530239381466147;
12052
12053 type Protocol = crate::Node;
12054
12055 type Request = ();
12056
12057 type Response = ::fidl_next::WireFlexibleResult<
12058 'static,
12059 crate::WireNodeGetFlagsResponse,
12060 ::fidl_next::WireI32,
12061 >;
12062 }
12063
12064 pub struct SetFlags;
12065
12066 impl ::fidl_next::Method for SetFlags {
12067 const ORDINAL: u64 = 6172186066099445416;
12068
12069 type Protocol = crate::Node;
12070
12071 type Request = crate::WireNodeSetFlagsRequest;
12072
12073 type Response = ::fidl_next::WireFlexibleResult<
12074 'static,
12075 crate::WireNodeSetFlagsResponse,
12076 ::fidl_next::WireI32,
12077 >;
12078 }
12079
12080 pub struct QueryFilesystem;
12081
12082 impl ::fidl_next::Method for QueryFilesystem {
12083 const ORDINAL: u64 = 8013111122914313744;
12084
12085 type Protocol = crate::Node;
12086
12087 type Request = ();
12088
12089 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
12090 }
12091
12092 pub struct OnRepresentation;
12093
12094 impl ::fidl_next::Method for OnRepresentation {
12095 const ORDINAL: u64 = 6679970090861613324;
12096
12097 type Protocol = crate::Node;
12098
12099 type Request = ::fidl_next::Never;
12100
12101 type Response = crate::WireRepresentation<'static>;
12102 }
12103
12104 pub struct GetAttributes;
12105
12106 impl ::fidl_next::Method for GetAttributes {
12107 const ORDINAL: u64 = 4414537700416816443;
12108
12109 type Protocol = crate::Node;
12110
12111 type Request = crate::WireNodeGetAttributesRequest;
12112
12113 type Response = ::fidl_next::WireResult<
12114 'static,
12115 crate::WireNodeAttributes2<'static>,
12116 ::fidl_next::WireI32,
12117 >;
12118 }
12119
12120 pub struct UpdateAttributes;
12121
12122 impl ::fidl_next::Method for UpdateAttributes {
12123 const ORDINAL: u64 = 3677402239314018056;
12124
12125 type Protocol = crate::Node;
12126
12127 type Request = crate::WireMutableNodeAttributes<'static>;
12128
12129 type Response = ::fidl_next::WireResult<
12130 'static,
12131 crate::WireNodeUpdateAttributesResponse,
12132 ::fidl_next::WireI32,
12133 >;
12134 }
12135
12136 pub struct Sync;
12137
12138 impl ::fidl_next::Method for Sync {
12139 const ORDINAL: u64 = 3196473584242777161;
12140
12141 type Protocol = crate::Node;
12142
12143 type Request = ();
12144
12145 type Response =
12146 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
12147 }
12148
12149 pub struct ListExtendedAttributes;
12150
12151 impl ::fidl_next::Method for ListExtendedAttributes {
12152 const ORDINAL: u64 = 5431626189872037072;
12153
12154 type Protocol = crate::Node;
12155
12156 type Request = crate::WireNodeListExtendedAttributesRequest;
12157
12158 type Response = ::fidl_next::Never;
12159 }
12160
12161 pub struct GetExtendedAttribute;
12162
12163 impl ::fidl_next::Method for GetExtendedAttribute {
12164 const ORDINAL: u64 = 5043930208506967771;
12165
12166 type Protocol = crate::Node;
12167
12168 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
12169
12170 type Response = ::fidl_next::WireResult<
12171 'static,
12172 crate::WireExtendedAttributeValue<'static>,
12173 ::fidl_next::WireI32,
12174 >;
12175 }
12176
12177 pub struct SetExtendedAttribute;
12178
12179 impl ::fidl_next::Method for SetExtendedAttribute {
12180 const ORDINAL: u64 = 5374223046099989052;
12181
12182 type Protocol = crate::Node;
12183
12184 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
12185
12186 type Response = ::fidl_next::WireResult<
12187 'static,
12188 crate::WireNodeSetExtendedAttributeResponse,
12189 ::fidl_next::WireI32,
12190 >;
12191 }
12192
12193 pub struct RemoveExtendedAttribute;
12194
12195 impl ::fidl_next::Method for RemoveExtendedAttribute {
12196 const ORDINAL: u64 = 8794297771444732717;
12197
12198 type Protocol = crate::Node;
12199
12200 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
12201
12202 type Response = ::fidl_next::WireResult<
12203 'static,
12204 crate::WireNodeRemoveExtendedAttributeResponse,
12205 ::fidl_next::WireI32,
12206 >;
12207 }
12208
12209 mod ___detail {
12210
12211 pub struct Clone<T0> {
12212 request: T0,
12213 }
12214
12215 impl<T0> ::fidl_next::Encodable for Clone<T0>
12216 where
12217 T0: ::fidl_next::Encodable<
12218 Encoded = ::fidl_next::ServerEnd<
12219 ::fidl_next_fuchsia_unknown::Cloneable,
12220 ::fidl_next::fuchsia::WireChannel,
12221 >,
12222 >,
12223 {
12224 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
12225 }
12226
12227 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
12228 where
12229 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12230
12231 ___E: ::fidl_next::fuchsia::HandleEncoder,
12232
12233 T0: ::fidl_next::Encode<
12234 ___E,
12235 Encoded = ::fidl_next::ServerEnd<
12236 ::fidl_next_fuchsia_unknown::Cloneable,
12237 ::fidl_next::fuchsia::WireChannel,
12238 >,
12239 >,
12240 {
12241 #[inline]
12242 fn encode(
12243 self,
12244 encoder: &mut ___E,
12245 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12246 ) -> Result<(), ::fidl_next::EncodeError> {
12247 ::fidl_next::munge! {
12248 let Self::Encoded {
12249 request,
12250
12251 } = out;
12252 }
12253
12254 ::fidl_next::Encode::encode(self.request, encoder, request)?;
12255
12256 Ok(())
12257 }
12258 }
12259
12260 pub struct DeprecatedClone<T0, T1> {
12261 flags: T0,
12262
12263 object: T1,
12264 }
12265
12266 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
12267 where
12268 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
12269
12270 T1: ::fidl_next::Encodable<
12271 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
12272 >,
12273 {
12274 type Encoded = crate::WireNodeDeprecatedCloneRequest;
12275 }
12276
12277 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
12278 where
12279 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12280
12281 ___E: ::fidl_next::fuchsia::HandleEncoder,
12282
12283 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
12284
12285 T1: ::fidl_next::Encode<
12286 ___E,
12287 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
12288 >,
12289 {
12290 #[inline]
12291 fn encode(
12292 self,
12293 encoder: &mut ___E,
12294 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12295 ) -> Result<(), ::fidl_next::EncodeError> {
12296 ::fidl_next::munge! {
12297 let Self::Encoded {
12298 flags,
12299 object,
12300
12301 } = out;
12302 }
12303
12304 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12305
12306 ::fidl_next::Encode::encode(self.object, encoder, object)?;
12307
12308 Ok(())
12309 }
12310 }
12311
12312 pub struct OnOpen<T0, T1> {
12313 s: T0,
12314
12315 info: T1,
12316 }
12317
12318 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
12319 where
12320 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
12321
12322 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
12323 {
12324 type Encoded = crate::WireNodeOnOpenRequest<'static>;
12325 }
12326
12327 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
12328 where
12329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12330
12331 ___E: ::fidl_next::Encoder,
12332
12333 ___E: ::fidl_next::fuchsia::HandleEncoder,
12334
12335 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
12336
12337 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
12338 {
12339 #[inline]
12340 fn encode(
12341 self,
12342 encoder: &mut ___E,
12343 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12344 ) -> Result<(), ::fidl_next::EncodeError> {
12345 ::fidl_next::munge! {
12346 let Self::Encoded {
12347 s,
12348 info,
12349
12350 } = out;
12351 }
12352
12353 ::fidl_next::Encode::encode(self.s, encoder, s)?;
12354
12355 ::fidl_next::Encode::encode(self.info, encoder, info)?;
12356
12357 Ok(())
12358 }
12359 }
12360
12361 pub struct DeprecatedSetAttr<T0, T1> {
12362 flags: T0,
12363
12364 attributes: T1,
12365 }
12366
12367 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
12368 where
12369 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
12370
12371 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
12372 {
12373 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
12374 }
12375
12376 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
12377 where
12378 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12379
12380 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
12381
12382 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
12383 {
12384 #[inline]
12385 fn encode(
12386 self,
12387 encoder: &mut ___E,
12388 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12389 ) -> Result<(), ::fidl_next::EncodeError> {
12390 ::fidl_next::munge! {
12391 let Self::Encoded {
12392 flags,
12393 attributes,
12394
12395 } = out;
12396 }
12397
12398 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12399
12400 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
12401
12402 Ok(())
12403 }
12404 }
12405
12406 pub struct DeprecatedSetFlags<T0> {
12407 flags: T0,
12408 }
12409
12410 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
12411 where
12412 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
12413 {
12414 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
12415 }
12416
12417 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
12418 where
12419 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12420
12421 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
12422 {
12423 #[inline]
12424 fn encode(
12425 self,
12426 encoder: &mut ___E,
12427 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12428 ) -> Result<(), ::fidl_next::EncodeError> {
12429 ::fidl_next::munge! {
12430 let Self::Encoded {
12431 flags,
12432
12433 } = out;
12434 }
12435
12436 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12437
12438 Ok(())
12439 }
12440 }
12441
12442 pub struct SetFlags<T0> {
12443 flags: T0,
12444 }
12445
12446 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
12447 where
12448 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
12449 {
12450 type Encoded = crate::WireNodeSetFlagsRequest;
12451 }
12452
12453 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
12454 where
12455 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12456
12457 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
12458 {
12459 #[inline]
12460 fn encode(
12461 self,
12462 encoder: &mut ___E,
12463 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12464 ) -> Result<(), ::fidl_next::EncodeError> {
12465 ::fidl_next::munge! {
12466 let Self::Encoded {
12467 flags,
12468
12469 } = out;
12470 }
12471
12472 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12473
12474 Ok(())
12475 }
12476 }
12477
12478 pub struct GetAttributes<T0> {
12479 query: T0,
12480 }
12481
12482 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
12483 where
12484 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
12485 {
12486 type Encoded = crate::WireNodeGetAttributesRequest;
12487 }
12488
12489 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
12490 where
12491 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12492
12493 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
12494 {
12495 #[inline]
12496 fn encode(
12497 self,
12498 encoder: &mut ___E,
12499 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12500 ) -> Result<(), ::fidl_next::EncodeError> {
12501 ::fidl_next::munge! {
12502 let Self::Encoded {
12503 query,
12504
12505 } = out;
12506 }
12507
12508 ::fidl_next::Encode::encode(self.query, encoder, query)?;
12509
12510 Ok(())
12511 }
12512 }
12513
12514 pub struct ListExtendedAttributes<T0> {
12515 iterator: T0,
12516 }
12517
12518 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
12519 where
12520 T0: ::fidl_next::Encodable<
12521 Encoded = ::fidl_next::ServerEnd<
12522 crate::ExtendedAttributeIterator,
12523 ::fidl_next::fuchsia::WireChannel,
12524 >,
12525 >,
12526 {
12527 type Encoded = crate::WireNodeListExtendedAttributesRequest;
12528 }
12529
12530 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
12531 where
12532 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12533
12534 ___E: ::fidl_next::fuchsia::HandleEncoder,
12535
12536 T0: ::fidl_next::Encode<
12537 ___E,
12538 Encoded = ::fidl_next::ServerEnd<
12539 crate::ExtendedAttributeIterator,
12540 ::fidl_next::fuchsia::WireChannel,
12541 >,
12542 >,
12543 {
12544 #[inline]
12545 fn encode(
12546 self,
12547 encoder: &mut ___E,
12548 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12549 ) -> Result<(), ::fidl_next::EncodeError> {
12550 ::fidl_next::munge! {
12551 let Self::Encoded {
12552 iterator,
12553
12554 } = out;
12555 }
12556
12557 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
12558
12559 Ok(())
12560 }
12561 }
12562
12563 pub struct GetExtendedAttribute<T0> {
12564 name: T0,
12565 }
12566
12567 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
12568 where
12569 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12570 {
12571 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
12572 }
12573
12574 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
12575 where
12576 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12577
12578 ___E: ::fidl_next::Encoder,
12579
12580 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12581 {
12582 #[inline]
12583 fn encode(
12584 self,
12585 encoder: &mut ___E,
12586 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12587 ) -> Result<(), ::fidl_next::EncodeError> {
12588 ::fidl_next::munge! {
12589 let Self::Encoded {
12590 name,
12591
12592 } = out;
12593 }
12594
12595 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12596
12597 Ok(())
12598 }
12599 }
12600
12601 pub struct SetExtendedAttribute<T0, T1, T2> {
12602 name: T0,
12603
12604 value: T1,
12605
12606 mode: T2,
12607 }
12608
12609 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
12610 where
12611 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12612
12613 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
12614
12615 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
12616 {
12617 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
12618 }
12619
12620 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
12621 where
12622 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12623
12624 ___E: ::fidl_next::Encoder,
12625
12626 ___E: ::fidl_next::fuchsia::HandleEncoder,
12627
12628 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12629
12630 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
12631
12632 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
12633 {
12634 #[inline]
12635 fn encode(
12636 self,
12637 encoder: &mut ___E,
12638 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12639 ) -> Result<(), ::fidl_next::EncodeError> {
12640 ::fidl_next::munge! {
12641 let Self::Encoded {
12642 name,
12643 value,
12644 mode,
12645
12646 } = out;
12647 }
12648
12649 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12650
12651 ::fidl_next::Encode::encode(self.value, encoder, value)?;
12652
12653 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
12654
12655 Ok(())
12656 }
12657 }
12658
12659 pub struct RemoveExtendedAttribute<T0> {
12660 name: T0,
12661 }
12662
12663 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
12664 where
12665 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12666 {
12667 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
12668 }
12669
12670 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
12671 where
12672 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12673
12674 ___E: ::fidl_next::Encoder,
12675
12676 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12677 {
12678 #[inline]
12679 fn encode(
12680 self,
12681 encoder: &mut ___E,
12682 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12683 ) -> Result<(), ::fidl_next::EncodeError> {
12684 ::fidl_next::munge! {
12685 let Self::Encoded {
12686 name,
12687
12688 } = out;
12689 }
12690
12691 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12692
12693 Ok(())
12694 }
12695 }
12696
12697 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Node
12698 where
12699 ___T: ::fidl_next::Transport,
12700 {
12701 type ClientSender = NodeClientSender<___T>;
12702 type ServerSender = NodeServerSender<___T>;
12703 }
12704
12705 pub struct NodeClientSender<___T: ::fidl_next::Transport> {
12707 #[allow(dead_code)]
12708 sender: ::fidl_next::protocol::ClientSender<___T>,
12709 }
12710
12711 impl<___T> NodeClientSender<___T>
12712 where
12713 ___T: ::fidl_next::Transport,
12714 {
12715 pub fn clone(
12716 &self,
12717
12718 request: impl ::fidl_next::Encode<
12719 <___T as ::fidl_next::Transport>::SendBuffer,
12720 Encoded = ::fidl_next::ServerEnd<
12721 ::fidl_next_fuchsia_unknown::Cloneable,
12722 ::fidl_next::fuchsia::WireChannel,
12723 >,
12724 >,
12725 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
12726 where
12727 <___T as ::fidl_next::Transport>::SendBuffer:
12728 ::fidl_next::encoder::InternalHandleEncoder,
12729
12730 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
12731 {
12732 self.clone_with(Clone { request })
12733 }
12734
12735 pub fn clone_with<___R>(
12736 &self,
12737 request: ___R,
12738 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
12739 where
12740 ___R: ::fidl_next::Encode<
12741 <___T as ::fidl_next::Transport>::SendBuffer,
12742 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
12743 >,
12744 {
12745 self.sender.send_one_way(2366825959783828089, request)
12746 }
12747
12748 #[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"]
12749 pub fn close(
12750 &self,
12751 ) -> Result<::fidl_next::ResponseFuture<'_, super::Close, ___T>, ::fidl_next::EncodeError>
12752 {
12753 self.sender
12754 .send_two_way(6540867515453498750, ())
12755 .map(::fidl_next::ResponseFuture::from_untyped)
12756 }
12757
12758 pub fn query(
12759 &self,
12760 ) -> Result<::fidl_next::ResponseFuture<'_, super::Query, ___T>, ::fidl_next::EncodeError>
12761 {
12762 self.sender
12763 .send_two_way(2763219980499352582, ())
12764 .map(::fidl_next::ResponseFuture::from_untyped)
12765 }
12766
12767 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
12768 pub fn deprecated_clone(
12769 &self,
12770
12771 flags: impl ::fidl_next::Encode<
12772 <___T as ::fidl_next::Transport>::SendBuffer,
12773 Encoded = crate::WireOpenFlags,
12774 >,
12775
12776 object: impl ::fidl_next::Encode<
12777 <___T as ::fidl_next::Transport>::SendBuffer,
12778 Encoded = ::fidl_next::ServerEnd<
12779 crate::Node,
12780 ::fidl_next::fuchsia::WireChannel,
12781 >,
12782 >,
12783 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
12784 where
12785 <___T as ::fidl_next::Transport>::SendBuffer:
12786 ::fidl_next::encoder::InternalHandleEncoder,
12787
12788 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
12789 {
12790 self.deprecated_clone_with(DeprecatedClone { flags, object })
12791 }
12792
12793 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
12794 pub fn deprecated_clone_with<___R>(
12795 &self,
12796 request: ___R,
12797 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
12798 where
12799 ___R: ::fidl_next::Encode<
12800 <___T as ::fidl_next::Transport>::SendBuffer,
12801 Encoded = crate::WireNodeDeprecatedCloneRequest,
12802 >,
12803 {
12804 self.sender.send_one_way(6512600400724287855, request)
12805 }
12806
12807 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
12808 pub fn deprecated_get_attr(
12809 &self,
12810 ) -> Result<
12811 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetAttr, ___T>,
12812 ::fidl_next::EncodeError,
12813 > {
12814 self.sender
12815 .send_two_way(8689798978500614909, ())
12816 .map(::fidl_next::ResponseFuture::from_untyped)
12817 }
12818
12819 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
12820 pub fn deprecated_set_attr(
12821 &self,
12822
12823 flags: impl ::fidl_next::Encode<
12824 <___T as ::fidl_next::Transport>::SendBuffer,
12825 Encoded = crate::WireNodeAttributeFlags,
12826 >,
12827
12828 attributes: impl ::fidl_next::Encode<
12829 <___T as ::fidl_next::Transport>::SendBuffer,
12830 Encoded = crate::WireNodeAttributes,
12831 >,
12832 ) -> Result<
12833 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
12834 ::fidl_next::EncodeError,
12835 >
12836 where
12837 <___T as ::fidl_next::Transport>::SendBuffer:
12838 ::fidl_next::encoder::InternalHandleEncoder,
12839 {
12840 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
12841 }
12842
12843 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
12844 pub fn deprecated_set_attr_with<___R>(
12845 &self,
12846 request: ___R,
12847 ) -> Result<
12848 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
12849 ::fidl_next::EncodeError,
12850 >
12851 where
12852 ___R: ::fidl_next::Encode<
12853 <___T as ::fidl_next::Transport>::SendBuffer,
12854 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
12855 >,
12856 {
12857 self.sender
12858 .send_two_way(4721673413776871238, request)
12859 .map(::fidl_next::ResponseFuture::from_untyped)
12860 }
12861
12862 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
12863 pub fn deprecated_get_flags(
12864 &self,
12865 ) -> Result<
12866 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetFlags, ___T>,
12867 ::fidl_next::EncodeError,
12868 > {
12869 self.sender
12870 .send_two_way(6595803110182632097, ())
12871 .map(::fidl_next::ResponseFuture::from_untyped)
12872 }
12873
12874 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
12875 pub fn deprecated_set_flags(
12876 &self,
12877
12878 flags: impl ::fidl_next::Encode<
12879 <___T as ::fidl_next::Transport>::SendBuffer,
12880 Encoded = crate::WireOpenFlags,
12881 >,
12882 ) -> Result<
12883 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
12884 ::fidl_next::EncodeError,
12885 >
12886 where
12887 <___T as ::fidl_next::Transport>::SendBuffer:
12888 ::fidl_next::encoder::InternalHandleEncoder,
12889 {
12890 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
12891 }
12892
12893 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
12894 pub fn deprecated_set_flags_with<___R>(
12895 &self,
12896 request: ___R,
12897 ) -> Result<
12898 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
12899 ::fidl_next::EncodeError,
12900 >
12901 where
12902 ___R: ::fidl_next::Encode<
12903 <___T as ::fidl_next::Transport>::SendBuffer,
12904 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
12905 >,
12906 {
12907 self.sender
12908 .send_two_way(5950864159036794675, request)
12909 .map(::fidl_next::ResponseFuture::from_untyped)
12910 }
12911
12912 #[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"]
12913 pub fn get_flags(
12914 &self,
12915 ) -> Result<
12916 ::fidl_next::ResponseFuture<'_, super::GetFlags, ___T>,
12917 ::fidl_next::EncodeError,
12918 > {
12919 self.sender
12920 .send_two_way(105530239381466147, ())
12921 .map(::fidl_next::ResponseFuture::from_untyped)
12922 }
12923
12924 #[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"]
12925 pub fn set_flags(
12926 &self,
12927
12928 flags: impl ::fidl_next::Encode<
12929 <___T as ::fidl_next::Transport>::SendBuffer,
12930 Encoded = crate::WireFlags,
12931 >,
12932 ) -> Result<
12933 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
12934 ::fidl_next::EncodeError,
12935 >
12936 where
12937 <___T as ::fidl_next::Transport>::SendBuffer:
12938 ::fidl_next::encoder::InternalHandleEncoder,
12939 {
12940 self.set_flags_with(SetFlags { flags })
12941 }
12942
12943 #[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"]
12944 pub fn set_flags_with<___R>(
12945 &self,
12946 request: ___R,
12947 ) -> Result<
12948 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
12949 ::fidl_next::EncodeError,
12950 >
12951 where
12952 ___R: ::fidl_next::Encode<
12953 <___T as ::fidl_next::Transport>::SendBuffer,
12954 Encoded = crate::WireNodeSetFlagsRequest,
12955 >,
12956 {
12957 self.sender
12958 .send_two_way(6172186066099445416, request)
12959 .map(::fidl_next::ResponseFuture::from_untyped)
12960 }
12961
12962 #[doc = " Query the filesystem for filesystem-specific information.\n"]
12963 pub fn query_filesystem(
12964 &self,
12965 ) -> Result<
12966 ::fidl_next::ResponseFuture<'_, super::QueryFilesystem, ___T>,
12967 ::fidl_next::EncodeError,
12968 > {
12969 self.sender
12970 .send_two_way(8013111122914313744, ())
12971 .map(::fidl_next::ResponseFuture::from_untyped)
12972 }
12973
12974 #[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"]
12975 pub fn get_attributes(
12976 &self,
12977
12978 query: impl ::fidl_next::Encode<
12979 <___T as ::fidl_next::Transport>::SendBuffer,
12980 Encoded = crate::WireNodeAttributesQuery,
12981 >,
12982 ) -> Result<
12983 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
12984 ::fidl_next::EncodeError,
12985 >
12986 where
12987 <___T as ::fidl_next::Transport>::SendBuffer:
12988 ::fidl_next::encoder::InternalHandleEncoder,
12989 {
12990 self.get_attributes_with(GetAttributes { query })
12991 }
12992
12993 #[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"]
12994 pub fn get_attributes_with<___R>(
12995 &self,
12996 request: ___R,
12997 ) -> Result<
12998 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
12999 ::fidl_next::EncodeError,
13000 >
13001 where
13002 ___R: ::fidl_next::Encode<
13003 <___T as ::fidl_next::Transport>::SendBuffer,
13004 Encoded = crate::WireNodeGetAttributesRequest,
13005 >,
13006 {
13007 self.sender
13008 .send_two_way(4414537700416816443, request)
13009 .map(::fidl_next::ResponseFuture::from_untyped)
13010 }
13011
13012 #[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"]
13013 pub fn update_attributes_with<___R>(
13014 &self,
13015 request: ___R,
13016 ) -> Result<
13017 ::fidl_next::ResponseFuture<'_, super::UpdateAttributes, ___T>,
13018 ::fidl_next::EncodeError,
13019 >
13020 where
13021 ___R: ::fidl_next::Encode<
13022 <___T as ::fidl_next::Transport>::SendBuffer,
13023 Encoded = crate::WireMutableNodeAttributes<'static>,
13024 >,
13025 {
13026 self.sender
13027 .send_two_way(3677402239314018056, request)
13028 .map(::fidl_next::ResponseFuture::from_untyped)
13029 }
13030
13031 #[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"]
13032 pub fn sync(
13033 &self,
13034 ) -> Result<::fidl_next::ResponseFuture<'_, super::Sync, ___T>, ::fidl_next::EncodeError>
13035 {
13036 self.sender
13037 .send_two_way(3196473584242777161, ())
13038 .map(::fidl_next::ResponseFuture::from_untyped)
13039 }
13040
13041 #[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"]
13042 pub fn list_extended_attributes(
13043 &self,
13044
13045 iterator: impl ::fidl_next::Encode<
13046 <___T as ::fidl_next::Transport>::SendBuffer,
13047 Encoded = ::fidl_next::ServerEnd<
13048 crate::ExtendedAttributeIterator,
13049 ::fidl_next::fuchsia::WireChannel,
13050 >,
13051 >,
13052 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13053 where
13054 <___T as ::fidl_next::Transport>::SendBuffer:
13055 ::fidl_next::encoder::InternalHandleEncoder,
13056
13057 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13058 {
13059 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
13060 }
13061
13062 #[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"]
13063 pub fn list_extended_attributes_with<___R>(
13064 &self,
13065 request: ___R,
13066 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13067 where
13068 ___R: ::fidl_next::Encode<
13069 <___T as ::fidl_next::Transport>::SendBuffer,
13070 Encoded = crate::WireNodeListExtendedAttributesRequest,
13071 >,
13072 {
13073 self.sender.send_one_way(5431626189872037072, request)
13074 }
13075
13076 #[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"]
13077 pub fn get_extended_attribute(
13078 &self,
13079
13080 name: impl ::fidl_next::Encode<
13081 <___T as ::fidl_next::Transport>::SendBuffer,
13082 Encoded = ::fidl_next::WireVector<'static, u8>,
13083 >,
13084 ) -> Result<
13085 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
13086 ::fidl_next::EncodeError,
13087 >
13088 where
13089 <___T as ::fidl_next::Transport>::SendBuffer:
13090 ::fidl_next::encoder::InternalHandleEncoder,
13091
13092 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13093 {
13094 self.get_extended_attribute_with(GetExtendedAttribute { name })
13095 }
13096
13097 #[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"]
13098 pub fn get_extended_attribute_with<___R>(
13099 &self,
13100 request: ___R,
13101 ) -> Result<
13102 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
13103 ::fidl_next::EncodeError,
13104 >
13105 where
13106 ___R: ::fidl_next::Encode<
13107 <___T as ::fidl_next::Transport>::SendBuffer,
13108 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
13109 >,
13110 {
13111 self.sender
13112 .send_two_way(5043930208506967771, request)
13113 .map(::fidl_next::ResponseFuture::from_untyped)
13114 }
13115
13116 #[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"]
13117 pub fn set_extended_attribute(
13118 &self,
13119
13120 name: impl ::fidl_next::Encode<
13121 <___T as ::fidl_next::Transport>::SendBuffer,
13122 Encoded = ::fidl_next::WireVector<'static, u8>,
13123 >,
13124
13125 value: impl ::fidl_next::Encode<
13126 <___T as ::fidl_next::Transport>::SendBuffer,
13127 Encoded = crate::WireExtendedAttributeValue<'static>,
13128 >,
13129
13130 mode: impl ::fidl_next::Encode<
13131 <___T as ::fidl_next::Transport>::SendBuffer,
13132 Encoded = crate::WireSetExtendedAttributeMode,
13133 >,
13134 ) -> Result<
13135 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
13136 ::fidl_next::EncodeError,
13137 >
13138 where
13139 <___T as ::fidl_next::Transport>::SendBuffer:
13140 ::fidl_next::encoder::InternalHandleEncoder,
13141
13142 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13143
13144 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13145 {
13146 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
13147 }
13148
13149 #[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"]
13150 pub fn set_extended_attribute_with<___R>(
13151 &self,
13152 request: ___R,
13153 ) -> Result<
13154 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
13155 ::fidl_next::EncodeError,
13156 >
13157 where
13158 ___R: ::fidl_next::Encode<
13159 <___T as ::fidl_next::Transport>::SendBuffer,
13160 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
13161 >,
13162 {
13163 self.sender
13164 .send_two_way(5374223046099989052, request)
13165 .map(::fidl_next::ResponseFuture::from_untyped)
13166 }
13167
13168 #[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"]
13169 pub fn remove_extended_attribute(
13170 &self,
13171
13172 name: impl ::fidl_next::Encode<
13173 <___T as ::fidl_next::Transport>::SendBuffer,
13174 Encoded = ::fidl_next::WireVector<'static, u8>,
13175 >,
13176 ) -> Result<
13177 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
13178 ::fidl_next::EncodeError,
13179 >
13180 where
13181 <___T as ::fidl_next::Transport>::SendBuffer:
13182 ::fidl_next::encoder::InternalHandleEncoder,
13183
13184 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13185 {
13186 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
13187 }
13188
13189 #[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"]
13190 pub fn remove_extended_attribute_with<___R>(
13191 &self,
13192 request: ___R,
13193 ) -> Result<
13194 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
13195 ::fidl_next::EncodeError,
13196 >
13197 where
13198 ___R: ::fidl_next::Encode<
13199 <___T as ::fidl_next::Transport>::SendBuffer,
13200 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
13201 >,
13202 {
13203 self.sender
13204 .send_two_way(8794297771444732717, request)
13205 .map(::fidl_next::ResponseFuture::from_untyped)
13206 }
13207 }
13208
13209 #[repr(transparent)]
13211 pub struct NodeServerSender<___T: ::fidl_next::Transport> {
13212 sender: ::fidl_next::protocol::ServerSender<___T>,
13213 }
13214
13215 impl<___T> NodeServerSender<___T>
13216 where
13217 ___T: ::fidl_next::Transport,
13218 {
13219 #[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"]
13220 pub fn on_open(
13221 &self,
13222
13223 s: impl ::fidl_next::Encode<
13224 <___T as ::fidl_next::Transport>::SendBuffer,
13225 Encoded = ::fidl_next::WireI32,
13226 >,
13227
13228 info: impl ::fidl_next::Encode<
13229 <___T as ::fidl_next::Transport>::SendBuffer,
13230 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
13231 >,
13232 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13233 where
13234 <___T as ::fidl_next::Transport>::SendBuffer:
13235 ::fidl_next::encoder::InternalHandleEncoder,
13236
13237 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13238
13239 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13240 {
13241 self.on_open_with(OnOpen { s, info })
13242 }
13243
13244 #[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"]
13245
13246 pub fn on_open_with<___R>(
13247 &self,
13248 request: ___R,
13249 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13250 where
13251 ___R: ::fidl_next::Encode<
13252 <___T as ::fidl_next::Transport>::SendBuffer,
13253 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
13254 >,
13255 {
13256 self.sender.send_event(9207534335756671346, request)
13257 }
13258
13259 #[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"]
13260
13261 pub fn on_representation_with<___R>(
13262 &self,
13263 request: ___R,
13264 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13265 where
13266 ___R: ::fidl_next::Encode<
13267 <___T as ::fidl_next::Transport>::SendBuffer,
13268 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
13269 >,
13270 {
13271 self.sender.send_event(6679970090861613324, request)
13272 }
13273 }
13274 }
13275}
13276
13277pub trait NodeClientHandler<___T: ::fidl_next::Transport> {
13281 #[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"]
13282 fn on_open(
13283 &mut self,
13284 sender: &::fidl_next::ClientSender<Node, ___T>,
13285
13286 event: ::fidl_next::Response<node::OnOpen, ___T>,
13287 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13288
13289 #[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"]
13290 fn on_representation(
13291 &mut self,
13292 sender: &::fidl_next::ClientSender<Node, ___T>,
13293
13294 event: ::fidl_next::Response<node::OnRepresentation, ___T>,
13295 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13296
13297 fn on_unknown_interaction(
13298 &mut self,
13299 sender: &::fidl_next::ClientSender<Node, ___T>,
13300 ordinal: u64,
13301 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13302 sender.close();
13303 ::core::future::ready(())
13304 }
13305}
13306
13307impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Node
13308where
13309 ___H: NodeClientHandler<___T> + Send,
13310 ___T: ::fidl_next::Transport,
13311
13312 <node::Close as ::fidl_next::Method>::Response:
13313 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13314
13315 <node::Query as ::fidl_next::Method>::Response:
13316 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13317
13318 <node::OnOpen as ::fidl_next::Method>::Response:
13319 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13320
13321 <node::DeprecatedGetAttr as ::fidl_next::Method>::Response:
13322 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13323
13324 <node::DeprecatedSetAttr as ::fidl_next::Method>::Response:
13325 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13326
13327 <node::DeprecatedGetFlags as ::fidl_next::Method>::Response:
13328 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13329
13330 <node::DeprecatedSetFlags as ::fidl_next::Method>::Response:
13331 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13332
13333 <node::GetFlags as ::fidl_next::Method>::Response:
13334 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13335
13336 <node::SetFlags as ::fidl_next::Method>::Response:
13337 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13338
13339 <node::QueryFilesystem as ::fidl_next::Method>::Response:
13340 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13341
13342 <node::OnRepresentation as ::fidl_next::Method>::Response:
13343 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13344
13345 <node::GetAttributes as ::fidl_next::Method>::Response:
13346 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13347
13348 <node::UpdateAttributes as ::fidl_next::Method>::Response:
13349 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13350
13351 <node::Sync as ::fidl_next::Method>::Response:
13352 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13353
13354 <node::GetExtendedAttribute as ::fidl_next::Method>::Response:
13355 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13356
13357 <node::SetExtendedAttribute as ::fidl_next::Method>::Response:
13358 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13359
13360 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
13361 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13362{
13363 async fn on_event(
13364 handler: &mut ___H,
13365 sender: &::fidl_next::ClientSender<Self, ___T>,
13366 ordinal: u64,
13367 buffer: ___T::RecvBuffer,
13368 ) {
13369 match ordinal {
13370 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
13371 Ok(decoded) => handler.on_open(sender, decoded).await,
13372 Err(e) => {
13373 sender.close();
13374 }
13375 },
13376
13377 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
13378 Ok(decoded) => handler.on_representation(sender, decoded).await,
13379 Err(e) => {
13380 sender.close();
13381 }
13382 },
13383
13384 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13385 }
13386 }
13387}
13388
13389pub trait NodeServerHandler<___T: ::fidl_next::Transport> {
13393 fn clone(
13394 &mut self,
13395 sender: &::fidl_next::ServerSender<Node, ___T>,
13396
13397 request: ::fidl_next::Request<node::Clone, ___T>,
13398 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13399
13400 #[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"]
13401 fn close(
13402 &mut self,
13403 sender: &::fidl_next::ServerSender<Node, ___T>,
13404
13405 responder: ::fidl_next::Responder<node::Close>,
13406 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13407
13408 fn query(
13409 &mut self,
13410 sender: &::fidl_next::ServerSender<Node, ___T>,
13411
13412 responder: ::fidl_next::Responder<node::Query>,
13413 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13414
13415 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13416 fn deprecated_clone(
13417 &mut self,
13418 sender: &::fidl_next::ServerSender<Node, ___T>,
13419
13420 request: ::fidl_next::Request<node::DeprecatedClone, ___T>,
13421 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13422
13423 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
13424 fn deprecated_get_attr(
13425 &mut self,
13426 sender: &::fidl_next::ServerSender<Node, ___T>,
13427
13428 responder: ::fidl_next::Responder<node::DeprecatedGetAttr>,
13429 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13430
13431 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
13432 fn deprecated_set_attr(
13433 &mut self,
13434 sender: &::fidl_next::ServerSender<Node, ___T>,
13435
13436 request: ::fidl_next::Request<node::DeprecatedSetAttr, ___T>,
13437
13438 responder: ::fidl_next::Responder<node::DeprecatedSetAttr>,
13439 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13440
13441 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
13442 fn deprecated_get_flags(
13443 &mut self,
13444 sender: &::fidl_next::ServerSender<Node, ___T>,
13445
13446 responder: ::fidl_next::Responder<node::DeprecatedGetFlags>,
13447 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13448
13449 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13450 fn deprecated_set_flags(
13451 &mut self,
13452 sender: &::fidl_next::ServerSender<Node, ___T>,
13453
13454 request: ::fidl_next::Request<node::DeprecatedSetFlags, ___T>,
13455
13456 responder: ::fidl_next::Responder<node::DeprecatedSetFlags>,
13457 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13458
13459 #[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"]
13460 fn get_flags(
13461 &mut self,
13462 sender: &::fidl_next::ServerSender<Node, ___T>,
13463
13464 responder: ::fidl_next::Responder<node::GetFlags>,
13465 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13466
13467 #[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"]
13468 fn set_flags(
13469 &mut self,
13470 sender: &::fidl_next::ServerSender<Node, ___T>,
13471
13472 request: ::fidl_next::Request<node::SetFlags, ___T>,
13473
13474 responder: ::fidl_next::Responder<node::SetFlags>,
13475 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13476
13477 #[doc = " Query the filesystem for filesystem-specific information.\n"]
13478 fn query_filesystem(
13479 &mut self,
13480 sender: &::fidl_next::ServerSender<Node, ___T>,
13481
13482 responder: ::fidl_next::Responder<node::QueryFilesystem>,
13483 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13484
13485 #[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"]
13486 fn get_attributes(
13487 &mut self,
13488 sender: &::fidl_next::ServerSender<Node, ___T>,
13489
13490 request: ::fidl_next::Request<node::GetAttributes, ___T>,
13491
13492 responder: ::fidl_next::Responder<node::GetAttributes>,
13493 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13494
13495 #[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"]
13496 fn update_attributes(
13497 &mut self,
13498 sender: &::fidl_next::ServerSender<Node, ___T>,
13499
13500 request: ::fidl_next::Request<node::UpdateAttributes, ___T>,
13501
13502 responder: ::fidl_next::Responder<node::UpdateAttributes>,
13503 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13504
13505 #[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"]
13506 fn sync(
13507 &mut self,
13508 sender: &::fidl_next::ServerSender<Node, ___T>,
13509
13510 responder: ::fidl_next::Responder<node::Sync>,
13511 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13512
13513 #[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"]
13514 fn list_extended_attributes(
13515 &mut self,
13516 sender: &::fidl_next::ServerSender<Node, ___T>,
13517
13518 request: ::fidl_next::Request<node::ListExtendedAttributes, ___T>,
13519 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13520
13521 #[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"]
13522 fn get_extended_attribute(
13523 &mut self,
13524 sender: &::fidl_next::ServerSender<Node, ___T>,
13525
13526 request: ::fidl_next::Request<node::GetExtendedAttribute, ___T>,
13527
13528 responder: ::fidl_next::Responder<node::GetExtendedAttribute>,
13529 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13530
13531 #[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"]
13532 fn set_extended_attribute(
13533 &mut self,
13534 sender: &::fidl_next::ServerSender<Node, ___T>,
13535
13536 request: ::fidl_next::Request<node::SetExtendedAttribute, ___T>,
13537
13538 responder: ::fidl_next::Responder<node::SetExtendedAttribute>,
13539 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13540
13541 #[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"]
13542 fn remove_extended_attribute(
13543 &mut self,
13544 sender: &::fidl_next::ServerSender<Node, ___T>,
13545
13546 request: ::fidl_next::Request<node::RemoveExtendedAttribute, ___T>,
13547
13548 responder: ::fidl_next::Responder<node::RemoveExtendedAttribute>,
13549 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13550
13551 fn on_unknown_interaction(
13552 &mut self,
13553 sender: &::fidl_next::ServerSender<Node, ___T>,
13554 ordinal: u64,
13555 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13556 sender.close();
13557 ::core::future::ready(())
13558 }
13559}
13560
13561impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Node
13562where
13563 ___H: NodeServerHandler<___T> + Send,
13564 ___T: ::fidl_next::Transport,
13565
13566 <node::Clone as ::fidl_next::Method>::Request:
13567 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13568
13569 <node::DeprecatedClone as ::fidl_next::Method>::Request:
13570 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13571
13572 <node::DeprecatedSetAttr as ::fidl_next::Method>::Request:
13573 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13574
13575 <node::DeprecatedSetFlags as ::fidl_next::Method>::Request:
13576 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13577
13578 <node::SetFlags as ::fidl_next::Method>::Request:
13579 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13580
13581 <node::GetAttributes as ::fidl_next::Method>::Request:
13582 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13583
13584 <node::UpdateAttributes as ::fidl_next::Method>::Request:
13585 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13586
13587 <node::ListExtendedAttributes as ::fidl_next::Method>::Request:
13588 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13589
13590 <node::GetExtendedAttribute as ::fidl_next::Method>::Request:
13591 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13592
13593 <node::SetExtendedAttribute as ::fidl_next::Method>::Request:
13594 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13595
13596 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
13597 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13598{
13599 async fn on_one_way(
13600 handler: &mut ___H,
13601 sender: &::fidl_next::ServerSender<Self, ___T>,
13602 ordinal: u64,
13603 buffer: ___T::RecvBuffer,
13604 ) {
13605 match ordinal {
13606 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
13607 Ok(decoded) => handler.clone(sender, decoded).await,
13608 Err(e) => {
13609 sender.close();
13610 }
13611 },
13612
13613 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
13614 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
13615 Err(e) => {
13616 sender.close();
13617 }
13618 },
13619
13620 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
13621 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
13622 Err(e) => {
13623 sender.close();
13624 }
13625 },
13626
13627 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13628 }
13629 }
13630
13631 async fn on_two_way(
13632 handler: &mut ___H,
13633 sender: &::fidl_next::ServerSender<Self, ___T>,
13634 ordinal: u64,
13635 buffer: ___T::RecvBuffer,
13636 responder: ::fidl_next::protocol::Responder,
13637 ) {
13638 match ordinal {
13639 6540867515453498750 => {
13640 let responder = ::fidl_next::Responder::from_untyped(responder);
13641
13642 handler.close(sender, responder).await;
13643 }
13644
13645 2763219980499352582 => {
13646 let responder = ::fidl_next::Responder::from_untyped(responder);
13647
13648 handler.query(sender, responder).await;
13649 }
13650
13651 8689798978500614909 => {
13652 let responder = ::fidl_next::Responder::from_untyped(responder);
13653
13654 handler.deprecated_get_attr(sender, responder).await;
13655 }
13656
13657 4721673413776871238 => {
13658 let responder = ::fidl_next::Responder::from_untyped(responder);
13659
13660 match ::fidl_next::DecoderExt::decode(buffer) {
13661 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
13662 Err(e) => {
13663 sender.close();
13664 }
13665 }
13666 }
13667
13668 6595803110182632097 => {
13669 let responder = ::fidl_next::Responder::from_untyped(responder);
13670
13671 handler.deprecated_get_flags(sender, responder).await;
13672 }
13673
13674 5950864159036794675 => {
13675 let responder = ::fidl_next::Responder::from_untyped(responder);
13676
13677 match ::fidl_next::DecoderExt::decode(buffer) {
13678 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
13679 Err(e) => {
13680 sender.close();
13681 }
13682 }
13683 }
13684
13685 105530239381466147 => {
13686 let responder = ::fidl_next::Responder::from_untyped(responder);
13687
13688 handler.get_flags(sender, responder).await;
13689 }
13690
13691 6172186066099445416 => {
13692 let responder = ::fidl_next::Responder::from_untyped(responder);
13693
13694 match ::fidl_next::DecoderExt::decode(buffer) {
13695 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
13696 Err(e) => {
13697 sender.close();
13698 }
13699 }
13700 }
13701
13702 8013111122914313744 => {
13703 let responder = ::fidl_next::Responder::from_untyped(responder);
13704
13705 handler.query_filesystem(sender, responder).await;
13706 }
13707
13708 4414537700416816443 => {
13709 let responder = ::fidl_next::Responder::from_untyped(responder);
13710
13711 match ::fidl_next::DecoderExt::decode(buffer) {
13712 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
13713 Err(e) => {
13714 sender.close();
13715 }
13716 }
13717 }
13718
13719 3677402239314018056 => {
13720 let responder = ::fidl_next::Responder::from_untyped(responder);
13721
13722 match ::fidl_next::DecoderExt::decode(buffer) {
13723 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
13724 Err(e) => {
13725 sender.close();
13726 }
13727 }
13728 }
13729
13730 3196473584242777161 => {
13731 let responder = ::fidl_next::Responder::from_untyped(responder);
13732
13733 handler.sync(sender, responder).await;
13734 }
13735
13736 5043930208506967771 => {
13737 let responder = ::fidl_next::Responder::from_untyped(responder);
13738
13739 match ::fidl_next::DecoderExt::decode(buffer) {
13740 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
13741 Err(e) => {
13742 sender.close();
13743 }
13744 }
13745 }
13746
13747 5374223046099989052 => {
13748 let responder = ::fidl_next::Responder::from_untyped(responder);
13749
13750 match ::fidl_next::DecoderExt::decode(buffer) {
13751 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
13752 Err(e) => {
13753 sender.close();
13754 }
13755 }
13756 }
13757
13758 8794297771444732717 => {
13759 let responder = ::fidl_next::Responder::from_untyped(responder);
13760
13761 match ::fidl_next::DecoderExt::decode(buffer) {
13762 Ok(decoded) => {
13763 handler.remove_extended_attribute(sender, decoded, responder).await
13764 }
13765 Err(e) => {
13766 sender.close();
13767 }
13768 }
13769 }
13770
13771 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13772 }
13773 }
13774}
13775
13776#[derive(Debug)]
13777pub struct DirectoryDeprecatedOpenRequest {
13778 pub flags: crate::OpenFlags,
13779
13780 pub mode: crate::ModeType,
13781
13782 pub path: String,
13783
13784 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
13785}
13786
13787impl ::fidl_next::Encodable for DirectoryDeprecatedOpenRequest {
13788 type Encoded = WireDirectoryDeprecatedOpenRequest<'static>;
13789}
13790
13791unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryDeprecatedOpenRequest
13792where
13793 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13794
13795 ___E: ::fidl_next::Encoder,
13796
13797 ___E: ::fidl_next::fuchsia::HandleEncoder,
13798{
13799 #[inline]
13800 fn encode(
13801 self,
13802 encoder: &mut ___E,
13803 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13804 ) -> Result<(), ::fidl_next::EncodeError> {
13805 ::fidl_next::munge! {
13806 let Self::Encoded {
13807 flags,
13808 mode,
13809 path,
13810 object,
13811
13812 } = out;
13813 }
13814
13815 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
13816
13817 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
13818
13819 ::fidl_next::Encode::encode(self.path, encoder, path)?;
13820
13821 ::fidl_next::Encode::encode(self.object, encoder, object)?;
13822
13823 Ok(())
13824 }
13825}
13826
13827impl ::fidl_next::EncodableOption for DirectoryDeprecatedOpenRequest {
13828 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryDeprecatedOpenRequest<'static>>;
13829}
13830
13831unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryDeprecatedOpenRequest
13832where
13833 ___E: ::fidl_next::Encoder + ?Sized,
13834 DirectoryDeprecatedOpenRequest: ::fidl_next::Encode<___E>,
13835{
13836 #[inline]
13837 fn encode_option(
13838 this: Option<Self>,
13839 encoder: &mut ___E,
13840 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13841 ) -> Result<(), ::fidl_next::EncodeError> {
13842 if let Some(inner) = this {
13843 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
13844 ::fidl_next::WireBox::encode_present(out);
13845 } else {
13846 ::fidl_next::WireBox::encode_absent(out);
13847 }
13848
13849 Ok(())
13850 }
13851}
13852
13853impl<'de> ::fidl_next::FromWire<WireDirectoryDeprecatedOpenRequest<'de>>
13854 for DirectoryDeprecatedOpenRequest
13855{
13856 #[inline]
13857 fn from_wire(wire: WireDirectoryDeprecatedOpenRequest<'de>) -> Self {
13858 Self {
13859 flags: ::fidl_next::FromWire::from_wire(wire.flags),
13860
13861 mode: ::fidl_next::FromWire::from_wire(wire.mode),
13862
13863 path: ::fidl_next::FromWire::from_wire(wire.path),
13864
13865 object: ::fidl_next::FromWire::from_wire(wire.object),
13866 }
13867 }
13868}
13869
13870#[derive(Debug)]
13872#[repr(C)]
13873pub struct WireDirectoryDeprecatedOpenRequest<'de> {
13874 pub flags: crate::WireOpenFlags,
13875
13876 pub mode: crate::WireModeType,
13877
13878 pub path: ::fidl_next::WireString<'de>,
13879
13880 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
13881}
13882
13883unsafe impl ::fidl_next::Wire for WireDirectoryDeprecatedOpenRequest<'static> {
13884 type Decoded<'de> = WireDirectoryDeprecatedOpenRequest<'de>;
13885
13886 #[inline]
13887 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13888 unsafe {
13889 out.as_mut_ptr().cast::<u8>().add(28).write_bytes(0, 4);
13890 }
13891 }
13892}
13893
13894unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryDeprecatedOpenRequest<'static>
13895where
13896 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13897
13898 ___D: ::fidl_next::Decoder,
13899
13900 ___D: ::fidl_next::fuchsia::HandleDecoder,
13901{
13902 fn decode(
13903 slot: ::fidl_next::Slot<'_, Self>,
13904 decoder: &mut ___D,
13905 ) -> Result<(), ::fidl_next::DecodeError> {
13906 ::fidl_next::munge! {
13907 let Self {
13908 mut flags,
13909 mut mode,
13910 mut path,
13911 mut object,
13912
13913 } = slot;
13914 }
13915
13916 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
13917
13918 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
13919
13920 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
13921
13922 let path = unsafe { path.deref_unchecked() };
13923
13924 if path.len() > 4095 {
13925 return Err(::fidl_next::DecodeError::VectorTooLong {
13926 size: path.len() as u64,
13927 limit: 4095,
13928 });
13929 }
13930
13931 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
13932
13933 Ok(())
13934 }
13935}
13936
13937#[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"]
13938#[derive(Clone, Debug, Default)]
13939pub struct Options {
13940 pub attributes: Option<crate::NodeAttributesQuery>,
13941
13942 pub create_attributes: Option<crate::MutableNodeAttributes>,
13943}
13944
13945impl Options {
13946 fn __max_ordinal(&self) -> usize {
13947 if self.create_attributes.is_some() {
13948 return 2;
13949 }
13950
13951 if self.attributes.is_some() {
13952 return 1;
13953 }
13954
13955 0
13956 }
13957}
13958
13959impl ::fidl_next::Encodable for Options {
13960 type Encoded = WireOptions<'static>;
13961}
13962
13963unsafe impl<___E> ::fidl_next::Encode<___E> for Options
13964where
13965 ___E: ::fidl_next::Encoder + ?Sized,
13966{
13967 #[inline]
13968 fn encode(
13969 mut self,
13970 encoder: &mut ___E,
13971 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13972 ) -> Result<(), ::fidl_next::EncodeError> {
13973 ::fidl_next::munge!(let WireOptions { table } = out);
13974
13975 let max_ord = self.__max_ordinal();
13976
13977 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13978 ::fidl_next::Wire::zero_padding(&mut out);
13979
13980 let mut preallocated =
13981 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13982
13983 for i in 1..=max_ord {
13984 match i {
13985 2 => {
13986 if let Some(create_attributes) = self.create_attributes.take() {
13987 ::fidl_next::WireEnvelope::encode_value(
13988 create_attributes,
13989 preallocated.encoder,
13990 &mut out,
13991 )?;
13992 } else {
13993 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13994 }
13995 }
13996
13997 1 => {
13998 if let Some(attributes) = self.attributes.take() {
13999 ::fidl_next::WireEnvelope::encode_value(
14000 attributes,
14001 preallocated.encoder,
14002 &mut out,
14003 )?;
14004 } else {
14005 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14006 }
14007 }
14008
14009 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14010 }
14011 unsafe {
14012 preallocated.write_next(out.assume_init_ref());
14013 }
14014 }
14015
14016 ::fidl_next::WireTable::encode_len(table, max_ord);
14017
14018 Ok(())
14019 }
14020}
14021
14022unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Options
14023where
14024 ___E: ::fidl_next::Encoder + ?Sized,
14025{
14026 #[inline]
14027 fn encode_ref(
14028 &self,
14029 encoder: &mut ___E,
14030 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14031 ) -> Result<(), ::fidl_next::EncodeError> {
14032 ::fidl_next::munge!(let WireOptions { table } = out);
14033
14034 let max_ord = self.__max_ordinal();
14035
14036 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14037 ::fidl_next::Wire::zero_padding(&mut out);
14038
14039 let mut preallocated =
14040 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14041
14042 for i in 1..=max_ord {
14043 match i {
14044 2 => {
14045 if let Some(create_attributes) = &self.create_attributes {
14046 ::fidl_next::WireEnvelope::encode_value(
14047 create_attributes,
14048 preallocated.encoder,
14049 &mut out,
14050 )?;
14051 } else {
14052 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14053 }
14054 }
14055
14056 1 => {
14057 if let Some(attributes) = &self.attributes {
14058 ::fidl_next::WireEnvelope::encode_value(
14059 attributes,
14060 preallocated.encoder,
14061 &mut out,
14062 )?;
14063 } else {
14064 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14065 }
14066 }
14067
14068 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14069 }
14070 unsafe {
14071 preallocated.write_next(out.assume_init_ref());
14072 }
14073 }
14074
14075 ::fidl_next::WireTable::encode_len(table, max_ord);
14076
14077 Ok(())
14078 }
14079}
14080
14081impl<'de> ::fidl_next::FromWire<WireOptions<'de>> for Options {
14082 #[inline]
14083 fn from_wire(wire: WireOptions<'de>) -> Self {
14084 let wire = ::core::mem::ManuallyDrop::new(wire);
14085
14086 let attributes = wire.table.get(1);
14087
14088 let create_attributes = wire.table.get(2);
14089
14090 Self {
14091 attributes: attributes.map(|envelope| {
14092 ::fidl_next::FromWire::from_wire(unsafe {
14093 envelope.read_unchecked::<crate::WireNodeAttributesQuery>()
14094 })
14095 }),
14096
14097 create_attributes: create_attributes.map(|envelope| {
14098 ::fidl_next::FromWire::from_wire(unsafe {
14099 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
14100 })
14101 }),
14102 }
14103 }
14104}
14105
14106impl<'de> ::fidl_next::FromWireRef<WireOptions<'de>> for Options {
14107 #[inline]
14108 fn from_wire_ref(wire: &WireOptions<'de>) -> Self {
14109 Self {
14110 attributes: wire.table.get(1).map(|envelope| {
14111 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14112 envelope.deref_unchecked::<crate::WireNodeAttributesQuery>()
14113 })
14114 }),
14115
14116 create_attributes: wire.table.get(2).map(|envelope| {
14117 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14118 envelope.deref_unchecked::<crate::WireMutableNodeAttributes<'de>>()
14119 })
14120 }),
14121 }
14122 }
14123}
14124
14125#[repr(C)]
14127pub struct WireOptions<'de> {
14128 table: ::fidl_next::WireTable<'de>,
14129}
14130
14131impl<'de> Drop for WireOptions<'de> {
14132 fn drop(&mut self) {
14133 let _ = self
14134 .table
14135 .get(1)
14136 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeAttributesQuery>() });
14137
14138 let _ = self.table.get(2).map(|envelope| unsafe {
14139 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
14140 });
14141 }
14142}
14143
14144unsafe impl ::fidl_next::Wire for WireOptions<'static> {
14145 type Decoded<'de> = WireOptions<'de>;
14146
14147 #[inline]
14148 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14149 ::fidl_next::munge!(let Self { table } = out);
14150 ::fidl_next::WireTable::zero_padding(table);
14151 }
14152}
14153
14154unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptions<'static>
14155where
14156 ___D: ::fidl_next::Decoder + ?Sized,
14157{
14158 fn decode(
14159 slot: ::fidl_next::Slot<'_, Self>,
14160 decoder: &mut ___D,
14161 ) -> Result<(), ::fidl_next::DecodeError> {
14162 ::fidl_next::munge!(let Self { table } = slot);
14163
14164 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14165 match ordinal {
14166 0 => unsafe { ::core::hint::unreachable_unchecked() },
14167
14168 1 => {
14169 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributesQuery>(
14170 slot.as_mut(),
14171 decoder,
14172 )?;
14173
14174 Ok(())
14175 }
14176
14177 2 => {
14178 ::fidl_next::WireEnvelope::decode_as::<
14179 ___D,
14180 crate::WireMutableNodeAttributes<'static>,
14181 >(slot.as_mut(), decoder)?;
14182
14183 Ok(())
14184 }
14185
14186 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14187 }
14188 })
14189 }
14190}
14191
14192impl<'de> WireOptions<'de> {
14193 pub fn attributes(&self) -> Option<&crate::WireNodeAttributesQuery> {
14194 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14195 }
14196
14197 pub fn create_attributes(&self) -> Option<&crate::WireMutableNodeAttributes<'de>> {
14198 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14199 }
14200}
14201
14202impl<'de> ::core::fmt::Debug for WireOptions<'de> {
14203 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14204 f.debug_struct("Options")
14205 .field("attributes", &self.attributes())
14206 .field("create_attributes", &self.create_attributes())
14207 .finish()
14208 }
14209}
14210
14211#[derive(Debug)]
14212pub struct DirectoryOpenRequest {
14213 pub path: String,
14214
14215 pub flags: crate::Flags,
14216
14217 pub options: crate::Options,
14218
14219 pub object: ::fidl_next::fuchsia::zx::Handle,
14220}
14221
14222impl ::fidl_next::Encodable for DirectoryOpenRequest {
14223 type Encoded = WireDirectoryOpenRequest<'static>;
14224}
14225
14226unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryOpenRequest
14227where
14228 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14229
14230 ___E: ::fidl_next::Encoder,
14231
14232 ___E: ::fidl_next::fuchsia::HandleEncoder,
14233{
14234 #[inline]
14235 fn encode(
14236 self,
14237 encoder: &mut ___E,
14238 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14239 ) -> Result<(), ::fidl_next::EncodeError> {
14240 ::fidl_next::munge! {
14241 let Self::Encoded {
14242 path,
14243 flags,
14244 options,
14245 object,
14246
14247 } = out;
14248 }
14249
14250 ::fidl_next::Encode::encode(self.path, encoder, path)?;
14251
14252 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
14253
14254 ::fidl_next::Encode::encode(self.options, encoder, options)?;
14255
14256 ::fidl_next::Encode::encode(self.object, encoder, object)?;
14257
14258 Ok(())
14259 }
14260}
14261
14262impl ::fidl_next::EncodableOption for DirectoryOpenRequest {
14263 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryOpenRequest<'static>>;
14264}
14265
14266unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryOpenRequest
14267where
14268 ___E: ::fidl_next::Encoder + ?Sized,
14269 DirectoryOpenRequest: ::fidl_next::Encode<___E>,
14270{
14271 #[inline]
14272 fn encode_option(
14273 this: Option<Self>,
14274 encoder: &mut ___E,
14275 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14276 ) -> Result<(), ::fidl_next::EncodeError> {
14277 if let Some(inner) = this {
14278 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14279 ::fidl_next::WireBox::encode_present(out);
14280 } else {
14281 ::fidl_next::WireBox::encode_absent(out);
14282 }
14283
14284 Ok(())
14285 }
14286}
14287
14288impl<'de> ::fidl_next::FromWire<WireDirectoryOpenRequest<'de>> for DirectoryOpenRequest {
14289 #[inline]
14290 fn from_wire(wire: WireDirectoryOpenRequest<'de>) -> Self {
14291 Self {
14292 path: ::fidl_next::FromWire::from_wire(wire.path),
14293
14294 flags: ::fidl_next::FromWire::from_wire(wire.flags),
14295
14296 options: ::fidl_next::FromWire::from_wire(wire.options),
14297
14298 object: ::fidl_next::FromWire::from_wire(wire.object),
14299 }
14300 }
14301}
14302
14303#[derive(Debug)]
14305#[repr(C)]
14306pub struct WireDirectoryOpenRequest<'de> {
14307 pub path: ::fidl_next::WireString<'de>,
14308
14309 pub flags: crate::WireFlags,
14310
14311 pub options: crate::WireOptions<'de>,
14312
14313 pub object: ::fidl_next::fuchsia::WireHandle,
14314}
14315
14316unsafe impl ::fidl_next::Wire for WireDirectoryOpenRequest<'static> {
14317 type Decoded<'de> = WireDirectoryOpenRequest<'de>;
14318
14319 #[inline]
14320 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14321 unsafe {
14322 out.as_mut_ptr().cast::<u8>().add(44).write_bytes(0, 4);
14323 }
14324 }
14325}
14326
14327unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryOpenRequest<'static>
14328where
14329 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14330
14331 ___D: ::fidl_next::Decoder,
14332
14333 ___D: ::fidl_next::fuchsia::HandleDecoder,
14334{
14335 fn decode(
14336 slot: ::fidl_next::Slot<'_, Self>,
14337 decoder: &mut ___D,
14338 ) -> Result<(), ::fidl_next::DecodeError> {
14339 ::fidl_next::munge! {
14340 let Self {
14341 mut path,
14342 mut flags,
14343 mut options,
14344 mut object,
14345
14346 } = slot;
14347 }
14348
14349 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
14350
14351 let path = unsafe { path.deref_unchecked() };
14352
14353 if path.len() > 4095 {
14354 return Err(::fidl_next::DecodeError::VectorTooLong {
14355 size: path.len() as u64,
14356 limit: 4095,
14357 });
14358 }
14359
14360 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
14361
14362 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
14363
14364 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
14365
14366 Ok(())
14367 }
14368}
14369
14370#[derive(Debug)]
14371pub struct DirectoryCreateSymlinkRequest {
14372 pub name: String,
14373
14374 pub target: Vec<u8>,
14375
14376 pub connection:
14377 Option<::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::zx::Channel>>,
14378}
14379
14380impl ::fidl_next::Encodable for DirectoryCreateSymlinkRequest {
14381 type Encoded = WireDirectoryCreateSymlinkRequest<'static>;
14382}
14383
14384unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryCreateSymlinkRequest
14385where
14386 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14387
14388 ___E: ::fidl_next::Encoder,
14389
14390 ___E: ::fidl_next::fuchsia::HandleEncoder,
14391{
14392 #[inline]
14393 fn encode(
14394 self,
14395 encoder: &mut ___E,
14396 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14397 ) -> Result<(), ::fidl_next::EncodeError> {
14398 ::fidl_next::munge! {
14399 let Self::Encoded {
14400 name,
14401 target,
14402 connection,
14403
14404 } = out;
14405 }
14406
14407 ::fidl_next::Encode::encode(self.name, encoder, name)?;
14408
14409 ::fidl_next::Encode::encode(self.target, encoder, target)?;
14410
14411 ::fidl_next::Encode::encode(self.connection, encoder, connection)?;
14412
14413 Ok(())
14414 }
14415}
14416
14417impl ::fidl_next::EncodableOption for DirectoryCreateSymlinkRequest {
14418 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryCreateSymlinkRequest<'static>>;
14419}
14420
14421unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryCreateSymlinkRequest
14422where
14423 ___E: ::fidl_next::Encoder + ?Sized,
14424 DirectoryCreateSymlinkRequest: ::fidl_next::Encode<___E>,
14425{
14426 #[inline]
14427 fn encode_option(
14428 this: Option<Self>,
14429 encoder: &mut ___E,
14430 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14431 ) -> Result<(), ::fidl_next::EncodeError> {
14432 if let Some(inner) = this {
14433 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14434 ::fidl_next::WireBox::encode_present(out);
14435 } else {
14436 ::fidl_next::WireBox::encode_absent(out);
14437 }
14438
14439 Ok(())
14440 }
14441}
14442
14443impl<'de> ::fidl_next::FromWire<WireDirectoryCreateSymlinkRequest<'de>>
14444 for DirectoryCreateSymlinkRequest
14445{
14446 #[inline]
14447 fn from_wire(wire: WireDirectoryCreateSymlinkRequest<'de>) -> Self {
14448 Self {
14449 name: ::fidl_next::FromWire::from_wire(wire.name),
14450
14451 target: ::fidl_next::FromWire::from_wire(wire.target),
14452
14453 connection: ::fidl_next::FromWire::from_wire(wire.connection),
14454 }
14455 }
14456}
14457
14458#[derive(Debug)]
14460#[repr(C)]
14461pub struct WireDirectoryCreateSymlinkRequest<'de> {
14462 pub name: ::fidl_next::WireString<'de>,
14463
14464 pub target: ::fidl_next::WireVector<'de, u8>,
14465
14466 pub connection:
14467 ::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::WireOptionalChannel>,
14468}
14469
14470unsafe impl ::fidl_next::Wire for WireDirectoryCreateSymlinkRequest<'static> {
14471 type Decoded<'de> = WireDirectoryCreateSymlinkRequest<'de>;
14472
14473 #[inline]
14474 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14475 unsafe {
14476 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
14477 }
14478 }
14479}
14480
14481unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryCreateSymlinkRequest<'static>
14482where
14483 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14484
14485 ___D: ::fidl_next::Decoder,
14486
14487 ___D: ::fidl_next::fuchsia::HandleDecoder,
14488{
14489 fn decode(
14490 slot: ::fidl_next::Slot<'_, Self>,
14491 decoder: &mut ___D,
14492 ) -> Result<(), ::fidl_next::DecodeError> {
14493 ::fidl_next::munge! {
14494 let Self {
14495 mut name,
14496 mut target,
14497 mut connection,
14498
14499 } = slot;
14500 }
14501
14502 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
14503
14504 let name = unsafe { name.deref_unchecked() };
14505
14506 if name.len() > 255 {
14507 return Err(::fidl_next::DecodeError::VectorTooLong {
14508 size: name.len() as u64,
14509 limit: 255,
14510 });
14511 }
14512
14513 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
14514
14515 let target = unsafe { target.deref_unchecked() };
14516
14517 if target.len() > 4095 {
14518 return Err(::fidl_next::DecodeError::VectorTooLong {
14519 size: target.len() as u64,
14520 limit: 4095,
14521 });
14522 }
14523
14524 ::fidl_next::Decode::decode(connection.as_mut(), decoder)?;
14525
14526 Ok(())
14527 }
14528}
14529
14530#[doc = " Directory defines a node which is capable of containing other Objects.\n"]
14532#[derive(Debug)]
14533pub struct Directory;
14534
14535impl ::fidl_next::Discoverable for Directory {
14536 const PROTOCOL_NAME: &'static str = "fuchsia.io.Directory";
14537}
14538
14539pub mod directory {
14540 pub mod prelude {
14541 pub use crate::{directory, Directory, DirectoryClientHandler, DirectoryServerHandler};
14542
14543 pub use crate::AdvisoryLockingAdvisoryLockRequest;
14544
14545 pub use crate::AdvisoryLockingAdvisoryLockResponse;
14546
14547 pub use crate::DirectoryCreateSymlinkRequest;
14548
14549 pub use crate::DirectoryDeprecatedOpenRequest;
14550
14551 pub use crate::DirectoryGetTokenResponse;
14552
14553 pub use crate::DirectoryLinkRequest;
14554
14555 pub use crate::DirectoryLinkResponse;
14556
14557 pub use crate::DirectoryOpenRequest;
14558
14559 pub use crate::DirectoryReadDirentsRequest;
14560
14561 pub use crate::DirectoryReadDirentsResponse;
14562
14563 pub use crate::DirectoryRenameRequest;
14564
14565 pub use crate::DirectoryRewindResponse;
14566
14567 pub use crate::DirectoryUnlinkRequest;
14568
14569 pub use crate::DirectoryWatchRequest;
14570
14571 pub use crate::DirectoryWatchResponse;
14572
14573 pub use crate::DirectoryCreateSymlinkResponse;
14574
14575 pub use crate::DirectoryRenameResponse;
14576
14577 pub use crate::DirectoryUnlinkResponse;
14578
14579 pub use crate::ExtendedAttributeValue;
14580
14581 pub use crate::MutableNodeAttributes;
14582
14583 pub use crate::NodeAttributes2;
14584
14585 pub use crate::NodeDeprecatedCloneRequest;
14586
14587 pub use crate::NodeDeprecatedGetAttrResponse;
14588
14589 pub use crate::NodeDeprecatedGetFlagsResponse;
14590
14591 pub use crate::NodeDeprecatedSetAttrRequest;
14592
14593 pub use crate::NodeDeprecatedSetAttrResponse;
14594
14595 pub use crate::NodeDeprecatedSetFlagsRequest;
14596
14597 pub use crate::NodeDeprecatedSetFlagsResponse;
14598
14599 pub use crate::NodeGetAttributesRequest;
14600
14601 pub use crate::NodeGetExtendedAttributeRequest;
14602
14603 pub use crate::NodeListExtendedAttributesRequest;
14604
14605 pub use crate::NodeOnOpenRequest;
14606
14607 pub use crate::NodeQueryFilesystemResponse;
14608
14609 pub use crate::NodeRemoveExtendedAttributeRequest;
14610
14611 pub use crate::NodeSetExtendedAttributeRequest;
14612
14613 pub use crate::NodeSetFlagsRequest;
14614
14615 pub use crate::NodeGetFlagsResponse;
14616
14617 pub use crate::NodeRemoveExtendedAttributeResponse;
14618
14619 pub use crate::NodeSetExtendedAttributeResponse;
14620
14621 pub use crate::NodeSetFlagsResponse;
14622
14623 pub use crate::NodeSyncResponse;
14624
14625 pub use crate::NodeUpdateAttributesResponse;
14626
14627 pub use crate::Representation;
14628
14629 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
14630
14631 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
14632
14633 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
14634 }
14635
14636 pub struct AdvisoryLock;
14637
14638 impl ::fidl_next::Method for AdvisoryLock {
14639 const ORDINAL: u64 = 7992130864415541162;
14640
14641 type Protocol = crate::Directory;
14642
14643 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
14644
14645 type Response = ::fidl_next::WireResult<
14646 'static,
14647 crate::WireAdvisoryLockingAdvisoryLockResponse,
14648 ::fidl_next::WireI32,
14649 >;
14650 }
14651
14652 pub struct Clone;
14653
14654 impl ::fidl_next::Method for Clone {
14655 const ORDINAL: u64 = 2366825959783828089;
14656
14657 type Protocol = crate::Directory;
14658
14659 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
14660
14661 type Response = ::fidl_next::Never;
14662 }
14663
14664 pub struct Close;
14665
14666 impl ::fidl_next::Method for Close {
14667 const ORDINAL: u64 = 6540867515453498750;
14668
14669 type Protocol = crate::Directory;
14670
14671 type Request = ();
14672
14673 type Response = ::fidl_next::WireResult<
14674 'static,
14675 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
14676 ::fidl_next::WireI32,
14677 >;
14678 }
14679
14680 pub struct Query;
14681
14682 impl ::fidl_next::Method for Query {
14683 const ORDINAL: u64 = 2763219980499352582;
14684
14685 type Protocol = crate::Directory;
14686
14687 type Request = ();
14688
14689 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
14690 }
14691
14692 pub struct DeprecatedClone;
14693
14694 impl ::fidl_next::Method for DeprecatedClone {
14695 const ORDINAL: u64 = 6512600400724287855;
14696
14697 type Protocol = crate::Directory;
14698
14699 type Request = crate::WireNodeDeprecatedCloneRequest;
14700
14701 type Response = ::fidl_next::Never;
14702 }
14703
14704 pub struct OnOpen;
14705
14706 impl ::fidl_next::Method for OnOpen {
14707 const ORDINAL: u64 = 9207534335756671346;
14708
14709 type Protocol = crate::Directory;
14710
14711 type Request = ::fidl_next::Never;
14712
14713 type Response = crate::WireNodeOnOpenRequest<'static>;
14714 }
14715
14716 pub struct DeprecatedGetAttr;
14717
14718 impl ::fidl_next::Method for DeprecatedGetAttr {
14719 const ORDINAL: u64 = 8689798978500614909;
14720
14721 type Protocol = crate::Directory;
14722
14723 type Request = ();
14724
14725 type Response = crate::WireNodeDeprecatedGetAttrResponse;
14726 }
14727
14728 pub struct DeprecatedSetAttr;
14729
14730 impl ::fidl_next::Method for DeprecatedSetAttr {
14731 const ORDINAL: u64 = 4721673413776871238;
14732
14733 type Protocol = crate::Directory;
14734
14735 type Request = crate::WireNodeDeprecatedSetAttrRequest;
14736
14737 type Response = crate::WireNodeDeprecatedSetAttrResponse;
14738 }
14739
14740 pub struct DeprecatedGetFlags;
14741
14742 impl ::fidl_next::Method for DeprecatedGetFlags {
14743 const ORDINAL: u64 = 6595803110182632097;
14744
14745 type Protocol = crate::Directory;
14746
14747 type Request = ();
14748
14749 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
14750 }
14751
14752 pub struct DeprecatedSetFlags;
14753
14754 impl ::fidl_next::Method for DeprecatedSetFlags {
14755 const ORDINAL: u64 = 5950864159036794675;
14756
14757 type Protocol = crate::Directory;
14758
14759 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
14760
14761 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
14762 }
14763
14764 pub struct GetFlags;
14765
14766 impl ::fidl_next::Method for GetFlags {
14767 const ORDINAL: u64 = 105530239381466147;
14768
14769 type Protocol = crate::Directory;
14770
14771 type Request = ();
14772
14773 type Response = ::fidl_next::WireFlexibleResult<
14774 'static,
14775 crate::WireNodeGetFlagsResponse,
14776 ::fidl_next::WireI32,
14777 >;
14778 }
14779
14780 pub struct SetFlags;
14781
14782 impl ::fidl_next::Method for SetFlags {
14783 const ORDINAL: u64 = 6172186066099445416;
14784
14785 type Protocol = crate::Directory;
14786
14787 type Request = crate::WireNodeSetFlagsRequest;
14788
14789 type Response = ::fidl_next::WireFlexibleResult<
14790 'static,
14791 crate::WireNodeSetFlagsResponse,
14792 ::fidl_next::WireI32,
14793 >;
14794 }
14795
14796 pub struct QueryFilesystem;
14797
14798 impl ::fidl_next::Method for QueryFilesystem {
14799 const ORDINAL: u64 = 8013111122914313744;
14800
14801 type Protocol = crate::Directory;
14802
14803 type Request = ();
14804
14805 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
14806 }
14807
14808 pub struct OnRepresentation;
14809
14810 impl ::fidl_next::Method for OnRepresentation {
14811 const ORDINAL: u64 = 6679970090861613324;
14812
14813 type Protocol = crate::Directory;
14814
14815 type Request = ::fidl_next::Never;
14816
14817 type Response = crate::WireRepresentation<'static>;
14818 }
14819
14820 pub struct GetAttributes;
14821
14822 impl ::fidl_next::Method for GetAttributes {
14823 const ORDINAL: u64 = 4414537700416816443;
14824
14825 type Protocol = crate::Directory;
14826
14827 type Request = crate::WireNodeGetAttributesRequest;
14828
14829 type Response = ::fidl_next::WireResult<
14830 'static,
14831 crate::WireNodeAttributes2<'static>,
14832 ::fidl_next::WireI32,
14833 >;
14834 }
14835
14836 pub struct UpdateAttributes;
14837
14838 impl ::fidl_next::Method for UpdateAttributes {
14839 const ORDINAL: u64 = 3677402239314018056;
14840
14841 type Protocol = crate::Directory;
14842
14843 type Request = crate::WireMutableNodeAttributes<'static>;
14844
14845 type Response = ::fidl_next::WireResult<
14846 'static,
14847 crate::WireNodeUpdateAttributesResponse,
14848 ::fidl_next::WireI32,
14849 >;
14850 }
14851
14852 pub struct Sync;
14853
14854 impl ::fidl_next::Method for Sync {
14855 const ORDINAL: u64 = 3196473584242777161;
14856
14857 type Protocol = crate::Directory;
14858
14859 type Request = ();
14860
14861 type Response =
14862 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
14863 }
14864
14865 pub struct ListExtendedAttributes;
14866
14867 impl ::fidl_next::Method for ListExtendedAttributes {
14868 const ORDINAL: u64 = 5431626189872037072;
14869
14870 type Protocol = crate::Directory;
14871
14872 type Request = crate::WireNodeListExtendedAttributesRequest;
14873
14874 type Response = ::fidl_next::Never;
14875 }
14876
14877 pub struct GetExtendedAttribute;
14878
14879 impl ::fidl_next::Method for GetExtendedAttribute {
14880 const ORDINAL: u64 = 5043930208506967771;
14881
14882 type Protocol = crate::Directory;
14883
14884 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
14885
14886 type Response = ::fidl_next::WireResult<
14887 'static,
14888 crate::WireExtendedAttributeValue<'static>,
14889 ::fidl_next::WireI32,
14890 >;
14891 }
14892
14893 pub struct SetExtendedAttribute;
14894
14895 impl ::fidl_next::Method for SetExtendedAttribute {
14896 const ORDINAL: u64 = 5374223046099989052;
14897
14898 type Protocol = crate::Directory;
14899
14900 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
14901
14902 type Response = ::fidl_next::WireResult<
14903 'static,
14904 crate::WireNodeSetExtendedAttributeResponse,
14905 ::fidl_next::WireI32,
14906 >;
14907 }
14908
14909 pub struct RemoveExtendedAttribute;
14910
14911 impl ::fidl_next::Method for RemoveExtendedAttribute {
14912 const ORDINAL: u64 = 8794297771444732717;
14913
14914 type Protocol = crate::Directory;
14915
14916 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
14917
14918 type Response = ::fidl_next::WireResult<
14919 'static,
14920 crate::WireNodeRemoveExtendedAttributeResponse,
14921 ::fidl_next::WireI32,
14922 >;
14923 }
14924
14925 pub struct DeprecatedOpen;
14926
14927 impl ::fidl_next::Method for DeprecatedOpen {
14928 const ORDINAL: u64 = 3193127272456937152;
14929
14930 type Protocol = crate::Directory;
14931
14932 type Request = crate::WireDirectoryDeprecatedOpenRequest<'static>;
14933
14934 type Response = ::fidl_next::Never;
14935 }
14936
14937 pub struct Open;
14938
14939 impl ::fidl_next::Method for Open {
14940 const ORDINAL: u64 = 6236883748953765593;
14941
14942 type Protocol = crate::Directory;
14943
14944 type Request = crate::WireDirectoryOpenRequest<'static>;
14945
14946 type Response = ::fidl_next::Never;
14947 }
14948
14949 pub struct ReadDirents;
14950
14951 impl ::fidl_next::Method for ReadDirents {
14952 const ORDINAL: u64 = 3855785432100874762;
14953
14954 type Protocol = crate::Directory;
14955
14956 type Request = crate::WireDirectoryReadDirentsRequest;
14957
14958 type Response = crate::WireDirectoryReadDirentsResponse<'static>;
14959 }
14960
14961 pub struct Rewind;
14962
14963 impl ::fidl_next::Method for Rewind {
14964 const ORDINAL: u64 = 1635123508515392625;
14965
14966 type Protocol = crate::Directory;
14967
14968 type Request = ();
14969
14970 type Response = crate::WireDirectoryRewindResponse;
14971 }
14972
14973 pub struct GetToken;
14974
14975 impl ::fidl_next::Method for GetToken {
14976 const ORDINAL: u64 = 2787337947777369685;
14977
14978 type Protocol = crate::Directory;
14979
14980 type Request = ();
14981
14982 type Response = crate::WireDirectoryGetTokenResponse;
14983 }
14984
14985 pub struct Link;
14986
14987 impl ::fidl_next::Method for Link {
14988 const ORDINAL: u64 = 8360374984291987687;
14989
14990 type Protocol = crate::Directory;
14991
14992 type Request = crate::WireDirectoryLinkRequest<'static>;
14993
14994 type Response = crate::WireDirectoryLinkResponse;
14995 }
14996
14997 pub struct Unlink;
14998
14999 impl ::fidl_next::Method for Unlink {
15000 const ORDINAL: u64 = 8433556716759383021;
15001
15002 type Protocol = crate::Directory;
15003
15004 type Request = crate::WireDirectoryUnlinkRequest<'static>;
15005
15006 type Response = ::fidl_next::WireResult<
15007 'static,
15008 crate::WireDirectoryUnlinkResponse,
15009 ::fidl_next::WireI32,
15010 >;
15011 }
15012
15013 pub struct Rename;
15014
15015 impl ::fidl_next::Method for Rename {
15016 const ORDINAL: u64 = 8097726607824333022;
15017
15018 type Protocol = crate::Directory;
15019
15020 type Request = crate::WireDirectoryRenameRequest<'static>;
15021
15022 type Response = ::fidl_next::WireResult<
15023 'static,
15024 crate::WireDirectoryRenameResponse,
15025 ::fidl_next::WireI32,
15026 >;
15027 }
15028
15029 pub struct CreateSymlink;
15030
15031 impl ::fidl_next::Method for CreateSymlink {
15032 const ORDINAL: u64 = 2435901052462315657;
15033
15034 type Protocol = crate::Directory;
15035
15036 type Request = crate::WireDirectoryCreateSymlinkRequest<'static>;
15037
15038 type Response = ::fidl_next::WireResult<
15039 'static,
15040 crate::WireDirectoryCreateSymlinkResponse,
15041 ::fidl_next::WireI32,
15042 >;
15043 }
15044
15045 pub struct Watch;
15046
15047 impl ::fidl_next::Method for Watch {
15048 const ORDINAL: u64 = 6275512344170098065;
15049
15050 type Protocol = crate::Directory;
15051
15052 type Request = crate::WireDirectoryWatchRequest;
15053
15054 type Response = crate::WireDirectoryWatchResponse;
15055 }
15056
15057 mod ___detail {
15058
15059 pub struct AdvisoryLock<T0> {
15060 request: T0,
15061 }
15062
15063 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
15064 where
15065 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
15066 {
15067 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
15068 }
15069
15070 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
15071 where
15072 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15073
15074 ___E: ::fidl_next::Encoder,
15075
15076 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
15077 {
15078 #[inline]
15079 fn encode(
15080 self,
15081 encoder: &mut ___E,
15082 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15083 ) -> Result<(), ::fidl_next::EncodeError> {
15084 ::fidl_next::munge! {
15085 let Self::Encoded {
15086 request,
15087
15088 } = out;
15089 }
15090
15091 ::fidl_next::Encode::encode(self.request, encoder, request)?;
15092
15093 Ok(())
15094 }
15095 }
15096
15097 pub struct Clone<T0> {
15098 request: T0,
15099 }
15100
15101 impl<T0> ::fidl_next::Encodable for Clone<T0>
15102 where
15103 T0: ::fidl_next::Encodable<
15104 Encoded = ::fidl_next::ServerEnd<
15105 ::fidl_next_fuchsia_unknown::Cloneable,
15106 ::fidl_next::fuchsia::WireChannel,
15107 >,
15108 >,
15109 {
15110 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
15111 }
15112
15113 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
15114 where
15115 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15116
15117 ___E: ::fidl_next::fuchsia::HandleEncoder,
15118
15119 T0: ::fidl_next::Encode<
15120 ___E,
15121 Encoded = ::fidl_next::ServerEnd<
15122 ::fidl_next_fuchsia_unknown::Cloneable,
15123 ::fidl_next::fuchsia::WireChannel,
15124 >,
15125 >,
15126 {
15127 #[inline]
15128 fn encode(
15129 self,
15130 encoder: &mut ___E,
15131 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15132 ) -> Result<(), ::fidl_next::EncodeError> {
15133 ::fidl_next::munge! {
15134 let Self::Encoded {
15135 request,
15136
15137 } = out;
15138 }
15139
15140 ::fidl_next::Encode::encode(self.request, encoder, request)?;
15141
15142 Ok(())
15143 }
15144 }
15145
15146 pub struct DeprecatedClone<T0, T1> {
15147 flags: T0,
15148
15149 object: T1,
15150 }
15151
15152 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
15153 where
15154 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
15155
15156 T1: ::fidl_next::Encodable<
15157 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
15158 >,
15159 {
15160 type Encoded = crate::WireNodeDeprecatedCloneRequest;
15161 }
15162
15163 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
15164 where
15165 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15166
15167 ___E: ::fidl_next::fuchsia::HandleEncoder,
15168
15169 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
15170
15171 T1: ::fidl_next::Encode<
15172 ___E,
15173 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
15174 >,
15175 {
15176 #[inline]
15177 fn encode(
15178 self,
15179 encoder: &mut ___E,
15180 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15181 ) -> Result<(), ::fidl_next::EncodeError> {
15182 ::fidl_next::munge! {
15183 let Self::Encoded {
15184 flags,
15185 object,
15186
15187 } = out;
15188 }
15189
15190 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15191
15192 ::fidl_next::Encode::encode(self.object, encoder, object)?;
15193
15194 Ok(())
15195 }
15196 }
15197
15198 pub struct OnOpen<T0, T1> {
15199 s: T0,
15200
15201 info: T1,
15202 }
15203
15204 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
15205 where
15206 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
15207
15208 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
15209 {
15210 type Encoded = crate::WireNodeOnOpenRequest<'static>;
15211 }
15212
15213 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
15214 where
15215 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15216
15217 ___E: ::fidl_next::Encoder,
15218
15219 ___E: ::fidl_next::fuchsia::HandleEncoder,
15220
15221 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
15222
15223 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
15224 {
15225 #[inline]
15226 fn encode(
15227 self,
15228 encoder: &mut ___E,
15229 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15230 ) -> Result<(), ::fidl_next::EncodeError> {
15231 ::fidl_next::munge! {
15232 let Self::Encoded {
15233 s,
15234 info,
15235
15236 } = out;
15237 }
15238
15239 ::fidl_next::Encode::encode(self.s, encoder, s)?;
15240
15241 ::fidl_next::Encode::encode(self.info, encoder, info)?;
15242
15243 Ok(())
15244 }
15245 }
15246
15247 pub struct DeprecatedSetAttr<T0, T1> {
15248 flags: T0,
15249
15250 attributes: T1,
15251 }
15252
15253 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
15254 where
15255 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
15256
15257 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
15258 {
15259 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
15260 }
15261
15262 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
15263 where
15264 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15265
15266 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
15267
15268 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
15269 {
15270 #[inline]
15271 fn encode(
15272 self,
15273 encoder: &mut ___E,
15274 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15275 ) -> Result<(), ::fidl_next::EncodeError> {
15276 ::fidl_next::munge! {
15277 let Self::Encoded {
15278 flags,
15279 attributes,
15280
15281 } = out;
15282 }
15283
15284 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15285
15286 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
15287
15288 Ok(())
15289 }
15290 }
15291
15292 pub struct DeprecatedSetFlags<T0> {
15293 flags: T0,
15294 }
15295
15296 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
15297 where
15298 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
15299 {
15300 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
15301 }
15302
15303 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
15304 where
15305 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15306
15307 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
15308 {
15309 #[inline]
15310 fn encode(
15311 self,
15312 encoder: &mut ___E,
15313 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15314 ) -> Result<(), ::fidl_next::EncodeError> {
15315 ::fidl_next::munge! {
15316 let Self::Encoded {
15317 flags,
15318
15319 } = out;
15320 }
15321
15322 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15323
15324 Ok(())
15325 }
15326 }
15327
15328 pub struct SetFlags<T0> {
15329 flags: T0,
15330 }
15331
15332 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
15333 where
15334 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
15335 {
15336 type Encoded = crate::WireNodeSetFlagsRequest;
15337 }
15338
15339 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
15340 where
15341 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15342
15343 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
15344 {
15345 #[inline]
15346 fn encode(
15347 self,
15348 encoder: &mut ___E,
15349 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15350 ) -> Result<(), ::fidl_next::EncodeError> {
15351 ::fidl_next::munge! {
15352 let Self::Encoded {
15353 flags,
15354
15355 } = out;
15356 }
15357
15358 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15359
15360 Ok(())
15361 }
15362 }
15363
15364 pub struct GetAttributes<T0> {
15365 query: T0,
15366 }
15367
15368 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
15369 where
15370 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
15371 {
15372 type Encoded = crate::WireNodeGetAttributesRequest;
15373 }
15374
15375 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
15376 where
15377 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15378
15379 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
15380 {
15381 #[inline]
15382 fn encode(
15383 self,
15384 encoder: &mut ___E,
15385 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15386 ) -> Result<(), ::fidl_next::EncodeError> {
15387 ::fidl_next::munge! {
15388 let Self::Encoded {
15389 query,
15390
15391 } = out;
15392 }
15393
15394 ::fidl_next::Encode::encode(self.query, encoder, query)?;
15395
15396 Ok(())
15397 }
15398 }
15399
15400 pub struct ListExtendedAttributes<T0> {
15401 iterator: T0,
15402 }
15403
15404 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
15405 where
15406 T0: ::fidl_next::Encodable<
15407 Encoded = ::fidl_next::ServerEnd<
15408 crate::ExtendedAttributeIterator,
15409 ::fidl_next::fuchsia::WireChannel,
15410 >,
15411 >,
15412 {
15413 type Encoded = crate::WireNodeListExtendedAttributesRequest;
15414 }
15415
15416 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
15417 where
15418 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15419
15420 ___E: ::fidl_next::fuchsia::HandleEncoder,
15421
15422 T0: ::fidl_next::Encode<
15423 ___E,
15424 Encoded = ::fidl_next::ServerEnd<
15425 crate::ExtendedAttributeIterator,
15426 ::fidl_next::fuchsia::WireChannel,
15427 >,
15428 >,
15429 {
15430 #[inline]
15431 fn encode(
15432 self,
15433 encoder: &mut ___E,
15434 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15435 ) -> Result<(), ::fidl_next::EncodeError> {
15436 ::fidl_next::munge! {
15437 let Self::Encoded {
15438 iterator,
15439
15440 } = out;
15441 }
15442
15443 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
15444
15445 Ok(())
15446 }
15447 }
15448
15449 pub struct GetExtendedAttribute<T0> {
15450 name: T0,
15451 }
15452
15453 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
15454 where
15455 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15456 {
15457 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
15458 }
15459
15460 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
15461 where
15462 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15463
15464 ___E: ::fidl_next::Encoder,
15465
15466 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15467 {
15468 #[inline]
15469 fn encode(
15470 self,
15471 encoder: &mut ___E,
15472 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15473 ) -> Result<(), ::fidl_next::EncodeError> {
15474 ::fidl_next::munge! {
15475 let Self::Encoded {
15476 name,
15477
15478 } = out;
15479 }
15480
15481 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15482
15483 Ok(())
15484 }
15485 }
15486
15487 pub struct SetExtendedAttribute<T0, T1, T2> {
15488 name: T0,
15489
15490 value: T1,
15491
15492 mode: T2,
15493 }
15494
15495 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
15496 where
15497 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15498
15499 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
15500
15501 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
15502 {
15503 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
15504 }
15505
15506 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
15507 where
15508 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15509
15510 ___E: ::fidl_next::Encoder,
15511
15512 ___E: ::fidl_next::fuchsia::HandleEncoder,
15513
15514 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15515
15516 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
15517
15518 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
15519 {
15520 #[inline]
15521 fn encode(
15522 self,
15523 encoder: &mut ___E,
15524 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15525 ) -> Result<(), ::fidl_next::EncodeError> {
15526 ::fidl_next::munge! {
15527 let Self::Encoded {
15528 name,
15529 value,
15530 mode,
15531
15532 } = out;
15533 }
15534
15535 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15536
15537 ::fidl_next::Encode::encode(self.value, encoder, value)?;
15538
15539 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
15540
15541 Ok(())
15542 }
15543 }
15544
15545 pub struct RemoveExtendedAttribute<T0> {
15546 name: T0,
15547 }
15548
15549 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
15550 where
15551 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15552 {
15553 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
15554 }
15555
15556 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
15557 where
15558 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15559
15560 ___E: ::fidl_next::Encoder,
15561
15562 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15563 {
15564 #[inline]
15565 fn encode(
15566 self,
15567 encoder: &mut ___E,
15568 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15569 ) -> Result<(), ::fidl_next::EncodeError> {
15570 ::fidl_next::munge! {
15571 let Self::Encoded {
15572 name,
15573
15574 } = out;
15575 }
15576
15577 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15578
15579 Ok(())
15580 }
15581 }
15582
15583 pub struct DeprecatedOpen<T0, T1, T2, T3> {
15584 flags: T0,
15585
15586 mode: T1,
15587
15588 path: T2,
15589
15590 object: T3,
15591 }
15592
15593 impl<T0, T1, T2, T3> ::fidl_next::Encodable for DeprecatedOpen<T0, T1, T2, T3>
15594 where
15595 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
15596
15597 T1: ::fidl_next::Encodable<Encoded = crate::WireModeType>,
15598
15599 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15600
15601 T3: ::fidl_next::Encodable<
15602 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
15603 >,
15604 {
15605 type Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>;
15606 }
15607
15608 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for DeprecatedOpen<T0, T1, T2, T3>
15609 where
15610 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15611
15612 ___E: ::fidl_next::Encoder,
15613
15614 ___E: ::fidl_next::fuchsia::HandleEncoder,
15615
15616 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
15617
15618 T1: ::fidl_next::Encode<___E, Encoded = crate::WireModeType>,
15619
15620 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15621
15622 T3: ::fidl_next::Encode<
15623 ___E,
15624 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
15625 >,
15626 {
15627 #[inline]
15628 fn encode(
15629 self,
15630 encoder: &mut ___E,
15631 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15632 ) -> Result<(), ::fidl_next::EncodeError> {
15633 ::fidl_next::munge! {
15634 let Self::Encoded {
15635 flags,
15636 mode,
15637 path,
15638 object,
15639
15640 } = out;
15641 }
15642
15643 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15644
15645 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
15646
15647 ::fidl_next::Encode::encode(self.path, encoder, path)?;
15648
15649 ::fidl_next::Encode::encode(self.object, encoder, object)?;
15650
15651 Ok(())
15652 }
15653 }
15654
15655 pub struct Open<T0, T1, T2, T3> {
15656 path: T0,
15657
15658 flags: T1,
15659
15660 options: T2,
15661
15662 object: T3,
15663 }
15664
15665 impl<T0, T1, T2, T3> ::fidl_next::Encodable for Open<T0, T1, T2, T3>
15666 where
15667 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15668
15669 T1: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
15670
15671 T2: ::fidl_next::Encodable<Encoded = crate::WireOptions<'static>>,
15672
15673 T3: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
15674 {
15675 type Encoded = crate::WireDirectoryOpenRequest<'static>;
15676 }
15677
15678 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for Open<T0, T1, T2, T3>
15679 where
15680 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15681
15682 ___E: ::fidl_next::Encoder,
15683
15684 ___E: ::fidl_next::fuchsia::HandleEncoder,
15685
15686 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15687
15688 T1: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
15689
15690 T2: ::fidl_next::Encode<___E, Encoded = crate::WireOptions<'static>>,
15691
15692 T3: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
15693 {
15694 #[inline]
15695 fn encode(
15696 self,
15697 encoder: &mut ___E,
15698 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15699 ) -> Result<(), ::fidl_next::EncodeError> {
15700 ::fidl_next::munge! {
15701 let Self::Encoded {
15702 path,
15703 flags,
15704 options,
15705 object,
15706
15707 } = out;
15708 }
15709
15710 ::fidl_next::Encode::encode(self.path, encoder, path)?;
15711
15712 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15713
15714 ::fidl_next::Encode::encode(self.options, encoder, options)?;
15715
15716 ::fidl_next::Encode::encode(self.object, encoder, object)?;
15717
15718 Ok(())
15719 }
15720 }
15721
15722 pub struct ReadDirents<T0> {
15723 max_bytes: T0,
15724 }
15725
15726 impl<T0> ::fidl_next::Encodable for ReadDirents<T0>
15727 where
15728 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
15729 {
15730 type Encoded = crate::WireDirectoryReadDirentsRequest;
15731 }
15732
15733 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ReadDirents<T0>
15734 where
15735 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15736
15737 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
15738 {
15739 #[inline]
15740 fn encode(
15741 self,
15742 encoder: &mut ___E,
15743 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15744 ) -> Result<(), ::fidl_next::EncodeError> {
15745 ::fidl_next::munge! {
15746 let Self::Encoded {
15747 max_bytes,
15748
15749 } = out;
15750 }
15751
15752 ::fidl_next::Encode::encode(self.max_bytes, encoder, max_bytes)?;
15753
15754 Ok(())
15755 }
15756 }
15757
15758 pub struct Link<T0, T1, T2> {
15759 src: T0,
15760
15761 dst_parent_token: T1,
15762
15763 dst: T2,
15764 }
15765
15766 impl<T0, T1, T2> ::fidl_next::Encodable for Link<T0, T1, T2>
15767 where
15768 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15769
15770 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
15771
15772 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15773 {
15774 type Encoded = crate::WireDirectoryLinkRequest<'static>;
15775 }
15776
15777 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Link<T0, T1, T2>
15778 where
15779 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15780
15781 ___E: ::fidl_next::Encoder,
15782
15783 ___E: ::fidl_next::fuchsia::HandleEncoder,
15784
15785 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15786
15787 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
15788
15789 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15790 {
15791 #[inline]
15792 fn encode(
15793 self,
15794 encoder: &mut ___E,
15795 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15796 ) -> Result<(), ::fidl_next::EncodeError> {
15797 ::fidl_next::munge! {
15798 let Self::Encoded {
15799 src,
15800 dst_parent_token,
15801 dst,
15802
15803 } = out;
15804 }
15805
15806 ::fidl_next::Encode::encode(self.src, encoder, src)?;
15807
15808 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
15809
15810 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
15811
15812 Ok(())
15813 }
15814 }
15815
15816 pub struct Unlink<T0, T1> {
15817 name: T0,
15818
15819 options: T1,
15820 }
15821
15822 impl<T0, T1> ::fidl_next::Encodable for Unlink<T0, T1>
15823 where
15824 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15825
15826 T1: ::fidl_next::Encodable<Encoded = crate::WireUnlinkOptions<'static>>,
15827 {
15828 type Encoded = crate::WireDirectoryUnlinkRequest<'static>;
15829 }
15830
15831 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Unlink<T0, T1>
15832 where
15833 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15834
15835 ___E: ::fidl_next::Encoder,
15836
15837 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15838
15839 T1: ::fidl_next::Encode<___E, Encoded = crate::WireUnlinkOptions<'static>>,
15840 {
15841 #[inline]
15842 fn encode(
15843 self,
15844 encoder: &mut ___E,
15845 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15846 ) -> Result<(), ::fidl_next::EncodeError> {
15847 ::fidl_next::munge! {
15848 let Self::Encoded {
15849 name,
15850 options,
15851
15852 } = out;
15853 }
15854
15855 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15856
15857 ::fidl_next::Encode::encode(self.options, encoder, options)?;
15858
15859 Ok(())
15860 }
15861 }
15862
15863 pub struct Rename<T0, T1, T2> {
15864 src: T0,
15865
15866 dst_parent_token: T1,
15867
15868 dst: T2,
15869 }
15870
15871 impl<T0, T1, T2> ::fidl_next::Encodable for Rename<T0, T1, T2>
15872 where
15873 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15874
15875 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
15876
15877 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15878 {
15879 type Encoded = crate::WireDirectoryRenameRequest<'static>;
15880 }
15881
15882 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Rename<T0, T1, T2>
15883 where
15884 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15885
15886 ___E: ::fidl_next::Encoder,
15887
15888 ___E: ::fidl_next::fuchsia::HandleEncoder,
15889
15890 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15891
15892 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
15893
15894 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15895 {
15896 #[inline]
15897 fn encode(
15898 self,
15899 encoder: &mut ___E,
15900 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15901 ) -> Result<(), ::fidl_next::EncodeError> {
15902 ::fidl_next::munge! {
15903 let Self::Encoded {
15904 src,
15905 dst_parent_token,
15906 dst,
15907
15908 } = out;
15909 }
15910
15911 ::fidl_next::Encode::encode(self.src, encoder, src)?;
15912
15913 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
15914
15915 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
15916
15917 Ok(())
15918 }
15919 }
15920
15921 pub struct CreateSymlink<T0, T1, T2> {
15922 name: T0,
15923
15924 target: T1,
15925
15926 connection: T2,
15927 }
15928
15929 impl<T0, T1, T2> ::fidl_next::Encodable for CreateSymlink<T0, T1, T2>
15930 where
15931 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15932
15933 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15934
15935 T2: ::fidl_next::Encodable<
15936 Encoded = ::fidl_next::ServerEnd<
15937 crate::Symlink,
15938 ::fidl_next::fuchsia::WireOptionalChannel,
15939 >,
15940 >,
15941 {
15942 type Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>;
15943 }
15944
15945 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for CreateSymlink<T0, T1, T2>
15946 where
15947 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15948
15949 ___E: ::fidl_next::Encoder,
15950
15951 ___E: ::fidl_next::fuchsia::HandleEncoder,
15952
15953 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15954
15955 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15956
15957 T2: ::fidl_next::Encode<
15958 ___E,
15959 Encoded = ::fidl_next::ServerEnd<
15960 crate::Symlink,
15961 ::fidl_next::fuchsia::WireOptionalChannel,
15962 >,
15963 >,
15964 {
15965 #[inline]
15966 fn encode(
15967 self,
15968 encoder: &mut ___E,
15969 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15970 ) -> Result<(), ::fidl_next::EncodeError> {
15971 ::fidl_next::munge! {
15972 let Self::Encoded {
15973 name,
15974 target,
15975 connection,
15976
15977 } = out;
15978 }
15979
15980 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15981
15982 ::fidl_next::Encode::encode(self.target, encoder, target)?;
15983
15984 ::fidl_next::Encode::encode(self.connection, encoder, connection)?;
15985
15986 Ok(())
15987 }
15988 }
15989
15990 pub struct Watch<T0, T1, T2> {
15991 mask: T0,
15992
15993 options: T1,
15994
15995 watcher: T2,
15996 }
15997
15998 impl<T0, T1, T2> ::fidl_next::Encodable for Watch<T0, T1, T2>
15999 where
16000 T0: ::fidl_next::Encodable<Encoded = crate::WireWatchMask>,
16001
16002 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
16003
16004 T2: ::fidl_next::Encodable<
16005 Encoded = ::fidl_next::ServerEnd<
16006 crate::DirectoryWatcher,
16007 ::fidl_next::fuchsia::WireChannel,
16008 >,
16009 >,
16010 {
16011 type Encoded = crate::WireDirectoryWatchRequest;
16012 }
16013
16014 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Watch<T0, T1, T2>
16015 where
16016 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16017
16018 ___E: ::fidl_next::fuchsia::HandleEncoder,
16019
16020 T0: ::fidl_next::Encode<___E, Encoded = crate::WireWatchMask>,
16021
16022 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
16023
16024 T2: ::fidl_next::Encode<
16025 ___E,
16026 Encoded = ::fidl_next::ServerEnd<
16027 crate::DirectoryWatcher,
16028 ::fidl_next::fuchsia::WireChannel,
16029 >,
16030 >,
16031 {
16032 #[inline]
16033 fn encode(
16034 self,
16035 encoder: &mut ___E,
16036 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16037 ) -> Result<(), ::fidl_next::EncodeError> {
16038 ::fidl_next::munge! {
16039 let Self::Encoded {
16040 mask,
16041 options,
16042 watcher,
16043
16044 } = out;
16045 }
16046
16047 ::fidl_next::Encode::encode(self.mask, encoder, mask)?;
16048
16049 ::fidl_next::Encode::encode(self.options, encoder, options)?;
16050
16051 ::fidl_next::Encode::encode(self.watcher, encoder, watcher)?;
16052
16053 Ok(())
16054 }
16055 }
16056
16057 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Directory
16058 where
16059 ___T: ::fidl_next::Transport,
16060 {
16061 type ClientSender = DirectoryClientSender<___T>;
16062 type ServerSender = DirectoryServerSender<___T>;
16063 }
16064
16065 pub struct DirectoryClientSender<___T: ::fidl_next::Transport> {
16067 #[allow(dead_code)]
16068 sender: ::fidl_next::protocol::ClientSender<___T>,
16069 }
16070
16071 impl<___T> DirectoryClientSender<___T>
16072 where
16073 ___T: ::fidl_next::Transport,
16074 {
16075 #[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"]
16076 pub fn advisory_lock(
16077 &self,
16078
16079 request: impl ::fidl_next::Encode<
16080 <___T as ::fidl_next::Transport>::SendBuffer,
16081 Encoded = crate::WireAdvisoryLockRequest<'static>,
16082 >,
16083 ) -> Result<
16084 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
16085 ::fidl_next::EncodeError,
16086 >
16087 where
16088 <___T as ::fidl_next::Transport>::SendBuffer:
16089 ::fidl_next::encoder::InternalHandleEncoder,
16090
16091 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16092 {
16093 self.advisory_lock_with(AdvisoryLock { request })
16094 }
16095
16096 #[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"]
16097 pub fn advisory_lock_with<___R>(
16098 &self,
16099 request: ___R,
16100 ) -> Result<
16101 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
16102 ::fidl_next::EncodeError,
16103 >
16104 where
16105 ___R: ::fidl_next::Encode<
16106 <___T as ::fidl_next::Transport>::SendBuffer,
16107 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
16108 >,
16109 {
16110 self.sender
16111 .send_two_way(7992130864415541162, request)
16112 .map(::fidl_next::ResponseFuture::from_untyped)
16113 }
16114
16115 pub fn clone(
16116 &self,
16117
16118 request: impl ::fidl_next::Encode<
16119 <___T as ::fidl_next::Transport>::SendBuffer,
16120 Encoded = ::fidl_next::ServerEnd<
16121 ::fidl_next_fuchsia_unknown::Cloneable,
16122 ::fidl_next::fuchsia::WireChannel,
16123 >,
16124 >,
16125 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16126 where
16127 <___T as ::fidl_next::Transport>::SendBuffer:
16128 ::fidl_next::encoder::InternalHandleEncoder,
16129
16130 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16131 {
16132 self.clone_with(Clone { request })
16133 }
16134
16135 pub fn clone_with<___R>(
16136 &self,
16137 request: ___R,
16138 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16139 where
16140 ___R: ::fidl_next::Encode<
16141 <___T as ::fidl_next::Transport>::SendBuffer,
16142 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
16143 >,
16144 {
16145 self.sender.send_one_way(2366825959783828089, request)
16146 }
16147
16148 #[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"]
16149 pub fn close(
16150 &self,
16151 ) -> Result<::fidl_next::ResponseFuture<'_, super::Close, ___T>, ::fidl_next::EncodeError>
16152 {
16153 self.sender
16154 .send_two_way(6540867515453498750, ())
16155 .map(::fidl_next::ResponseFuture::from_untyped)
16156 }
16157
16158 pub fn query(
16159 &self,
16160 ) -> Result<::fidl_next::ResponseFuture<'_, super::Query, ___T>, ::fidl_next::EncodeError>
16161 {
16162 self.sender
16163 .send_two_way(2763219980499352582, ())
16164 .map(::fidl_next::ResponseFuture::from_untyped)
16165 }
16166
16167 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
16168 pub fn deprecated_clone(
16169 &self,
16170
16171 flags: impl ::fidl_next::Encode<
16172 <___T as ::fidl_next::Transport>::SendBuffer,
16173 Encoded = crate::WireOpenFlags,
16174 >,
16175
16176 object: impl ::fidl_next::Encode<
16177 <___T as ::fidl_next::Transport>::SendBuffer,
16178 Encoded = ::fidl_next::ServerEnd<
16179 crate::Node,
16180 ::fidl_next::fuchsia::WireChannel,
16181 >,
16182 >,
16183 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16184 where
16185 <___T as ::fidl_next::Transport>::SendBuffer:
16186 ::fidl_next::encoder::InternalHandleEncoder,
16187
16188 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16189 {
16190 self.deprecated_clone_with(DeprecatedClone { flags, object })
16191 }
16192
16193 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
16194 pub fn deprecated_clone_with<___R>(
16195 &self,
16196 request: ___R,
16197 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16198 where
16199 ___R: ::fidl_next::Encode<
16200 <___T as ::fidl_next::Transport>::SendBuffer,
16201 Encoded = crate::WireNodeDeprecatedCloneRequest,
16202 >,
16203 {
16204 self.sender.send_one_way(6512600400724287855, request)
16205 }
16206
16207 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
16208 pub fn deprecated_get_attr(
16209 &self,
16210 ) -> Result<
16211 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetAttr, ___T>,
16212 ::fidl_next::EncodeError,
16213 > {
16214 self.sender
16215 .send_two_way(8689798978500614909, ())
16216 .map(::fidl_next::ResponseFuture::from_untyped)
16217 }
16218
16219 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
16220 pub fn deprecated_set_attr(
16221 &self,
16222
16223 flags: impl ::fidl_next::Encode<
16224 <___T as ::fidl_next::Transport>::SendBuffer,
16225 Encoded = crate::WireNodeAttributeFlags,
16226 >,
16227
16228 attributes: impl ::fidl_next::Encode<
16229 <___T as ::fidl_next::Transport>::SendBuffer,
16230 Encoded = crate::WireNodeAttributes,
16231 >,
16232 ) -> Result<
16233 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
16234 ::fidl_next::EncodeError,
16235 >
16236 where
16237 <___T as ::fidl_next::Transport>::SendBuffer:
16238 ::fidl_next::encoder::InternalHandleEncoder,
16239 {
16240 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
16241 }
16242
16243 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
16244 pub fn deprecated_set_attr_with<___R>(
16245 &self,
16246 request: ___R,
16247 ) -> Result<
16248 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
16249 ::fidl_next::EncodeError,
16250 >
16251 where
16252 ___R: ::fidl_next::Encode<
16253 <___T as ::fidl_next::Transport>::SendBuffer,
16254 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
16255 >,
16256 {
16257 self.sender
16258 .send_two_way(4721673413776871238, request)
16259 .map(::fidl_next::ResponseFuture::from_untyped)
16260 }
16261
16262 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
16263 pub fn deprecated_get_flags(
16264 &self,
16265 ) -> Result<
16266 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetFlags, ___T>,
16267 ::fidl_next::EncodeError,
16268 > {
16269 self.sender
16270 .send_two_way(6595803110182632097, ())
16271 .map(::fidl_next::ResponseFuture::from_untyped)
16272 }
16273
16274 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
16275 pub fn deprecated_set_flags(
16276 &self,
16277
16278 flags: impl ::fidl_next::Encode<
16279 <___T as ::fidl_next::Transport>::SendBuffer,
16280 Encoded = crate::WireOpenFlags,
16281 >,
16282 ) -> Result<
16283 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
16284 ::fidl_next::EncodeError,
16285 >
16286 where
16287 <___T as ::fidl_next::Transport>::SendBuffer:
16288 ::fidl_next::encoder::InternalHandleEncoder,
16289 {
16290 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
16291 }
16292
16293 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
16294 pub fn deprecated_set_flags_with<___R>(
16295 &self,
16296 request: ___R,
16297 ) -> Result<
16298 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
16299 ::fidl_next::EncodeError,
16300 >
16301 where
16302 ___R: ::fidl_next::Encode<
16303 <___T as ::fidl_next::Transport>::SendBuffer,
16304 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
16305 >,
16306 {
16307 self.sender
16308 .send_two_way(5950864159036794675, request)
16309 .map(::fidl_next::ResponseFuture::from_untyped)
16310 }
16311
16312 #[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"]
16313 pub fn get_flags(
16314 &self,
16315 ) -> Result<
16316 ::fidl_next::ResponseFuture<'_, super::GetFlags, ___T>,
16317 ::fidl_next::EncodeError,
16318 > {
16319 self.sender
16320 .send_two_way(105530239381466147, ())
16321 .map(::fidl_next::ResponseFuture::from_untyped)
16322 }
16323
16324 #[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"]
16325 pub fn set_flags(
16326 &self,
16327
16328 flags: impl ::fidl_next::Encode<
16329 <___T as ::fidl_next::Transport>::SendBuffer,
16330 Encoded = crate::WireFlags,
16331 >,
16332 ) -> Result<
16333 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
16334 ::fidl_next::EncodeError,
16335 >
16336 where
16337 <___T as ::fidl_next::Transport>::SendBuffer:
16338 ::fidl_next::encoder::InternalHandleEncoder,
16339 {
16340 self.set_flags_with(SetFlags { flags })
16341 }
16342
16343 #[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"]
16344 pub fn set_flags_with<___R>(
16345 &self,
16346 request: ___R,
16347 ) -> Result<
16348 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
16349 ::fidl_next::EncodeError,
16350 >
16351 where
16352 ___R: ::fidl_next::Encode<
16353 <___T as ::fidl_next::Transport>::SendBuffer,
16354 Encoded = crate::WireNodeSetFlagsRequest,
16355 >,
16356 {
16357 self.sender
16358 .send_two_way(6172186066099445416, request)
16359 .map(::fidl_next::ResponseFuture::from_untyped)
16360 }
16361
16362 #[doc = " Query the filesystem for filesystem-specific information.\n"]
16363 pub fn query_filesystem(
16364 &self,
16365 ) -> Result<
16366 ::fidl_next::ResponseFuture<'_, super::QueryFilesystem, ___T>,
16367 ::fidl_next::EncodeError,
16368 > {
16369 self.sender
16370 .send_two_way(8013111122914313744, ())
16371 .map(::fidl_next::ResponseFuture::from_untyped)
16372 }
16373
16374 #[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"]
16375 pub fn get_attributes(
16376 &self,
16377
16378 query: impl ::fidl_next::Encode<
16379 <___T as ::fidl_next::Transport>::SendBuffer,
16380 Encoded = crate::WireNodeAttributesQuery,
16381 >,
16382 ) -> Result<
16383 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
16384 ::fidl_next::EncodeError,
16385 >
16386 where
16387 <___T as ::fidl_next::Transport>::SendBuffer:
16388 ::fidl_next::encoder::InternalHandleEncoder,
16389 {
16390 self.get_attributes_with(GetAttributes { query })
16391 }
16392
16393 #[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"]
16394 pub fn get_attributes_with<___R>(
16395 &self,
16396 request: ___R,
16397 ) -> Result<
16398 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
16399 ::fidl_next::EncodeError,
16400 >
16401 where
16402 ___R: ::fidl_next::Encode<
16403 <___T as ::fidl_next::Transport>::SendBuffer,
16404 Encoded = crate::WireNodeGetAttributesRequest,
16405 >,
16406 {
16407 self.sender
16408 .send_two_way(4414537700416816443, request)
16409 .map(::fidl_next::ResponseFuture::from_untyped)
16410 }
16411
16412 #[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"]
16413 pub fn update_attributes_with<___R>(
16414 &self,
16415 request: ___R,
16416 ) -> Result<
16417 ::fidl_next::ResponseFuture<'_, super::UpdateAttributes, ___T>,
16418 ::fidl_next::EncodeError,
16419 >
16420 where
16421 ___R: ::fidl_next::Encode<
16422 <___T as ::fidl_next::Transport>::SendBuffer,
16423 Encoded = crate::WireMutableNodeAttributes<'static>,
16424 >,
16425 {
16426 self.sender
16427 .send_two_way(3677402239314018056, request)
16428 .map(::fidl_next::ResponseFuture::from_untyped)
16429 }
16430
16431 #[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"]
16432 pub fn sync(
16433 &self,
16434 ) -> Result<::fidl_next::ResponseFuture<'_, super::Sync, ___T>, ::fidl_next::EncodeError>
16435 {
16436 self.sender
16437 .send_two_way(3196473584242777161, ())
16438 .map(::fidl_next::ResponseFuture::from_untyped)
16439 }
16440
16441 #[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"]
16442 pub fn list_extended_attributes(
16443 &self,
16444
16445 iterator: impl ::fidl_next::Encode<
16446 <___T as ::fidl_next::Transport>::SendBuffer,
16447 Encoded = ::fidl_next::ServerEnd<
16448 crate::ExtendedAttributeIterator,
16449 ::fidl_next::fuchsia::WireChannel,
16450 >,
16451 >,
16452 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16453 where
16454 <___T as ::fidl_next::Transport>::SendBuffer:
16455 ::fidl_next::encoder::InternalHandleEncoder,
16456
16457 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16458 {
16459 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
16460 }
16461
16462 #[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"]
16463 pub fn list_extended_attributes_with<___R>(
16464 &self,
16465 request: ___R,
16466 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16467 where
16468 ___R: ::fidl_next::Encode<
16469 <___T as ::fidl_next::Transport>::SendBuffer,
16470 Encoded = crate::WireNodeListExtendedAttributesRequest,
16471 >,
16472 {
16473 self.sender.send_one_way(5431626189872037072, request)
16474 }
16475
16476 #[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"]
16477 pub fn get_extended_attribute(
16478 &self,
16479
16480 name: impl ::fidl_next::Encode<
16481 <___T as ::fidl_next::Transport>::SendBuffer,
16482 Encoded = ::fidl_next::WireVector<'static, u8>,
16483 >,
16484 ) -> Result<
16485 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
16486 ::fidl_next::EncodeError,
16487 >
16488 where
16489 <___T as ::fidl_next::Transport>::SendBuffer:
16490 ::fidl_next::encoder::InternalHandleEncoder,
16491
16492 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16493 {
16494 self.get_extended_attribute_with(GetExtendedAttribute { name })
16495 }
16496
16497 #[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"]
16498 pub fn get_extended_attribute_with<___R>(
16499 &self,
16500 request: ___R,
16501 ) -> Result<
16502 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
16503 ::fidl_next::EncodeError,
16504 >
16505 where
16506 ___R: ::fidl_next::Encode<
16507 <___T as ::fidl_next::Transport>::SendBuffer,
16508 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
16509 >,
16510 {
16511 self.sender
16512 .send_two_way(5043930208506967771, request)
16513 .map(::fidl_next::ResponseFuture::from_untyped)
16514 }
16515
16516 #[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"]
16517 pub fn set_extended_attribute(
16518 &self,
16519
16520 name: impl ::fidl_next::Encode<
16521 <___T as ::fidl_next::Transport>::SendBuffer,
16522 Encoded = ::fidl_next::WireVector<'static, u8>,
16523 >,
16524
16525 value: impl ::fidl_next::Encode<
16526 <___T as ::fidl_next::Transport>::SendBuffer,
16527 Encoded = crate::WireExtendedAttributeValue<'static>,
16528 >,
16529
16530 mode: impl ::fidl_next::Encode<
16531 <___T as ::fidl_next::Transport>::SendBuffer,
16532 Encoded = crate::WireSetExtendedAttributeMode,
16533 >,
16534 ) -> Result<
16535 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
16536 ::fidl_next::EncodeError,
16537 >
16538 where
16539 <___T as ::fidl_next::Transport>::SendBuffer:
16540 ::fidl_next::encoder::InternalHandleEncoder,
16541
16542 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16543
16544 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16545 {
16546 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
16547 }
16548
16549 #[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"]
16550 pub fn set_extended_attribute_with<___R>(
16551 &self,
16552 request: ___R,
16553 ) -> Result<
16554 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
16555 ::fidl_next::EncodeError,
16556 >
16557 where
16558 ___R: ::fidl_next::Encode<
16559 <___T as ::fidl_next::Transport>::SendBuffer,
16560 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
16561 >,
16562 {
16563 self.sender
16564 .send_two_way(5374223046099989052, request)
16565 .map(::fidl_next::ResponseFuture::from_untyped)
16566 }
16567
16568 #[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"]
16569 pub fn remove_extended_attribute(
16570 &self,
16571
16572 name: impl ::fidl_next::Encode<
16573 <___T as ::fidl_next::Transport>::SendBuffer,
16574 Encoded = ::fidl_next::WireVector<'static, u8>,
16575 >,
16576 ) -> Result<
16577 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
16578 ::fidl_next::EncodeError,
16579 >
16580 where
16581 <___T as ::fidl_next::Transport>::SendBuffer:
16582 ::fidl_next::encoder::InternalHandleEncoder,
16583
16584 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16585 {
16586 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
16587 }
16588
16589 #[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"]
16590 pub fn remove_extended_attribute_with<___R>(
16591 &self,
16592 request: ___R,
16593 ) -> Result<
16594 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
16595 ::fidl_next::EncodeError,
16596 >
16597 where
16598 ___R: ::fidl_next::Encode<
16599 <___T as ::fidl_next::Transport>::SendBuffer,
16600 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
16601 >,
16602 {
16603 self.sender
16604 .send_two_way(8794297771444732717, request)
16605 .map(::fidl_next::ResponseFuture::from_untyped)
16606 }
16607
16608 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
16609 pub fn deprecated_open(
16610 &self,
16611
16612 flags: impl ::fidl_next::Encode<
16613 <___T as ::fidl_next::Transport>::SendBuffer,
16614 Encoded = crate::WireOpenFlags,
16615 >,
16616
16617 mode: impl ::fidl_next::Encode<
16618 <___T as ::fidl_next::Transport>::SendBuffer,
16619 Encoded = crate::WireModeType,
16620 >,
16621
16622 path: impl ::fidl_next::Encode<
16623 <___T as ::fidl_next::Transport>::SendBuffer,
16624 Encoded = ::fidl_next::WireString<'static>,
16625 >,
16626
16627 object: impl ::fidl_next::Encode<
16628 <___T as ::fidl_next::Transport>::SendBuffer,
16629 Encoded = ::fidl_next::ServerEnd<
16630 crate::Node,
16631 ::fidl_next::fuchsia::WireChannel,
16632 >,
16633 >,
16634 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16635 where
16636 <___T as ::fidl_next::Transport>::SendBuffer:
16637 ::fidl_next::encoder::InternalHandleEncoder,
16638
16639 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16640
16641 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16642 {
16643 self.deprecated_open_with(DeprecatedOpen { flags, mode, path, object })
16644 }
16645
16646 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
16647 pub fn deprecated_open_with<___R>(
16648 &self,
16649 request: ___R,
16650 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16651 where
16652 ___R: ::fidl_next::Encode<
16653 <___T as ::fidl_next::Transport>::SendBuffer,
16654 Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>,
16655 >,
16656 {
16657 self.sender.send_one_way(3193127272456937152, request)
16658 }
16659
16660 #[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"]
16661 pub fn open(
16662 &self,
16663
16664 path: impl ::fidl_next::Encode<
16665 <___T as ::fidl_next::Transport>::SendBuffer,
16666 Encoded = ::fidl_next::WireString<'static>,
16667 >,
16668
16669 flags: impl ::fidl_next::Encode<
16670 <___T as ::fidl_next::Transport>::SendBuffer,
16671 Encoded = crate::WireFlags,
16672 >,
16673
16674 options: impl ::fidl_next::Encode<
16675 <___T as ::fidl_next::Transport>::SendBuffer,
16676 Encoded = crate::WireOptions<'static>,
16677 >,
16678
16679 object: impl ::fidl_next::Encode<
16680 <___T as ::fidl_next::Transport>::SendBuffer,
16681 Encoded = ::fidl_next::fuchsia::WireHandle,
16682 >,
16683 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16684 where
16685 <___T as ::fidl_next::Transport>::SendBuffer:
16686 ::fidl_next::encoder::InternalHandleEncoder,
16687
16688 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16689
16690 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16691 {
16692 self.open_with(Open { path, flags, options, object })
16693 }
16694
16695 #[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"]
16696 pub fn open_with<___R>(
16697 &self,
16698 request: ___R,
16699 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
16700 where
16701 ___R: ::fidl_next::Encode<
16702 <___T as ::fidl_next::Transport>::SendBuffer,
16703 Encoded = crate::WireDirectoryOpenRequest<'static>,
16704 >,
16705 {
16706 self.sender.send_one_way(6236883748953765593, request)
16707 }
16708
16709 #[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"]
16710 pub fn read_dirents(
16711 &self,
16712
16713 max_bytes: impl ::fidl_next::Encode<
16714 <___T as ::fidl_next::Transport>::SendBuffer,
16715 Encoded = ::fidl_next::WireU64,
16716 >,
16717 ) -> Result<
16718 ::fidl_next::ResponseFuture<'_, super::ReadDirents, ___T>,
16719 ::fidl_next::EncodeError,
16720 >
16721 where
16722 <___T as ::fidl_next::Transport>::SendBuffer:
16723 ::fidl_next::encoder::InternalHandleEncoder,
16724 {
16725 self.read_dirents_with(ReadDirents { max_bytes })
16726 }
16727
16728 #[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"]
16729 pub fn read_dirents_with<___R>(
16730 &self,
16731 request: ___R,
16732 ) -> Result<
16733 ::fidl_next::ResponseFuture<'_, super::ReadDirents, ___T>,
16734 ::fidl_next::EncodeError,
16735 >
16736 where
16737 ___R: ::fidl_next::Encode<
16738 <___T as ::fidl_next::Transport>::SendBuffer,
16739 Encoded = crate::WireDirectoryReadDirentsRequest,
16740 >,
16741 {
16742 self.sender
16743 .send_two_way(3855785432100874762, request)
16744 .map(::fidl_next::ResponseFuture::from_untyped)
16745 }
16746
16747 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
16748 pub fn rewind(
16749 &self,
16750 ) -> Result<
16751 ::fidl_next::ResponseFuture<'_, super::Rewind, ___T>,
16752 ::fidl_next::EncodeError,
16753 > {
16754 self.sender
16755 .send_two_way(1635123508515392625, ())
16756 .map(::fidl_next::ResponseFuture::from_untyped)
16757 }
16758
16759 #[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"]
16760 pub fn get_token(
16761 &self,
16762 ) -> Result<
16763 ::fidl_next::ResponseFuture<'_, super::GetToken, ___T>,
16764 ::fidl_next::EncodeError,
16765 > {
16766 self.sender
16767 .send_two_way(2787337947777369685, ())
16768 .map(::fidl_next::ResponseFuture::from_untyped)
16769 }
16770
16771 #[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"]
16772 pub fn link(
16773 &self,
16774
16775 src: impl ::fidl_next::Encode<
16776 <___T as ::fidl_next::Transport>::SendBuffer,
16777 Encoded = ::fidl_next::WireString<'static>,
16778 >,
16779
16780 dst_parent_token: impl ::fidl_next::Encode<
16781 <___T as ::fidl_next::Transport>::SendBuffer,
16782 Encoded = ::fidl_next::fuchsia::WireHandle,
16783 >,
16784
16785 dst: impl ::fidl_next::Encode<
16786 <___T as ::fidl_next::Transport>::SendBuffer,
16787 Encoded = ::fidl_next::WireString<'static>,
16788 >,
16789 ) -> Result<::fidl_next::ResponseFuture<'_, super::Link, ___T>, ::fidl_next::EncodeError>
16790 where
16791 <___T as ::fidl_next::Transport>::SendBuffer:
16792 ::fidl_next::encoder::InternalHandleEncoder,
16793
16794 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16795
16796 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16797 {
16798 self.link_with(Link { src, dst_parent_token, dst })
16799 }
16800
16801 #[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"]
16802 pub fn link_with<___R>(
16803 &self,
16804 request: ___R,
16805 ) -> Result<::fidl_next::ResponseFuture<'_, super::Link, ___T>, ::fidl_next::EncodeError>
16806 where
16807 ___R: ::fidl_next::Encode<
16808 <___T as ::fidl_next::Transport>::SendBuffer,
16809 Encoded = crate::WireDirectoryLinkRequest<'static>,
16810 >,
16811 {
16812 self.sender
16813 .send_two_way(8360374984291987687, request)
16814 .map(::fidl_next::ResponseFuture::from_untyped)
16815 }
16816
16817 #[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"]
16818 pub fn unlink(
16819 &self,
16820
16821 name: impl ::fidl_next::Encode<
16822 <___T as ::fidl_next::Transport>::SendBuffer,
16823 Encoded = ::fidl_next::WireString<'static>,
16824 >,
16825
16826 options: impl ::fidl_next::Encode<
16827 <___T as ::fidl_next::Transport>::SendBuffer,
16828 Encoded = crate::WireUnlinkOptions<'static>,
16829 >,
16830 ) -> Result<
16831 ::fidl_next::ResponseFuture<'_, super::Unlink, ___T>,
16832 ::fidl_next::EncodeError,
16833 >
16834 where
16835 <___T as ::fidl_next::Transport>::SendBuffer:
16836 ::fidl_next::encoder::InternalHandleEncoder,
16837
16838 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16839 {
16840 self.unlink_with(Unlink { name, options })
16841 }
16842
16843 #[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"]
16844 pub fn unlink_with<___R>(
16845 &self,
16846 request: ___R,
16847 ) -> Result<
16848 ::fidl_next::ResponseFuture<'_, super::Unlink, ___T>,
16849 ::fidl_next::EncodeError,
16850 >
16851 where
16852 ___R: ::fidl_next::Encode<
16853 <___T as ::fidl_next::Transport>::SendBuffer,
16854 Encoded = crate::WireDirectoryUnlinkRequest<'static>,
16855 >,
16856 {
16857 self.sender
16858 .send_two_way(8433556716759383021, request)
16859 .map(::fidl_next::ResponseFuture::from_untyped)
16860 }
16861
16862 #[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"]
16863 pub fn rename(
16864 &self,
16865
16866 src: impl ::fidl_next::Encode<
16867 <___T as ::fidl_next::Transport>::SendBuffer,
16868 Encoded = ::fidl_next::WireString<'static>,
16869 >,
16870
16871 dst_parent_token: impl ::fidl_next::Encode<
16872 <___T as ::fidl_next::Transport>::SendBuffer,
16873 Encoded = ::fidl_next::fuchsia::WireHandle,
16874 >,
16875
16876 dst: impl ::fidl_next::Encode<
16877 <___T as ::fidl_next::Transport>::SendBuffer,
16878 Encoded = ::fidl_next::WireString<'static>,
16879 >,
16880 ) -> Result<
16881 ::fidl_next::ResponseFuture<'_, super::Rename, ___T>,
16882 ::fidl_next::EncodeError,
16883 >
16884 where
16885 <___T as ::fidl_next::Transport>::SendBuffer:
16886 ::fidl_next::encoder::InternalHandleEncoder,
16887
16888 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16889
16890 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16891 {
16892 self.rename_with(Rename { src, dst_parent_token, dst })
16893 }
16894
16895 #[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"]
16896 pub fn rename_with<___R>(
16897 &self,
16898 request: ___R,
16899 ) -> Result<
16900 ::fidl_next::ResponseFuture<'_, super::Rename, ___T>,
16901 ::fidl_next::EncodeError,
16902 >
16903 where
16904 ___R: ::fidl_next::Encode<
16905 <___T as ::fidl_next::Transport>::SendBuffer,
16906 Encoded = crate::WireDirectoryRenameRequest<'static>,
16907 >,
16908 {
16909 self.sender
16910 .send_two_way(8097726607824333022, request)
16911 .map(::fidl_next::ResponseFuture::from_untyped)
16912 }
16913
16914 #[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"]
16915 pub fn create_symlink(
16916 &self,
16917
16918 name: impl ::fidl_next::Encode<
16919 <___T as ::fidl_next::Transport>::SendBuffer,
16920 Encoded = ::fidl_next::WireString<'static>,
16921 >,
16922
16923 target: impl ::fidl_next::Encode<
16924 <___T as ::fidl_next::Transport>::SendBuffer,
16925 Encoded = ::fidl_next::WireVector<'static, u8>,
16926 >,
16927
16928 connection: impl ::fidl_next::Encode<
16929 <___T as ::fidl_next::Transport>::SendBuffer,
16930 Encoded = ::fidl_next::ServerEnd<
16931 crate::Symlink,
16932 ::fidl_next::fuchsia::WireOptionalChannel,
16933 >,
16934 >,
16935 ) -> Result<
16936 ::fidl_next::ResponseFuture<'_, super::CreateSymlink, ___T>,
16937 ::fidl_next::EncodeError,
16938 >
16939 where
16940 <___T as ::fidl_next::Transport>::SendBuffer:
16941 ::fidl_next::encoder::InternalHandleEncoder,
16942
16943 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16944
16945 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16946 {
16947 self.create_symlink_with(CreateSymlink { name, target, connection })
16948 }
16949
16950 #[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"]
16951 pub fn create_symlink_with<___R>(
16952 &self,
16953 request: ___R,
16954 ) -> Result<
16955 ::fidl_next::ResponseFuture<'_, super::CreateSymlink, ___T>,
16956 ::fidl_next::EncodeError,
16957 >
16958 where
16959 ___R: ::fidl_next::Encode<
16960 <___T as ::fidl_next::Transport>::SendBuffer,
16961 Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>,
16962 >,
16963 {
16964 self.sender
16965 .send_two_way(2435901052462315657, request)
16966 .map(::fidl_next::ResponseFuture::from_untyped)
16967 }
16968
16969 #[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"]
16970 pub fn watch(
16971 &self,
16972
16973 mask: impl ::fidl_next::Encode<
16974 <___T as ::fidl_next::Transport>::SendBuffer,
16975 Encoded = crate::WireWatchMask,
16976 >,
16977
16978 options: impl ::fidl_next::Encode<
16979 <___T as ::fidl_next::Transport>::SendBuffer,
16980 Encoded = ::fidl_next::WireU32,
16981 >,
16982
16983 watcher: impl ::fidl_next::Encode<
16984 <___T as ::fidl_next::Transport>::SendBuffer,
16985 Encoded = ::fidl_next::ServerEnd<
16986 crate::DirectoryWatcher,
16987 ::fidl_next::fuchsia::WireChannel,
16988 >,
16989 >,
16990 ) -> Result<::fidl_next::ResponseFuture<'_, super::Watch, ___T>, ::fidl_next::EncodeError>
16991 where
16992 <___T as ::fidl_next::Transport>::SendBuffer:
16993 ::fidl_next::encoder::InternalHandleEncoder,
16994
16995 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16996 {
16997 self.watch_with(Watch { mask, options, watcher })
16998 }
16999
17000 #[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"]
17001 pub fn watch_with<___R>(
17002 &self,
17003 request: ___R,
17004 ) -> Result<::fidl_next::ResponseFuture<'_, super::Watch, ___T>, ::fidl_next::EncodeError>
17005 where
17006 ___R: ::fidl_next::Encode<
17007 <___T as ::fidl_next::Transport>::SendBuffer,
17008 Encoded = crate::WireDirectoryWatchRequest,
17009 >,
17010 {
17011 self.sender
17012 .send_two_way(6275512344170098065, request)
17013 .map(::fidl_next::ResponseFuture::from_untyped)
17014 }
17015 }
17016
17017 #[repr(transparent)]
17019 pub struct DirectoryServerSender<___T: ::fidl_next::Transport> {
17020 sender: ::fidl_next::protocol::ServerSender<___T>,
17021 }
17022
17023 impl<___T> DirectoryServerSender<___T>
17024 where
17025 ___T: ::fidl_next::Transport,
17026 {
17027 #[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"]
17028 pub fn on_open(
17029 &self,
17030
17031 s: impl ::fidl_next::Encode<
17032 <___T as ::fidl_next::Transport>::SendBuffer,
17033 Encoded = ::fidl_next::WireI32,
17034 >,
17035
17036 info: impl ::fidl_next::Encode<
17037 <___T as ::fidl_next::Transport>::SendBuffer,
17038 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
17039 >,
17040 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
17041 where
17042 <___T as ::fidl_next::Transport>::SendBuffer:
17043 ::fidl_next::encoder::InternalHandleEncoder,
17044
17045 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
17046
17047 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
17048 {
17049 self.on_open_with(OnOpen { s, info })
17050 }
17051
17052 #[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"]
17053
17054 pub fn on_open_with<___R>(
17055 &self,
17056 request: ___R,
17057 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
17058 where
17059 ___R: ::fidl_next::Encode<
17060 <___T as ::fidl_next::Transport>::SendBuffer,
17061 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
17062 >,
17063 {
17064 self.sender.send_event(9207534335756671346, request)
17065 }
17066
17067 #[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"]
17068
17069 pub fn on_representation_with<___R>(
17070 &self,
17071 request: ___R,
17072 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
17073 where
17074 ___R: ::fidl_next::Encode<
17075 <___T as ::fidl_next::Transport>::SendBuffer,
17076 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
17077 >,
17078 {
17079 self.sender.send_event(6679970090861613324, request)
17080 }
17081 }
17082 }
17083}
17084
17085pub trait DirectoryClientHandler<___T: ::fidl_next::Transport> {
17089 #[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"]
17090 fn on_open(
17091 &mut self,
17092 sender: &::fidl_next::ClientSender<Directory, ___T>,
17093
17094 event: ::fidl_next::Response<directory::OnOpen, ___T>,
17095 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17096
17097 #[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"]
17098 fn on_representation(
17099 &mut self,
17100 sender: &::fidl_next::ClientSender<Directory, ___T>,
17101
17102 event: ::fidl_next::Response<directory::OnRepresentation, ___T>,
17103 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17104
17105 fn on_unknown_interaction(
17106 &mut self,
17107 sender: &::fidl_next::ClientSender<Directory, ___T>,
17108 ordinal: u64,
17109 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
17110 sender.close();
17111 ::core::future::ready(())
17112 }
17113}
17114
17115impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Directory
17116where
17117 ___H: DirectoryClientHandler<___T> + Send,
17118 ___T: ::fidl_next::Transport,
17119
17120 <directory::AdvisoryLock as ::fidl_next::Method>::Response:
17121 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17122
17123 <directory::Close as ::fidl_next::Method>::Response:
17124 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17125
17126 <directory::Query as ::fidl_next::Method>::Response:
17127 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17128
17129 <directory::OnOpen as ::fidl_next::Method>::Response:
17130 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17131
17132 <directory::DeprecatedGetAttr as ::fidl_next::Method>::Response:
17133 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17134
17135 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Response:
17136 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17137
17138 <directory::DeprecatedGetFlags as ::fidl_next::Method>::Response:
17139 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17140
17141 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Response:
17142 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17143
17144 <directory::GetFlags as ::fidl_next::Method>::Response:
17145 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17146
17147 <directory::SetFlags as ::fidl_next::Method>::Response:
17148 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17149
17150 <directory::QueryFilesystem as ::fidl_next::Method>::Response:
17151 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17152
17153 <directory::OnRepresentation as ::fidl_next::Method>::Response:
17154 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17155
17156 <directory::GetAttributes as ::fidl_next::Method>::Response:
17157 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17158
17159 <directory::UpdateAttributes as ::fidl_next::Method>::Response:
17160 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17161
17162 <directory::Sync as ::fidl_next::Method>::Response:
17163 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17164
17165 <directory::GetExtendedAttribute as ::fidl_next::Method>::Response:
17166 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17167
17168 <directory::SetExtendedAttribute as ::fidl_next::Method>::Response:
17169 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17170
17171 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
17172 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17173
17174 <directory::ReadDirents as ::fidl_next::Method>::Response:
17175 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17176
17177 <directory::Rewind as ::fidl_next::Method>::Response:
17178 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17179
17180 <directory::GetToken as ::fidl_next::Method>::Response:
17181 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17182
17183 <directory::Link as ::fidl_next::Method>::Response:
17184 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17185
17186 <directory::Unlink as ::fidl_next::Method>::Response:
17187 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17188
17189 <directory::Rename as ::fidl_next::Method>::Response:
17190 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17191
17192 <directory::CreateSymlink as ::fidl_next::Method>::Response:
17193 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17194
17195 <directory::Watch as ::fidl_next::Method>::Response:
17196 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17197{
17198 async fn on_event(
17199 handler: &mut ___H,
17200 sender: &::fidl_next::ClientSender<Self, ___T>,
17201 ordinal: u64,
17202 buffer: ___T::RecvBuffer,
17203 ) {
17204 match ordinal {
17205 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
17206 Ok(decoded) => handler.on_open(sender, decoded).await,
17207 Err(e) => {
17208 sender.close();
17209 }
17210 },
17211
17212 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
17213 Ok(decoded) => handler.on_representation(sender, decoded).await,
17214 Err(e) => {
17215 sender.close();
17216 }
17217 },
17218
17219 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
17220 }
17221 }
17222}
17223
17224pub trait DirectoryServerHandler<___T: ::fidl_next::Transport> {
17228 #[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"]
17229 fn advisory_lock(
17230 &mut self,
17231 sender: &::fidl_next::ServerSender<Directory, ___T>,
17232
17233 request: ::fidl_next::Request<directory::AdvisoryLock, ___T>,
17234
17235 responder: ::fidl_next::Responder<directory::AdvisoryLock>,
17236 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17237
17238 fn clone(
17239 &mut self,
17240 sender: &::fidl_next::ServerSender<Directory, ___T>,
17241
17242 request: ::fidl_next::Request<directory::Clone, ___T>,
17243 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17244
17245 #[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"]
17246 fn close(
17247 &mut self,
17248 sender: &::fidl_next::ServerSender<Directory, ___T>,
17249
17250 responder: ::fidl_next::Responder<directory::Close>,
17251 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17252
17253 fn query(
17254 &mut self,
17255 sender: &::fidl_next::ServerSender<Directory, ___T>,
17256
17257 responder: ::fidl_next::Responder<directory::Query>,
17258 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17259
17260 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
17261 fn deprecated_clone(
17262 &mut self,
17263 sender: &::fidl_next::ServerSender<Directory, ___T>,
17264
17265 request: ::fidl_next::Request<directory::DeprecatedClone, ___T>,
17266 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17267
17268 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
17269 fn deprecated_get_attr(
17270 &mut self,
17271 sender: &::fidl_next::ServerSender<Directory, ___T>,
17272
17273 responder: ::fidl_next::Responder<directory::DeprecatedGetAttr>,
17274 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17275
17276 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
17277 fn deprecated_set_attr(
17278 &mut self,
17279 sender: &::fidl_next::ServerSender<Directory, ___T>,
17280
17281 request: ::fidl_next::Request<directory::DeprecatedSetAttr, ___T>,
17282
17283 responder: ::fidl_next::Responder<directory::DeprecatedSetAttr>,
17284 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17285
17286 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
17287 fn deprecated_get_flags(
17288 &mut self,
17289 sender: &::fidl_next::ServerSender<Directory, ___T>,
17290
17291 responder: ::fidl_next::Responder<directory::DeprecatedGetFlags>,
17292 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17293
17294 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
17295 fn deprecated_set_flags(
17296 &mut self,
17297 sender: &::fidl_next::ServerSender<Directory, ___T>,
17298
17299 request: ::fidl_next::Request<directory::DeprecatedSetFlags, ___T>,
17300
17301 responder: ::fidl_next::Responder<directory::DeprecatedSetFlags>,
17302 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17303
17304 #[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"]
17305 fn get_flags(
17306 &mut self,
17307 sender: &::fidl_next::ServerSender<Directory, ___T>,
17308
17309 responder: ::fidl_next::Responder<directory::GetFlags>,
17310 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17311
17312 #[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"]
17313 fn set_flags(
17314 &mut self,
17315 sender: &::fidl_next::ServerSender<Directory, ___T>,
17316
17317 request: ::fidl_next::Request<directory::SetFlags, ___T>,
17318
17319 responder: ::fidl_next::Responder<directory::SetFlags>,
17320 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17321
17322 #[doc = " Query the filesystem for filesystem-specific information.\n"]
17323 fn query_filesystem(
17324 &mut self,
17325 sender: &::fidl_next::ServerSender<Directory, ___T>,
17326
17327 responder: ::fidl_next::Responder<directory::QueryFilesystem>,
17328 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17329
17330 #[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"]
17331 fn get_attributes(
17332 &mut self,
17333 sender: &::fidl_next::ServerSender<Directory, ___T>,
17334
17335 request: ::fidl_next::Request<directory::GetAttributes, ___T>,
17336
17337 responder: ::fidl_next::Responder<directory::GetAttributes>,
17338 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17339
17340 #[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"]
17341 fn update_attributes(
17342 &mut self,
17343 sender: &::fidl_next::ServerSender<Directory, ___T>,
17344
17345 request: ::fidl_next::Request<directory::UpdateAttributes, ___T>,
17346
17347 responder: ::fidl_next::Responder<directory::UpdateAttributes>,
17348 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17349
17350 #[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"]
17351 fn sync(
17352 &mut self,
17353 sender: &::fidl_next::ServerSender<Directory, ___T>,
17354
17355 responder: ::fidl_next::Responder<directory::Sync>,
17356 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17357
17358 #[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"]
17359 fn list_extended_attributes(
17360 &mut self,
17361 sender: &::fidl_next::ServerSender<Directory, ___T>,
17362
17363 request: ::fidl_next::Request<directory::ListExtendedAttributes, ___T>,
17364 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17365
17366 #[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"]
17367 fn get_extended_attribute(
17368 &mut self,
17369 sender: &::fidl_next::ServerSender<Directory, ___T>,
17370
17371 request: ::fidl_next::Request<directory::GetExtendedAttribute, ___T>,
17372
17373 responder: ::fidl_next::Responder<directory::GetExtendedAttribute>,
17374 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17375
17376 #[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"]
17377 fn set_extended_attribute(
17378 &mut self,
17379 sender: &::fidl_next::ServerSender<Directory, ___T>,
17380
17381 request: ::fidl_next::Request<directory::SetExtendedAttribute, ___T>,
17382
17383 responder: ::fidl_next::Responder<directory::SetExtendedAttribute>,
17384 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17385
17386 #[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"]
17387 fn remove_extended_attribute(
17388 &mut self,
17389 sender: &::fidl_next::ServerSender<Directory, ___T>,
17390
17391 request: ::fidl_next::Request<directory::RemoveExtendedAttribute, ___T>,
17392
17393 responder: ::fidl_next::Responder<directory::RemoveExtendedAttribute>,
17394 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17395
17396 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
17397 fn deprecated_open(
17398 &mut self,
17399 sender: &::fidl_next::ServerSender<Directory, ___T>,
17400
17401 request: ::fidl_next::Request<directory::DeprecatedOpen, ___T>,
17402 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17403
17404 #[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"]
17405 fn open(
17406 &mut self,
17407 sender: &::fidl_next::ServerSender<Directory, ___T>,
17408
17409 request: ::fidl_next::Request<directory::Open, ___T>,
17410 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17411
17412 #[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"]
17413 fn read_dirents(
17414 &mut self,
17415 sender: &::fidl_next::ServerSender<Directory, ___T>,
17416
17417 request: ::fidl_next::Request<directory::ReadDirents, ___T>,
17418
17419 responder: ::fidl_next::Responder<directory::ReadDirents>,
17420 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17421
17422 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
17423 fn rewind(
17424 &mut self,
17425 sender: &::fidl_next::ServerSender<Directory, ___T>,
17426
17427 responder: ::fidl_next::Responder<directory::Rewind>,
17428 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17429
17430 #[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"]
17431 fn get_token(
17432 &mut self,
17433 sender: &::fidl_next::ServerSender<Directory, ___T>,
17434
17435 responder: ::fidl_next::Responder<directory::GetToken>,
17436 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17437
17438 #[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"]
17439 fn link(
17440 &mut self,
17441 sender: &::fidl_next::ServerSender<Directory, ___T>,
17442
17443 request: ::fidl_next::Request<directory::Link, ___T>,
17444
17445 responder: ::fidl_next::Responder<directory::Link>,
17446 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17447
17448 #[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"]
17449 fn unlink(
17450 &mut self,
17451 sender: &::fidl_next::ServerSender<Directory, ___T>,
17452
17453 request: ::fidl_next::Request<directory::Unlink, ___T>,
17454
17455 responder: ::fidl_next::Responder<directory::Unlink>,
17456 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17457
17458 #[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"]
17459 fn rename(
17460 &mut self,
17461 sender: &::fidl_next::ServerSender<Directory, ___T>,
17462
17463 request: ::fidl_next::Request<directory::Rename, ___T>,
17464
17465 responder: ::fidl_next::Responder<directory::Rename>,
17466 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17467
17468 #[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"]
17469 fn create_symlink(
17470 &mut self,
17471 sender: &::fidl_next::ServerSender<Directory, ___T>,
17472
17473 request: ::fidl_next::Request<directory::CreateSymlink, ___T>,
17474
17475 responder: ::fidl_next::Responder<directory::CreateSymlink>,
17476 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17477
17478 #[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"]
17479 fn watch(
17480 &mut self,
17481 sender: &::fidl_next::ServerSender<Directory, ___T>,
17482
17483 request: ::fidl_next::Request<directory::Watch, ___T>,
17484
17485 responder: ::fidl_next::Responder<directory::Watch>,
17486 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17487
17488 fn on_unknown_interaction(
17489 &mut self,
17490 sender: &::fidl_next::ServerSender<Directory, ___T>,
17491 ordinal: u64,
17492 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
17493 sender.close();
17494 ::core::future::ready(())
17495 }
17496}
17497
17498impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Directory
17499where
17500 ___H: DirectoryServerHandler<___T> + Send,
17501 ___T: ::fidl_next::Transport,
17502
17503 <directory::AdvisoryLock as ::fidl_next::Method>::Request:
17504 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17505
17506 <directory::Clone as ::fidl_next::Method>::Request:
17507 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17508
17509 <directory::DeprecatedClone as ::fidl_next::Method>::Request:
17510 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17511
17512 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Request:
17513 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17514
17515 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Request:
17516 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17517
17518 <directory::SetFlags as ::fidl_next::Method>::Request:
17519 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17520
17521 <directory::GetAttributes as ::fidl_next::Method>::Request:
17522 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17523
17524 <directory::UpdateAttributes as ::fidl_next::Method>::Request:
17525 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17526
17527 <directory::ListExtendedAttributes as ::fidl_next::Method>::Request:
17528 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17529
17530 <directory::GetExtendedAttribute as ::fidl_next::Method>::Request:
17531 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17532
17533 <directory::SetExtendedAttribute as ::fidl_next::Method>::Request:
17534 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17535
17536 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
17537 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17538
17539 <directory::DeprecatedOpen as ::fidl_next::Method>::Request:
17540 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17541
17542 <directory::Open as ::fidl_next::Method>::Request:
17543 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17544
17545 <directory::ReadDirents as ::fidl_next::Method>::Request:
17546 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17547
17548 <directory::Link as ::fidl_next::Method>::Request:
17549 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17550
17551 <directory::Unlink as ::fidl_next::Method>::Request:
17552 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17553
17554 <directory::Rename as ::fidl_next::Method>::Request:
17555 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17556
17557 <directory::CreateSymlink as ::fidl_next::Method>::Request:
17558 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17559
17560 <directory::Watch as ::fidl_next::Method>::Request:
17561 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17562{
17563 async fn on_one_way(
17564 handler: &mut ___H,
17565 sender: &::fidl_next::ServerSender<Self, ___T>,
17566 ordinal: u64,
17567 buffer: ___T::RecvBuffer,
17568 ) {
17569 match ordinal {
17570 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
17571 Ok(decoded) => handler.clone(sender, decoded).await,
17572 Err(e) => {
17573 sender.close();
17574 }
17575 },
17576
17577 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
17578 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
17579 Err(e) => {
17580 sender.close();
17581 }
17582 },
17583
17584 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
17585 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
17586 Err(e) => {
17587 sender.close();
17588 }
17589 },
17590
17591 3193127272456937152 => match ::fidl_next::DecoderExt::decode(buffer) {
17592 Ok(decoded) => handler.deprecated_open(sender, decoded).await,
17593 Err(e) => {
17594 sender.close();
17595 }
17596 },
17597
17598 6236883748953765593 => match ::fidl_next::DecoderExt::decode(buffer) {
17599 Ok(decoded) => handler.open(sender, decoded).await,
17600 Err(e) => {
17601 sender.close();
17602 }
17603 },
17604
17605 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
17606 }
17607 }
17608
17609 async fn on_two_way(
17610 handler: &mut ___H,
17611 sender: &::fidl_next::ServerSender<Self, ___T>,
17612 ordinal: u64,
17613 buffer: ___T::RecvBuffer,
17614 responder: ::fidl_next::protocol::Responder,
17615 ) {
17616 match ordinal {
17617 7992130864415541162 => {
17618 let responder = ::fidl_next::Responder::from_untyped(responder);
17619
17620 match ::fidl_next::DecoderExt::decode(buffer) {
17621 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
17622 Err(e) => {
17623 sender.close();
17624 }
17625 }
17626 }
17627
17628 6540867515453498750 => {
17629 let responder = ::fidl_next::Responder::from_untyped(responder);
17630
17631 handler.close(sender, responder).await;
17632 }
17633
17634 2763219980499352582 => {
17635 let responder = ::fidl_next::Responder::from_untyped(responder);
17636
17637 handler.query(sender, responder).await;
17638 }
17639
17640 8689798978500614909 => {
17641 let responder = ::fidl_next::Responder::from_untyped(responder);
17642
17643 handler.deprecated_get_attr(sender, responder).await;
17644 }
17645
17646 4721673413776871238 => {
17647 let responder = ::fidl_next::Responder::from_untyped(responder);
17648
17649 match ::fidl_next::DecoderExt::decode(buffer) {
17650 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
17651 Err(e) => {
17652 sender.close();
17653 }
17654 }
17655 }
17656
17657 6595803110182632097 => {
17658 let responder = ::fidl_next::Responder::from_untyped(responder);
17659
17660 handler.deprecated_get_flags(sender, responder).await;
17661 }
17662
17663 5950864159036794675 => {
17664 let responder = ::fidl_next::Responder::from_untyped(responder);
17665
17666 match ::fidl_next::DecoderExt::decode(buffer) {
17667 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
17668 Err(e) => {
17669 sender.close();
17670 }
17671 }
17672 }
17673
17674 105530239381466147 => {
17675 let responder = ::fidl_next::Responder::from_untyped(responder);
17676
17677 handler.get_flags(sender, responder).await;
17678 }
17679
17680 6172186066099445416 => {
17681 let responder = ::fidl_next::Responder::from_untyped(responder);
17682
17683 match ::fidl_next::DecoderExt::decode(buffer) {
17684 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
17685 Err(e) => {
17686 sender.close();
17687 }
17688 }
17689 }
17690
17691 8013111122914313744 => {
17692 let responder = ::fidl_next::Responder::from_untyped(responder);
17693
17694 handler.query_filesystem(sender, responder).await;
17695 }
17696
17697 4414537700416816443 => {
17698 let responder = ::fidl_next::Responder::from_untyped(responder);
17699
17700 match ::fidl_next::DecoderExt::decode(buffer) {
17701 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
17702 Err(e) => {
17703 sender.close();
17704 }
17705 }
17706 }
17707
17708 3677402239314018056 => {
17709 let responder = ::fidl_next::Responder::from_untyped(responder);
17710
17711 match ::fidl_next::DecoderExt::decode(buffer) {
17712 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
17713 Err(e) => {
17714 sender.close();
17715 }
17716 }
17717 }
17718
17719 3196473584242777161 => {
17720 let responder = ::fidl_next::Responder::from_untyped(responder);
17721
17722 handler.sync(sender, responder).await;
17723 }
17724
17725 5043930208506967771 => {
17726 let responder = ::fidl_next::Responder::from_untyped(responder);
17727
17728 match ::fidl_next::DecoderExt::decode(buffer) {
17729 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
17730 Err(e) => {
17731 sender.close();
17732 }
17733 }
17734 }
17735
17736 5374223046099989052 => {
17737 let responder = ::fidl_next::Responder::from_untyped(responder);
17738
17739 match ::fidl_next::DecoderExt::decode(buffer) {
17740 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
17741 Err(e) => {
17742 sender.close();
17743 }
17744 }
17745 }
17746
17747 8794297771444732717 => {
17748 let responder = ::fidl_next::Responder::from_untyped(responder);
17749
17750 match ::fidl_next::DecoderExt::decode(buffer) {
17751 Ok(decoded) => {
17752 handler.remove_extended_attribute(sender, decoded, responder).await
17753 }
17754 Err(e) => {
17755 sender.close();
17756 }
17757 }
17758 }
17759
17760 3855785432100874762 => {
17761 let responder = ::fidl_next::Responder::from_untyped(responder);
17762
17763 match ::fidl_next::DecoderExt::decode(buffer) {
17764 Ok(decoded) => handler.read_dirents(sender, decoded, responder).await,
17765 Err(e) => {
17766 sender.close();
17767 }
17768 }
17769 }
17770
17771 1635123508515392625 => {
17772 let responder = ::fidl_next::Responder::from_untyped(responder);
17773
17774 handler.rewind(sender, responder).await;
17775 }
17776
17777 2787337947777369685 => {
17778 let responder = ::fidl_next::Responder::from_untyped(responder);
17779
17780 handler.get_token(sender, responder).await;
17781 }
17782
17783 8360374984291987687 => {
17784 let responder = ::fidl_next::Responder::from_untyped(responder);
17785
17786 match ::fidl_next::DecoderExt::decode(buffer) {
17787 Ok(decoded) => handler.link(sender, decoded, responder).await,
17788 Err(e) => {
17789 sender.close();
17790 }
17791 }
17792 }
17793
17794 8433556716759383021 => {
17795 let responder = ::fidl_next::Responder::from_untyped(responder);
17796
17797 match ::fidl_next::DecoderExt::decode(buffer) {
17798 Ok(decoded) => handler.unlink(sender, decoded, responder).await,
17799 Err(e) => {
17800 sender.close();
17801 }
17802 }
17803 }
17804
17805 8097726607824333022 => {
17806 let responder = ::fidl_next::Responder::from_untyped(responder);
17807
17808 match ::fidl_next::DecoderExt::decode(buffer) {
17809 Ok(decoded) => handler.rename(sender, decoded, responder).await,
17810 Err(e) => {
17811 sender.close();
17812 }
17813 }
17814 }
17815
17816 2435901052462315657 => {
17817 let responder = ::fidl_next::Responder::from_untyped(responder);
17818
17819 match ::fidl_next::DecoderExt::decode(buffer) {
17820 Ok(decoded) => handler.create_symlink(sender, decoded, responder).await,
17821 Err(e) => {
17822 sender.close();
17823 }
17824 }
17825 }
17826
17827 6275512344170098065 => {
17828 let responder = ::fidl_next::Responder::from_untyped(responder);
17829
17830 match ::fidl_next::DecoderExt::decode(buffer) {
17831 Ok(decoded) => handler.watch(sender, decoded, responder).await,
17832 Err(e) => {
17833 sender.close();
17834 }
17835 }
17836 }
17837
17838 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
17839 }
17840 }
17841}
17842
17843#[derive(Clone, Debug)]
17844#[repr(C)]
17845pub struct DirectoryObject {}
17846
17847impl ::fidl_next::Encodable for DirectoryObject {
17848 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryObject> =
17849 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
17850
17851 type Encoded = WireDirectoryObject;
17852}
17853
17854unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryObject
17855where
17856 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17857{
17858 #[inline]
17859 fn encode(
17860 self,
17861 encoder: &mut ___E,
17862 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17863 ) -> Result<(), ::fidl_next::EncodeError> {
17864 ::fidl_next::munge! {
17865 let Self::Encoded {
17866
17867 } = out;
17868 }
17869
17870 Ok(())
17871 }
17872}
17873
17874unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryObject
17875where
17876 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17877{
17878 #[inline]
17879 fn encode_ref(
17880 &self,
17881 encoder: &mut ___E,
17882 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17883 ) -> Result<(), ::fidl_next::EncodeError> {
17884 ::fidl_next::munge! {
17885 let Self::Encoded {
17886
17887 } = out;
17888 }
17889
17890 Ok(())
17891 }
17892}
17893
17894impl ::fidl_next::EncodableOption for DirectoryObject {
17895 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryObject>;
17896}
17897
17898unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryObject
17899where
17900 ___E: ::fidl_next::Encoder + ?Sized,
17901 DirectoryObject: ::fidl_next::Encode<___E>,
17902{
17903 #[inline]
17904 fn encode_option(
17905 this: Option<Self>,
17906 encoder: &mut ___E,
17907 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17908 ) -> Result<(), ::fidl_next::EncodeError> {
17909 if let Some(inner) = this {
17910 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17911 ::fidl_next::WireBox::encode_present(out);
17912 } else {
17913 ::fidl_next::WireBox::encode_absent(out);
17914 }
17915
17916 Ok(())
17917 }
17918}
17919
17920unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryObject
17921where
17922 ___E: ::fidl_next::Encoder + ?Sized,
17923 DirectoryObject: ::fidl_next::EncodeRef<___E>,
17924{
17925 #[inline]
17926 fn encode_option_ref(
17927 this: Option<&Self>,
17928 encoder: &mut ___E,
17929 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17930 ) -> Result<(), ::fidl_next::EncodeError> {
17931 if let Some(inner) = this {
17932 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17933 ::fidl_next::WireBox::encode_present(out);
17934 } else {
17935 ::fidl_next::WireBox::encode_absent(out);
17936 }
17937
17938 Ok(())
17939 }
17940}
17941
17942impl ::fidl_next::FromWire<WireDirectoryObject> for DirectoryObject {
17943 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryObject, Self> =
17944 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
17945
17946 #[inline]
17947 fn from_wire(wire: WireDirectoryObject) -> Self {
17948 Self {}
17949 }
17950}
17951
17952impl ::fidl_next::FromWireRef<WireDirectoryObject> for DirectoryObject {
17953 #[inline]
17954 fn from_wire_ref(wire: &WireDirectoryObject) -> Self {
17955 Self {}
17956 }
17957}
17958
17959#[derive(Clone, Debug)]
17961#[repr(C)]
17962pub struct WireDirectoryObject {}
17963
17964unsafe impl ::fidl_next::Wire for WireDirectoryObject {
17965 type Decoded<'de> = WireDirectoryObject;
17966
17967 #[inline]
17968 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17969}
17970
17971unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryObject
17972where
17973 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17974{
17975 fn decode(
17976 slot: ::fidl_next::Slot<'_, Self>,
17977 decoder: &mut ___D,
17978 ) -> Result<(), ::fidl_next::DecodeError> {
17979 ::fidl_next::munge! {
17980 let Self {
17981
17982 } = slot;
17983 }
17984
17985 Ok(())
17986 }
17987}
17988
17989#[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"]
17991#[derive(Debug)]
17992pub struct DirectoryWatcher;
17993
17994pub mod directory_watcher {
17995 pub mod prelude {
17996 pub use crate::{
17997 directory_watcher, DirectoryWatcher, DirectoryWatcherClientHandler,
17998 DirectoryWatcherServerHandler,
17999 };
18000 }
18001
18002 mod ___detail {
18003
18004 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirectoryWatcher
18005 where
18006 ___T: ::fidl_next::Transport,
18007 {
18008 type ClientSender = DirectoryWatcherClientSender<___T>;
18009 type ServerSender = DirectoryWatcherServerSender<___T>;
18010 }
18011
18012 pub struct DirectoryWatcherClientSender<___T: ::fidl_next::Transport> {
18014 #[allow(dead_code)]
18015 sender: ::fidl_next::protocol::ClientSender<___T>,
18016 }
18017
18018 impl<___T> DirectoryWatcherClientSender<___T> where ___T: ::fidl_next::Transport {}
18019
18020 #[repr(transparent)]
18022 pub struct DirectoryWatcherServerSender<___T: ::fidl_next::Transport> {
18023 sender: ::fidl_next::protocol::ServerSender<___T>,
18024 }
18025
18026 impl<___T> DirectoryWatcherServerSender<___T> where ___T: ::fidl_next::Transport {}
18027 }
18028}
18029
18030pub trait DirectoryWatcherClientHandler<___T: ::fidl_next::Transport> {}
18034
18035impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DirectoryWatcher
18036where
18037 ___H: DirectoryWatcherClientHandler<___T> + Send,
18038 ___T: ::fidl_next::Transport,
18039{
18040 async fn on_event(
18041 handler: &mut ___H,
18042 sender: &::fidl_next::ClientSender<Self, ___T>,
18043 ordinal: u64,
18044 buffer: ___T::RecvBuffer,
18045 ) {
18046 match ordinal {
18047 ordinal => {
18048 sender.close();
18049 }
18050 }
18051 }
18052}
18053
18054pub trait DirectoryWatcherServerHandler<___T: ::fidl_next::Transport> {}
18058
18059impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DirectoryWatcher
18060where
18061 ___H: DirectoryWatcherServerHandler<___T> + Send,
18062 ___T: ::fidl_next::Transport,
18063{
18064 async fn on_one_way(
18065 handler: &mut ___H,
18066 sender: &::fidl_next::ServerSender<Self, ___T>,
18067 ordinal: u64,
18068 buffer: ___T::RecvBuffer,
18069 ) {
18070 match ordinal {
18071 ordinal => {
18072 sender.close();
18073 }
18074 }
18075 }
18076
18077 async fn on_two_way(
18078 handler: &mut ___H,
18079 sender: &::fidl_next::ServerSender<Self, ___T>,
18080 ordinal: u64,
18081 buffer: ___T::RecvBuffer,
18082 responder: ::fidl_next::protocol::Responder,
18083 ) {
18084 match ordinal {
18085 ordinal => {
18086 sender.close();
18087 }
18088 }
18089 }
18090}
18091
18092#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18093#[repr(u8)]
18094pub enum DirentType {
18095 Unknown = 0,
18096 Directory = 4,
18097 BlockDevice = 6,
18098 File = 8,
18099 Symlink = 10,
18100 Service = 16,
18101 UnknownOrdinal_(u8),
18102}
18103
18104impl ::fidl_next::Encodable for DirentType {
18105 type Encoded = WireDirentType;
18106}
18107impl ::std::convert::From<u8> for DirentType {
18108 fn from(value: u8) -> Self {
18109 match value {
18110 0 => Self::Unknown,
18111 4 => Self::Directory,
18112 6 => Self::BlockDevice,
18113 8 => Self::File,
18114 10 => Self::Symlink,
18115 16 => Self::Service,
18116
18117 _ => Self::UnknownOrdinal_(value),
18118 }
18119 }
18120}
18121
18122unsafe impl<___E> ::fidl_next::Encode<___E> for DirentType
18123where
18124 ___E: ?Sized,
18125{
18126 #[inline]
18127 fn encode(
18128 self,
18129 encoder: &mut ___E,
18130 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18131 ) -> Result<(), ::fidl_next::EncodeError> {
18132 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
18133 }
18134}
18135
18136unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirentType
18137where
18138 ___E: ?Sized,
18139{
18140 #[inline]
18141 fn encode_ref(
18142 &self,
18143 encoder: &mut ___E,
18144 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18145 ) -> Result<(), ::fidl_next::EncodeError> {
18146 ::fidl_next::munge!(let WireDirentType { value } = out);
18147 let _ = value.write(u8::from(match *self {
18148 Self::Unknown => 0,
18149
18150 Self::Directory => 4,
18151
18152 Self::BlockDevice => 6,
18153
18154 Self::File => 8,
18155
18156 Self::Symlink => 10,
18157
18158 Self::Service => 16,
18159
18160 Self::UnknownOrdinal_(value) => value,
18161 }));
18162
18163 Ok(())
18164 }
18165}
18166
18167impl ::core::convert::From<WireDirentType> for DirentType {
18168 fn from(wire: WireDirentType) -> Self {
18169 match u8::from(wire.value) {
18170 0 => Self::Unknown,
18171
18172 4 => Self::Directory,
18173
18174 6 => Self::BlockDevice,
18175
18176 8 => Self::File,
18177
18178 10 => Self::Symlink,
18179
18180 16 => Self::Service,
18181
18182 value => Self::UnknownOrdinal_(value),
18183 }
18184 }
18185}
18186
18187impl ::fidl_next::FromWire<WireDirentType> for DirentType {
18188 #[inline]
18189 fn from_wire(wire: WireDirentType) -> Self {
18190 Self::from(wire)
18191 }
18192}
18193
18194impl ::fidl_next::FromWireRef<WireDirentType> for DirentType {
18195 #[inline]
18196 fn from_wire_ref(wire: &WireDirentType) -> Self {
18197 Self::from(*wire)
18198 }
18199}
18200
18201#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18203#[repr(transparent)]
18204pub struct WireDirentType {
18205 value: u8,
18206}
18207
18208unsafe impl ::fidl_next::Wire for WireDirentType {
18209 type Decoded<'de> = Self;
18210
18211 #[inline]
18212 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
18213 }
18215}
18216
18217impl WireDirentType {
18218 pub const UNKNOWN: WireDirentType = WireDirentType { value: 0 };
18219
18220 pub const DIRECTORY: WireDirentType = WireDirentType { value: 4 };
18221
18222 pub const BLOCK_DEVICE: WireDirentType = WireDirentType { value: 6 };
18223
18224 pub const FILE: WireDirentType = WireDirentType { value: 8 };
18225
18226 pub const SYMLINK: WireDirentType = WireDirentType { value: 10 };
18227
18228 pub const SERVICE: WireDirentType = WireDirentType { value: 16 };
18229}
18230
18231unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirentType
18232where
18233 ___D: ?Sized,
18234{
18235 fn decode(
18236 slot: ::fidl_next::Slot<'_, Self>,
18237 _: &mut ___D,
18238 ) -> Result<(), ::fidl_next::DecodeError> {
18239 Ok(())
18240 }
18241}
18242
18243impl ::core::convert::From<DirentType> for WireDirentType {
18244 fn from(natural: DirentType) -> Self {
18245 match natural {
18246 DirentType::Unknown => WireDirentType::UNKNOWN,
18247
18248 DirentType::Directory => WireDirentType::DIRECTORY,
18249
18250 DirentType::BlockDevice => WireDirentType::BLOCK_DEVICE,
18251
18252 DirentType::File => WireDirentType::FILE,
18253
18254 DirentType::Symlink => WireDirentType::SYMLINK,
18255
18256 DirentType::Service => WireDirentType::SERVICE,
18257
18258 DirentType::UnknownOrdinal_(value) => WireDirentType { value: u8::from(value) },
18259 }
18260 }
18261}
18262
18263#[doc = " The maximum size of a chunk in the ListExtendedAttributes iterator.\n"]
18264pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128;
18265
18266#[derive(Clone, Debug)]
18267pub struct ExtendedAttributeIteratorGetNextResponse {
18268 pub attributes: Vec<Vec<u8>>,
18269
18270 pub last: bool,
18271}
18272
18273impl ::fidl_next::Encodable for ExtendedAttributeIteratorGetNextResponse {
18274 type Encoded = WireExtendedAttributeIteratorGetNextResponse<'static>;
18275}
18276
18277unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeIteratorGetNextResponse
18278where
18279 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18280
18281 ___E: ::fidl_next::Encoder,
18282{
18283 #[inline]
18284 fn encode(
18285 self,
18286 encoder: &mut ___E,
18287 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18288 ) -> Result<(), ::fidl_next::EncodeError> {
18289 ::fidl_next::munge! {
18290 let Self::Encoded {
18291 attributes,
18292 last,
18293
18294 } = out;
18295 }
18296
18297 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
18298
18299 ::fidl_next::Encode::encode(self.last, encoder, last)?;
18300
18301 Ok(())
18302 }
18303}
18304
18305unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExtendedAttributeIteratorGetNextResponse
18306where
18307 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18308
18309 ___E: ::fidl_next::Encoder,
18310{
18311 #[inline]
18312 fn encode_ref(
18313 &self,
18314 encoder: &mut ___E,
18315 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18316 ) -> Result<(), ::fidl_next::EncodeError> {
18317 ::fidl_next::munge! {
18318 let Self::Encoded {
18319 attributes,
18320 last,
18321
18322 } = out;
18323 }
18324
18325 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
18326
18327 ::fidl_next::EncodeRef::encode_ref(&self.last, encoder, last)?;
18328
18329 Ok(())
18330 }
18331}
18332
18333impl ::fidl_next::EncodableOption for ExtendedAttributeIteratorGetNextResponse {
18334 type EncodedOption =
18335 ::fidl_next::WireBox<'static, WireExtendedAttributeIteratorGetNextResponse<'static>>;
18336}
18337
18338unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeIteratorGetNextResponse
18339where
18340 ___E: ::fidl_next::Encoder + ?Sized,
18341 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<___E>,
18342{
18343 #[inline]
18344 fn encode_option(
18345 this: Option<Self>,
18346 encoder: &mut ___E,
18347 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18348 ) -> Result<(), ::fidl_next::EncodeError> {
18349 if let Some(inner) = this {
18350 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18351 ::fidl_next::WireBox::encode_present(out);
18352 } else {
18353 ::fidl_next::WireBox::encode_absent(out);
18354 }
18355
18356 Ok(())
18357 }
18358}
18359
18360unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ExtendedAttributeIteratorGetNextResponse
18361where
18362 ___E: ::fidl_next::Encoder + ?Sized,
18363 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::EncodeRef<___E>,
18364{
18365 #[inline]
18366 fn encode_option_ref(
18367 this: Option<&Self>,
18368 encoder: &mut ___E,
18369 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18370 ) -> Result<(), ::fidl_next::EncodeError> {
18371 if let Some(inner) = this {
18372 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18373 ::fidl_next::WireBox::encode_present(out);
18374 } else {
18375 ::fidl_next::WireBox::encode_absent(out);
18376 }
18377
18378 Ok(())
18379 }
18380}
18381
18382impl<'de> ::fidl_next::FromWire<WireExtendedAttributeIteratorGetNextResponse<'de>>
18383 for ExtendedAttributeIteratorGetNextResponse
18384{
18385 #[inline]
18386 fn from_wire(wire: WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
18387 Self {
18388 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
18389
18390 last: ::fidl_next::FromWire::from_wire(wire.last),
18391 }
18392 }
18393}
18394
18395impl<'de> ::fidl_next::FromWireRef<WireExtendedAttributeIteratorGetNextResponse<'de>>
18396 for ExtendedAttributeIteratorGetNextResponse
18397{
18398 #[inline]
18399 fn from_wire_ref(wire: &WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
18400 Self {
18401 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
18402
18403 last: ::fidl_next::FromWireRef::from_wire_ref(&wire.last),
18404 }
18405 }
18406}
18407
18408#[derive(Debug)]
18410#[repr(C)]
18411pub struct WireExtendedAttributeIteratorGetNextResponse<'de> {
18412 pub attributes: ::fidl_next::WireVector<'de, ::fidl_next::WireVector<'de, u8>>,
18413
18414 pub last: bool,
18415}
18416
18417unsafe impl ::fidl_next::Wire for WireExtendedAttributeIteratorGetNextResponse<'static> {
18418 type Decoded<'de> = WireExtendedAttributeIteratorGetNextResponse<'de>;
18419
18420 #[inline]
18421 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18422 unsafe {
18423 out.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
18424 }
18425 }
18426}
18427
18428unsafe impl<___D> ::fidl_next::Decode<___D>
18429 for WireExtendedAttributeIteratorGetNextResponse<'static>
18430where
18431 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18432
18433 ___D: ::fidl_next::Decoder,
18434{
18435 fn decode(
18436 slot: ::fidl_next::Slot<'_, Self>,
18437 decoder: &mut ___D,
18438 ) -> Result<(), ::fidl_next::DecodeError> {
18439 ::fidl_next::munge! {
18440 let Self {
18441 mut attributes,
18442 mut last,
18443
18444 } = slot;
18445 }
18446
18447 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
18448
18449 let attributes = unsafe { attributes.deref_unchecked() };
18450
18451 if attributes.len() > 128 {
18452 return Err(::fidl_next::DecodeError::VectorTooLong {
18453 size: attributes.len() as u64,
18454 limit: 128,
18455 });
18456 }
18457
18458 ::fidl_next::Decode::decode(last.as_mut(), decoder)?;
18459
18460 Ok(())
18461 }
18462}
18463
18464#[derive(Debug)]
18466pub struct ExtendedAttributeIterator;
18467
18468pub mod extended_attribute_iterator {
18469 pub mod prelude {
18470 pub use crate::{
18471 extended_attribute_iterator, ExtendedAttributeIterator,
18472 ExtendedAttributeIteratorClientHandler, ExtendedAttributeIteratorServerHandler,
18473 };
18474
18475 pub use crate::ExtendedAttributeIteratorGetNextResponse;
18476 }
18477
18478 pub struct GetNext;
18479
18480 impl ::fidl_next::Method for GetNext {
18481 const ORDINAL: u64 = 268639596268373415;
18482
18483 type Protocol = crate::ExtendedAttributeIterator;
18484
18485 type Request = ();
18486
18487 type Response = ::fidl_next::WireResult<
18488 'static,
18489 crate::WireExtendedAttributeIteratorGetNextResponse<'static>,
18490 ::fidl_next::WireI32,
18491 >;
18492 }
18493
18494 mod ___detail {
18495
18496 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ExtendedAttributeIterator
18497 where
18498 ___T: ::fidl_next::Transport,
18499 {
18500 type ClientSender = ExtendedAttributeIteratorClientSender<___T>;
18501 type ServerSender = ExtendedAttributeIteratorServerSender<___T>;
18502 }
18503
18504 pub struct ExtendedAttributeIteratorClientSender<___T: ::fidl_next::Transport> {
18506 #[allow(dead_code)]
18507 sender: ::fidl_next::protocol::ClientSender<___T>,
18508 }
18509
18510 impl<___T> ExtendedAttributeIteratorClientSender<___T>
18511 where
18512 ___T: ::fidl_next::Transport,
18513 {
18514 #[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"]
18515 pub fn get_next(
18516 &self,
18517 ) -> Result<
18518 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
18519 ::fidl_next::EncodeError,
18520 > {
18521 self.sender
18522 .send_two_way(268639596268373415, ())
18523 .map(::fidl_next::ResponseFuture::from_untyped)
18524 }
18525 }
18526
18527 #[repr(transparent)]
18529 pub struct ExtendedAttributeIteratorServerSender<___T: ::fidl_next::Transport> {
18530 sender: ::fidl_next::protocol::ServerSender<___T>,
18531 }
18532
18533 impl<___T> ExtendedAttributeIteratorServerSender<___T> where ___T: ::fidl_next::Transport {}
18534 }
18535}
18536
18537pub trait ExtendedAttributeIteratorClientHandler<___T: ::fidl_next::Transport> {}
18541
18542impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for ExtendedAttributeIterator
18543where
18544 ___H: ExtendedAttributeIteratorClientHandler<___T> + Send,
18545 ___T: ::fidl_next::Transport,
18546
18547 <extended_attribute_iterator::GetNext as ::fidl_next::Method>::Response:
18548 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18549{
18550 async fn on_event(
18551 handler: &mut ___H,
18552 sender: &::fidl_next::ClientSender<Self, ___T>,
18553 ordinal: u64,
18554 buffer: ___T::RecvBuffer,
18555 ) {
18556 match ordinal {
18557 ordinal => {
18558 sender.close();
18559 }
18560 }
18561 }
18562}
18563
18564pub trait ExtendedAttributeIteratorServerHandler<___T: ::fidl_next::Transport> {
18568 #[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"]
18569 fn get_next(
18570 &mut self,
18571 sender: &::fidl_next::ServerSender<ExtendedAttributeIterator, ___T>,
18572
18573 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext>,
18574 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18575}
18576
18577impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for ExtendedAttributeIterator
18578where
18579 ___H: ExtendedAttributeIteratorServerHandler<___T> + Send,
18580 ___T: ::fidl_next::Transport,
18581{
18582 async fn on_one_way(
18583 handler: &mut ___H,
18584 sender: &::fidl_next::ServerSender<Self, ___T>,
18585 ordinal: u64,
18586 buffer: ___T::RecvBuffer,
18587 ) {
18588 match ordinal {
18589 ordinal => {
18590 sender.close();
18591 }
18592 }
18593 }
18594
18595 async fn on_two_way(
18596 handler: &mut ___H,
18597 sender: &::fidl_next::ServerSender<Self, ___T>,
18598 ordinal: u64,
18599 buffer: ___T::RecvBuffer,
18600 responder: ::fidl_next::protocol::Responder,
18601 ) {
18602 match ordinal {
18603 268639596268373415 => {
18604 let responder = ::fidl_next::Responder::from_untyped(responder);
18605
18606 handler.get_next(sender, responder).await;
18607 }
18608
18609 ordinal => {
18610 sender.close();
18611 }
18612 }
18613 }
18614}
18615
18616pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
18617
18618#[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"]
18619pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: crate::Flags = crate::Flags::FLAG_MUST_CREATE;
18620
18621#[derive(Clone, Debug)]
18622#[repr(C)]
18623pub struct ReadableReadRequest {
18624 pub count: u64,
18625}
18626
18627impl ::fidl_next::Encodable for ReadableReadRequest {
18628 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireReadableReadRequest> = unsafe {
18629 ::fidl_next::CopyOptimization::enable_if(
18630 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
18631 )
18632 };
18633
18634 type Encoded = WireReadableReadRequest;
18635}
18636
18637unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadRequest
18638where
18639 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18640{
18641 #[inline]
18642 fn encode(
18643 self,
18644 encoder: &mut ___E,
18645 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18646 ) -> Result<(), ::fidl_next::EncodeError> {
18647 ::fidl_next::munge! {
18648 let Self::Encoded {
18649 count,
18650
18651 } = out;
18652 }
18653
18654 ::fidl_next::Encode::encode(self.count, encoder, count)?;
18655
18656 Ok(())
18657 }
18658}
18659
18660unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadRequest
18661where
18662 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18663{
18664 #[inline]
18665 fn encode_ref(
18666 &self,
18667 encoder: &mut ___E,
18668 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18669 ) -> Result<(), ::fidl_next::EncodeError> {
18670 ::fidl_next::munge! {
18671 let Self::Encoded {
18672 count,
18673
18674 } = out;
18675 }
18676
18677 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
18678
18679 Ok(())
18680 }
18681}
18682
18683impl ::fidl_next::EncodableOption for ReadableReadRequest {
18684 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadRequest>;
18685}
18686
18687unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadRequest
18688where
18689 ___E: ::fidl_next::Encoder + ?Sized,
18690 ReadableReadRequest: ::fidl_next::Encode<___E>,
18691{
18692 #[inline]
18693 fn encode_option(
18694 this: Option<Self>,
18695 encoder: &mut ___E,
18696 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18697 ) -> Result<(), ::fidl_next::EncodeError> {
18698 if let Some(inner) = this {
18699 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18700 ::fidl_next::WireBox::encode_present(out);
18701 } else {
18702 ::fidl_next::WireBox::encode_absent(out);
18703 }
18704
18705 Ok(())
18706 }
18707}
18708
18709unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadRequest
18710where
18711 ___E: ::fidl_next::Encoder + ?Sized,
18712 ReadableReadRequest: ::fidl_next::EncodeRef<___E>,
18713{
18714 #[inline]
18715 fn encode_option_ref(
18716 this: Option<&Self>,
18717 encoder: &mut ___E,
18718 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18719 ) -> Result<(), ::fidl_next::EncodeError> {
18720 if let Some(inner) = this {
18721 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18722 ::fidl_next::WireBox::encode_present(out);
18723 } else {
18724 ::fidl_next::WireBox::encode_absent(out);
18725 }
18726
18727 Ok(())
18728 }
18729}
18730
18731impl ::fidl_next::FromWire<WireReadableReadRequest> for ReadableReadRequest {
18732 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireReadableReadRequest, Self> = unsafe {
18733 ::fidl_next::CopyOptimization::enable_if(
18734 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
18735 .is_enabled(),
18736 )
18737 };
18738
18739 #[inline]
18740 fn from_wire(wire: WireReadableReadRequest) -> Self {
18741 Self { count: ::fidl_next::FromWire::from_wire(wire.count) }
18742 }
18743}
18744
18745impl ::fidl_next::FromWireRef<WireReadableReadRequest> for ReadableReadRequest {
18746 #[inline]
18747 fn from_wire_ref(wire: &WireReadableReadRequest) -> Self {
18748 Self { count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count) }
18749 }
18750}
18751
18752#[derive(Clone, Debug)]
18754#[repr(C)]
18755pub struct WireReadableReadRequest {
18756 pub count: ::fidl_next::WireU64,
18757}
18758
18759unsafe impl ::fidl_next::Wire for WireReadableReadRequest {
18760 type Decoded<'de> = WireReadableReadRequest;
18761
18762 #[inline]
18763 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18764}
18765
18766unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadRequest
18767where
18768 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18769{
18770 fn decode(
18771 slot: ::fidl_next::Slot<'_, Self>,
18772 decoder: &mut ___D,
18773 ) -> Result<(), ::fidl_next::DecodeError> {
18774 ::fidl_next::munge! {
18775 let Self {
18776 mut count,
18777
18778 } = slot;
18779 }
18780
18781 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
18782
18783 Ok(())
18784 }
18785}
18786
18787#[doc = " The maximum I/O size that is allowed for read/write operations using\n byte vectors.\n"]
18788pub const MAX_TRANSFER_SIZE: u64 = 8192;
18789
18790#[doc = " The byte vector type used for read/write operations.\n"]
18791pub type Transfer = Vec<u8>;
18792
18793pub type WireTransfer<'de> = ::fidl_next::WireVector<'de, u8>;
18795
18796#[derive(Clone, Debug)]
18797pub struct ReadableReadResponse {
18798 pub data: Vec<u8>,
18799}
18800
18801impl ::fidl_next::Encodable for ReadableReadResponse {
18802 type Encoded = WireReadableReadResponse<'static>;
18803}
18804
18805unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadResponse
18806where
18807 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18808
18809 ___E: ::fidl_next::Encoder,
18810{
18811 #[inline]
18812 fn encode(
18813 self,
18814 encoder: &mut ___E,
18815 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18816 ) -> Result<(), ::fidl_next::EncodeError> {
18817 ::fidl_next::munge! {
18818 let Self::Encoded {
18819 data,
18820
18821 } = out;
18822 }
18823
18824 ::fidl_next::Encode::encode(self.data, encoder, data)?;
18825
18826 Ok(())
18827 }
18828}
18829
18830unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadResponse
18831where
18832 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18833
18834 ___E: ::fidl_next::Encoder,
18835{
18836 #[inline]
18837 fn encode_ref(
18838 &self,
18839 encoder: &mut ___E,
18840 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18841 ) -> Result<(), ::fidl_next::EncodeError> {
18842 ::fidl_next::munge! {
18843 let Self::Encoded {
18844 data,
18845
18846 } = out;
18847 }
18848
18849 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
18850
18851 Ok(())
18852 }
18853}
18854
18855impl ::fidl_next::EncodableOption for ReadableReadResponse {
18856 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadResponse<'static>>;
18857}
18858
18859unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadResponse
18860where
18861 ___E: ::fidl_next::Encoder + ?Sized,
18862 ReadableReadResponse: ::fidl_next::Encode<___E>,
18863{
18864 #[inline]
18865 fn encode_option(
18866 this: Option<Self>,
18867 encoder: &mut ___E,
18868 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18869 ) -> Result<(), ::fidl_next::EncodeError> {
18870 if let Some(inner) = this {
18871 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18872 ::fidl_next::WireBox::encode_present(out);
18873 } else {
18874 ::fidl_next::WireBox::encode_absent(out);
18875 }
18876
18877 Ok(())
18878 }
18879}
18880
18881unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadResponse
18882where
18883 ___E: ::fidl_next::Encoder + ?Sized,
18884 ReadableReadResponse: ::fidl_next::EncodeRef<___E>,
18885{
18886 #[inline]
18887 fn encode_option_ref(
18888 this: Option<&Self>,
18889 encoder: &mut ___E,
18890 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18891 ) -> Result<(), ::fidl_next::EncodeError> {
18892 if let Some(inner) = this {
18893 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18894 ::fidl_next::WireBox::encode_present(out);
18895 } else {
18896 ::fidl_next::WireBox::encode_absent(out);
18897 }
18898
18899 Ok(())
18900 }
18901}
18902
18903impl<'de> ::fidl_next::FromWire<WireReadableReadResponse<'de>> for ReadableReadResponse {
18904 #[inline]
18905 fn from_wire(wire: WireReadableReadResponse<'de>) -> Self {
18906 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
18907 }
18908}
18909
18910impl<'de> ::fidl_next::FromWireRef<WireReadableReadResponse<'de>> for ReadableReadResponse {
18911 #[inline]
18912 fn from_wire_ref(wire: &WireReadableReadResponse<'de>) -> Self {
18913 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
18914 }
18915}
18916
18917#[derive(Debug)]
18919#[repr(C)]
18920pub struct WireReadableReadResponse<'de> {
18921 pub data: ::fidl_next::WireVector<'de, u8>,
18922}
18923
18924unsafe impl ::fidl_next::Wire for WireReadableReadResponse<'static> {
18925 type Decoded<'de> = WireReadableReadResponse<'de>;
18926
18927 #[inline]
18928 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18929}
18930
18931unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadResponse<'static>
18932where
18933 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18934
18935 ___D: ::fidl_next::Decoder,
18936{
18937 fn decode(
18938 slot: ::fidl_next::Slot<'_, Self>,
18939 decoder: &mut ___D,
18940 ) -> Result<(), ::fidl_next::DecodeError> {
18941 ::fidl_next::munge! {
18942 let Self {
18943 mut data,
18944
18945 } = slot;
18946 }
18947
18948 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
18949
18950 let data = unsafe { data.deref_unchecked() };
18951
18952 if data.len() > 8192 {
18953 return Err(::fidl_next::DecodeError::VectorTooLong {
18954 size: data.len() as u64,
18955 limit: 8192,
18956 });
18957 }
18958
18959 Ok(())
18960 }
18961}
18962
18963#[derive(Debug)]
18965pub struct Readable;
18966
18967pub mod readable {
18968 pub mod prelude {
18969 pub use crate::{readable, Readable, ReadableClientHandler, ReadableServerHandler};
18970
18971 pub use crate::ReadableReadRequest;
18972
18973 pub use crate::ReadableReadResponse;
18974 }
18975
18976 pub struct Read;
18977
18978 impl ::fidl_next::Method for Read {
18979 const ORDINAL: u64 = 395825947633028830;
18980
18981 type Protocol = crate::Readable;
18982
18983 type Request = crate::WireReadableReadRequest;
18984
18985 type Response = ::fidl_next::WireResult<
18986 'static,
18987 crate::WireReadableReadResponse<'static>,
18988 ::fidl_next::WireI32,
18989 >;
18990 }
18991
18992 mod ___detail {
18993
18994 pub struct Read<T0> {
18995 count: T0,
18996 }
18997
18998 impl<T0> ::fidl_next::Encodable for Read<T0>
18999 where
19000 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
19001 {
19002 type Encoded = crate::WireReadableReadRequest;
19003 }
19004
19005 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
19006 where
19007 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19008
19009 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
19010 {
19011 #[inline]
19012 fn encode(
19013 self,
19014 encoder: &mut ___E,
19015 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19016 ) -> Result<(), ::fidl_next::EncodeError> {
19017 ::fidl_next::munge! {
19018 let Self::Encoded {
19019 count,
19020
19021 } = out;
19022 }
19023
19024 ::fidl_next::Encode::encode(self.count, encoder, count)?;
19025
19026 Ok(())
19027 }
19028 }
19029
19030 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Readable
19031 where
19032 ___T: ::fidl_next::Transport,
19033 {
19034 type ClientSender = ReadableClientSender<___T>;
19035 type ServerSender = ReadableServerSender<___T>;
19036 }
19037
19038 pub struct ReadableClientSender<___T: ::fidl_next::Transport> {
19040 #[allow(dead_code)]
19041 sender: ::fidl_next::protocol::ClientSender<___T>,
19042 }
19043
19044 impl<___T> ReadableClientSender<___T>
19045 where
19046 ___T: ::fidl_next::Transport,
19047 {
19048 #[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"]
19049 pub fn read(
19050 &self,
19051
19052 count: impl ::fidl_next::Encode<
19053 <___T as ::fidl_next::Transport>::SendBuffer,
19054 Encoded = ::fidl_next::WireU64,
19055 >,
19056 ) -> Result<::fidl_next::ResponseFuture<'_, super::Read, ___T>, ::fidl_next::EncodeError>
19057 where
19058 <___T as ::fidl_next::Transport>::SendBuffer:
19059 ::fidl_next::encoder::InternalHandleEncoder,
19060 {
19061 self.read_with(Read { count })
19062 }
19063
19064 #[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"]
19065 pub fn read_with<___R>(
19066 &self,
19067 request: ___R,
19068 ) -> Result<::fidl_next::ResponseFuture<'_, super::Read, ___T>, ::fidl_next::EncodeError>
19069 where
19070 ___R: ::fidl_next::Encode<
19071 <___T as ::fidl_next::Transport>::SendBuffer,
19072 Encoded = crate::WireReadableReadRequest,
19073 >,
19074 {
19075 self.sender
19076 .send_two_way(395825947633028830, request)
19077 .map(::fidl_next::ResponseFuture::from_untyped)
19078 }
19079 }
19080
19081 #[repr(transparent)]
19083 pub struct ReadableServerSender<___T: ::fidl_next::Transport> {
19084 sender: ::fidl_next::protocol::ServerSender<___T>,
19085 }
19086
19087 impl<___T> ReadableServerSender<___T> where ___T: ::fidl_next::Transport {}
19088 }
19089}
19090
19091pub trait ReadableClientHandler<___T: ::fidl_next::Transport> {}
19095
19096impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Readable
19097where
19098 ___H: ReadableClientHandler<___T> + Send,
19099 ___T: ::fidl_next::Transport,
19100
19101 <readable::Read as ::fidl_next::Method>::Response:
19102 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19103{
19104 async fn on_event(
19105 handler: &mut ___H,
19106 sender: &::fidl_next::ClientSender<Self, ___T>,
19107 ordinal: u64,
19108 buffer: ___T::RecvBuffer,
19109 ) {
19110 match ordinal {
19111 ordinal => {
19112 sender.close();
19113 }
19114 }
19115 }
19116}
19117
19118pub trait ReadableServerHandler<___T: ::fidl_next::Transport> {
19122 #[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"]
19123 fn read(
19124 &mut self,
19125 sender: &::fidl_next::ServerSender<Readable, ___T>,
19126
19127 request: ::fidl_next::Request<readable::Read, ___T>,
19128
19129 responder: ::fidl_next::Responder<readable::Read>,
19130 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19131}
19132
19133impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Readable
19134where
19135 ___H: ReadableServerHandler<___T> + Send,
19136 ___T: ::fidl_next::Transport,
19137
19138 <readable::Read as ::fidl_next::Method>::Request:
19139 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19140{
19141 async fn on_one_way(
19142 handler: &mut ___H,
19143 sender: &::fidl_next::ServerSender<Self, ___T>,
19144 ordinal: u64,
19145 buffer: ___T::RecvBuffer,
19146 ) {
19147 match ordinal {
19148 ordinal => {
19149 sender.close();
19150 }
19151 }
19152 }
19153
19154 async fn on_two_way(
19155 handler: &mut ___H,
19156 sender: &::fidl_next::ServerSender<Self, ___T>,
19157 ordinal: u64,
19158 buffer: ___T::RecvBuffer,
19159 responder: ::fidl_next::protocol::Responder,
19160 ) {
19161 match ordinal {
19162 395825947633028830 => {
19163 let responder = ::fidl_next::Responder::from_untyped(responder);
19164
19165 match ::fidl_next::DecoderExt::decode(buffer) {
19166 Ok(decoded) => handler.read(sender, decoded, responder).await,
19167 Err(e) => {
19168 sender.close();
19169 }
19170 }
19171 }
19172
19173 ordinal => {
19174 sender.close();
19175 }
19176 }
19177 }
19178}
19179
19180#[derive(Clone, Debug)]
19181pub struct WritableWriteRequest {
19182 pub data: Vec<u8>,
19183}
19184
19185impl ::fidl_next::Encodable for WritableWriteRequest {
19186 type Encoded = WireWritableWriteRequest<'static>;
19187}
19188
19189unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteRequest
19190where
19191 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19192
19193 ___E: ::fidl_next::Encoder,
19194{
19195 #[inline]
19196 fn encode(
19197 self,
19198 encoder: &mut ___E,
19199 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19200 ) -> Result<(), ::fidl_next::EncodeError> {
19201 ::fidl_next::munge! {
19202 let Self::Encoded {
19203 data,
19204
19205 } = out;
19206 }
19207
19208 ::fidl_next::Encode::encode(self.data, encoder, data)?;
19209
19210 Ok(())
19211 }
19212}
19213
19214unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteRequest
19215where
19216 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19217
19218 ___E: ::fidl_next::Encoder,
19219{
19220 #[inline]
19221 fn encode_ref(
19222 &self,
19223 encoder: &mut ___E,
19224 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19225 ) -> Result<(), ::fidl_next::EncodeError> {
19226 ::fidl_next::munge! {
19227 let Self::Encoded {
19228 data,
19229
19230 } = out;
19231 }
19232
19233 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
19234
19235 Ok(())
19236 }
19237}
19238
19239impl ::fidl_next::EncodableOption for WritableWriteRequest {
19240 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteRequest<'static>>;
19241}
19242
19243unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteRequest
19244where
19245 ___E: ::fidl_next::Encoder + ?Sized,
19246 WritableWriteRequest: ::fidl_next::Encode<___E>,
19247{
19248 #[inline]
19249 fn encode_option(
19250 this: Option<Self>,
19251 encoder: &mut ___E,
19252 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19253 ) -> Result<(), ::fidl_next::EncodeError> {
19254 if let Some(inner) = this {
19255 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19256 ::fidl_next::WireBox::encode_present(out);
19257 } else {
19258 ::fidl_next::WireBox::encode_absent(out);
19259 }
19260
19261 Ok(())
19262 }
19263}
19264
19265unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteRequest
19266where
19267 ___E: ::fidl_next::Encoder + ?Sized,
19268 WritableWriteRequest: ::fidl_next::EncodeRef<___E>,
19269{
19270 #[inline]
19271 fn encode_option_ref(
19272 this: Option<&Self>,
19273 encoder: &mut ___E,
19274 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19275 ) -> Result<(), ::fidl_next::EncodeError> {
19276 if let Some(inner) = this {
19277 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19278 ::fidl_next::WireBox::encode_present(out);
19279 } else {
19280 ::fidl_next::WireBox::encode_absent(out);
19281 }
19282
19283 Ok(())
19284 }
19285}
19286
19287impl<'de> ::fidl_next::FromWire<WireWritableWriteRequest<'de>> for WritableWriteRequest {
19288 #[inline]
19289 fn from_wire(wire: WireWritableWriteRequest<'de>) -> Self {
19290 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
19291 }
19292}
19293
19294impl<'de> ::fidl_next::FromWireRef<WireWritableWriteRequest<'de>> for WritableWriteRequest {
19295 #[inline]
19296 fn from_wire_ref(wire: &WireWritableWriteRequest<'de>) -> Self {
19297 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
19298 }
19299}
19300
19301#[derive(Debug)]
19303#[repr(C)]
19304pub struct WireWritableWriteRequest<'de> {
19305 pub data: ::fidl_next::WireVector<'de, u8>,
19306}
19307
19308unsafe impl ::fidl_next::Wire for WireWritableWriteRequest<'static> {
19309 type Decoded<'de> = WireWritableWriteRequest<'de>;
19310
19311 #[inline]
19312 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19313}
19314
19315unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteRequest<'static>
19316where
19317 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19318
19319 ___D: ::fidl_next::Decoder,
19320{
19321 fn decode(
19322 slot: ::fidl_next::Slot<'_, Self>,
19323 decoder: &mut ___D,
19324 ) -> Result<(), ::fidl_next::DecodeError> {
19325 ::fidl_next::munge! {
19326 let Self {
19327 mut data,
19328
19329 } = slot;
19330 }
19331
19332 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
19333
19334 let data = unsafe { data.deref_unchecked() };
19335
19336 if data.len() > 8192 {
19337 return Err(::fidl_next::DecodeError::VectorTooLong {
19338 size: data.len() as u64,
19339 limit: 8192,
19340 });
19341 }
19342
19343 Ok(())
19344 }
19345}
19346
19347#[derive(Clone, Debug)]
19348#[repr(C)]
19349pub struct WritableWriteResponse {
19350 pub actual_count: u64,
19351}
19352
19353impl ::fidl_next::Encodable for WritableWriteResponse {
19354 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireWritableWriteResponse> = unsafe {
19355 ::fidl_next::CopyOptimization::enable_if(
19356 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
19357 )
19358 };
19359
19360 type Encoded = WireWritableWriteResponse;
19361}
19362
19363unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteResponse
19364where
19365 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19366{
19367 #[inline]
19368 fn encode(
19369 self,
19370 encoder: &mut ___E,
19371 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19372 ) -> Result<(), ::fidl_next::EncodeError> {
19373 ::fidl_next::munge! {
19374 let Self::Encoded {
19375 actual_count,
19376
19377 } = out;
19378 }
19379
19380 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
19381
19382 Ok(())
19383 }
19384}
19385
19386unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteResponse
19387where
19388 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19389{
19390 #[inline]
19391 fn encode_ref(
19392 &self,
19393 encoder: &mut ___E,
19394 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19395 ) -> Result<(), ::fidl_next::EncodeError> {
19396 ::fidl_next::munge! {
19397 let Self::Encoded {
19398 actual_count,
19399
19400 } = out;
19401 }
19402
19403 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
19404
19405 Ok(())
19406 }
19407}
19408
19409impl ::fidl_next::EncodableOption for WritableWriteResponse {
19410 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteResponse>;
19411}
19412
19413unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteResponse
19414where
19415 ___E: ::fidl_next::Encoder + ?Sized,
19416 WritableWriteResponse: ::fidl_next::Encode<___E>,
19417{
19418 #[inline]
19419 fn encode_option(
19420 this: Option<Self>,
19421 encoder: &mut ___E,
19422 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19423 ) -> Result<(), ::fidl_next::EncodeError> {
19424 if let Some(inner) = this {
19425 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19426 ::fidl_next::WireBox::encode_present(out);
19427 } else {
19428 ::fidl_next::WireBox::encode_absent(out);
19429 }
19430
19431 Ok(())
19432 }
19433}
19434
19435unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteResponse
19436where
19437 ___E: ::fidl_next::Encoder + ?Sized,
19438 WritableWriteResponse: ::fidl_next::EncodeRef<___E>,
19439{
19440 #[inline]
19441 fn encode_option_ref(
19442 this: Option<&Self>,
19443 encoder: &mut ___E,
19444 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19445 ) -> Result<(), ::fidl_next::EncodeError> {
19446 if let Some(inner) = this {
19447 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19448 ::fidl_next::WireBox::encode_present(out);
19449 } else {
19450 ::fidl_next::WireBox::encode_absent(out);
19451 }
19452
19453 Ok(())
19454 }
19455}
19456
19457impl ::fidl_next::FromWire<WireWritableWriteResponse> for WritableWriteResponse {
19458 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireWritableWriteResponse, Self> = unsafe {
19459 ::fidl_next::CopyOptimization::enable_if(
19460 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
19461 .is_enabled(),
19462 )
19463 };
19464
19465 #[inline]
19466 fn from_wire(wire: WireWritableWriteResponse) -> Self {
19467 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
19468 }
19469}
19470
19471impl ::fidl_next::FromWireRef<WireWritableWriteResponse> for WritableWriteResponse {
19472 #[inline]
19473 fn from_wire_ref(wire: &WireWritableWriteResponse) -> Self {
19474 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
19475 }
19476}
19477
19478#[derive(Clone, Debug)]
19480#[repr(C)]
19481pub struct WireWritableWriteResponse {
19482 pub actual_count: ::fidl_next::WireU64,
19483}
19484
19485unsafe impl ::fidl_next::Wire for WireWritableWriteResponse {
19486 type Decoded<'de> = WireWritableWriteResponse;
19487
19488 #[inline]
19489 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19490}
19491
19492unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteResponse
19493where
19494 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19495{
19496 fn decode(
19497 slot: ::fidl_next::Slot<'_, Self>,
19498 decoder: &mut ___D,
19499 ) -> Result<(), ::fidl_next::DecodeError> {
19500 ::fidl_next::munge! {
19501 let Self {
19502 mut actual_count,
19503
19504 } = slot;
19505 }
19506
19507 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
19508
19509 Ok(())
19510 }
19511}
19512
19513#[derive(Debug)]
19515pub struct Writable;
19516
19517pub mod writable {
19518 pub mod prelude {
19519 pub use crate::{writable, Writable, WritableClientHandler, WritableServerHandler};
19520
19521 pub use crate::WritableWriteRequest;
19522
19523 pub use crate::WritableWriteResponse;
19524 }
19525
19526 pub struct Write;
19527
19528 impl ::fidl_next::Method for Write {
19529 const ORDINAL: u64 = 7651971425397809026;
19530
19531 type Protocol = crate::Writable;
19532
19533 type Request = crate::WireWritableWriteRequest<'static>;
19534
19535 type Response = ::fidl_next::WireResult<
19536 'static,
19537 crate::WireWritableWriteResponse,
19538 ::fidl_next::WireI32,
19539 >;
19540 }
19541
19542 mod ___detail {
19543
19544 pub struct Write<T0> {
19545 data: T0,
19546 }
19547
19548 impl<T0> ::fidl_next::Encodable for Write<T0>
19549 where
19550 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
19551 {
19552 type Encoded = crate::WireWritableWriteRequest<'static>;
19553 }
19554
19555 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
19556 where
19557 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19558
19559 ___E: ::fidl_next::Encoder,
19560
19561 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
19562 {
19563 #[inline]
19564 fn encode(
19565 self,
19566 encoder: &mut ___E,
19567 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19568 ) -> Result<(), ::fidl_next::EncodeError> {
19569 ::fidl_next::munge! {
19570 let Self::Encoded {
19571 data,
19572
19573 } = out;
19574 }
19575
19576 ::fidl_next::Encode::encode(self.data, encoder, data)?;
19577
19578 Ok(())
19579 }
19580 }
19581
19582 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Writable
19583 where
19584 ___T: ::fidl_next::Transport,
19585 {
19586 type ClientSender = WritableClientSender<___T>;
19587 type ServerSender = WritableServerSender<___T>;
19588 }
19589
19590 pub struct WritableClientSender<___T: ::fidl_next::Transport> {
19592 #[allow(dead_code)]
19593 sender: ::fidl_next::protocol::ClientSender<___T>,
19594 }
19595
19596 impl<___T> WritableClientSender<___T>
19597 where
19598 ___T: ::fidl_next::Transport,
19599 {
19600 #[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"]
19601 pub fn write(
19602 &self,
19603
19604 data: impl ::fidl_next::Encode<
19605 <___T as ::fidl_next::Transport>::SendBuffer,
19606 Encoded = ::fidl_next::WireVector<'static, u8>,
19607 >,
19608 ) -> Result<::fidl_next::ResponseFuture<'_, super::Write, ___T>, ::fidl_next::EncodeError>
19609 where
19610 <___T as ::fidl_next::Transport>::SendBuffer:
19611 ::fidl_next::encoder::InternalHandleEncoder,
19612
19613 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
19614 {
19615 self.write_with(Write { data })
19616 }
19617
19618 #[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"]
19619 pub fn write_with<___R>(
19620 &self,
19621 request: ___R,
19622 ) -> Result<::fidl_next::ResponseFuture<'_, super::Write, ___T>, ::fidl_next::EncodeError>
19623 where
19624 ___R: ::fidl_next::Encode<
19625 <___T as ::fidl_next::Transport>::SendBuffer,
19626 Encoded = crate::WireWritableWriteRequest<'static>,
19627 >,
19628 {
19629 self.sender
19630 .send_two_way(7651971425397809026, request)
19631 .map(::fidl_next::ResponseFuture::from_untyped)
19632 }
19633 }
19634
19635 #[repr(transparent)]
19637 pub struct WritableServerSender<___T: ::fidl_next::Transport> {
19638 sender: ::fidl_next::protocol::ServerSender<___T>,
19639 }
19640
19641 impl<___T> WritableServerSender<___T> where ___T: ::fidl_next::Transport {}
19642 }
19643}
19644
19645pub trait WritableClientHandler<___T: ::fidl_next::Transport> {}
19649
19650impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Writable
19651where
19652 ___H: WritableClientHandler<___T> + Send,
19653 ___T: ::fidl_next::Transport,
19654
19655 <writable::Write as ::fidl_next::Method>::Response:
19656 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19657{
19658 async fn on_event(
19659 handler: &mut ___H,
19660 sender: &::fidl_next::ClientSender<Self, ___T>,
19661 ordinal: u64,
19662 buffer: ___T::RecvBuffer,
19663 ) {
19664 match ordinal {
19665 ordinal => {
19666 sender.close();
19667 }
19668 }
19669 }
19670}
19671
19672pub trait WritableServerHandler<___T: ::fidl_next::Transport> {
19676 #[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"]
19677 fn write(
19678 &mut self,
19679 sender: &::fidl_next::ServerSender<Writable, ___T>,
19680
19681 request: ::fidl_next::Request<writable::Write, ___T>,
19682
19683 responder: ::fidl_next::Responder<writable::Write>,
19684 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19685}
19686
19687impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Writable
19688where
19689 ___H: WritableServerHandler<___T> + Send,
19690 ___T: ::fidl_next::Transport,
19691
19692 <writable::Write as ::fidl_next::Method>::Request:
19693 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19694{
19695 async fn on_one_way(
19696 handler: &mut ___H,
19697 sender: &::fidl_next::ServerSender<Self, ___T>,
19698 ordinal: u64,
19699 buffer: ___T::RecvBuffer,
19700 ) {
19701 match ordinal {
19702 ordinal => {
19703 sender.close();
19704 }
19705 }
19706 }
19707
19708 async fn on_two_way(
19709 handler: &mut ___H,
19710 sender: &::fidl_next::ServerSender<Self, ___T>,
19711 ordinal: u64,
19712 buffer: ___T::RecvBuffer,
19713 responder: ::fidl_next::protocol::Responder,
19714 ) {
19715 match ordinal {
19716 7651971425397809026 => {
19717 let responder = ::fidl_next::Responder::from_untyped(responder);
19718
19719 match ::fidl_next::DecoderExt::decode(buffer) {
19720 Ok(decoded) => handler.write(sender, decoded, responder).await,
19721 Err(e) => {
19722 sender.close();
19723 }
19724 }
19725 }
19726
19727 ordinal => {
19728 sender.close();
19729 }
19730 }
19731 }
19732}
19733
19734#[derive(Clone, Debug)]
19735pub struct FileSeekRequest {
19736 pub origin: crate::SeekOrigin,
19737
19738 pub offset: i64,
19739}
19740
19741impl ::fidl_next::Encodable for FileSeekRequest {
19742 type Encoded = WireFileSeekRequest;
19743}
19744
19745unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekRequest
19746where
19747 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19748{
19749 #[inline]
19750 fn encode(
19751 self,
19752 encoder: &mut ___E,
19753 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19754 ) -> Result<(), ::fidl_next::EncodeError> {
19755 ::fidl_next::munge! {
19756 let Self::Encoded {
19757 origin,
19758 offset,
19759
19760 } = out;
19761 }
19762
19763 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
19764
19765 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
19766
19767 Ok(())
19768 }
19769}
19770
19771unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekRequest
19772where
19773 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19774{
19775 #[inline]
19776 fn encode_ref(
19777 &self,
19778 encoder: &mut ___E,
19779 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19780 ) -> Result<(), ::fidl_next::EncodeError> {
19781 ::fidl_next::munge! {
19782 let Self::Encoded {
19783 origin,
19784 offset,
19785
19786 } = out;
19787 }
19788
19789 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder, origin)?;
19790
19791 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
19792
19793 Ok(())
19794 }
19795}
19796
19797impl ::fidl_next::EncodableOption for FileSeekRequest {
19798 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekRequest>;
19799}
19800
19801unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekRequest
19802where
19803 ___E: ::fidl_next::Encoder + ?Sized,
19804 FileSeekRequest: ::fidl_next::Encode<___E>,
19805{
19806 #[inline]
19807 fn encode_option(
19808 this: Option<Self>,
19809 encoder: &mut ___E,
19810 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19811 ) -> Result<(), ::fidl_next::EncodeError> {
19812 if let Some(inner) = this {
19813 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19814 ::fidl_next::WireBox::encode_present(out);
19815 } else {
19816 ::fidl_next::WireBox::encode_absent(out);
19817 }
19818
19819 Ok(())
19820 }
19821}
19822
19823unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekRequest
19824where
19825 ___E: ::fidl_next::Encoder + ?Sized,
19826 FileSeekRequest: ::fidl_next::EncodeRef<___E>,
19827{
19828 #[inline]
19829 fn encode_option_ref(
19830 this: Option<&Self>,
19831 encoder: &mut ___E,
19832 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19833 ) -> Result<(), ::fidl_next::EncodeError> {
19834 if let Some(inner) = this {
19835 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19836 ::fidl_next::WireBox::encode_present(out);
19837 } else {
19838 ::fidl_next::WireBox::encode_absent(out);
19839 }
19840
19841 Ok(())
19842 }
19843}
19844
19845impl ::fidl_next::FromWire<WireFileSeekRequest> for FileSeekRequest {
19846 #[inline]
19847 fn from_wire(wire: WireFileSeekRequest) -> Self {
19848 Self {
19849 origin: ::fidl_next::FromWire::from_wire(wire.origin),
19850
19851 offset: ::fidl_next::FromWire::from_wire(wire.offset),
19852 }
19853 }
19854}
19855
19856impl ::fidl_next::FromWireRef<WireFileSeekRequest> for FileSeekRequest {
19857 #[inline]
19858 fn from_wire_ref(wire: &WireFileSeekRequest) -> Self {
19859 Self {
19860 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
19861
19862 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
19863 }
19864 }
19865}
19866
19867#[derive(Clone, Debug)]
19869#[repr(C)]
19870pub struct WireFileSeekRequest {
19871 pub origin: crate::WireSeekOrigin,
19872
19873 pub offset: ::fidl_next::WireI64,
19874}
19875
19876unsafe impl ::fidl_next::Wire for WireFileSeekRequest {
19877 type Decoded<'de> = WireFileSeekRequest;
19878
19879 #[inline]
19880 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19881 unsafe {
19882 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
19883 }
19884 }
19885}
19886
19887unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekRequest
19888where
19889 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19890{
19891 fn decode(
19892 slot: ::fidl_next::Slot<'_, Self>,
19893 decoder: &mut ___D,
19894 ) -> Result<(), ::fidl_next::DecodeError> {
19895 ::fidl_next::munge! {
19896 let Self {
19897 mut origin,
19898 mut offset,
19899
19900 } = slot;
19901 }
19902
19903 ::fidl_next::Decode::decode(origin.as_mut(), decoder)?;
19904
19905 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
19906
19907 Ok(())
19908 }
19909}
19910
19911#[derive(Clone, Debug)]
19912#[repr(C)]
19913pub struct FileSeekResponse {
19914 pub offset_from_start: u64,
19915}
19916
19917impl ::fidl_next::Encodable for FileSeekResponse {
19918 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileSeekResponse> = unsafe {
19919 ::fidl_next::CopyOptimization::enable_if(
19920 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
19921 )
19922 };
19923
19924 type Encoded = WireFileSeekResponse;
19925}
19926
19927unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekResponse
19928where
19929 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19930{
19931 #[inline]
19932 fn encode(
19933 self,
19934 encoder: &mut ___E,
19935 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19936 ) -> Result<(), ::fidl_next::EncodeError> {
19937 ::fidl_next::munge! {
19938 let Self::Encoded {
19939 offset_from_start,
19940
19941 } = out;
19942 }
19943
19944 ::fidl_next::Encode::encode(self.offset_from_start, encoder, offset_from_start)?;
19945
19946 Ok(())
19947 }
19948}
19949
19950unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekResponse
19951where
19952 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19953{
19954 #[inline]
19955 fn encode_ref(
19956 &self,
19957 encoder: &mut ___E,
19958 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19959 ) -> Result<(), ::fidl_next::EncodeError> {
19960 ::fidl_next::munge! {
19961 let Self::Encoded {
19962 offset_from_start,
19963
19964 } = out;
19965 }
19966
19967 ::fidl_next::EncodeRef::encode_ref(&self.offset_from_start, encoder, offset_from_start)?;
19968
19969 Ok(())
19970 }
19971}
19972
19973impl ::fidl_next::EncodableOption for FileSeekResponse {
19974 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekResponse>;
19975}
19976
19977unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekResponse
19978where
19979 ___E: ::fidl_next::Encoder + ?Sized,
19980 FileSeekResponse: ::fidl_next::Encode<___E>,
19981{
19982 #[inline]
19983 fn encode_option(
19984 this: Option<Self>,
19985 encoder: &mut ___E,
19986 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19987 ) -> Result<(), ::fidl_next::EncodeError> {
19988 if let Some(inner) = this {
19989 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19990 ::fidl_next::WireBox::encode_present(out);
19991 } else {
19992 ::fidl_next::WireBox::encode_absent(out);
19993 }
19994
19995 Ok(())
19996 }
19997}
19998
19999unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekResponse
20000where
20001 ___E: ::fidl_next::Encoder + ?Sized,
20002 FileSeekResponse: ::fidl_next::EncodeRef<___E>,
20003{
20004 #[inline]
20005 fn encode_option_ref(
20006 this: Option<&Self>,
20007 encoder: &mut ___E,
20008 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20009 ) -> Result<(), ::fidl_next::EncodeError> {
20010 if let Some(inner) = this {
20011 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20012 ::fidl_next::WireBox::encode_present(out);
20013 } else {
20014 ::fidl_next::WireBox::encode_absent(out);
20015 }
20016
20017 Ok(())
20018 }
20019}
20020
20021impl ::fidl_next::FromWire<WireFileSeekResponse> for FileSeekResponse {
20022 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileSeekResponse, Self> = unsafe {
20023 ::fidl_next::CopyOptimization::enable_if(
20024 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20025 .is_enabled(),
20026 )
20027 };
20028
20029 #[inline]
20030 fn from_wire(wire: WireFileSeekResponse) -> Self {
20031 Self { offset_from_start: ::fidl_next::FromWire::from_wire(wire.offset_from_start) }
20032 }
20033}
20034
20035impl ::fidl_next::FromWireRef<WireFileSeekResponse> for FileSeekResponse {
20036 #[inline]
20037 fn from_wire_ref(wire: &WireFileSeekResponse) -> Self {
20038 Self { offset_from_start: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset_from_start) }
20039 }
20040}
20041
20042#[derive(Clone, Debug)]
20044#[repr(C)]
20045pub struct WireFileSeekResponse {
20046 pub offset_from_start: ::fidl_next::WireU64,
20047}
20048
20049unsafe impl ::fidl_next::Wire for WireFileSeekResponse {
20050 type Decoded<'de> = WireFileSeekResponse;
20051
20052 #[inline]
20053 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20054}
20055
20056unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekResponse
20057where
20058 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20059{
20060 fn decode(
20061 slot: ::fidl_next::Slot<'_, Self>,
20062 decoder: &mut ___D,
20063 ) -> Result<(), ::fidl_next::DecodeError> {
20064 ::fidl_next::munge! {
20065 let Self {
20066 mut offset_from_start,
20067
20068 } = slot;
20069 }
20070
20071 ::fidl_next::Decode::decode(offset_from_start.as_mut(), decoder)?;
20072
20073 Ok(())
20074 }
20075}
20076
20077#[derive(Clone, Debug)]
20078#[repr(C)]
20079pub struct FileReadAtRequest {
20080 pub count: u64,
20081
20082 pub offset: u64,
20083}
20084
20085impl ::fidl_next::Encodable for FileReadAtRequest {
20086 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileReadAtRequest> = unsafe {
20087 ::fidl_next::CopyOptimization::enable_if(
20088 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
20089 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20090 )
20091 };
20092
20093 type Encoded = WireFileReadAtRequest;
20094}
20095
20096unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtRequest
20097where
20098 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20099{
20100 #[inline]
20101 fn encode(
20102 self,
20103 encoder: &mut ___E,
20104 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20105 ) -> Result<(), ::fidl_next::EncodeError> {
20106 ::fidl_next::munge! {
20107 let Self::Encoded {
20108 count,
20109 offset,
20110
20111 } = out;
20112 }
20113
20114 ::fidl_next::Encode::encode(self.count, encoder, count)?;
20115
20116 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
20117
20118 Ok(())
20119 }
20120}
20121
20122unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtRequest
20123where
20124 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20125{
20126 #[inline]
20127 fn encode_ref(
20128 &self,
20129 encoder: &mut ___E,
20130 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20131 ) -> Result<(), ::fidl_next::EncodeError> {
20132 ::fidl_next::munge! {
20133 let Self::Encoded {
20134 count,
20135 offset,
20136
20137 } = out;
20138 }
20139
20140 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
20141
20142 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
20143
20144 Ok(())
20145 }
20146}
20147
20148impl ::fidl_next::EncodableOption for FileReadAtRequest {
20149 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtRequest>;
20150}
20151
20152unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtRequest
20153where
20154 ___E: ::fidl_next::Encoder + ?Sized,
20155 FileReadAtRequest: ::fidl_next::Encode<___E>,
20156{
20157 #[inline]
20158 fn encode_option(
20159 this: Option<Self>,
20160 encoder: &mut ___E,
20161 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20162 ) -> Result<(), ::fidl_next::EncodeError> {
20163 if let Some(inner) = this {
20164 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20165 ::fidl_next::WireBox::encode_present(out);
20166 } else {
20167 ::fidl_next::WireBox::encode_absent(out);
20168 }
20169
20170 Ok(())
20171 }
20172}
20173
20174unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileReadAtRequest
20175where
20176 ___E: ::fidl_next::Encoder + ?Sized,
20177 FileReadAtRequest: ::fidl_next::EncodeRef<___E>,
20178{
20179 #[inline]
20180 fn encode_option_ref(
20181 this: Option<&Self>,
20182 encoder: &mut ___E,
20183 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20184 ) -> Result<(), ::fidl_next::EncodeError> {
20185 if let Some(inner) = this {
20186 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20187 ::fidl_next::WireBox::encode_present(out);
20188 } else {
20189 ::fidl_next::WireBox::encode_absent(out);
20190 }
20191
20192 Ok(())
20193 }
20194}
20195
20196impl ::fidl_next::FromWire<WireFileReadAtRequest> for FileReadAtRequest {
20197 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileReadAtRequest, Self> = unsafe {
20198 ::fidl_next::CopyOptimization::enable_if(
20199 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20200 .is_enabled()
20201 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20202 .is_enabled(),
20203 )
20204 };
20205
20206 #[inline]
20207 fn from_wire(wire: WireFileReadAtRequest) -> Self {
20208 Self {
20209 count: ::fidl_next::FromWire::from_wire(wire.count),
20210
20211 offset: ::fidl_next::FromWire::from_wire(wire.offset),
20212 }
20213 }
20214}
20215
20216impl ::fidl_next::FromWireRef<WireFileReadAtRequest> for FileReadAtRequest {
20217 #[inline]
20218 fn from_wire_ref(wire: &WireFileReadAtRequest) -> Self {
20219 Self {
20220 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
20221
20222 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
20223 }
20224 }
20225}
20226
20227#[derive(Clone, Debug)]
20229#[repr(C)]
20230pub struct WireFileReadAtRequest {
20231 pub count: ::fidl_next::WireU64,
20232
20233 pub offset: ::fidl_next::WireU64,
20234}
20235
20236unsafe impl ::fidl_next::Wire for WireFileReadAtRequest {
20237 type Decoded<'de> = WireFileReadAtRequest;
20238
20239 #[inline]
20240 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20241}
20242
20243unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtRequest
20244where
20245 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20246{
20247 fn decode(
20248 slot: ::fidl_next::Slot<'_, Self>,
20249 decoder: &mut ___D,
20250 ) -> Result<(), ::fidl_next::DecodeError> {
20251 ::fidl_next::munge! {
20252 let Self {
20253 mut count,
20254 mut offset,
20255
20256 } = slot;
20257 }
20258
20259 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
20260
20261 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
20262
20263 Ok(())
20264 }
20265}
20266
20267#[derive(Clone, Debug)]
20268pub struct FileReadAtResponse {
20269 pub data: Vec<u8>,
20270}
20271
20272impl ::fidl_next::Encodable for FileReadAtResponse {
20273 type Encoded = WireFileReadAtResponse<'static>;
20274}
20275
20276unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtResponse
20277where
20278 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20279
20280 ___E: ::fidl_next::Encoder,
20281{
20282 #[inline]
20283 fn encode(
20284 self,
20285 encoder: &mut ___E,
20286 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20287 ) -> Result<(), ::fidl_next::EncodeError> {
20288 ::fidl_next::munge! {
20289 let Self::Encoded {
20290 data,
20291
20292 } = out;
20293 }
20294
20295 ::fidl_next::Encode::encode(self.data, encoder, data)?;
20296
20297 Ok(())
20298 }
20299}
20300
20301unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtResponse
20302where
20303 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20304
20305 ___E: ::fidl_next::Encoder,
20306{
20307 #[inline]
20308 fn encode_ref(
20309 &self,
20310 encoder: &mut ___E,
20311 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20312 ) -> Result<(), ::fidl_next::EncodeError> {
20313 ::fidl_next::munge! {
20314 let Self::Encoded {
20315 data,
20316
20317 } = out;
20318 }
20319
20320 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
20321
20322 Ok(())
20323 }
20324}
20325
20326impl ::fidl_next::EncodableOption for FileReadAtResponse {
20327 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtResponse<'static>>;
20328}
20329
20330unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtResponse
20331where
20332 ___E: ::fidl_next::Encoder + ?Sized,
20333 FileReadAtResponse: ::fidl_next::Encode<___E>,
20334{
20335 #[inline]
20336 fn encode_option(
20337 this: Option<Self>,
20338 encoder: &mut ___E,
20339 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20340 ) -> Result<(), ::fidl_next::EncodeError> {
20341 if let Some(inner) = this {
20342 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20343 ::fidl_next::WireBox::encode_present(out);
20344 } else {
20345 ::fidl_next::WireBox::encode_absent(out);
20346 }
20347
20348 Ok(())
20349 }
20350}
20351
20352unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileReadAtResponse
20353where
20354 ___E: ::fidl_next::Encoder + ?Sized,
20355 FileReadAtResponse: ::fidl_next::EncodeRef<___E>,
20356{
20357 #[inline]
20358 fn encode_option_ref(
20359 this: Option<&Self>,
20360 encoder: &mut ___E,
20361 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20362 ) -> Result<(), ::fidl_next::EncodeError> {
20363 if let Some(inner) = this {
20364 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20365 ::fidl_next::WireBox::encode_present(out);
20366 } else {
20367 ::fidl_next::WireBox::encode_absent(out);
20368 }
20369
20370 Ok(())
20371 }
20372}
20373
20374impl<'de> ::fidl_next::FromWire<WireFileReadAtResponse<'de>> for FileReadAtResponse {
20375 #[inline]
20376 fn from_wire(wire: WireFileReadAtResponse<'de>) -> Self {
20377 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
20378 }
20379}
20380
20381impl<'de> ::fidl_next::FromWireRef<WireFileReadAtResponse<'de>> for FileReadAtResponse {
20382 #[inline]
20383 fn from_wire_ref(wire: &WireFileReadAtResponse<'de>) -> Self {
20384 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
20385 }
20386}
20387
20388#[derive(Debug)]
20390#[repr(C)]
20391pub struct WireFileReadAtResponse<'de> {
20392 pub data: ::fidl_next::WireVector<'de, u8>,
20393}
20394
20395unsafe impl ::fidl_next::Wire for WireFileReadAtResponse<'static> {
20396 type Decoded<'de> = WireFileReadAtResponse<'de>;
20397
20398 #[inline]
20399 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20400}
20401
20402unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtResponse<'static>
20403where
20404 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20405
20406 ___D: ::fidl_next::Decoder,
20407{
20408 fn decode(
20409 slot: ::fidl_next::Slot<'_, Self>,
20410 decoder: &mut ___D,
20411 ) -> Result<(), ::fidl_next::DecodeError> {
20412 ::fidl_next::munge! {
20413 let Self {
20414 mut data,
20415
20416 } = slot;
20417 }
20418
20419 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
20420
20421 let data = unsafe { data.deref_unchecked() };
20422
20423 if data.len() > 8192 {
20424 return Err(::fidl_next::DecodeError::VectorTooLong {
20425 size: data.len() as u64,
20426 limit: 8192,
20427 });
20428 }
20429
20430 Ok(())
20431 }
20432}
20433
20434#[derive(Clone, Debug)]
20435pub struct FileWriteAtRequest {
20436 pub data: Vec<u8>,
20437
20438 pub offset: u64,
20439}
20440
20441impl ::fidl_next::Encodable for FileWriteAtRequest {
20442 type Encoded = WireFileWriteAtRequest<'static>;
20443}
20444
20445unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtRequest
20446where
20447 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20448
20449 ___E: ::fidl_next::Encoder,
20450{
20451 #[inline]
20452 fn encode(
20453 self,
20454 encoder: &mut ___E,
20455 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20456 ) -> Result<(), ::fidl_next::EncodeError> {
20457 ::fidl_next::munge! {
20458 let Self::Encoded {
20459 data,
20460 offset,
20461
20462 } = out;
20463 }
20464
20465 ::fidl_next::Encode::encode(self.data, encoder, data)?;
20466
20467 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
20468
20469 Ok(())
20470 }
20471}
20472
20473unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtRequest
20474where
20475 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20476
20477 ___E: ::fidl_next::Encoder,
20478{
20479 #[inline]
20480 fn encode_ref(
20481 &self,
20482 encoder: &mut ___E,
20483 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20484 ) -> Result<(), ::fidl_next::EncodeError> {
20485 ::fidl_next::munge! {
20486 let Self::Encoded {
20487 data,
20488 offset,
20489
20490 } = out;
20491 }
20492
20493 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
20494
20495 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
20496
20497 Ok(())
20498 }
20499}
20500
20501impl ::fidl_next::EncodableOption for FileWriteAtRequest {
20502 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtRequest<'static>>;
20503}
20504
20505unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtRequest
20506where
20507 ___E: ::fidl_next::Encoder + ?Sized,
20508 FileWriteAtRequest: ::fidl_next::Encode<___E>,
20509{
20510 #[inline]
20511 fn encode_option(
20512 this: Option<Self>,
20513 encoder: &mut ___E,
20514 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20515 ) -> Result<(), ::fidl_next::EncodeError> {
20516 if let Some(inner) = this {
20517 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20518 ::fidl_next::WireBox::encode_present(out);
20519 } else {
20520 ::fidl_next::WireBox::encode_absent(out);
20521 }
20522
20523 Ok(())
20524 }
20525}
20526
20527unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtRequest
20528where
20529 ___E: ::fidl_next::Encoder + ?Sized,
20530 FileWriteAtRequest: ::fidl_next::EncodeRef<___E>,
20531{
20532 #[inline]
20533 fn encode_option_ref(
20534 this: Option<&Self>,
20535 encoder: &mut ___E,
20536 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20537 ) -> Result<(), ::fidl_next::EncodeError> {
20538 if let Some(inner) = this {
20539 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20540 ::fidl_next::WireBox::encode_present(out);
20541 } else {
20542 ::fidl_next::WireBox::encode_absent(out);
20543 }
20544
20545 Ok(())
20546 }
20547}
20548
20549impl<'de> ::fidl_next::FromWire<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
20550 #[inline]
20551 fn from_wire(wire: WireFileWriteAtRequest<'de>) -> Self {
20552 Self {
20553 data: ::fidl_next::FromWire::from_wire(wire.data),
20554
20555 offset: ::fidl_next::FromWire::from_wire(wire.offset),
20556 }
20557 }
20558}
20559
20560impl<'de> ::fidl_next::FromWireRef<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
20561 #[inline]
20562 fn from_wire_ref(wire: &WireFileWriteAtRequest<'de>) -> Self {
20563 Self {
20564 data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
20565
20566 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
20567 }
20568 }
20569}
20570
20571#[derive(Debug)]
20573#[repr(C)]
20574pub struct WireFileWriteAtRequest<'de> {
20575 pub data: ::fidl_next::WireVector<'de, u8>,
20576
20577 pub offset: ::fidl_next::WireU64,
20578}
20579
20580unsafe impl ::fidl_next::Wire for WireFileWriteAtRequest<'static> {
20581 type Decoded<'de> = WireFileWriteAtRequest<'de>;
20582
20583 #[inline]
20584 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20585}
20586
20587unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtRequest<'static>
20588where
20589 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20590
20591 ___D: ::fidl_next::Decoder,
20592{
20593 fn decode(
20594 slot: ::fidl_next::Slot<'_, Self>,
20595 decoder: &mut ___D,
20596 ) -> Result<(), ::fidl_next::DecodeError> {
20597 ::fidl_next::munge! {
20598 let Self {
20599 mut data,
20600 mut offset,
20601
20602 } = slot;
20603 }
20604
20605 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
20606
20607 let data = unsafe { data.deref_unchecked() };
20608
20609 if data.len() > 8192 {
20610 return Err(::fidl_next::DecodeError::VectorTooLong {
20611 size: data.len() as u64,
20612 limit: 8192,
20613 });
20614 }
20615
20616 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
20617
20618 Ok(())
20619 }
20620}
20621
20622#[derive(Clone, Debug)]
20623#[repr(C)]
20624pub struct FileWriteAtResponse {
20625 pub actual_count: u64,
20626}
20627
20628impl ::fidl_next::Encodable for FileWriteAtResponse {
20629 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileWriteAtResponse> = unsafe {
20630 ::fidl_next::CopyOptimization::enable_if(
20631 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20632 )
20633 };
20634
20635 type Encoded = WireFileWriteAtResponse;
20636}
20637
20638unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtResponse
20639where
20640 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20641{
20642 #[inline]
20643 fn encode(
20644 self,
20645 encoder: &mut ___E,
20646 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20647 ) -> Result<(), ::fidl_next::EncodeError> {
20648 ::fidl_next::munge! {
20649 let Self::Encoded {
20650 actual_count,
20651
20652 } = out;
20653 }
20654
20655 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
20656
20657 Ok(())
20658 }
20659}
20660
20661unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtResponse
20662where
20663 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20664{
20665 #[inline]
20666 fn encode_ref(
20667 &self,
20668 encoder: &mut ___E,
20669 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20670 ) -> Result<(), ::fidl_next::EncodeError> {
20671 ::fidl_next::munge! {
20672 let Self::Encoded {
20673 actual_count,
20674
20675 } = out;
20676 }
20677
20678 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
20679
20680 Ok(())
20681 }
20682}
20683
20684impl ::fidl_next::EncodableOption for FileWriteAtResponse {
20685 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtResponse>;
20686}
20687
20688unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtResponse
20689where
20690 ___E: ::fidl_next::Encoder + ?Sized,
20691 FileWriteAtResponse: ::fidl_next::Encode<___E>,
20692{
20693 #[inline]
20694 fn encode_option(
20695 this: Option<Self>,
20696 encoder: &mut ___E,
20697 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20698 ) -> Result<(), ::fidl_next::EncodeError> {
20699 if let Some(inner) = this {
20700 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20701 ::fidl_next::WireBox::encode_present(out);
20702 } else {
20703 ::fidl_next::WireBox::encode_absent(out);
20704 }
20705
20706 Ok(())
20707 }
20708}
20709
20710unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtResponse
20711where
20712 ___E: ::fidl_next::Encoder + ?Sized,
20713 FileWriteAtResponse: ::fidl_next::EncodeRef<___E>,
20714{
20715 #[inline]
20716 fn encode_option_ref(
20717 this: Option<&Self>,
20718 encoder: &mut ___E,
20719 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20720 ) -> Result<(), ::fidl_next::EncodeError> {
20721 if let Some(inner) = this {
20722 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20723 ::fidl_next::WireBox::encode_present(out);
20724 } else {
20725 ::fidl_next::WireBox::encode_absent(out);
20726 }
20727
20728 Ok(())
20729 }
20730}
20731
20732impl ::fidl_next::FromWire<WireFileWriteAtResponse> for FileWriteAtResponse {
20733 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileWriteAtResponse, Self> = unsafe {
20734 ::fidl_next::CopyOptimization::enable_if(
20735 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20736 .is_enabled(),
20737 )
20738 };
20739
20740 #[inline]
20741 fn from_wire(wire: WireFileWriteAtResponse) -> Self {
20742 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
20743 }
20744}
20745
20746impl ::fidl_next::FromWireRef<WireFileWriteAtResponse> for FileWriteAtResponse {
20747 #[inline]
20748 fn from_wire_ref(wire: &WireFileWriteAtResponse) -> Self {
20749 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
20750 }
20751}
20752
20753#[derive(Clone, Debug)]
20755#[repr(C)]
20756pub struct WireFileWriteAtResponse {
20757 pub actual_count: ::fidl_next::WireU64,
20758}
20759
20760unsafe impl ::fidl_next::Wire for WireFileWriteAtResponse {
20761 type Decoded<'de> = WireFileWriteAtResponse;
20762
20763 #[inline]
20764 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20765}
20766
20767unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtResponse
20768where
20769 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20770{
20771 fn decode(
20772 slot: ::fidl_next::Slot<'_, Self>,
20773 decoder: &mut ___D,
20774 ) -> Result<(), ::fidl_next::DecodeError> {
20775 ::fidl_next::munge! {
20776 let Self {
20777 mut actual_count,
20778
20779 } = slot;
20780 }
20781
20782 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
20783
20784 Ok(())
20785 }
20786}
20787
20788#[derive(Clone, Debug)]
20789#[repr(C)]
20790pub struct FileResizeRequest {
20791 pub length: u64,
20792}
20793
20794impl ::fidl_next::Encodable for FileResizeRequest {
20795 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileResizeRequest> = unsafe {
20796 ::fidl_next::CopyOptimization::enable_if(
20797 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20798 )
20799 };
20800
20801 type Encoded = WireFileResizeRequest;
20802}
20803
20804unsafe impl<___E> ::fidl_next::Encode<___E> for FileResizeRequest
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 ) -> Result<(), ::fidl_next::EncodeError> {
20814 ::fidl_next::munge! {
20815 let Self::Encoded {
20816 length,
20817
20818 } = out;
20819 }
20820
20821 ::fidl_next::Encode::encode(self.length, encoder, length)?;
20822
20823 Ok(())
20824 }
20825}
20826
20827unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileResizeRequest
20828where
20829 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20830{
20831 #[inline]
20832 fn encode_ref(
20833 &self,
20834 encoder: &mut ___E,
20835 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20836 ) -> Result<(), ::fidl_next::EncodeError> {
20837 ::fidl_next::munge! {
20838 let Self::Encoded {
20839 length,
20840
20841 } = out;
20842 }
20843
20844 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder, length)?;
20845
20846 Ok(())
20847 }
20848}
20849
20850impl ::fidl_next::EncodableOption for FileResizeRequest {
20851 type EncodedOption = ::fidl_next::WireBox<'static, WireFileResizeRequest>;
20852}
20853
20854unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileResizeRequest
20855where
20856 ___E: ::fidl_next::Encoder + ?Sized,
20857 FileResizeRequest: ::fidl_next::Encode<___E>,
20858{
20859 #[inline]
20860 fn encode_option(
20861 this: Option<Self>,
20862 encoder: &mut ___E,
20863 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20864 ) -> Result<(), ::fidl_next::EncodeError> {
20865 if let Some(inner) = this {
20866 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20867 ::fidl_next::WireBox::encode_present(out);
20868 } else {
20869 ::fidl_next::WireBox::encode_absent(out);
20870 }
20871
20872 Ok(())
20873 }
20874}
20875
20876unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileResizeRequest
20877where
20878 ___E: ::fidl_next::Encoder + ?Sized,
20879 FileResizeRequest: ::fidl_next::EncodeRef<___E>,
20880{
20881 #[inline]
20882 fn encode_option_ref(
20883 this: Option<&Self>,
20884 encoder: &mut ___E,
20885 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20886 ) -> Result<(), ::fidl_next::EncodeError> {
20887 if let Some(inner) = this {
20888 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20889 ::fidl_next::WireBox::encode_present(out);
20890 } else {
20891 ::fidl_next::WireBox::encode_absent(out);
20892 }
20893
20894 Ok(())
20895 }
20896}
20897
20898impl ::fidl_next::FromWire<WireFileResizeRequest> for FileResizeRequest {
20899 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileResizeRequest, Self> = unsafe {
20900 ::fidl_next::CopyOptimization::enable_if(
20901 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20902 .is_enabled(),
20903 )
20904 };
20905
20906 #[inline]
20907 fn from_wire(wire: WireFileResizeRequest) -> Self {
20908 Self { length: ::fidl_next::FromWire::from_wire(wire.length) }
20909 }
20910}
20911
20912impl ::fidl_next::FromWireRef<WireFileResizeRequest> for FileResizeRequest {
20913 #[inline]
20914 fn from_wire_ref(wire: &WireFileResizeRequest) -> Self {
20915 Self { length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length) }
20916 }
20917}
20918
20919#[derive(Clone, Debug)]
20921#[repr(C)]
20922pub struct WireFileResizeRequest {
20923 pub length: ::fidl_next::WireU64,
20924}
20925
20926unsafe impl ::fidl_next::Wire for WireFileResizeRequest {
20927 type Decoded<'de> = WireFileResizeRequest;
20928
20929 #[inline]
20930 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20931}
20932
20933unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileResizeRequest
20934where
20935 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20936{
20937 fn decode(
20938 slot: ::fidl_next::Slot<'_, Self>,
20939 decoder: &mut ___D,
20940 ) -> Result<(), ::fidl_next::DecodeError> {
20941 ::fidl_next::munge! {
20942 let Self {
20943 mut length,
20944
20945 } = slot;
20946 }
20947
20948 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
20949
20950 Ok(())
20951 }
20952}
20953
20954pub type FileResizeResponse = ();
20955
20956pub type WireFileResizeResponse = ();
20958
20959::fidl_next::bitflags! {
20960 #[derive(
20961 Clone,
20962 Copy,
20963 Debug,
20964 PartialEq,
20965 Eq,
20966 Hash,
20967 )]
20968 pub struct VmoFlags: u32 {
20969 #[doc = " Requests that the VMO be readable.\n"]const READ = 1;
20970 #[doc = " Requests that the VMO be writable.\n"]const WRITE = 2;
20971 #[doc = " Request that the VMO be executable.\n"]const EXECUTE = 4;
20972 #[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;
20973 #[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;
20974
20975 }
20976}
20977
20978impl ::fidl_next::Encodable for VmoFlags {
20979 type Encoded = WireVmoFlags;
20980}
20981
20982unsafe impl<___E> ::fidl_next::Encode<___E> for VmoFlags
20983where
20984 ___E: ?Sized,
20985{
20986 #[inline]
20987 fn encode(
20988 self,
20989 encoder: &mut ___E,
20990 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20991 ) -> Result<(), ::fidl_next::EncodeError> {
20992 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
20993 }
20994}
20995
20996unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VmoFlags
20997where
20998 ___E: ?Sized,
20999{
21000 #[inline]
21001 fn encode_ref(
21002 &self,
21003 _: &mut ___E,
21004 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21005 ) -> Result<(), ::fidl_next::EncodeError> {
21006 ::fidl_next::munge!(let WireVmoFlags { value } = out);
21007 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
21008 Ok(())
21009 }
21010}
21011
21012impl ::core::convert::From<WireVmoFlags> for VmoFlags {
21013 fn from(wire: WireVmoFlags) -> Self {
21014 Self::from_bits_retain(u32::from(wire.value))
21015 }
21016}
21017
21018impl ::fidl_next::FromWire<WireVmoFlags> for VmoFlags {
21019 #[inline]
21020 fn from_wire(wire: WireVmoFlags) -> Self {
21021 Self::from(wire)
21022 }
21023}
21024
21025impl ::fidl_next::FromWireRef<WireVmoFlags> for VmoFlags {
21026 #[inline]
21027 fn from_wire_ref(wire: &WireVmoFlags) -> Self {
21028 Self::from(*wire)
21029 }
21030}
21031
21032#[derive(Clone, Copy, Debug)]
21034#[repr(transparent)]
21035pub struct WireVmoFlags {
21036 value: ::fidl_next::WireU32,
21037}
21038
21039unsafe impl ::fidl_next::Wire for WireVmoFlags {
21040 type Decoded<'de> = Self;
21041
21042 #[inline]
21043 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21044 }
21046}
21047
21048unsafe impl<___D> ::fidl_next::Decode<___D> for WireVmoFlags
21049where
21050 ___D: ?Sized,
21051{
21052 fn decode(
21053 slot: ::fidl_next::Slot<'_, Self>,
21054 _: &mut ___D,
21055 ) -> Result<(), ::fidl_next::DecodeError> {
21056 ::fidl_next::munge!(let Self { value } = slot);
21057 let set = u32::from(*value);
21058 if set & !VmoFlags::all().bits() != 0 {
21059 return Err(::fidl_next::DecodeError::InvalidBits {
21060 expected: VmoFlags::all().bits() as usize,
21061 actual: set as usize,
21062 });
21063 }
21064
21065 Ok(())
21066 }
21067}
21068
21069impl ::core::convert::From<VmoFlags> for WireVmoFlags {
21070 fn from(natural: VmoFlags) -> Self {
21071 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
21072 }
21073}
21074
21075#[derive(Clone, Debug)]
21076#[repr(C)]
21077pub struct FileGetBackingMemoryRequest {
21078 pub flags: crate::VmoFlags,
21079}
21080
21081impl ::fidl_next::Encodable for FileGetBackingMemoryRequest {
21082 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryRequest> = unsafe {
21083 ::fidl_next::CopyOptimization::enable_if(
21084 true && <crate::VmoFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21085 )
21086 };
21087
21088 type Encoded = WireFileGetBackingMemoryRequest;
21089}
21090
21091unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryRequest
21092where
21093 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21094{
21095 #[inline]
21096 fn encode(
21097 self,
21098 encoder: &mut ___E,
21099 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21100 ) -> Result<(), ::fidl_next::EncodeError> {
21101 ::fidl_next::munge! {
21102 let Self::Encoded {
21103 flags,
21104
21105 } = out;
21106 }
21107
21108 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
21109
21110 Ok(())
21111 }
21112}
21113
21114unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileGetBackingMemoryRequest
21115where
21116 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21117{
21118 #[inline]
21119 fn encode_ref(
21120 &self,
21121 encoder: &mut ___E,
21122 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21123 ) -> Result<(), ::fidl_next::EncodeError> {
21124 ::fidl_next::munge! {
21125 let Self::Encoded {
21126 flags,
21127
21128 } = out;
21129 }
21130
21131 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
21132
21133 Ok(())
21134 }
21135}
21136
21137impl ::fidl_next::EncodableOption for FileGetBackingMemoryRequest {
21138 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryRequest>;
21139}
21140
21141unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryRequest
21142where
21143 ___E: ::fidl_next::Encoder + ?Sized,
21144 FileGetBackingMemoryRequest: ::fidl_next::Encode<___E>,
21145{
21146 #[inline]
21147 fn encode_option(
21148 this: Option<Self>,
21149 encoder: &mut ___E,
21150 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21151 ) -> Result<(), ::fidl_next::EncodeError> {
21152 if let Some(inner) = this {
21153 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21154 ::fidl_next::WireBox::encode_present(out);
21155 } else {
21156 ::fidl_next::WireBox::encode_absent(out);
21157 }
21158
21159 Ok(())
21160 }
21161}
21162
21163unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileGetBackingMemoryRequest
21164where
21165 ___E: ::fidl_next::Encoder + ?Sized,
21166 FileGetBackingMemoryRequest: ::fidl_next::EncodeRef<___E>,
21167{
21168 #[inline]
21169 fn encode_option_ref(
21170 this: Option<&Self>,
21171 encoder: &mut ___E,
21172 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21173 ) -> Result<(), ::fidl_next::EncodeError> {
21174 if let Some(inner) = this {
21175 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21176 ::fidl_next::WireBox::encode_present(out);
21177 } else {
21178 ::fidl_next::WireBox::encode_absent(out);
21179 }
21180
21181 Ok(())
21182 }
21183}
21184
21185impl ::fidl_next::FromWire<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
21186 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryRequest, Self> = unsafe {
21187 ::fidl_next::CopyOptimization::enable_if(
21188 true
21189
21190 && <
21191 crate::VmoFlags as ::fidl_next::FromWire<crate::WireVmoFlags>
21192 >::COPY_OPTIMIZATION.is_enabled()
21193
21194 )
21195 };
21196
21197 #[inline]
21198 fn from_wire(wire: WireFileGetBackingMemoryRequest) -> Self {
21199 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
21200 }
21201}
21202
21203impl ::fidl_next::FromWireRef<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
21204 #[inline]
21205 fn from_wire_ref(wire: &WireFileGetBackingMemoryRequest) -> Self {
21206 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
21207 }
21208}
21209
21210#[derive(Clone, Debug)]
21212#[repr(C)]
21213pub struct WireFileGetBackingMemoryRequest {
21214 pub flags: crate::WireVmoFlags,
21215}
21216
21217unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryRequest {
21218 type Decoded<'de> = WireFileGetBackingMemoryRequest;
21219
21220 #[inline]
21221 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21222}
21223
21224unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryRequest
21225where
21226 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21227{
21228 fn decode(
21229 slot: ::fidl_next::Slot<'_, Self>,
21230 decoder: &mut ___D,
21231 ) -> Result<(), ::fidl_next::DecodeError> {
21232 ::fidl_next::munge! {
21233 let Self {
21234 mut flags,
21235
21236 } = slot;
21237 }
21238
21239 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
21240
21241 Ok(())
21242 }
21243}
21244
21245#[derive(Debug)]
21246#[repr(C)]
21247pub struct FileGetBackingMemoryResponse {
21248 pub vmo: ::fidl_next::fuchsia::zx::Handle,
21249}
21250
21251impl ::fidl_next::Encodable for FileGetBackingMemoryResponse {
21252 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryResponse> = unsafe {
21253 ::fidl_next::CopyOptimization::enable_if(
21254 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
21255 .is_enabled(),
21256 )
21257 };
21258
21259 type Encoded = WireFileGetBackingMemoryResponse;
21260}
21261
21262unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryResponse
21263where
21264 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21265
21266 ___E: ::fidl_next::fuchsia::HandleEncoder,
21267{
21268 #[inline]
21269 fn encode(
21270 self,
21271 encoder: &mut ___E,
21272 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21273 ) -> Result<(), ::fidl_next::EncodeError> {
21274 ::fidl_next::munge! {
21275 let Self::Encoded {
21276 vmo,
21277
21278 } = out;
21279 }
21280
21281 ::fidl_next::Encode::encode(self.vmo, encoder, vmo)?;
21282
21283 Ok(())
21284 }
21285}
21286
21287impl ::fidl_next::EncodableOption for FileGetBackingMemoryResponse {
21288 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryResponse>;
21289}
21290
21291unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryResponse
21292where
21293 ___E: ::fidl_next::Encoder + ?Sized,
21294 FileGetBackingMemoryResponse: ::fidl_next::Encode<___E>,
21295{
21296 #[inline]
21297 fn encode_option(
21298 this: Option<Self>,
21299 encoder: &mut ___E,
21300 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21301 ) -> Result<(), ::fidl_next::EncodeError> {
21302 if let Some(inner) = this {
21303 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21304 ::fidl_next::WireBox::encode_present(out);
21305 } else {
21306 ::fidl_next::WireBox::encode_absent(out);
21307 }
21308
21309 Ok(())
21310 }
21311}
21312
21313impl ::fidl_next::FromWire<WireFileGetBackingMemoryResponse> for FileGetBackingMemoryResponse {
21314 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryResponse, Self> = unsafe {
21315 ::fidl_next::CopyOptimization::enable_if(
21316 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
21317 ::fidl_next::fuchsia::WireHandle,
21318 >>::COPY_OPTIMIZATION
21319 .is_enabled(),
21320 )
21321 };
21322
21323 #[inline]
21324 fn from_wire(wire: WireFileGetBackingMemoryResponse) -> Self {
21325 Self { vmo: ::fidl_next::FromWire::from_wire(wire.vmo) }
21326 }
21327}
21328
21329#[derive(Debug)]
21331#[repr(C)]
21332pub struct WireFileGetBackingMemoryResponse {
21333 pub vmo: ::fidl_next::fuchsia::WireHandle,
21334}
21335
21336unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryResponse {
21337 type Decoded<'de> = WireFileGetBackingMemoryResponse;
21338
21339 #[inline]
21340 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21341}
21342
21343unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryResponse
21344where
21345 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21346
21347 ___D: ::fidl_next::fuchsia::HandleDecoder,
21348{
21349 fn decode(
21350 slot: ::fidl_next::Slot<'_, Self>,
21351 decoder: &mut ___D,
21352 ) -> Result<(), ::fidl_next::DecodeError> {
21353 ::fidl_next::munge! {
21354 let Self {
21355 mut vmo,
21356
21357 } = slot;
21358 }
21359
21360 ::fidl_next::Decode::decode(vmo.as_mut(), decoder)?;
21361
21362 Ok(())
21363 }
21364}
21365
21366#[derive(Debug)]
21367pub struct LinkableLinkIntoRequest {
21368 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
21369
21370 pub dst: String,
21371}
21372
21373impl ::fidl_next::Encodable for LinkableLinkIntoRequest {
21374 type Encoded = WireLinkableLinkIntoRequest<'static>;
21375}
21376
21377unsafe impl<___E> ::fidl_next::Encode<___E> for LinkableLinkIntoRequest
21378where
21379 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21380
21381 ___E: ::fidl_next::Encoder,
21382
21383 ___E: ::fidl_next::fuchsia::HandleEncoder,
21384{
21385 #[inline]
21386 fn encode(
21387 self,
21388 encoder: &mut ___E,
21389 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21390 ) -> Result<(), ::fidl_next::EncodeError> {
21391 ::fidl_next::munge! {
21392 let Self::Encoded {
21393 dst_parent_token,
21394 dst,
21395
21396 } = out;
21397 }
21398
21399 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
21400
21401 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
21402
21403 Ok(())
21404 }
21405}
21406
21407impl ::fidl_next::EncodableOption for LinkableLinkIntoRequest {
21408 type EncodedOption = ::fidl_next::WireBox<'static, WireLinkableLinkIntoRequest<'static>>;
21409}
21410
21411unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LinkableLinkIntoRequest
21412where
21413 ___E: ::fidl_next::Encoder + ?Sized,
21414 LinkableLinkIntoRequest: ::fidl_next::Encode<___E>,
21415{
21416 #[inline]
21417 fn encode_option(
21418 this: Option<Self>,
21419 encoder: &mut ___E,
21420 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21421 ) -> Result<(), ::fidl_next::EncodeError> {
21422 if let Some(inner) = this {
21423 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21424 ::fidl_next::WireBox::encode_present(out);
21425 } else {
21426 ::fidl_next::WireBox::encode_absent(out);
21427 }
21428
21429 Ok(())
21430 }
21431}
21432
21433impl<'de> ::fidl_next::FromWire<WireLinkableLinkIntoRequest<'de>> for LinkableLinkIntoRequest {
21434 #[inline]
21435 fn from_wire(wire: WireLinkableLinkIntoRequest<'de>) -> Self {
21436 Self {
21437 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
21438
21439 dst: ::fidl_next::FromWire::from_wire(wire.dst),
21440 }
21441 }
21442}
21443
21444#[derive(Debug)]
21446#[repr(C)]
21447pub struct WireLinkableLinkIntoRequest<'de> {
21448 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
21449
21450 pub dst: ::fidl_next::WireString<'de>,
21451}
21452
21453unsafe impl ::fidl_next::Wire for WireLinkableLinkIntoRequest<'static> {
21454 type Decoded<'de> = WireLinkableLinkIntoRequest<'de>;
21455
21456 #[inline]
21457 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21458 unsafe {
21459 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
21460 }
21461 }
21462}
21463
21464unsafe impl<___D> ::fidl_next::Decode<___D> for WireLinkableLinkIntoRequest<'static>
21465where
21466 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21467
21468 ___D: ::fidl_next::Decoder,
21469
21470 ___D: ::fidl_next::fuchsia::HandleDecoder,
21471{
21472 fn decode(
21473 slot: ::fidl_next::Slot<'_, Self>,
21474 decoder: &mut ___D,
21475 ) -> Result<(), ::fidl_next::DecodeError> {
21476 ::fidl_next::munge! {
21477 let Self {
21478 mut dst_parent_token,
21479 mut dst,
21480
21481 } = slot;
21482 }
21483
21484 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
21485
21486 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
21487
21488 let dst = unsafe { dst.deref_unchecked() };
21489
21490 if dst.len() > 255 {
21491 return Err(::fidl_next::DecodeError::VectorTooLong {
21492 size: dst.len() as u64,
21493 limit: 255,
21494 });
21495 }
21496
21497 Ok(())
21498 }
21499}
21500
21501pub type LinkableLinkIntoResponse = ();
21502
21503pub type WireLinkableLinkIntoResponse = ();
21505
21506#[derive(Debug)]
21508pub struct Linkable;
21509
21510pub mod linkable {
21511 pub mod prelude {
21512 pub use crate::{linkable, Linkable, LinkableClientHandler, LinkableServerHandler};
21513
21514 pub use crate::LinkableLinkIntoRequest;
21515
21516 pub use crate::LinkableLinkIntoResponse;
21517 }
21518
21519 pub struct LinkInto;
21520
21521 impl ::fidl_next::Method for LinkInto {
21522 const ORDINAL: u64 = 6121399674497678964;
21523
21524 type Protocol = crate::Linkable;
21525
21526 type Request = crate::WireLinkableLinkIntoRequest<'static>;
21527
21528 type Response = ::fidl_next::WireResult<
21529 'static,
21530 crate::WireLinkableLinkIntoResponse,
21531 ::fidl_next::WireI32,
21532 >;
21533 }
21534
21535 mod ___detail {
21536
21537 pub struct LinkInto<T0, T1> {
21538 dst_parent_token: T0,
21539
21540 dst: T1,
21541 }
21542
21543 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
21544 where
21545 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
21546
21547 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
21548 {
21549 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
21550 }
21551
21552 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
21553 where
21554 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21555
21556 ___E: ::fidl_next::Encoder,
21557
21558 ___E: ::fidl_next::fuchsia::HandleEncoder,
21559
21560 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
21561
21562 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
21563 {
21564 #[inline]
21565 fn encode(
21566 self,
21567 encoder: &mut ___E,
21568 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21569 ) -> Result<(), ::fidl_next::EncodeError> {
21570 ::fidl_next::munge! {
21571 let Self::Encoded {
21572 dst_parent_token,
21573 dst,
21574
21575 } = out;
21576 }
21577
21578 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
21579
21580 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
21581
21582 Ok(())
21583 }
21584 }
21585
21586 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Linkable
21587 where
21588 ___T: ::fidl_next::Transport,
21589 {
21590 type ClientSender = LinkableClientSender<___T>;
21591 type ServerSender = LinkableServerSender<___T>;
21592 }
21593
21594 pub struct LinkableClientSender<___T: ::fidl_next::Transport> {
21596 #[allow(dead_code)]
21597 sender: ::fidl_next::protocol::ClientSender<___T>,
21598 }
21599
21600 impl<___T> LinkableClientSender<___T>
21601 where
21602 ___T: ::fidl_next::Transport,
21603 {
21604 #[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"]
21605 pub fn link_into(
21606 &self,
21607
21608 dst_parent_token: impl ::fidl_next::Encode<
21609 <___T as ::fidl_next::Transport>::SendBuffer,
21610 Encoded = ::fidl_next::fuchsia::WireHandle,
21611 >,
21612
21613 dst: impl ::fidl_next::Encode<
21614 <___T as ::fidl_next::Transport>::SendBuffer,
21615 Encoded = ::fidl_next::WireString<'static>,
21616 >,
21617 ) -> Result<
21618 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
21619 ::fidl_next::EncodeError,
21620 >
21621 where
21622 <___T as ::fidl_next::Transport>::SendBuffer:
21623 ::fidl_next::encoder::InternalHandleEncoder,
21624
21625 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
21626
21627 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
21628 {
21629 self.link_into_with(LinkInto { dst_parent_token, dst })
21630 }
21631
21632 #[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"]
21633 pub fn link_into_with<___R>(
21634 &self,
21635 request: ___R,
21636 ) -> Result<
21637 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
21638 ::fidl_next::EncodeError,
21639 >
21640 where
21641 ___R: ::fidl_next::Encode<
21642 <___T as ::fidl_next::Transport>::SendBuffer,
21643 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
21644 >,
21645 {
21646 self.sender
21647 .send_two_way(6121399674497678964, request)
21648 .map(::fidl_next::ResponseFuture::from_untyped)
21649 }
21650 }
21651
21652 #[repr(transparent)]
21654 pub struct LinkableServerSender<___T: ::fidl_next::Transport> {
21655 sender: ::fidl_next::protocol::ServerSender<___T>,
21656 }
21657
21658 impl<___T> LinkableServerSender<___T> where ___T: ::fidl_next::Transport {}
21659 }
21660}
21661
21662pub trait LinkableClientHandler<___T: ::fidl_next::Transport> {}
21666
21667impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Linkable
21668where
21669 ___H: LinkableClientHandler<___T> + Send,
21670 ___T: ::fidl_next::Transport,
21671
21672 <linkable::LinkInto as ::fidl_next::Method>::Response:
21673 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
21674{
21675 async fn on_event(
21676 handler: &mut ___H,
21677 sender: &::fidl_next::ClientSender<Self, ___T>,
21678 ordinal: u64,
21679 buffer: ___T::RecvBuffer,
21680 ) {
21681 match ordinal {
21682 ordinal => {
21683 sender.close();
21684 }
21685 }
21686 }
21687}
21688
21689pub trait LinkableServerHandler<___T: ::fidl_next::Transport> {
21693 #[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"]
21694 fn link_into(
21695 &mut self,
21696 sender: &::fidl_next::ServerSender<Linkable, ___T>,
21697
21698 request: ::fidl_next::Request<linkable::LinkInto, ___T>,
21699
21700 responder: ::fidl_next::Responder<linkable::LinkInto>,
21701 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
21702}
21703
21704impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Linkable
21705where
21706 ___H: LinkableServerHandler<___T> + Send,
21707 ___T: ::fidl_next::Transport,
21708
21709 <linkable::LinkInto as ::fidl_next::Method>::Request:
21710 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
21711{
21712 async fn on_one_way(
21713 handler: &mut ___H,
21714 sender: &::fidl_next::ServerSender<Self, ___T>,
21715 ordinal: u64,
21716 buffer: ___T::RecvBuffer,
21717 ) {
21718 match ordinal {
21719 ordinal => {
21720 sender.close();
21721 }
21722 }
21723 }
21724
21725 async fn on_two_way(
21726 handler: &mut ___H,
21727 sender: &::fidl_next::ServerSender<Self, ___T>,
21728 ordinal: u64,
21729 buffer: ___T::RecvBuffer,
21730 responder: ::fidl_next::protocol::Responder,
21731 ) {
21732 match ordinal {
21733 6121399674497678964 => {
21734 let responder = ::fidl_next::Responder::from_untyped(responder);
21735
21736 match ::fidl_next::DecoderExt::decode(buffer) {
21737 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
21738 Err(e) => {
21739 sender.close();
21740 }
21741 }
21742 }
21743
21744 ordinal => {
21745 sender.close();
21746 }
21747 }
21748 }
21749}
21750
21751#[derive(Debug)]
21752pub struct FileAllocateRequest {
21753 pub offset: u64,
21754
21755 pub length: u64,
21756
21757 pub mode: crate::AllocateMode,
21758}
21759
21760impl ::fidl_next::Encodable for FileAllocateRequest {
21761 type Encoded = WireFileAllocateRequest;
21762}
21763
21764unsafe impl<___E> ::fidl_next::Encode<___E> for FileAllocateRequest
21765where
21766 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21767
21768 ___E: ::fidl_next::fuchsia::HandleEncoder,
21769{
21770 #[inline]
21771 fn encode(
21772 self,
21773 encoder: &mut ___E,
21774 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21775 ) -> Result<(), ::fidl_next::EncodeError> {
21776 ::fidl_next::munge! {
21777 let Self::Encoded {
21778 offset,
21779 length,
21780 mode,
21781
21782 } = out;
21783 }
21784
21785 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
21786
21787 ::fidl_next::Encode::encode(self.length, encoder, length)?;
21788
21789 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
21790
21791 Ok(())
21792 }
21793}
21794
21795impl ::fidl_next::EncodableOption for FileAllocateRequest {
21796 type EncodedOption = ::fidl_next::WireBox<'static, WireFileAllocateRequest>;
21797}
21798
21799unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileAllocateRequest
21800where
21801 ___E: ::fidl_next::Encoder + ?Sized,
21802 FileAllocateRequest: ::fidl_next::Encode<___E>,
21803{
21804 #[inline]
21805 fn encode_option(
21806 this: Option<Self>,
21807 encoder: &mut ___E,
21808 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21809 ) -> Result<(), ::fidl_next::EncodeError> {
21810 if let Some(inner) = this {
21811 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21812 ::fidl_next::WireBox::encode_present(out);
21813 } else {
21814 ::fidl_next::WireBox::encode_absent(out);
21815 }
21816
21817 Ok(())
21818 }
21819}
21820
21821impl ::fidl_next::FromWire<WireFileAllocateRequest> for FileAllocateRequest {
21822 #[inline]
21823 fn from_wire(wire: WireFileAllocateRequest) -> Self {
21824 Self {
21825 offset: ::fidl_next::FromWire::from_wire(wire.offset),
21826
21827 length: ::fidl_next::FromWire::from_wire(wire.length),
21828
21829 mode: ::fidl_next::FromWire::from_wire(wire.mode),
21830 }
21831 }
21832}
21833
21834#[derive(Debug)]
21836#[repr(C)]
21837pub struct WireFileAllocateRequest {
21838 pub offset: ::fidl_next::WireU64,
21839
21840 pub length: ::fidl_next::WireU64,
21841
21842 pub mode: crate::WireAllocateMode,
21843}
21844
21845unsafe impl ::fidl_next::Wire for WireFileAllocateRequest {
21846 type Decoded<'de> = WireFileAllocateRequest;
21847
21848 #[inline]
21849 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21850 unsafe {
21851 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
21852 }
21853 }
21854}
21855
21856unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileAllocateRequest
21857where
21858 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21859
21860 ___D: ::fidl_next::fuchsia::HandleDecoder,
21861{
21862 fn decode(
21863 slot: ::fidl_next::Slot<'_, Self>,
21864 decoder: &mut ___D,
21865 ) -> Result<(), ::fidl_next::DecodeError> {
21866 ::fidl_next::munge! {
21867 let Self {
21868 mut offset,
21869 mut length,
21870 mut mode,
21871
21872 } = slot;
21873 }
21874
21875 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
21876
21877 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
21878
21879 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
21880
21881 Ok(())
21882 }
21883}
21884
21885pub type FileAllocateResponse = ();
21886
21887pub type WireFileAllocateResponse = ();
21889
21890#[derive(Debug)]
21891pub struct FileEnableVerityRequest {
21892 pub options: crate::VerificationOptions,
21893}
21894
21895impl ::fidl_next::Encodable for FileEnableVerityRequest {
21896 type Encoded = WireFileEnableVerityRequest<'static>;
21897}
21898
21899unsafe impl<___E> ::fidl_next::Encode<___E> for FileEnableVerityRequest
21900where
21901 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21902
21903 ___E: ::fidl_next::Encoder,
21904
21905 ___E: ::fidl_next::fuchsia::HandleEncoder,
21906{
21907 #[inline]
21908 fn encode(
21909 self,
21910 encoder: &mut ___E,
21911 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21912 ) -> Result<(), ::fidl_next::EncodeError> {
21913 ::fidl_next::munge! {
21914 let Self::Encoded {
21915 options,
21916
21917 } = out;
21918 }
21919
21920 ::fidl_next::Encode::encode(self.options, encoder, options)?;
21921
21922 Ok(())
21923 }
21924}
21925
21926impl ::fidl_next::EncodableOption for FileEnableVerityRequest {
21927 type EncodedOption = ::fidl_next::WireBox<'static, WireFileEnableVerityRequest<'static>>;
21928}
21929
21930unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileEnableVerityRequest
21931where
21932 ___E: ::fidl_next::Encoder + ?Sized,
21933 FileEnableVerityRequest: ::fidl_next::Encode<___E>,
21934{
21935 #[inline]
21936 fn encode_option(
21937 this: Option<Self>,
21938 encoder: &mut ___E,
21939 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21940 ) -> Result<(), ::fidl_next::EncodeError> {
21941 if let Some(inner) = this {
21942 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21943 ::fidl_next::WireBox::encode_present(out);
21944 } else {
21945 ::fidl_next::WireBox::encode_absent(out);
21946 }
21947
21948 Ok(())
21949 }
21950}
21951
21952impl<'de> ::fidl_next::FromWire<WireFileEnableVerityRequest<'de>> for FileEnableVerityRequest {
21953 #[inline]
21954 fn from_wire(wire: WireFileEnableVerityRequest<'de>) -> Self {
21955 Self { options: ::fidl_next::FromWire::from_wire(wire.options) }
21956 }
21957}
21958
21959#[derive(Debug)]
21961#[repr(C)]
21962pub struct WireFileEnableVerityRequest<'de> {
21963 pub options: crate::WireVerificationOptions<'de>,
21964}
21965
21966unsafe impl ::fidl_next::Wire for WireFileEnableVerityRequest<'static> {
21967 type Decoded<'de> = WireFileEnableVerityRequest<'de>;
21968
21969 #[inline]
21970 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21971}
21972
21973unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileEnableVerityRequest<'static>
21974where
21975 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21976
21977 ___D: ::fidl_next::Decoder,
21978
21979 ___D: ::fidl_next::fuchsia::HandleDecoder,
21980{
21981 fn decode(
21982 slot: ::fidl_next::Slot<'_, Self>,
21983 decoder: &mut ___D,
21984 ) -> Result<(), ::fidl_next::DecodeError> {
21985 ::fidl_next::munge! {
21986 let Self {
21987 mut options,
21988
21989 } = slot;
21990 }
21991
21992 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
21993
21994 Ok(())
21995 }
21996}
21997
21998pub type FileEnableVerityResponse = ();
21999
22000pub type WireFileEnableVerityResponse = ();
22002
22003#[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"]
22005#[derive(Debug)]
22006pub struct File;
22007
22008impl ::fidl_next::Discoverable for File {
22009 const PROTOCOL_NAME: &'static str = "fuchsia.io.File";
22010}
22011
22012pub mod file {
22013 pub mod prelude {
22014 pub use crate::{file, File, FileClientHandler, FileServerHandler};
22015
22016 pub use crate::AdvisoryLockingAdvisoryLockRequest;
22017
22018 pub use crate::AdvisoryLockingAdvisoryLockResponse;
22019
22020 pub use crate::ExtendedAttributeValue;
22021
22022 pub use crate::FileAllocateRequest;
22023
22024 pub use crate::FileEnableVerityRequest;
22025
22026 pub use crate::FileGetBackingMemoryRequest;
22027
22028 pub use crate::FileInfo;
22029
22030 pub use crate::FileReadAtRequest;
22031
22032 pub use crate::FileResizeRequest;
22033
22034 pub use crate::FileSeekRequest;
22035
22036 pub use crate::FileWriteAtRequest;
22037
22038 pub use crate::FileAllocateResponse;
22039
22040 pub use crate::FileEnableVerityResponse;
22041
22042 pub use crate::FileGetBackingMemoryResponse;
22043
22044 pub use crate::FileReadAtResponse;
22045
22046 pub use crate::FileResizeResponse;
22047
22048 pub use crate::FileSeekResponse;
22049
22050 pub use crate::FileWriteAtResponse;
22051
22052 pub use crate::LinkableLinkIntoRequest;
22053
22054 pub use crate::LinkableLinkIntoResponse;
22055
22056 pub use crate::MutableNodeAttributes;
22057
22058 pub use crate::NodeAttributes2;
22059
22060 pub use crate::NodeDeprecatedCloneRequest;
22061
22062 pub use crate::NodeDeprecatedGetAttrResponse;
22063
22064 pub use crate::NodeDeprecatedGetFlagsResponse;
22065
22066 pub use crate::NodeDeprecatedSetAttrRequest;
22067
22068 pub use crate::NodeDeprecatedSetAttrResponse;
22069
22070 pub use crate::NodeDeprecatedSetFlagsRequest;
22071
22072 pub use crate::NodeDeprecatedSetFlagsResponse;
22073
22074 pub use crate::NodeGetAttributesRequest;
22075
22076 pub use crate::NodeGetExtendedAttributeRequest;
22077
22078 pub use crate::NodeListExtendedAttributesRequest;
22079
22080 pub use crate::NodeOnOpenRequest;
22081
22082 pub use crate::NodeQueryFilesystemResponse;
22083
22084 pub use crate::NodeRemoveExtendedAttributeRequest;
22085
22086 pub use crate::NodeSetExtendedAttributeRequest;
22087
22088 pub use crate::NodeSetFlagsRequest;
22089
22090 pub use crate::NodeGetFlagsResponse;
22091
22092 pub use crate::NodeRemoveExtendedAttributeResponse;
22093
22094 pub use crate::NodeSetExtendedAttributeResponse;
22095
22096 pub use crate::NodeSetFlagsResponse;
22097
22098 pub use crate::NodeSyncResponse;
22099
22100 pub use crate::NodeUpdateAttributesResponse;
22101
22102 pub use crate::ReadableReadRequest;
22103
22104 pub use crate::ReadableReadResponse;
22105
22106 pub use crate::Representation;
22107
22108 pub use crate::WritableWriteRequest;
22109
22110 pub use crate::WritableWriteResponse;
22111
22112 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
22113
22114 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
22115
22116 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
22117 }
22118
22119 pub struct AdvisoryLock;
22120
22121 impl ::fidl_next::Method for AdvisoryLock {
22122 const ORDINAL: u64 = 7992130864415541162;
22123
22124 type Protocol = crate::File;
22125
22126 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
22127
22128 type Response = ::fidl_next::WireResult<
22129 'static,
22130 crate::WireAdvisoryLockingAdvisoryLockResponse,
22131 ::fidl_next::WireI32,
22132 >;
22133 }
22134
22135 pub struct LinkInto;
22136
22137 impl ::fidl_next::Method for LinkInto {
22138 const ORDINAL: u64 = 6121399674497678964;
22139
22140 type Protocol = crate::File;
22141
22142 type Request = crate::WireLinkableLinkIntoRequest<'static>;
22143
22144 type Response = ::fidl_next::WireResult<
22145 'static,
22146 crate::WireLinkableLinkIntoResponse,
22147 ::fidl_next::WireI32,
22148 >;
22149 }
22150
22151 pub struct Clone;
22152
22153 impl ::fidl_next::Method for Clone {
22154 const ORDINAL: u64 = 2366825959783828089;
22155
22156 type Protocol = crate::File;
22157
22158 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
22159
22160 type Response = ::fidl_next::Never;
22161 }
22162
22163 pub struct Close;
22164
22165 impl ::fidl_next::Method for Close {
22166 const ORDINAL: u64 = 6540867515453498750;
22167
22168 type Protocol = crate::File;
22169
22170 type Request = ();
22171
22172 type Response = ::fidl_next::WireResult<
22173 'static,
22174 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
22175 ::fidl_next::WireI32,
22176 >;
22177 }
22178
22179 pub struct Query;
22180
22181 impl ::fidl_next::Method for Query {
22182 const ORDINAL: u64 = 2763219980499352582;
22183
22184 type Protocol = crate::File;
22185
22186 type Request = ();
22187
22188 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
22189 }
22190
22191 pub struct DeprecatedClone;
22192
22193 impl ::fidl_next::Method for DeprecatedClone {
22194 const ORDINAL: u64 = 6512600400724287855;
22195
22196 type Protocol = crate::File;
22197
22198 type Request = crate::WireNodeDeprecatedCloneRequest;
22199
22200 type Response = ::fidl_next::Never;
22201 }
22202
22203 pub struct OnOpen;
22204
22205 impl ::fidl_next::Method for OnOpen {
22206 const ORDINAL: u64 = 9207534335756671346;
22207
22208 type Protocol = crate::File;
22209
22210 type Request = ::fidl_next::Never;
22211
22212 type Response = crate::WireNodeOnOpenRequest<'static>;
22213 }
22214
22215 pub struct DeprecatedGetAttr;
22216
22217 impl ::fidl_next::Method for DeprecatedGetAttr {
22218 const ORDINAL: u64 = 8689798978500614909;
22219
22220 type Protocol = crate::File;
22221
22222 type Request = ();
22223
22224 type Response = crate::WireNodeDeprecatedGetAttrResponse;
22225 }
22226
22227 pub struct DeprecatedSetAttr;
22228
22229 impl ::fidl_next::Method for DeprecatedSetAttr {
22230 const ORDINAL: u64 = 4721673413776871238;
22231
22232 type Protocol = crate::File;
22233
22234 type Request = crate::WireNodeDeprecatedSetAttrRequest;
22235
22236 type Response = crate::WireNodeDeprecatedSetAttrResponse;
22237 }
22238
22239 pub struct DeprecatedGetFlags;
22240
22241 impl ::fidl_next::Method for DeprecatedGetFlags {
22242 const ORDINAL: u64 = 6595803110182632097;
22243
22244 type Protocol = crate::File;
22245
22246 type Request = ();
22247
22248 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
22249 }
22250
22251 pub struct DeprecatedSetFlags;
22252
22253 impl ::fidl_next::Method for DeprecatedSetFlags {
22254 const ORDINAL: u64 = 5950864159036794675;
22255
22256 type Protocol = crate::File;
22257
22258 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
22259
22260 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
22261 }
22262
22263 pub struct GetFlags;
22264
22265 impl ::fidl_next::Method for GetFlags {
22266 const ORDINAL: u64 = 105530239381466147;
22267
22268 type Protocol = crate::File;
22269
22270 type Request = ();
22271
22272 type Response = ::fidl_next::WireFlexibleResult<
22273 'static,
22274 crate::WireNodeGetFlagsResponse,
22275 ::fidl_next::WireI32,
22276 >;
22277 }
22278
22279 pub struct SetFlags;
22280
22281 impl ::fidl_next::Method for SetFlags {
22282 const ORDINAL: u64 = 6172186066099445416;
22283
22284 type Protocol = crate::File;
22285
22286 type Request = crate::WireNodeSetFlagsRequest;
22287
22288 type Response = ::fidl_next::WireFlexibleResult<
22289 'static,
22290 crate::WireNodeSetFlagsResponse,
22291 ::fidl_next::WireI32,
22292 >;
22293 }
22294
22295 pub struct QueryFilesystem;
22296
22297 impl ::fidl_next::Method for QueryFilesystem {
22298 const ORDINAL: u64 = 8013111122914313744;
22299
22300 type Protocol = crate::File;
22301
22302 type Request = ();
22303
22304 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
22305 }
22306
22307 pub struct OnRepresentation;
22308
22309 impl ::fidl_next::Method for OnRepresentation {
22310 const ORDINAL: u64 = 6679970090861613324;
22311
22312 type Protocol = crate::File;
22313
22314 type Request = ::fidl_next::Never;
22315
22316 type Response = crate::WireRepresentation<'static>;
22317 }
22318
22319 pub struct GetAttributes;
22320
22321 impl ::fidl_next::Method for GetAttributes {
22322 const ORDINAL: u64 = 4414537700416816443;
22323
22324 type Protocol = crate::File;
22325
22326 type Request = crate::WireNodeGetAttributesRequest;
22327
22328 type Response = ::fidl_next::WireResult<
22329 'static,
22330 crate::WireNodeAttributes2<'static>,
22331 ::fidl_next::WireI32,
22332 >;
22333 }
22334
22335 pub struct UpdateAttributes;
22336
22337 impl ::fidl_next::Method for UpdateAttributes {
22338 const ORDINAL: u64 = 3677402239314018056;
22339
22340 type Protocol = crate::File;
22341
22342 type Request = crate::WireMutableNodeAttributes<'static>;
22343
22344 type Response = ::fidl_next::WireResult<
22345 'static,
22346 crate::WireNodeUpdateAttributesResponse,
22347 ::fidl_next::WireI32,
22348 >;
22349 }
22350
22351 pub struct Sync;
22352
22353 impl ::fidl_next::Method for Sync {
22354 const ORDINAL: u64 = 3196473584242777161;
22355
22356 type Protocol = crate::File;
22357
22358 type Request = ();
22359
22360 type Response =
22361 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
22362 }
22363
22364 pub struct ListExtendedAttributes;
22365
22366 impl ::fidl_next::Method for ListExtendedAttributes {
22367 const ORDINAL: u64 = 5431626189872037072;
22368
22369 type Protocol = crate::File;
22370
22371 type Request = crate::WireNodeListExtendedAttributesRequest;
22372
22373 type Response = ::fidl_next::Never;
22374 }
22375
22376 pub struct GetExtendedAttribute;
22377
22378 impl ::fidl_next::Method for GetExtendedAttribute {
22379 const ORDINAL: u64 = 5043930208506967771;
22380
22381 type Protocol = crate::File;
22382
22383 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
22384
22385 type Response = ::fidl_next::WireResult<
22386 'static,
22387 crate::WireExtendedAttributeValue<'static>,
22388 ::fidl_next::WireI32,
22389 >;
22390 }
22391
22392 pub struct SetExtendedAttribute;
22393
22394 impl ::fidl_next::Method for SetExtendedAttribute {
22395 const ORDINAL: u64 = 5374223046099989052;
22396
22397 type Protocol = crate::File;
22398
22399 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
22400
22401 type Response = ::fidl_next::WireResult<
22402 'static,
22403 crate::WireNodeSetExtendedAttributeResponse,
22404 ::fidl_next::WireI32,
22405 >;
22406 }
22407
22408 pub struct RemoveExtendedAttribute;
22409
22410 impl ::fidl_next::Method for RemoveExtendedAttribute {
22411 const ORDINAL: u64 = 8794297771444732717;
22412
22413 type Protocol = crate::File;
22414
22415 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
22416
22417 type Response = ::fidl_next::WireResult<
22418 'static,
22419 crate::WireNodeRemoveExtendedAttributeResponse,
22420 ::fidl_next::WireI32,
22421 >;
22422 }
22423
22424 pub struct Read;
22425
22426 impl ::fidl_next::Method for Read {
22427 const ORDINAL: u64 = 395825947633028830;
22428
22429 type Protocol = crate::File;
22430
22431 type Request = crate::WireReadableReadRequest;
22432
22433 type Response = ::fidl_next::WireResult<
22434 'static,
22435 crate::WireReadableReadResponse<'static>,
22436 ::fidl_next::WireI32,
22437 >;
22438 }
22439
22440 pub struct Write;
22441
22442 impl ::fidl_next::Method for Write {
22443 const ORDINAL: u64 = 7651971425397809026;
22444
22445 type Protocol = crate::File;
22446
22447 type Request = crate::WireWritableWriteRequest<'static>;
22448
22449 type Response = ::fidl_next::WireResult<
22450 'static,
22451 crate::WireWritableWriteResponse,
22452 ::fidl_next::WireI32,
22453 >;
22454 }
22455
22456 pub struct Describe;
22457
22458 impl ::fidl_next::Method for Describe {
22459 const ORDINAL: u64 = 7545125870053689020;
22460
22461 type Protocol = crate::File;
22462
22463 type Request = ();
22464
22465 type Response = crate::WireFileInfo<'static>;
22466 }
22467
22468 pub struct Seek;
22469
22470 impl ::fidl_next::Method for Seek {
22471 const ORDINAL: u64 = 8649041485622956551;
22472
22473 type Protocol = crate::File;
22474
22475 type Request = crate::WireFileSeekRequest;
22476
22477 type Response =
22478 ::fidl_next::WireResult<'static, crate::WireFileSeekResponse, ::fidl_next::WireI32>;
22479 }
22480
22481 pub struct ReadAt;
22482
22483 impl ::fidl_next::Method for ReadAt {
22484 const ORDINAL: u64 = 1587416148701180478;
22485
22486 type Protocol = crate::File;
22487
22488 type Request = crate::WireFileReadAtRequest;
22489
22490 type Response = ::fidl_next::WireResult<
22491 'static,
22492 crate::WireFileReadAtResponse<'static>,
22493 ::fidl_next::WireI32,
22494 >;
22495 }
22496
22497 pub struct WriteAt;
22498
22499 impl ::fidl_next::Method for WriteAt {
22500 const ORDINAL: u64 = 8736683935131400491;
22501
22502 type Protocol = crate::File;
22503
22504 type Request = crate::WireFileWriteAtRequest<'static>;
22505
22506 type Response =
22507 ::fidl_next::WireResult<'static, crate::WireFileWriteAtResponse, ::fidl_next::WireI32>;
22508 }
22509
22510 pub struct Resize;
22511
22512 impl ::fidl_next::Method for Resize {
22513 const ORDINAL: u64 = 3134648685270758458;
22514
22515 type Protocol = crate::File;
22516
22517 type Request = crate::WireFileResizeRequest;
22518
22519 type Response =
22520 ::fidl_next::WireResult<'static, crate::WireFileResizeResponse, ::fidl_next::WireI32>;
22521 }
22522
22523 pub struct GetBackingMemory;
22524
22525 impl ::fidl_next::Method for GetBackingMemory {
22526 const ORDINAL: u64 = 46911652864194091;
22527
22528 type Protocol = crate::File;
22529
22530 type Request = crate::WireFileGetBackingMemoryRequest;
22531
22532 type Response = ::fidl_next::WireResult<
22533 'static,
22534 crate::WireFileGetBackingMemoryResponse,
22535 ::fidl_next::WireI32,
22536 >;
22537 }
22538
22539 pub struct Allocate;
22540
22541 impl ::fidl_next::Method for Allocate {
22542 const ORDINAL: u64 = 8645235848064269614;
22543
22544 type Protocol = crate::File;
22545
22546 type Request = crate::WireFileAllocateRequest;
22547
22548 type Response = ::fidl_next::WireFlexibleResult<
22549 'static,
22550 crate::WireFileAllocateResponse,
22551 ::fidl_next::WireI32,
22552 >;
22553 }
22554
22555 pub struct EnableVerity;
22556
22557 impl ::fidl_next::Method for EnableVerity {
22558 const ORDINAL: u64 = 3189145313204943035;
22559
22560 type Protocol = crate::File;
22561
22562 type Request = crate::WireFileEnableVerityRequest<'static>;
22563
22564 type Response = ::fidl_next::WireFlexibleResult<
22565 'static,
22566 crate::WireFileEnableVerityResponse,
22567 ::fidl_next::WireI32,
22568 >;
22569 }
22570
22571 mod ___detail {
22572
22573 pub struct AdvisoryLock<T0> {
22574 request: T0,
22575 }
22576
22577 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
22578 where
22579 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
22580 {
22581 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
22582 }
22583
22584 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
22585 where
22586 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22587
22588 ___E: ::fidl_next::Encoder,
22589
22590 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
22591 {
22592 #[inline]
22593 fn encode(
22594 self,
22595 encoder: &mut ___E,
22596 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22597 ) -> Result<(), ::fidl_next::EncodeError> {
22598 ::fidl_next::munge! {
22599 let Self::Encoded {
22600 request,
22601
22602 } = out;
22603 }
22604
22605 ::fidl_next::Encode::encode(self.request, encoder, request)?;
22606
22607 Ok(())
22608 }
22609 }
22610
22611 pub struct LinkInto<T0, T1> {
22612 dst_parent_token: T0,
22613
22614 dst: T1,
22615 }
22616
22617 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
22618 where
22619 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
22620
22621 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
22622 {
22623 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
22624 }
22625
22626 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
22627 where
22628 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22629
22630 ___E: ::fidl_next::Encoder,
22631
22632 ___E: ::fidl_next::fuchsia::HandleEncoder,
22633
22634 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
22635
22636 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
22637 {
22638 #[inline]
22639 fn encode(
22640 self,
22641 encoder: &mut ___E,
22642 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22643 ) -> Result<(), ::fidl_next::EncodeError> {
22644 ::fidl_next::munge! {
22645 let Self::Encoded {
22646 dst_parent_token,
22647 dst,
22648
22649 } = out;
22650 }
22651
22652 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
22653
22654 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
22655
22656 Ok(())
22657 }
22658 }
22659
22660 pub struct Clone<T0> {
22661 request: T0,
22662 }
22663
22664 impl<T0> ::fidl_next::Encodable for Clone<T0>
22665 where
22666 T0: ::fidl_next::Encodable<
22667 Encoded = ::fidl_next::ServerEnd<
22668 ::fidl_next_fuchsia_unknown::Cloneable,
22669 ::fidl_next::fuchsia::WireChannel,
22670 >,
22671 >,
22672 {
22673 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
22674 }
22675
22676 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
22677 where
22678 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22679
22680 ___E: ::fidl_next::fuchsia::HandleEncoder,
22681
22682 T0: ::fidl_next::Encode<
22683 ___E,
22684 Encoded = ::fidl_next::ServerEnd<
22685 ::fidl_next_fuchsia_unknown::Cloneable,
22686 ::fidl_next::fuchsia::WireChannel,
22687 >,
22688 >,
22689 {
22690 #[inline]
22691 fn encode(
22692 self,
22693 encoder: &mut ___E,
22694 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22695 ) -> Result<(), ::fidl_next::EncodeError> {
22696 ::fidl_next::munge! {
22697 let Self::Encoded {
22698 request,
22699
22700 } = out;
22701 }
22702
22703 ::fidl_next::Encode::encode(self.request, encoder, request)?;
22704
22705 Ok(())
22706 }
22707 }
22708
22709 pub struct DeprecatedClone<T0, T1> {
22710 flags: T0,
22711
22712 object: T1,
22713 }
22714
22715 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
22716 where
22717 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
22718
22719 T1: ::fidl_next::Encodable<
22720 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
22721 >,
22722 {
22723 type Encoded = crate::WireNodeDeprecatedCloneRequest;
22724 }
22725
22726 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
22727 where
22728 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22729
22730 ___E: ::fidl_next::fuchsia::HandleEncoder,
22731
22732 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
22733
22734 T1: ::fidl_next::Encode<
22735 ___E,
22736 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
22737 >,
22738 {
22739 #[inline]
22740 fn encode(
22741 self,
22742 encoder: &mut ___E,
22743 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22744 ) -> Result<(), ::fidl_next::EncodeError> {
22745 ::fidl_next::munge! {
22746 let Self::Encoded {
22747 flags,
22748 object,
22749
22750 } = out;
22751 }
22752
22753 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22754
22755 ::fidl_next::Encode::encode(self.object, encoder, object)?;
22756
22757 Ok(())
22758 }
22759 }
22760
22761 pub struct OnOpen<T0, T1> {
22762 s: T0,
22763
22764 info: T1,
22765 }
22766
22767 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
22768 where
22769 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
22770
22771 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
22772 {
22773 type Encoded = crate::WireNodeOnOpenRequest<'static>;
22774 }
22775
22776 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
22777 where
22778 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22779
22780 ___E: ::fidl_next::Encoder,
22781
22782 ___E: ::fidl_next::fuchsia::HandleEncoder,
22783
22784 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
22785
22786 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
22787 {
22788 #[inline]
22789 fn encode(
22790 self,
22791 encoder: &mut ___E,
22792 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22793 ) -> Result<(), ::fidl_next::EncodeError> {
22794 ::fidl_next::munge! {
22795 let Self::Encoded {
22796 s,
22797 info,
22798
22799 } = out;
22800 }
22801
22802 ::fidl_next::Encode::encode(self.s, encoder, s)?;
22803
22804 ::fidl_next::Encode::encode(self.info, encoder, info)?;
22805
22806 Ok(())
22807 }
22808 }
22809
22810 pub struct DeprecatedSetAttr<T0, T1> {
22811 flags: T0,
22812
22813 attributes: T1,
22814 }
22815
22816 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
22817 where
22818 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
22819
22820 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
22821 {
22822 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
22823 }
22824
22825 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
22826 where
22827 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22828
22829 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
22830
22831 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
22832 {
22833 #[inline]
22834 fn encode(
22835 self,
22836 encoder: &mut ___E,
22837 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22838 ) -> Result<(), ::fidl_next::EncodeError> {
22839 ::fidl_next::munge! {
22840 let Self::Encoded {
22841 flags,
22842 attributes,
22843
22844 } = out;
22845 }
22846
22847 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22848
22849 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
22850
22851 Ok(())
22852 }
22853 }
22854
22855 pub struct DeprecatedSetFlags<T0> {
22856 flags: T0,
22857 }
22858
22859 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
22860 where
22861 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
22862 {
22863 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
22864 }
22865
22866 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
22867 where
22868 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22869
22870 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
22871 {
22872 #[inline]
22873 fn encode(
22874 self,
22875 encoder: &mut ___E,
22876 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22877 ) -> Result<(), ::fidl_next::EncodeError> {
22878 ::fidl_next::munge! {
22879 let Self::Encoded {
22880 flags,
22881
22882 } = out;
22883 }
22884
22885 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22886
22887 Ok(())
22888 }
22889 }
22890
22891 pub struct SetFlags<T0> {
22892 flags: T0,
22893 }
22894
22895 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
22896 where
22897 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
22898 {
22899 type Encoded = crate::WireNodeSetFlagsRequest;
22900 }
22901
22902 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
22903 where
22904 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22905
22906 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
22907 {
22908 #[inline]
22909 fn encode(
22910 self,
22911 encoder: &mut ___E,
22912 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22913 ) -> Result<(), ::fidl_next::EncodeError> {
22914 ::fidl_next::munge! {
22915 let Self::Encoded {
22916 flags,
22917
22918 } = out;
22919 }
22920
22921 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22922
22923 Ok(())
22924 }
22925 }
22926
22927 pub struct GetAttributes<T0> {
22928 query: T0,
22929 }
22930
22931 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
22932 where
22933 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
22934 {
22935 type Encoded = crate::WireNodeGetAttributesRequest;
22936 }
22937
22938 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
22939 where
22940 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22941
22942 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
22943 {
22944 #[inline]
22945 fn encode(
22946 self,
22947 encoder: &mut ___E,
22948 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22949 ) -> Result<(), ::fidl_next::EncodeError> {
22950 ::fidl_next::munge! {
22951 let Self::Encoded {
22952 query,
22953
22954 } = out;
22955 }
22956
22957 ::fidl_next::Encode::encode(self.query, encoder, query)?;
22958
22959 Ok(())
22960 }
22961 }
22962
22963 pub struct ListExtendedAttributes<T0> {
22964 iterator: T0,
22965 }
22966
22967 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
22968 where
22969 T0: ::fidl_next::Encodable<
22970 Encoded = ::fidl_next::ServerEnd<
22971 crate::ExtendedAttributeIterator,
22972 ::fidl_next::fuchsia::WireChannel,
22973 >,
22974 >,
22975 {
22976 type Encoded = crate::WireNodeListExtendedAttributesRequest;
22977 }
22978
22979 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
22980 where
22981 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22982
22983 ___E: ::fidl_next::fuchsia::HandleEncoder,
22984
22985 T0: ::fidl_next::Encode<
22986 ___E,
22987 Encoded = ::fidl_next::ServerEnd<
22988 crate::ExtendedAttributeIterator,
22989 ::fidl_next::fuchsia::WireChannel,
22990 >,
22991 >,
22992 {
22993 #[inline]
22994 fn encode(
22995 self,
22996 encoder: &mut ___E,
22997 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22998 ) -> Result<(), ::fidl_next::EncodeError> {
22999 ::fidl_next::munge! {
23000 let Self::Encoded {
23001 iterator,
23002
23003 } = out;
23004 }
23005
23006 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
23007
23008 Ok(())
23009 }
23010 }
23011
23012 pub struct GetExtendedAttribute<T0> {
23013 name: T0,
23014 }
23015
23016 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
23017 where
23018 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
23019 {
23020 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
23021 }
23022
23023 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
23024 where
23025 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23026
23027 ___E: ::fidl_next::Encoder,
23028
23029 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
23030 {
23031 #[inline]
23032 fn encode(
23033 self,
23034 encoder: &mut ___E,
23035 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23036 ) -> Result<(), ::fidl_next::EncodeError> {
23037 ::fidl_next::munge! {
23038 let Self::Encoded {
23039 name,
23040
23041 } = out;
23042 }
23043
23044 ::fidl_next::Encode::encode(self.name, encoder, name)?;
23045
23046 Ok(())
23047 }
23048 }
23049
23050 pub struct SetExtendedAttribute<T0, T1, T2> {
23051 name: T0,
23052
23053 value: T1,
23054
23055 mode: T2,
23056 }
23057
23058 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
23059 where
23060 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
23061
23062 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
23063
23064 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
23065 {
23066 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
23067 }
23068
23069 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
23070 where
23071 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23072
23073 ___E: ::fidl_next::Encoder,
23074
23075 ___E: ::fidl_next::fuchsia::HandleEncoder,
23076
23077 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
23078
23079 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
23080
23081 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
23082 {
23083 #[inline]
23084 fn encode(
23085 self,
23086 encoder: &mut ___E,
23087 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23088 ) -> Result<(), ::fidl_next::EncodeError> {
23089 ::fidl_next::munge! {
23090 let Self::Encoded {
23091 name,
23092 value,
23093 mode,
23094
23095 } = out;
23096 }
23097
23098 ::fidl_next::Encode::encode(self.name, encoder, name)?;
23099
23100 ::fidl_next::Encode::encode(self.value, encoder, value)?;
23101
23102 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
23103
23104 Ok(())
23105 }
23106 }
23107
23108 pub struct RemoveExtendedAttribute<T0> {
23109 name: T0,
23110 }
23111
23112 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
23113 where
23114 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
23115 {
23116 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
23117 }
23118
23119 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
23120 where
23121 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23122
23123 ___E: ::fidl_next::Encoder,
23124
23125 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
23126 {
23127 #[inline]
23128 fn encode(
23129 self,
23130 encoder: &mut ___E,
23131 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23132 ) -> Result<(), ::fidl_next::EncodeError> {
23133 ::fidl_next::munge! {
23134 let Self::Encoded {
23135 name,
23136
23137 } = out;
23138 }
23139
23140 ::fidl_next::Encode::encode(self.name, encoder, name)?;
23141
23142 Ok(())
23143 }
23144 }
23145
23146 pub struct Read<T0> {
23147 count: T0,
23148 }
23149
23150 impl<T0> ::fidl_next::Encodable for Read<T0>
23151 where
23152 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23153 {
23154 type Encoded = crate::WireReadableReadRequest;
23155 }
23156
23157 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
23158 where
23159 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23160
23161 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23162 {
23163 #[inline]
23164 fn encode(
23165 self,
23166 encoder: &mut ___E,
23167 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23168 ) -> Result<(), ::fidl_next::EncodeError> {
23169 ::fidl_next::munge! {
23170 let Self::Encoded {
23171 count,
23172
23173 } = out;
23174 }
23175
23176 ::fidl_next::Encode::encode(self.count, encoder, count)?;
23177
23178 Ok(())
23179 }
23180 }
23181
23182 pub struct Write<T0> {
23183 data: T0,
23184 }
23185
23186 impl<T0> ::fidl_next::Encodable for Write<T0>
23187 where
23188 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
23189 {
23190 type Encoded = crate::WireWritableWriteRequest<'static>;
23191 }
23192
23193 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
23194 where
23195 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23196
23197 ___E: ::fidl_next::Encoder,
23198
23199 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
23200 {
23201 #[inline]
23202 fn encode(
23203 self,
23204 encoder: &mut ___E,
23205 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23206 ) -> Result<(), ::fidl_next::EncodeError> {
23207 ::fidl_next::munge! {
23208 let Self::Encoded {
23209 data,
23210
23211 } = out;
23212 }
23213
23214 ::fidl_next::Encode::encode(self.data, encoder, data)?;
23215
23216 Ok(())
23217 }
23218 }
23219
23220 pub struct Seek<T0, T1> {
23221 origin: T0,
23222
23223 offset: T1,
23224 }
23225
23226 impl<T0, T1> ::fidl_next::Encodable for Seek<T0, T1>
23227 where
23228 T0: ::fidl_next::Encodable<Encoded = crate::WireSeekOrigin>,
23229
23230 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI64>,
23231 {
23232 type Encoded = crate::WireFileSeekRequest;
23233 }
23234
23235 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Seek<T0, T1>
23236 where
23237 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23238
23239 T0: ::fidl_next::Encode<___E, Encoded = crate::WireSeekOrigin>,
23240
23241 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI64>,
23242 {
23243 #[inline]
23244 fn encode(
23245 self,
23246 encoder: &mut ___E,
23247 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23248 ) -> Result<(), ::fidl_next::EncodeError> {
23249 ::fidl_next::munge! {
23250 let Self::Encoded {
23251 origin,
23252 offset,
23253
23254 } = out;
23255 }
23256
23257 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
23258
23259 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
23260
23261 Ok(())
23262 }
23263 }
23264
23265 pub struct ReadAt<T0, T1> {
23266 count: T0,
23267
23268 offset: T1,
23269 }
23270
23271 impl<T0, T1> ::fidl_next::Encodable for ReadAt<T0, T1>
23272 where
23273 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23274
23275 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23276 {
23277 type Encoded = crate::WireFileReadAtRequest;
23278 }
23279
23280 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ReadAt<T0, T1>
23281 where
23282 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23283
23284 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23285
23286 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23287 {
23288 #[inline]
23289 fn encode(
23290 self,
23291 encoder: &mut ___E,
23292 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23293 ) -> Result<(), ::fidl_next::EncodeError> {
23294 ::fidl_next::munge! {
23295 let Self::Encoded {
23296 count,
23297 offset,
23298
23299 } = out;
23300 }
23301
23302 ::fidl_next::Encode::encode(self.count, encoder, count)?;
23303
23304 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
23305
23306 Ok(())
23307 }
23308 }
23309
23310 pub struct WriteAt<T0, T1> {
23311 data: T0,
23312
23313 offset: T1,
23314 }
23315
23316 impl<T0, T1> ::fidl_next::Encodable for WriteAt<T0, T1>
23317 where
23318 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
23319
23320 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23321 {
23322 type Encoded = crate::WireFileWriteAtRequest<'static>;
23323 }
23324
23325 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for WriteAt<T0, T1>
23326 where
23327 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23328
23329 ___E: ::fidl_next::Encoder,
23330
23331 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
23332
23333 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23334 {
23335 #[inline]
23336 fn encode(
23337 self,
23338 encoder: &mut ___E,
23339 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23340 ) -> Result<(), ::fidl_next::EncodeError> {
23341 ::fidl_next::munge! {
23342 let Self::Encoded {
23343 data,
23344 offset,
23345
23346 } = out;
23347 }
23348
23349 ::fidl_next::Encode::encode(self.data, encoder, data)?;
23350
23351 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
23352
23353 Ok(())
23354 }
23355 }
23356
23357 pub struct Resize<T0> {
23358 length: T0,
23359 }
23360
23361 impl<T0> ::fidl_next::Encodable for Resize<T0>
23362 where
23363 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23364 {
23365 type Encoded = crate::WireFileResizeRequest;
23366 }
23367
23368 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Resize<T0>
23369 where
23370 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23371
23372 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23373 {
23374 #[inline]
23375 fn encode(
23376 self,
23377 encoder: &mut ___E,
23378 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23379 ) -> Result<(), ::fidl_next::EncodeError> {
23380 ::fidl_next::munge! {
23381 let Self::Encoded {
23382 length,
23383
23384 } = out;
23385 }
23386
23387 ::fidl_next::Encode::encode(self.length, encoder, length)?;
23388
23389 Ok(())
23390 }
23391 }
23392
23393 pub struct GetBackingMemory<T0> {
23394 flags: T0,
23395 }
23396
23397 impl<T0> ::fidl_next::Encodable for GetBackingMemory<T0>
23398 where
23399 T0: ::fidl_next::Encodable<Encoded = crate::WireVmoFlags>,
23400 {
23401 type Encoded = crate::WireFileGetBackingMemoryRequest;
23402 }
23403
23404 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetBackingMemory<T0>
23405 where
23406 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23407
23408 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVmoFlags>,
23409 {
23410 #[inline]
23411 fn encode(
23412 self,
23413 encoder: &mut ___E,
23414 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23415 ) -> Result<(), ::fidl_next::EncodeError> {
23416 ::fidl_next::munge! {
23417 let Self::Encoded {
23418 flags,
23419
23420 } = out;
23421 }
23422
23423 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
23424
23425 Ok(())
23426 }
23427 }
23428
23429 pub struct Allocate<T0, T1, T2> {
23430 offset: T0,
23431
23432 length: T1,
23433
23434 mode: T2,
23435 }
23436
23437 impl<T0, T1, T2> ::fidl_next::Encodable for Allocate<T0, T1, T2>
23438 where
23439 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23440
23441 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
23442
23443 T2: ::fidl_next::Encodable<Encoded = crate::WireAllocateMode>,
23444 {
23445 type Encoded = crate::WireFileAllocateRequest;
23446 }
23447
23448 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Allocate<T0, T1, T2>
23449 where
23450 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23451
23452 ___E: ::fidl_next::fuchsia::HandleEncoder,
23453
23454 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23455
23456 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
23457
23458 T2: ::fidl_next::Encode<___E, Encoded = crate::WireAllocateMode>,
23459 {
23460 #[inline]
23461 fn encode(
23462 self,
23463 encoder: &mut ___E,
23464 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23465 ) -> Result<(), ::fidl_next::EncodeError> {
23466 ::fidl_next::munge! {
23467 let Self::Encoded {
23468 offset,
23469 length,
23470 mode,
23471
23472 } = out;
23473 }
23474
23475 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
23476
23477 ::fidl_next::Encode::encode(self.length, encoder, length)?;
23478
23479 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
23480
23481 Ok(())
23482 }
23483 }
23484
23485 pub struct EnableVerity<T0> {
23486 options: T0,
23487 }
23488
23489 impl<T0> ::fidl_next::Encodable for EnableVerity<T0>
23490 where
23491 T0: ::fidl_next::Encodable<Encoded = crate::WireVerificationOptions<'static>>,
23492 {
23493 type Encoded = crate::WireFileEnableVerityRequest<'static>;
23494 }
23495
23496 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for EnableVerity<T0>
23497 where
23498 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23499
23500 ___E: ::fidl_next::Encoder,
23501
23502 ___E: ::fidl_next::fuchsia::HandleEncoder,
23503
23504 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVerificationOptions<'static>>,
23505 {
23506 #[inline]
23507 fn encode(
23508 self,
23509 encoder: &mut ___E,
23510 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23511 ) -> Result<(), ::fidl_next::EncodeError> {
23512 ::fidl_next::munge! {
23513 let Self::Encoded {
23514 options,
23515
23516 } = out;
23517 }
23518
23519 ::fidl_next::Encode::encode(self.options, encoder, options)?;
23520
23521 Ok(())
23522 }
23523 }
23524
23525 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::File
23526 where
23527 ___T: ::fidl_next::Transport,
23528 {
23529 type ClientSender = FileClientSender<___T>;
23530 type ServerSender = FileServerSender<___T>;
23531 }
23532
23533 pub struct FileClientSender<___T: ::fidl_next::Transport> {
23535 #[allow(dead_code)]
23536 sender: ::fidl_next::protocol::ClientSender<___T>,
23537 }
23538
23539 impl<___T> FileClientSender<___T>
23540 where
23541 ___T: ::fidl_next::Transport,
23542 {
23543 #[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"]
23544 pub fn advisory_lock(
23545 &self,
23546
23547 request: impl ::fidl_next::Encode<
23548 <___T as ::fidl_next::Transport>::SendBuffer,
23549 Encoded = crate::WireAdvisoryLockRequest<'static>,
23550 >,
23551 ) -> Result<
23552 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
23553 ::fidl_next::EncodeError,
23554 >
23555 where
23556 <___T as ::fidl_next::Transport>::SendBuffer:
23557 ::fidl_next::encoder::InternalHandleEncoder,
23558
23559 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23560 {
23561 self.advisory_lock_with(AdvisoryLock { request })
23562 }
23563
23564 #[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"]
23565 pub fn advisory_lock_with<___R>(
23566 &self,
23567 request: ___R,
23568 ) -> Result<
23569 ::fidl_next::ResponseFuture<'_, super::AdvisoryLock, ___T>,
23570 ::fidl_next::EncodeError,
23571 >
23572 where
23573 ___R: ::fidl_next::Encode<
23574 <___T as ::fidl_next::Transport>::SendBuffer,
23575 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
23576 >,
23577 {
23578 self.sender
23579 .send_two_way(7992130864415541162, request)
23580 .map(::fidl_next::ResponseFuture::from_untyped)
23581 }
23582
23583 #[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"]
23584 pub fn link_into(
23585 &self,
23586
23587 dst_parent_token: impl ::fidl_next::Encode<
23588 <___T as ::fidl_next::Transport>::SendBuffer,
23589 Encoded = ::fidl_next::fuchsia::WireHandle,
23590 >,
23591
23592 dst: impl ::fidl_next::Encode<
23593 <___T as ::fidl_next::Transport>::SendBuffer,
23594 Encoded = ::fidl_next::WireString<'static>,
23595 >,
23596 ) -> Result<
23597 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
23598 ::fidl_next::EncodeError,
23599 >
23600 where
23601 <___T as ::fidl_next::Transport>::SendBuffer:
23602 ::fidl_next::encoder::InternalHandleEncoder,
23603
23604 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23605
23606 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23607 {
23608 self.link_into_with(LinkInto { dst_parent_token, dst })
23609 }
23610
23611 #[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"]
23612 pub fn link_into_with<___R>(
23613 &self,
23614 request: ___R,
23615 ) -> Result<
23616 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
23617 ::fidl_next::EncodeError,
23618 >
23619 where
23620 ___R: ::fidl_next::Encode<
23621 <___T as ::fidl_next::Transport>::SendBuffer,
23622 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
23623 >,
23624 {
23625 self.sender
23626 .send_two_way(6121399674497678964, request)
23627 .map(::fidl_next::ResponseFuture::from_untyped)
23628 }
23629
23630 pub fn clone(
23631 &self,
23632
23633 request: impl ::fidl_next::Encode<
23634 <___T as ::fidl_next::Transport>::SendBuffer,
23635 Encoded = ::fidl_next::ServerEnd<
23636 ::fidl_next_fuchsia_unknown::Cloneable,
23637 ::fidl_next::fuchsia::WireChannel,
23638 >,
23639 >,
23640 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23641 where
23642 <___T as ::fidl_next::Transport>::SendBuffer:
23643 ::fidl_next::encoder::InternalHandleEncoder,
23644
23645 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23646 {
23647 self.clone_with(Clone { request })
23648 }
23649
23650 pub fn clone_with<___R>(
23651 &self,
23652 request: ___R,
23653 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23654 where
23655 ___R: ::fidl_next::Encode<
23656 <___T as ::fidl_next::Transport>::SendBuffer,
23657 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
23658 >,
23659 {
23660 self.sender.send_one_way(2366825959783828089, request)
23661 }
23662
23663 #[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"]
23664 pub fn close(
23665 &self,
23666 ) -> Result<::fidl_next::ResponseFuture<'_, super::Close, ___T>, ::fidl_next::EncodeError>
23667 {
23668 self.sender
23669 .send_two_way(6540867515453498750, ())
23670 .map(::fidl_next::ResponseFuture::from_untyped)
23671 }
23672
23673 pub fn query(
23674 &self,
23675 ) -> Result<::fidl_next::ResponseFuture<'_, super::Query, ___T>, ::fidl_next::EncodeError>
23676 {
23677 self.sender
23678 .send_two_way(2763219980499352582, ())
23679 .map(::fidl_next::ResponseFuture::from_untyped)
23680 }
23681
23682 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23683 pub fn deprecated_clone(
23684 &self,
23685
23686 flags: impl ::fidl_next::Encode<
23687 <___T as ::fidl_next::Transport>::SendBuffer,
23688 Encoded = crate::WireOpenFlags,
23689 >,
23690
23691 object: impl ::fidl_next::Encode<
23692 <___T as ::fidl_next::Transport>::SendBuffer,
23693 Encoded = ::fidl_next::ServerEnd<
23694 crate::Node,
23695 ::fidl_next::fuchsia::WireChannel,
23696 >,
23697 >,
23698 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23699 where
23700 <___T as ::fidl_next::Transport>::SendBuffer:
23701 ::fidl_next::encoder::InternalHandleEncoder,
23702
23703 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23704 {
23705 self.deprecated_clone_with(DeprecatedClone { flags, object })
23706 }
23707
23708 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23709 pub fn deprecated_clone_with<___R>(
23710 &self,
23711 request: ___R,
23712 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23713 where
23714 ___R: ::fidl_next::Encode<
23715 <___T as ::fidl_next::Transport>::SendBuffer,
23716 Encoded = crate::WireNodeDeprecatedCloneRequest,
23717 >,
23718 {
23719 self.sender.send_one_way(6512600400724287855, request)
23720 }
23721
23722 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
23723 pub fn deprecated_get_attr(
23724 &self,
23725 ) -> Result<
23726 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetAttr, ___T>,
23727 ::fidl_next::EncodeError,
23728 > {
23729 self.sender
23730 .send_two_way(8689798978500614909, ())
23731 .map(::fidl_next::ResponseFuture::from_untyped)
23732 }
23733
23734 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
23735 pub fn deprecated_set_attr(
23736 &self,
23737
23738 flags: impl ::fidl_next::Encode<
23739 <___T as ::fidl_next::Transport>::SendBuffer,
23740 Encoded = crate::WireNodeAttributeFlags,
23741 >,
23742
23743 attributes: impl ::fidl_next::Encode<
23744 <___T as ::fidl_next::Transport>::SendBuffer,
23745 Encoded = crate::WireNodeAttributes,
23746 >,
23747 ) -> Result<
23748 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
23749 ::fidl_next::EncodeError,
23750 >
23751 where
23752 <___T as ::fidl_next::Transport>::SendBuffer:
23753 ::fidl_next::encoder::InternalHandleEncoder,
23754 {
23755 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
23756 }
23757
23758 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
23759 pub fn deprecated_set_attr_with<___R>(
23760 &self,
23761 request: ___R,
23762 ) -> Result<
23763 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
23764 ::fidl_next::EncodeError,
23765 >
23766 where
23767 ___R: ::fidl_next::Encode<
23768 <___T as ::fidl_next::Transport>::SendBuffer,
23769 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
23770 >,
23771 {
23772 self.sender
23773 .send_two_way(4721673413776871238, request)
23774 .map(::fidl_next::ResponseFuture::from_untyped)
23775 }
23776
23777 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
23778 pub fn deprecated_get_flags(
23779 &self,
23780 ) -> Result<
23781 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetFlags, ___T>,
23782 ::fidl_next::EncodeError,
23783 > {
23784 self.sender
23785 .send_two_way(6595803110182632097, ())
23786 .map(::fidl_next::ResponseFuture::from_untyped)
23787 }
23788
23789 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
23790 pub fn deprecated_set_flags(
23791 &self,
23792
23793 flags: impl ::fidl_next::Encode<
23794 <___T as ::fidl_next::Transport>::SendBuffer,
23795 Encoded = crate::WireOpenFlags,
23796 >,
23797 ) -> Result<
23798 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
23799 ::fidl_next::EncodeError,
23800 >
23801 where
23802 <___T as ::fidl_next::Transport>::SendBuffer:
23803 ::fidl_next::encoder::InternalHandleEncoder,
23804 {
23805 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
23806 }
23807
23808 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
23809 pub fn deprecated_set_flags_with<___R>(
23810 &self,
23811 request: ___R,
23812 ) -> Result<
23813 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
23814 ::fidl_next::EncodeError,
23815 >
23816 where
23817 ___R: ::fidl_next::Encode<
23818 <___T as ::fidl_next::Transport>::SendBuffer,
23819 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
23820 >,
23821 {
23822 self.sender
23823 .send_two_way(5950864159036794675, request)
23824 .map(::fidl_next::ResponseFuture::from_untyped)
23825 }
23826
23827 #[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"]
23828 pub fn get_flags(
23829 &self,
23830 ) -> Result<
23831 ::fidl_next::ResponseFuture<'_, super::GetFlags, ___T>,
23832 ::fidl_next::EncodeError,
23833 > {
23834 self.sender
23835 .send_two_way(105530239381466147, ())
23836 .map(::fidl_next::ResponseFuture::from_untyped)
23837 }
23838
23839 #[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"]
23840 pub fn set_flags(
23841 &self,
23842
23843 flags: impl ::fidl_next::Encode<
23844 <___T as ::fidl_next::Transport>::SendBuffer,
23845 Encoded = crate::WireFlags,
23846 >,
23847 ) -> Result<
23848 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
23849 ::fidl_next::EncodeError,
23850 >
23851 where
23852 <___T as ::fidl_next::Transport>::SendBuffer:
23853 ::fidl_next::encoder::InternalHandleEncoder,
23854 {
23855 self.set_flags_with(SetFlags { flags })
23856 }
23857
23858 #[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"]
23859 pub fn set_flags_with<___R>(
23860 &self,
23861 request: ___R,
23862 ) -> Result<
23863 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
23864 ::fidl_next::EncodeError,
23865 >
23866 where
23867 ___R: ::fidl_next::Encode<
23868 <___T as ::fidl_next::Transport>::SendBuffer,
23869 Encoded = crate::WireNodeSetFlagsRequest,
23870 >,
23871 {
23872 self.sender
23873 .send_two_way(6172186066099445416, request)
23874 .map(::fidl_next::ResponseFuture::from_untyped)
23875 }
23876
23877 #[doc = " Query the filesystem for filesystem-specific information.\n"]
23878 pub fn query_filesystem(
23879 &self,
23880 ) -> Result<
23881 ::fidl_next::ResponseFuture<'_, super::QueryFilesystem, ___T>,
23882 ::fidl_next::EncodeError,
23883 > {
23884 self.sender
23885 .send_two_way(8013111122914313744, ())
23886 .map(::fidl_next::ResponseFuture::from_untyped)
23887 }
23888
23889 #[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"]
23890 pub fn get_attributes(
23891 &self,
23892
23893 query: impl ::fidl_next::Encode<
23894 <___T as ::fidl_next::Transport>::SendBuffer,
23895 Encoded = crate::WireNodeAttributesQuery,
23896 >,
23897 ) -> Result<
23898 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
23899 ::fidl_next::EncodeError,
23900 >
23901 where
23902 <___T as ::fidl_next::Transport>::SendBuffer:
23903 ::fidl_next::encoder::InternalHandleEncoder,
23904 {
23905 self.get_attributes_with(GetAttributes { query })
23906 }
23907
23908 #[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"]
23909 pub fn get_attributes_with<___R>(
23910 &self,
23911 request: ___R,
23912 ) -> Result<
23913 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
23914 ::fidl_next::EncodeError,
23915 >
23916 where
23917 ___R: ::fidl_next::Encode<
23918 <___T as ::fidl_next::Transport>::SendBuffer,
23919 Encoded = crate::WireNodeGetAttributesRequest,
23920 >,
23921 {
23922 self.sender
23923 .send_two_way(4414537700416816443, request)
23924 .map(::fidl_next::ResponseFuture::from_untyped)
23925 }
23926
23927 #[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"]
23928 pub fn update_attributes_with<___R>(
23929 &self,
23930 request: ___R,
23931 ) -> Result<
23932 ::fidl_next::ResponseFuture<'_, super::UpdateAttributes, ___T>,
23933 ::fidl_next::EncodeError,
23934 >
23935 where
23936 ___R: ::fidl_next::Encode<
23937 <___T as ::fidl_next::Transport>::SendBuffer,
23938 Encoded = crate::WireMutableNodeAttributes<'static>,
23939 >,
23940 {
23941 self.sender
23942 .send_two_way(3677402239314018056, request)
23943 .map(::fidl_next::ResponseFuture::from_untyped)
23944 }
23945
23946 #[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"]
23947 pub fn sync(
23948 &self,
23949 ) -> Result<::fidl_next::ResponseFuture<'_, super::Sync, ___T>, ::fidl_next::EncodeError>
23950 {
23951 self.sender
23952 .send_two_way(3196473584242777161, ())
23953 .map(::fidl_next::ResponseFuture::from_untyped)
23954 }
23955
23956 #[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"]
23957 pub fn list_extended_attributes(
23958 &self,
23959
23960 iterator: impl ::fidl_next::Encode<
23961 <___T as ::fidl_next::Transport>::SendBuffer,
23962 Encoded = ::fidl_next::ServerEnd<
23963 crate::ExtendedAttributeIterator,
23964 ::fidl_next::fuchsia::WireChannel,
23965 >,
23966 >,
23967 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23968 where
23969 <___T as ::fidl_next::Transport>::SendBuffer:
23970 ::fidl_next::encoder::InternalHandleEncoder,
23971
23972 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23973 {
23974 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
23975 }
23976
23977 #[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"]
23978 pub fn list_extended_attributes_with<___R>(
23979 &self,
23980 request: ___R,
23981 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
23982 where
23983 ___R: ::fidl_next::Encode<
23984 <___T as ::fidl_next::Transport>::SendBuffer,
23985 Encoded = crate::WireNodeListExtendedAttributesRequest,
23986 >,
23987 {
23988 self.sender.send_one_way(5431626189872037072, request)
23989 }
23990
23991 #[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"]
23992 pub fn get_extended_attribute(
23993 &self,
23994
23995 name: impl ::fidl_next::Encode<
23996 <___T as ::fidl_next::Transport>::SendBuffer,
23997 Encoded = ::fidl_next::WireVector<'static, u8>,
23998 >,
23999 ) -> Result<
24000 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
24001 ::fidl_next::EncodeError,
24002 >
24003 where
24004 <___T as ::fidl_next::Transport>::SendBuffer:
24005 ::fidl_next::encoder::InternalHandleEncoder,
24006
24007 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24008 {
24009 self.get_extended_attribute_with(GetExtendedAttribute { name })
24010 }
24011
24012 #[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"]
24013 pub fn get_extended_attribute_with<___R>(
24014 &self,
24015 request: ___R,
24016 ) -> Result<
24017 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
24018 ::fidl_next::EncodeError,
24019 >
24020 where
24021 ___R: ::fidl_next::Encode<
24022 <___T as ::fidl_next::Transport>::SendBuffer,
24023 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
24024 >,
24025 {
24026 self.sender
24027 .send_two_way(5043930208506967771, request)
24028 .map(::fidl_next::ResponseFuture::from_untyped)
24029 }
24030
24031 #[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"]
24032 pub fn set_extended_attribute(
24033 &self,
24034
24035 name: impl ::fidl_next::Encode<
24036 <___T as ::fidl_next::Transport>::SendBuffer,
24037 Encoded = ::fidl_next::WireVector<'static, u8>,
24038 >,
24039
24040 value: impl ::fidl_next::Encode<
24041 <___T as ::fidl_next::Transport>::SendBuffer,
24042 Encoded = crate::WireExtendedAttributeValue<'static>,
24043 >,
24044
24045 mode: impl ::fidl_next::Encode<
24046 <___T as ::fidl_next::Transport>::SendBuffer,
24047 Encoded = crate::WireSetExtendedAttributeMode,
24048 >,
24049 ) -> Result<
24050 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
24051 ::fidl_next::EncodeError,
24052 >
24053 where
24054 <___T as ::fidl_next::Transport>::SendBuffer:
24055 ::fidl_next::encoder::InternalHandleEncoder,
24056
24057 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24058
24059 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24060 {
24061 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
24062 }
24063
24064 #[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"]
24065 pub fn set_extended_attribute_with<___R>(
24066 &self,
24067 request: ___R,
24068 ) -> Result<
24069 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
24070 ::fidl_next::EncodeError,
24071 >
24072 where
24073 ___R: ::fidl_next::Encode<
24074 <___T as ::fidl_next::Transport>::SendBuffer,
24075 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
24076 >,
24077 {
24078 self.sender
24079 .send_two_way(5374223046099989052, request)
24080 .map(::fidl_next::ResponseFuture::from_untyped)
24081 }
24082
24083 #[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"]
24084 pub fn remove_extended_attribute(
24085 &self,
24086
24087 name: impl ::fidl_next::Encode<
24088 <___T as ::fidl_next::Transport>::SendBuffer,
24089 Encoded = ::fidl_next::WireVector<'static, u8>,
24090 >,
24091 ) -> Result<
24092 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
24093 ::fidl_next::EncodeError,
24094 >
24095 where
24096 <___T as ::fidl_next::Transport>::SendBuffer:
24097 ::fidl_next::encoder::InternalHandleEncoder,
24098
24099 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24100 {
24101 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
24102 }
24103
24104 #[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"]
24105 pub fn remove_extended_attribute_with<___R>(
24106 &self,
24107 request: ___R,
24108 ) -> Result<
24109 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
24110 ::fidl_next::EncodeError,
24111 >
24112 where
24113 ___R: ::fidl_next::Encode<
24114 <___T as ::fidl_next::Transport>::SendBuffer,
24115 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
24116 >,
24117 {
24118 self.sender
24119 .send_two_way(8794297771444732717, request)
24120 .map(::fidl_next::ResponseFuture::from_untyped)
24121 }
24122
24123 #[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"]
24124 pub fn read(
24125 &self,
24126
24127 count: impl ::fidl_next::Encode<
24128 <___T as ::fidl_next::Transport>::SendBuffer,
24129 Encoded = ::fidl_next::WireU64,
24130 >,
24131 ) -> Result<::fidl_next::ResponseFuture<'_, super::Read, ___T>, ::fidl_next::EncodeError>
24132 where
24133 <___T as ::fidl_next::Transport>::SendBuffer:
24134 ::fidl_next::encoder::InternalHandleEncoder,
24135 {
24136 self.read_with(Read { count })
24137 }
24138
24139 #[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"]
24140 pub fn read_with<___R>(
24141 &self,
24142 request: ___R,
24143 ) -> Result<::fidl_next::ResponseFuture<'_, super::Read, ___T>, ::fidl_next::EncodeError>
24144 where
24145 ___R: ::fidl_next::Encode<
24146 <___T as ::fidl_next::Transport>::SendBuffer,
24147 Encoded = crate::WireReadableReadRequest,
24148 >,
24149 {
24150 self.sender
24151 .send_two_way(395825947633028830, request)
24152 .map(::fidl_next::ResponseFuture::from_untyped)
24153 }
24154
24155 #[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"]
24156 pub fn write(
24157 &self,
24158
24159 data: impl ::fidl_next::Encode<
24160 <___T as ::fidl_next::Transport>::SendBuffer,
24161 Encoded = ::fidl_next::WireVector<'static, u8>,
24162 >,
24163 ) -> Result<::fidl_next::ResponseFuture<'_, super::Write, ___T>, ::fidl_next::EncodeError>
24164 where
24165 <___T as ::fidl_next::Transport>::SendBuffer:
24166 ::fidl_next::encoder::InternalHandleEncoder,
24167
24168 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24169 {
24170 self.write_with(Write { data })
24171 }
24172
24173 #[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"]
24174 pub fn write_with<___R>(
24175 &self,
24176 request: ___R,
24177 ) -> Result<::fidl_next::ResponseFuture<'_, super::Write, ___T>, ::fidl_next::EncodeError>
24178 where
24179 ___R: ::fidl_next::Encode<
24180 <___T as ::fidl_next::Transport>::SendBuffer,
24181 Encoded = crate::WireWritableWriteRequest<'static>,
24182 >,
24183 {
24184 self.sender
24185 .send_two_way(7651971425397809026, request)
24186 .map(::fidl_next::ResponseFuture::from_untyped)
24187 }
24188
24189 pub fn describe(
24190 &self,
24191 ) -> Result<
24192 ::fidl_next::ResponseFuture<'_, super::Describe, ___T>,
24193 ::fidl_next::EncodeError,
24194 > {
24195 self.sender
24196 .send_two_way(7545125870053689020, ())
24197 .map(::fidl_next::ResponseFuture::from_untyped)
24198 }
24199
24200 #[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"]
24201 pub fn seek(
24202 &self,
24203
24204 origin: impl ::fidl_next::Encode<
24205 <___T as ::fidl_next::Transport>::SendBuffer,
24206 Encoded = crate::WireSeekOrigin,
24207 >,
24208
24209 offset: impl ::fidl_next::Encode<
24210 <___T as ::fidl_next::Transport>::SendBuffer,
24211 Encoded = ::fidl_next::WireI64,
24212 >,
24213 ) -> Result<::fidl_next::ResponseFuture<'_, super::Seek, ___T>, ::fidl_next::EncodeError>
24214 where
24215 <___T as ::fidl_next::Transport>::SendBuffer:
24216 ::fidl_next::encoder::InternalHandleEncoder,
24217 {
24218 self.seek_with(Seek { origin, offset })
24219 }
24220
24221 #[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"]
24222 pub fn seek_with<___R>(
24223 &self,
24224 request: ___R,
24225 ) -> Result<::fidl_next::ResponseFuture<'_, super::Seek, ___T>, ::fidl_next::EncodeError>
24226 where
24227 ___R: ::fidl_next::Encode<
24228 <___T as ::fidl_next::Transport>::SendBuffer,
24229 Encoded = crate::WireFileSeekRequest,
24230 >,
24231 {
24232 self.sender
24233 .send_two_way(8649041485622956551, request)
24234 .map(::fidl_next::ResponseFuture::from_untyped)
24235 }
24236
24237 #[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"]
24238 pub fn read_at(
24239 &self,
24240
24241 count: impl ::fidl_next::Encode<
24242 <___T as ::fidl_next::Transport>::SendBuffer,
24243 Encoded = ::fidl_next::WireU64,
24244 >,
24245
24246 offset: impl ::fidl_next::Encode<
24247 <___T as ::fidl_next::Transport>::SendBuffer,
24248 Encoded = ::fidl_next::WireU64,
24249 >,
24250 ) -> Result<
24251 ::fidl_next::ResponseFuture<'_, super::ReadAt, ___T>,
24252 ::fidl_next::EncodeError,
24253 >
24254 where
24255 <___T as ::fidl_next::Transport>::SendBuffer:
24256 ::fidl_next::encoder::InternalHandleEncoder,
24257 {
24258 self.read_at_with(ReadAt { count, offset })
24259 }
24260
24261 #[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"]
24262 pub fn read_at_with<___R>(
24263 &self,
24264 request: ___R,
24265 ) -> Result<
24266 ::fidl_next::ResponseFuture<'_, super::ReadAt, ___T>,
24267 ::fidl_next::EncodeError,
24268 >
24269 where
24270 ___R: ::fidl_next::Encode<
24271 <___T as ::fidl_next::Transport>::SendBuffer,
24272 Encoded = crate::WireFileReadAtRequest,
24273 >,
24274 {
24275 self.sender
24276 .send_two_way(1587416148701180478, request)
24277 .map(::fidl_next::ResponseFuture::from_untyped)
24278 }
24279
24280 #[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"]
24281 pub fn write_at(
24282 &self,
24283
24284 data: impl ::fidl_next::Encode<
24285 <___T as ::fidl_next::Transport>::SendBuffer,
24286 Encoded = ::fidl_next::WireVector<'static, u8>,
24287 >,
24288
24289 offset: impl ::fidl_next::Encode<
24290 <___T as ::fidl_next::Transport>::SendBuffer,
24291 Encoded = ::fidl_next::WireU64,
24292 >,
24293 ) -> Result<
24294 ::fidl_next::ResponseFuture<'_, super::WriteAt, ___T>,
24295 ::fidl_next::EncodeError,
24296 >
24297 where
24298 <___T as ::fidl_next::Transport>::SendBuffer:
24299 ::fidl_next::encoder::InternalHandleEncoder,
24300
24301 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24302 {
24303 self.write_at_with(WriteAt { data, offset })
24304 }
24305
24306 #[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"]
24307 pub fn write_at_with<___R>(
24308 &self,
24309 request: ___R,
24310 ) -> Result<
24311 ::fidl_next::ResponseFuture<'_, super::WriteAt, ___T>,
24312 ::fidl_next::EncodeError,
24313 >
24314 where
24315 ___R: ::fidl_next::Encode<
24316 <___T as ::fidl_next::Transport>::SendBuffer,
24317 Encoded = crate::WireFileWriteAtRequest<'static>,
24318 >,
24319 {
24320 self.sender
24321 .send_two_way(8736683935131400491, request)
24322 .map(::fidl_next::ResponseFuture::from_untyped)
24323 }
24324
24325 #[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"]
24326 pub fn resize(
24327 &self,
24328
24329 length: impl ::fidl_next::Encode<
24330 <___T as ::fidl_next::Transport>::SendBuffer,
24331 Encoded = ::fidl_next::WireU64,
24332 >,
24333 ) -> Result<
24334 ::fidl_next::ResponseFuture<'_, super::Resize, ___T>,
24335 ::fidl_next::EncodeError,
24336 >
24337 where
24338 <___T as ::fidl_next::Transport>::SendBuffer:
24339 ::fidl_next::encoder::InternalHandleEncoder,
24340 {
24341 self.resize_with(Resize { length })
24342 }
24343
24344 #[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"]
24345 pub fn resize_with<___R>(
24346 &self,
24347 request: ___R,
24348 ) -> Result<
24349 ::fidl_next::ResponseFuture<'_, super::Resize, ___T>,
24350 ::fidl_next::EncodeError,
24351 >
24352 where
24353 ___R: ::fidl_next::Encode<
24354 <___T as ::fidl_next::Transport>::SendBuffer,
24355 Encoded = crate::WireFileResizeRequest,
24356 >,
24357 {
24358 self.sender
24359 .send_two_way(3134648685270758458, request)
24360 .map(::fidl_next::ResponseFuture::from_untyped)
24361 }
24362
24363 #[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"]
24364 pub fn get_backing_memory(
24365 &self,
24366
24367 flags: impl ::fidl_next::Encode<
24368 <___T as ::fidl_next::Transport>::SendBuffer,
24369 Encoded = crate::WireVmoFlags,
24370 >,
24371 ) -> Result<
24372 ::fidl_next::ResponseFuture<'_, super::GetBackingMemory, ___T>,
24373 ::fidl_next::EncodeError,
24374 >
24375 where
24376 <___T as ::fidl_next::Transport>::SendBuffer:
24377 ::fidl_next::encoder::InternalHandleEncoder,
24378 {
24379 self.get_backing_memory_with(GetBackingMemory { flags })
24380 }
24381
24382 #[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"]
24383 pub fn get_backing_memory_with<___R>(
24384 &self,
24385 request: ___R,
24386 ) -> Result<
24387 ::fidl_next::ResponseFuture<'_, super::GetBackingMemory, ___T>,
24388 ::fidl_next::EncodeError,
24389 >
24390 where
24391 ___R: ::fidl_next::Encode<
24392 <___T as ::fidl_next::Transport>::SendBuffer,
24393 Encoded = crate::WireFileGetBackingMemoryRequest,
24394 >,
24395 {
24396 self.sender
24397 .send_two_way(46911652864194091, request)
24398 .map(::fidl_next::ResponseFuture::from_untyped)
24399 }
24400
24401 #[doc = " Pre-allocate on-disk space for this file.\n"]
24402 pub fn allocate(
24403 &self,
24404
24405 offset: impl ::fidl_next::Encode<
24406 <___T as ::fidl_next::Transport>::SendBuffer,
24407 Encoded = ::fidl_next::WireU64,
24408 >,
24409
24410 length: impl ::fidl_next::Encode<
24411 <___T as ::fidl_next::Transport>::SendBuffer,
24412 Encoded = ::fidl_next::WireU64,
24413 >,
24414
24415 mode: impl ::fidl_next::Encode<
24416 <___T as ::fidl_next::Transport>::SendBuffer,
24417 Encoded = crate::WireAllocateMode,
24418 >,
24419 ) -> Result<
24420 ::fidl_next::ResponseFuture<'_, super::Allocate, ___T>,
24421 ::fidl_next::EncodeError,
24422 >
24423 where
24424 <___T as ::fidl_next::Transport>::SendBuffer:
24425 ::fidl_next::encoder::InternalHandleEncoder,
24426
24427 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24428 {
24429 self.allocate_with(Allocate { offset, length, mode })
24430 }
24431
24432 #[doc = " Pre-allocate on-disk space for this file.\n"]
24433 pub fn allocate_with<___R>(
24434 &self,
24435 request: ___R,
24436 ) -> Result<
24437 ::fidl_next::ResponseFuture<'_, super::Allocate, ___T>,
24438 ::fidl_next::EncodeError,
24439 >
24440 where
24441 ___R: ::fidl_next::Encode<
24442 <___T as ::fidl_next::Transport>::SendBuffer,
24443 Encoded = crate::WireFileAllocateRequest,
24444 >,
24445 {
24446 self.sender
24447 .send_two_way(8645235848064269614, request)
24448 .map(::fidl_next::ResponseFuture::from_untyped)
24449 }
24450
24451 #[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"]
24452 pub fn enable_verity(
24453 &self,
24454
24455 options: impl ::fidl_next::Encode<
24456 <___T as ::fidl_next::Transport>::SendBuffer,
24457 Encoded = crate::WireVerificationOptions<'static>,
24458 >,
24459 ) -> Result<
24460 ::fidl_next::ResponseFuture<'_, super::EnableVerity, ___T>,
24461 ::fidl_next::EncodeError,
24462 >
24463 where
24464 <___T as ::fidl_next::Transport>::SendBuffer:
24465 ::fidl_next::encoder::InternalHandleEncoder,
24466
24467 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24468
24469 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24470 {
24471 self.enable_verity_with(EnableVerity { options })
24472 }
24473
24474 #[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"]
24475 pub fn enable_verity_with<___R>(
24476 &self,
24477 request: ___R,
24478 ) -> Result<
24479 ::fidl_next::ResponseFuture<'_, super::EnableVerity, ___T>,
24480 ::fidl_next::EncodeError,
24481 >
24482 where
24483 ___R: ::fidl_next::Encode<
24484 <___T as ::fidl_next::Transport>::SendBuffer,
24485 Encoded = crate::WireFileEnableVerityRequest<'static>,
24486 >,
24487 {
24488 self.sender
24489 .send_two_way(3189145313204943035, request)
24490 .map(::fidl_next::ResponseFuture::from_untyped)
24491 }
24492 }
24493
24494 #[repr(transparent)]
24496 pub struct FileServerSender<___T: ::fidl_next::Transport> {
24497 sender: ::fidl_next::protocol::ServerSender<___T>,
24498 }
24499
24500 impl<___T> FileServerSender<___T>
24501 where
24502 ___T: ::fidl_next::Transport,
24503 {
24504 #[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"]
24505 pub fn on_open(
24506 &self,
24507
24508 s: impl ::fidl_next::Encode<
24509 <___T as ::fidl_next::Transport>::SendBuffer,
24510 Encoded = ::fidl_next::WireI32,
24511 >,
24512
24513 info: impl ::fidl_next::Encode<
24514 <___T as ::fidl_next::Transport>::SendBuffer,
24515 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
24516 >,
24517 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
24518 where
24519 <___T as ::fidl_next::Transport>::SendBuffer:
24520 ::fidl_next::encoder::InternalHandleEncoder,
24521
24522 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
24523
24524 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
24525 {
24526 self.on_open_with(OnOpen { s, info })
24527 }
24528
24529 #[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"]
24530
24531 pub fn on_open_with<___R>(
24532 &self,
24533 request: ___R,
24534 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
24535 where
24536 ___R: ::fidl_next::Encode<
24537 <___T as ::fidl_next::Transport>::SendBuffer,
24538 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
24539 >,
24540 {
24541 self.sender.send_event(9207534335756671346, request)
24542 }
24543
24544 #[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"]
24545
24546 pub fn on_representation_with<___R>(
24547 &self,
24548 request: ___R,
24549 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
24550 where
24551 ___R: ::fidl_next::Encode<
24552 <___T as ::fidl_next::Transport>::SendBuffer,
24553 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
24554 >,
24555 {
24556 self.sender.send_event(6679970090861613324, request)
24557 }
24558 }
24559 }
24560}
24561
24562pub trait FileClientHandler<___T: ::fidl_next::Transport> {
24566 #[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"]
24567 fn on_open(
24568 &mut self,
24569 sender: &::fidl_next::ClientSender<File, ___T>,
24570
24571 event: ::fidl_next::Response<file::OnOpen, ___T>,
24572 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24573
24574 #[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"]
24575 fn on_representation(
24576 &mut self,
24577 sender: &::fidl_next::ClientSender<File, ___T>,
24578
24579 event: ::fidl_next::Response<file::OnRepresentation, ___T>,
24580 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24581
24582 fn on_unknown_interaction(
24583 &mut self,
24584 sender: &::fidl_next::ClientSender<File, ___T>,
24585 ordinal: u64,
24586 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
24587 sender.close();
24588 ::core::future::ready(())
24589 }
24590}
24591
24592impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for File
24593where
24594 ___H: FileClientHandler<___T> + Send,
24595 ___T: ::fidl_next::Transport,
24596
24597 <file::AdvisoryLock as ::fidl_next::Method>::Response:
24598 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24599
24600 <file::LinkInto as ::fidl_next::Method>::Response:
24601 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24602
24603 <file::Close as ::fidl_next::Method>::Response:
24604 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24605
24606 <file::Query as ::fidl_next::Method>::Response:
24607 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24608
24609 <file::OnOpen as ::fidl_next::Method>::Response:
24610 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24611
24612 <file::DeprecatedGetAttr as ::fidl_next::Method>::Response:
24613 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24614
24615 <file::DeprecatedSetAttr as ::fidl_next::Method>::Response:
24616 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24617
24618 <file::DeprecatedGetFlags as ::fidl_next::Method>::Response:
24619 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24620
24621 <file::DeprecatedSetFlags as ::fidl_next::Method>::Response:
24622 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24623
24624 <file::GetFlags as ::fidl_next::Method>::Response:
24625 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24626
24627 <file::SetFlags as ::fidl_next::Method>::Response:
24628 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24629
24630 <file::QueryFilesystem as ::fidl_next::Method>::Response:
24631 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24632
24633 <file::OnRepresentation as ::fidl_next::Method>::Response:
24634 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24635
24636 <file::GetAttributes as ::fidl_next::Method>::Response:
24637 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24638
24639 <file::UpdateAttributes as ::fidl_next::Method>::Response:
24640 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24641
24642 <file::Sync as ::fidl_next::Method>::Response:
24643 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24644
24645 <file::GetExtendedAttribute as ::fidl_next::Method>::Response:
24646 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24647
24648 <file::SetExtendedAttribute as ::fidl_next::Method>::Response:
24649 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24650
24651 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
24652 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24653
24654 <file::Read as ::fidl_next::Method>::Response:
24655 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24656
24657 <file::Write as ::fidl_next::Method>::Response:
24658 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24659
24660 <file::Describe as ::fidl_next::Method>::Response:
24661 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24662
24663 <file::Seek as ::fidl_next::Method>::Response:
24664 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24665
24666 <file::ReadAt as ::fidl_next::Method>::Response:
24667 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24668
24669 <file::WriteAt as ::fidl_next::Method>::Response:
24670 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24671
24672 <file::Resize as ::fidl_next::Method>::Response:
24673 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24674
24675 <file::GetBackingMemory as ::fidl_next::Method>::Response:
24676 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24677
24678 <file::Allocate as ::fidl_next::Method>::Response:
24679 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24680
24681 <file::EnableVerity as ::fidl_next::Method>::Response:
24682 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24683{
24684 async fn on_event(
24685 handler: &mut ___H,
24686 sender: &::fidl_next::ClientSender<Self, ___T>,
24687 ordinal: u64,
24688 buffer: ___T::RecvBuffer,
24689 ) {
24690 match ordinal {
24691 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
24692 Ok(decoded) => handler.on_open(sender, decoded).await,
24693 Err(e) => {
24694 sender.close();
24695 }
24696 },
24697
24698 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
24699 Ok(decoded) => handler.on_representation(sender, decoded).await,
24700 Err(e) => {
24701 sender.close();
24702 }
24703 },
24704
24705 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
24706 }
24707 }
24708}
24709
24710pub trait FileServerHandler<___T: ::fidl_next::Transport> {
24714 #[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"]
24715 fn advisory_lock(
24716 &mut self,
24717 sender: &::fidl_next::ServerSender<File, ___T>,
24718
24719 request: ::fidl_next::Request<file::AdvisoryLock, ___T>,
24720
24721 responder: ::fidl_next::Responder<file::AdvisoryLock>,
24722 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24723
24724 #[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"]
24725 fn link_into(
24726 &mut self,
24727 sender: &::fidl_next::ServerSender<File, ___T>,
24728
24729 request: ::fidl_next::Request<file::LinkInto, ___T>,
24730
24731 responder: ::fidl_next::Responder<file::LinkInto>,
24732 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24733
24734 fn clone(
24735 &mut self,
24736 sender: &::fidl_next::ServerSender<File, ___T>,
24737
24738 request: ::fidl_next::Request<file::Clone, ___T>,
24739 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24740
24741 #[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"]
24742 fn close(
24743 &mut self,
24744 sender: &::fidl_next::ServerSender<File, ___T>,
24745
24746 responder: ::fidl_next::Responder<file::Close>,
24747 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24748
24749 fn query(
24750 &mut self,
24751 sender: &::fidl_next::ServerSender<File, ___T>,
24752
24753 responder: ::fidl_next::Responder<file::Query>,
24754 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24755
24756 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
24757 fn deprecated_clone(
24758 &mut self,
24759 sender: &::fidl_next::ServerSender<File, ___T>,
24760
24761 request: ::fidl_next::Request<file::DeprecatedClone, ___T>,
24762 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24763
24764 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
24765 fn deprecated_get_attr(
24766 &mut self,
24767 sender: &::fidl_next::ServerSender<File, ___T>,
24768
24769 responder: ::fidl_next::Responder<file::DeprecatedGetAttr>,
24770 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24771
24772 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
24773 fn deprecated_set_attr(
24774 &mut self,
24775 sender: &::fidl_next::ServerSender<File, ___T>,
24776
24777 request: ::fidl_next::Request<file::DeprecatedSetAttr, ___T>,
24778
24779 responder: ::fidl_next::Responder<file::DeprecatedSetAttr>,
24780 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24781
24782 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
24783 fn deprecated_get_flags(
24784 &mut self,
24785 sender: &::fidl_next::ServerSender<File, ___T>,
24786
24787 responder: ::fidl_next::Responder<file::DeprecatedGetFlags>,
24788 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24789
24790 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
24791 fn deprecated_set_flags(
24792 &mut self,
24793 sender: &::fidl_next::ServerSender<File, ___T>,
24794
24795 request: ::fidl_next::Request<file::DeprecatedSetFlags, ___T>,
24796
24797 responder: ::fidl_next::Responder<file::DeprecatedSetFlags>,
24798 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24799
24800 #[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"]
24801 fn get_flags(
24802 &mut self,
24803 sender: &::fidl_next::ServerSender<File, ___T>,
24804
24805 responder: ::fidl_next::Responder<file::GetFlags>,
24806 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24807
24808 #[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"]
24809 fn set_flags(
24810 &mut self,
24811 sender: &::fidl_next::ServerSender<File, ___T>,
24812
24813 request: ::fidl_next::Request<file::SetFlags, ___T>,
24814
24815 responder: ::fidl_next::Responder<file::SetFlags>,
24816 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24817
24818 #[doc = " Query the filesystem for filesystem-specific information.\n"]
24819 fn query_filesystem(
24820 &mut self,
24821 sender: &::fidl_next::ServerSender<File, ___T>,
24822
24823 responder: ::fidl_next::Responder<file::QueryFilesystem>,
24824 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24825
24826 #[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"]
24827 fn get_attributes(
24828 &mut self,
24829 sender: &::fidl_next::ServerSender<File, ___T>,
24830
24831 request: ::fidl_next::Request<file::GetAttributes, ___T>,
24832
24833 responder: ::fidl_next::Responder<file::GetAttributes>,
24834 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24835
24836 #[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"]
24837 fn update_attributes(
24838 &mut self,
24839 sender: &::fidl_next::ServerSender<File, ___T>,
24840
24841 request: ::fidl_next::Request<file::UpdateAttributes, ___T>,
24842
24843 responder: ::fidl_next::Responder<file::UpdateAttributes>,
24844 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24845
24846 #[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"]
24847 fn sync(
24848 &mut self,
24849 sender: &::fidl_next::ServerSender<File, ___T>,
24850
24851 responder: ::fidl_next::Responder<file::Sync>,
24852 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24853
24854 #[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"]
24855 fn list_extended_attributes(
24856 &mut self,
24857 sender: &::fidl_next::ServerSender<File, ___T>,
24858
24859 request: ::fidl_next::Request<file::ListExtendedAttributes, ___T>,
24860 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24861
24862 #[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"]
24863 fn get_extended_attribute(
24864 &mut self,
24865 sender: &::fidl_next::ServerSender<File, ___T>,
24866
24867 request: ::fidl_next::Request<file::GetExtendedAttribute, ___T>,
24868
24869 responder: ::fidl_next::Responder<file::GetExtendedAttribute>,
24870 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24871
24872 #[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"]
24873 fn set_extended_attribute(
24874 &mut self,
24875 sender: &::fidl_next::ServerSender<File, ___T>,
24876
24877 request: ::fidl_next::Request<file::SetExtendedAttribute, ___T>,
24878
24879 responder: ::fidl_next::Responder<file::SetExtendedAttribute>,
24880 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24881
24882 #[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"]
24883 fn remove_extended_attribute(
24884 &mut self,
24885 sender: &::fidl_next::ServerSender<File, ___T>,
24886
24887 request: ::fidl_next::Request<file::RemoveExtendedAttribute, ___T>,
24888
24889 responder: ::fidl_next::Responder<file::RemoveExtendedAttribute>,
24890 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24891
24892 #[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"]
24893 fn read(
24894 &mut self,
24895 sender: &::fidl_next::ServerSender<File, ___T>,
24896
24897 request: ::fidl_next::Request<file::Read, ___T>,
24898
24899 responder: ::fidl_next::Responder<file::Read>,
24900 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24901
24902 #[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"]
24903 fn write(
24904 &mut self,
24905 sender: &::fidl_next::ServerSender<File, ___T>,
24906
24907 request: ::fidl_next::Request<file::Write, ___T>,
24908
24909 responder: ::fidl_next::Responder<file::Write>,
24910 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24911
24912 fn describe(
24913 &mut self,
24914 sender: &::fidl_next::ServerSender<File, ___T>,
24915
24916 responder: ::fidl_next::Responder<file::Describe>,
24917 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24918
24919 #[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"]
24920 fn seek(
24921 &mut self,
24922 sender: &::fidl_next::ServerSender<File, ___T>,
24923
24924 request: ::fidl_next::Request<file::Seek, ___T>,
24925
24926 responder: ::fidl_next::Responder<file::Seek>,
24927 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24928
24929 #[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"]
24930 fn read_at(
24931 &mut self,
24932 sender: &::fidl_next::ServerSender<File, ___T>,
24933
24934 request: ::fidl_next::Request<file::ReadAt, ___T>,
24935
24936 responder: ::fidl_next::Responder<file::ReadAt>,
24937 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24938
24939 #[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"]
24940 fn write_at(
24941 &mut self,
24942 sender: &::fidl_next::ServerSender<File, ___T>,
24943
24944 request: ::fidl_next::Request<file::WriteAt, ___T>,
24945
24946 responder: ::fidl_next::Responder<file::WriteAt>,
24947 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24948
24949 #[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"]
24950 fn resize(
24951 &mut self,
24952 sender: &::fidl_next::ServerSender<File, ___T>,
24953
24954 request: ::fidl_next::Request<file::Resize, ___T>,
24955
24956 responder: ::fidl_next::Responder<file::Resize>,
24957 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24958
24959 #[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"]
24960 fn get_backing_memory(
24961 &mut self,
24962 sender: &::fidl_next::ServerSender<File, ___T>,
24963
24964 request: ::fidl_next::Request<file::GetBackingMemory, ___T>,
24965
24966 responder: ::fidl_next::Responder<file::GetBackingMemory>,
24967 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24968
24969 #[doc = " Pre-allocate on-disk space for this file.\n"]
24970 fn allocate(
24971 &mut self,
24972 sender: &::fidl_next::ServerSender<File, ___T>,
24973
24974 request: ::fidl_next::Request<file::Allocate, ___T>,
24975
24976 responder: ::fidl_next::Responder<file::Allocate>,
24977 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24978
24979 #[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"]
24980 fn enable_verity(
24981 &mut self,
24982 sender: &::fidl_next::ServerSender<File, ___T>,
24983
24984 request: ::fidl_next::Request<file::EnableVerity, ___T>,
24985
24986 responder: ::fidl_next::Responder<file::EnableVerity>,
24987 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24988
24989 fn on_unknown_interaction(
24990 &mut self,
24991 sender: &::fidl_next::ServerSender<File, ___T>,
24992 ordinal: u64,
24993 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
24994 sender.close();
24995 ::core::future::ready(())
24996 }
24997}
24998
24999impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for File
25000where
25001 ___H: FileServerHandler<___T> + Send,
25002 ___T: ::fidl_next::Transport,
25003
25004 <file::AdvisoryLock as ::fidl_next::Method>::Request:
25005 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25006
25007 <file::LinkInto as ::fidl_next::Method>::Request:
25008 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25009
25010 <file::Clone as ::fidl_next::Method>::Request:
25011 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25012
25013 <file::DeprecatedClone as ::fidl_next::Method>::Request:
25014 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25015
25016 <file::DeprecatedSetAttr as ::fidl_next::Method>::Request:
25017 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25018
25019 <file::DeprecatedSetFlags as ::fidl_next::Method>::Request:
25020 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25021
25022 <file::SetFlags as ::fidl_next::Method>::Request:
25023 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25024
25025 <file::GetAttributes as ::fidl_next::Method>::Request:
25026 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25027
25028 <file::UpdateAttributes as ::fidl_next::Method>::Request:
25029 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25030
25031 <file::ListExtendedAttributes as ::fidl_next::Method>::Request:
25032 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25033
25034 <file::GetExtendedAttribute as ::fidl_next::Method>::Request:
25035 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25036
25037 <file::SetExtendedAttribute as ::fidl_next::Method>::Request:
25038 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25039
25040 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
25041 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25042
25043 <file::Read as ::fidl_next::Method>::Request:
25044 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25045
25046 <file::Write as ::fidl_next::Method>::Request:
25047 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25048
25049 <file::Seek as ::fidl_next::Method>::Request:
25050 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25051
25052 <file::ReadAt as ::fidl_next::Method>::Request:
25053 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25054
25055 <file::WriteAt as ::fidl_next::Method>::Request:
25056 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25057
25058 <file::Resize as ::fidl_next::Method>::Request:
25059 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25060
25061 <file::GetBackingMemory as ::fidl_next::Method>::Request:
25062 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25063
25064 <file::Allocate as ::fidl_next::Method>::Request:
25065 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25066
25067 <file::EnableVerity as ::fidl_next::Method>::Request:
25068 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
25069{
25070 async fn on_one_way(
25071 handler: &mut ___H,
25072 sender: &::fidl_next::ServerSender<Self, ___T>,
25073 ordinal: u64,
25074 buffer: ___T::RecvBuffer,
25075 ) {
25076 match ordinal {
25077 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
25078 Ok(decoded) => handler.clone(sender, decoded).await,
25079 Err(e) => {
25080 sender.close();
25081 }
25082 },
25083
25084 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
25085 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
25086 Err(e) => {
25087 sender.close();
25088 }
25089 },
25090
25091 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
25092 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
25093 Err(e) => {
25094 sender.close();
25095 }
25096 },
25097
25098 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
25099 }
25100 }
25101
25102 async fn on_two_way(
25103 handler: &mut ___H,
25104 sender: &::fidl_next::ServerSender<Self, ___T>,
25105 ordinal: u64,
25106 buffer: ___T::RecvBuffer,
25107 responder: ::fidl_next::protocol::Responder,
25108 ) {
25109 match ordinal {
25110 7992130864415541162 => {
25111 let responder = ::fidl_next::Responder::from_untyped(responder);
25112
25113 match ::fidl_next::DecoderExt::decode(buffer) {
25114 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
25115 Err(e) => {
25116 sender.close();
25117 }
25118 }
25119 }
25120
25121 6121399674497678964 => {
25122 let responder = ::fidl_next::Responder::from_untyped(responder);
25123
25124 match ::fidl_next::DecoderExt::decode(buffer) {
25125 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
25126 Err(e) => {
25127 sender.close();
25128 }
25129 }
25130 }
25131
25132 6540867515453498750 => {
25133 let responder = ::fidl_next::Responder::from_untyped(responder);
25134
25135 handler.close(sender, responder).await;
25136 }
25137
25138 2763219980499352582 => {
25139 let responder = ::fidl_next::Responder::from_untyped(responder);
25140
25141 handler.query(sender, responder).await;
25142 }
25143
25144 8689798978500614909 => {
25145 let responder = ::fidl_next::Responder::from_untyped(responder);
25146
25147 handler.deprecated_get_attr(sender, responder).await;
25148 }
25149
25150 4721673413776871238 => {
25151 let responder = ::fidl_next::Responder::from_untyped(responder);
25152
25153 match ::fidl_next::DecoderExt::decode(buffer) {
25154 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
25155 Err(e) => {
25156 sender.close();
25157 }
25158 }
25159 }
25160
25161 6595803110182632097 => {
25162 let responder = ::fidl_next::Responder::from_untyped(responder);
25163
25164 handler.deprecated_get_flags(sender, responder).await;
25165 }
25166
25167 5950864159036794675 => {
25168 let responder = ::fidl_next::Responder::from_untyped(responder);
25169
25170 match ::fidl_next::DecoderExt::decode(buffer) {
25171 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
25172 Err(e) => {
25173 sender.close();
25174 }
25175 }
25176 }
25177
25178 105530239381466147 => {
25179 let responder = ::fidl_next::Responder::from_untyped(responder);
25180
25181 handler.get_flags(sender, responder).await;
25182 }
25183
25184 6172186066099445416 => {
25185 let responder = ::fidl_next::Responder::from_untyped(responder);
25186
25187 match ::fidl_next::DecoderExt::decode(buffer) {
25188 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
25189 Err(e) => {
25190 sender.close();
25191 }
25192 }
25193 }
25194
25195 8013111122914313744 => {
25196 let responder = ::fidl_next::Responder::from_untyped(responder);
25197
25198 handler.query_filesystem(sender, responder).await;
25199 }
25200
25201 4414537700416816443 => {
25202 let responder = ::fidl_next::Responder::from_untyped(responder);
25203
25204 match ::fidl_next::DecoderExt::decode(buffer) {
25205 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
25206 Err(e) => {
25207 sender.close();
25208 }
25209 }
25210 }
25211
25212 3677402239314018056 => {
25213 let responder = ::fidl_next::Responder::from_untyped(responder);
25214
25215 match ::fidl_next::DecoderExt::decode(buffer) {
25216 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
25217 Err(e) => {
25218 sender.close();
25219 }
25220 }
25221 }
25222
25223 3196473584242777161 => {
25224 let responder = ::fidl_next::Responder::from_untyped(responder);
25225
25226 handler.sync(sender, responder).await;
25227 }
25228
25229 5043930208506967771 => {
25230 let responder = ::fidl_next::Responder::from_untyped(responder);
25231
25232 match ::fidl_next::DecoderExt::decode(buffer) {
25233 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
25234 Err(e) => {
25235 sender.close();
25236 }
25237 }
25238 }
25239
25240 5374223046099989052 => {
25241 let responder = ::fidl_next::Responder::from_untyped(responder);
25242
25243 match ::fidl_next::DecoderExt::decode(buffer) {
25244 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
25245 Err(e) => {
25246 sender.close();
25247 }
25248 }
25249 }
25250
25251 8794297771444732717 => {
25252 let responder = ::fidl_next::Responder::from_untyped(responder);
25253
25254 match ::fidl_next::DecoderExt::decode(buffer) {
25255 Ok(decoded) => {
25256 handler.remove_extended_attribute(sender, decoded, responder).await
25257 }
25258 Err(e) => {
25259 sender.close();
25260 }
25261 }
25262 }
25263
25264 395825947633028830 => {
25265 let responder = ::fidl_next::Responder::from_untyped(responder);
25266
25267 match ::fidl_next::DecoderExt::decode(buffer) {
25268 Ok(decoded) => handler.read(sender, decoded, responder).await,
25269 Err(e) => {
25270 sender.close();
25271 }
25272 }
25273 }
25274
25275 7651971425397809026 => {
25276 let responder = ::fidl_next::Responder::from_untyped(responder);
25277
25278 match ::fidl_next::DecoderExt::decode(buffer) {
25279 Ok(decoded) => handler.write(sender, decoded, responder).await,
25280 Err(e) => {
25281 sender.close();
25282 }
25283 }
25284 }
25285
25286 7545125870053689020 => {
25287 let responder = ::fidl_next::Responder::from_untyped(responder);
25288
25289 handler.describe(sender, responder).await;
25290 }
25291
25292 8649041485622956551 => {
25293 let responder = ::fidl_next::Responder::from_untyped(responder);
25294
25295 match ::fidl_next::DecoderExt::decode(buffer) {
25296 Ok(decoded) => handler.seek(sender, decoded, responder).await,
25297 Err(e) => {
25298 sender.close();
25299 }
25300 }
25301 }
25302
25303 1587416148701180478 => {
25304 let responder = ::fidl_next::Responder::from_untyped(responder);
25305
25306 match ::fidl_next::DecoderExt::decode(buffer) {
25307 Ok(decoded) => handler.read_at(sender, decoded, responder).await,
25308 Err(e) => {
25309 sender.close();
25310 }
25311 }
25312 }
25313
25314 8736683935131400491 => {
25315 let responder = ::fidl_next::Responder::from_untyped(responder);
25316
25317 match ::fidl_next::DecoderExt::decode(buffer) {
25318 Ok(decoded) => handler.write_at(sender, decoded, responder).await,
25319 Err(e) => {
25320 sender.close();
25321 }
25322 }
25323 }
25324
25325 3134648685270758458 => {
25326 let responder = ::fidl_next::Responder::from_untyped(responder);
25327
25328 match ::fidl_next::DecoderExt::decode(buffer) {
25329 Ok(decoded) => handler.resize(sender, decoded, responder).await,
25330 Err(e) => {
25331 sender.close();
25332 }
25333 }
25334 }
25335
25336 46911652864194091 => {
25337 let responder = ::fidl_next::Responder::from_untyped(responder);
25338
25339 match ::fidl_next::DecoderExt::decode(buffer) {
25340 Ok(decoded) => handler.get_backing_memory(sender, decoded, responder).await,
25341 Err(e) => {
25342 sender.close();
25343 }
25344 }
25345 }
25346
25347 8645235848064269614 => {
25348 let responder = ::fidl_next::Responder::from_untyped(responder);
25349
25350 match ::fidl_next::DecoderExt::decode(buffer) {
25351 Ok(decoded) => handler.allocate(sender, decoded, responder).await,
25352 Err(e) => {
25353 sender.close();
25354 }
25355 }
25356 }
25357
25358 3189145313204943035 => {
25359 let responder = ::fidl_next::Responder::from_untyped(responder);
25360
25361 match ::fidl_next::DecoderExt::decode(buffer) {
25362 Ok(decoded) => handler.enable_verity(sender, decoded, responder).await,
25363 Err(e) => {
25364 sender.close();
25365 }
25366 }
25367 }
25368
25369 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
25370 }
25371 }
25372}
25373
25374#[derive(Debug)]
25375#[repr(C)]
25376pub struct FileObject {
25377 pub event: Option<::fidl_next::fuchsia::zx::Handle>,
25378
25379 pub stream: Option<::fidl_next::fuchsia::zx::Handle>,
25380}
25381
25382impl ::fidl_next::Encodable for FileObject {
25383 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileObject> = unsafe {
25384 ::fidl_next::CopyOptimization::enable_if(
25385 true
25386
25387 && <
25388 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
25389 >::COPY_OPTIMIZATION.is_enabled()
25390
25391 && <
25392 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
25393 >::COPY_OPTIMIZATION.is_enabled()
25394
25395 )
25396 };
25397
25398 type Encoded = WireFileObject;
25399}
25400
25401unsafe impl<___E> ::fidl_next::Encode<___E> for FileObject
25402where
25403 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25404
25405 ___E: ::fidl_next::fuchsia::HandleEncoder,
25406{
25407 #[inline]
25408 fn encode(
25409 self,
25410 encoder: &mut ___E,
25411 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25412 ) -> Result<(), ::fidl_next::EncodeError> {
25413 ::fidl_next::munge! {
25414 let Self::Encoded {
25415 event,
25416 stream,
25417
25418 } = out;
25419 }
25420
25421 ::fidl_next::Encode::encode(self.event, encoder, event)?;
25422
25423 ::fidl_next::Encode::encode(self.stream, encoder, stream)?;
25424
25425 Ok(())
25426 }
25427}
25428
25429impl ::fidl_next::EncodableOption for FileObject {
25430 type EncodedOption = ::fidl_next::WireBox<'static, WireFileObject>;
25431}
25432
25433unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileObject
25434where
25435 ___E: ::fidl_next::Encoder + ?Sized,
25436 FileObject: ::fidl_next::Encode<___E>,
25437{
25438 #[inline]
25439 fn encode_option(
25440 this: Option<Self>,
25441 encoder: &mut ___E,
25442 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25443 ) -> Result<(), ::fidl_next::EncodeError> {
25444 if let Some(inner) = this {
25445 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25446 ::fidl_next::WireBox::encode_present(out);
25447 } else {
25448 ::fidl_next::WireBox::encode_absent(out);
25449 }
25450
25451 Ok(())
25452 }
25453}
25454
25455impl ::fidl_next::FromWire<WireFileObject> for FileObject {
25456 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileObject, Self> = unsafe {
25457 ::fidl_next::CopyOptimization::enable_if(
25458 true && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
25459 ::fidl_next::fuchsia::WireOptionalHandle,
25460 >>::COPY_OPTIMIZATION
25461 .is_enabled()
25462 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
25463 ::fidl_next::fuchsia::WireOptionalHandle,
25464 >>::COPY_OPTIMIZATION
25465 .is_enabled(),
25466 )
25467 };
25468
25469 #[inline]
25470 fn from_wire(wire: WireFileObject) -> Self {
25471 Self {
25472 event: ::fidl_next::FromWire::from_wire(wire.event),
25473
25474 stream: ::fidl_next::FromWire::from_wire(wire.stream),
25475 }
25476 }
25477}
25478
25479#[derive(Debug)]
25481#[repr(C)]
25482pub struct WireFileObject {
25483 pub event: ::fidl_next::fuchsia::WireOptionalHandle,
25484
25485 pub stream: ::fidl_next::fuchsia::WireOptionalHandle,
25486}
25487
25488unsafe impl ::fidl_next::Wire for WireFileObject {
25489 type Decoded<'de> = WireFileObject;
25490
25491 #[inline]
25492 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
25493}
25494
25495unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileObject
25496where
25497 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25498
25499 ___D: ::fidl_next::fuchsia::HandleDecoder,
25500{
25501 fn decode(
25502 slot: ::fidl_next::Slot<'_, Self>,
25503 decoder: &mut ___D,
25504 ) -> Result<(), ::fidl_next::DecodeError> {
25505 ::fidl_next::munge! {
25506 let Self {
25507 mut event,
25508 mut stream,
25509
25510 } = slot;
25511 }
25512
25513 ::fidl_next::Decode::decode(event.as_mut(), decoder)?;
25514
25515 ::fidl_next::Decode::decode(stream.as_mut(), decoder)?;
25516
25517 Ok(())
25518 }
25519}
25520
25521::fidl_next::bitflags! {
25522 #[derive(
25523 Clone,
25524 Copy,
25525 Debug,
25526 PartialEq,
25527 Eq,
25528 Hash,
25529 )]
25530 pub struct FileSignal: u32 {
25531 #[doc = " Indicates the file is ready for reading.\n"]const READABLE = 16777216;
25532 #[doc = " Indicates the file is ready for writing.\n"]const WRITABLE = 33554432;
25533
25534 }
25535}
25536
25537impl ::fidl_next::Encodable for FileSignal {
25538 type Encoded = WireFileSignal;
25539}
25540
25541unsafe impl<___E> ::fidl_next::Encode<___E> for FileSignal
25542where
25543 ___E: ?Sized,
25544{
25545 #[inline]
25546 fn encode(
25547 self,
25548 encoder: &mut ___E,
25549 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25550 ) -> Result<(), ::fidl_next::EncodeError> {
25551 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
25552 }
25553}
25554
25555unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSignal
25556where
25557 ___E: ?Sized,
25558{
25559 #[inline]
25560 fn encode_ref(
25561 &self,
25562 _: &mut ___E,
25563 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25564 ) -> Result<(), ::fidl_next::EncodeError> {
25565 ::fidl_next::munge!(let WireFileSignal { value } = out);
25566 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
25567 Ok(())
25568 }
25569}
25570
25571impl ::core::convert::From<WireFileSignal> for FileSignal {
25572 fn from(wire: WireFileSignal) -> Self {
25573 Self::from_bits_retain(u32::from(wire.value))
25574 }
25575}
25576
25577impl ::fidl_next::FromWire<WireFileSignal> for FileSignal {
25578 #[inline]
25579 fn from_wire(wire: WireFileSignal) -> Self {
25580 Self::from(wire)
25581 }
25582}
25583
25584impl ::fidl_next::FromWireRef<WireFileSignal> for FileSignal {
25585 #[inline]
25586 fn from_wire_ref(wire: &WireFileSignal) -> Self {
25587 Self::from(*wire)
25588 }
25589}
25590
25591#[derive(Clone, Copy, Debug)]
25593#[repr(transparent)]
25594pub struct WireFileSignal {
25595 value: ::fidl_next::WireU32,
25596}
25597
25598unsafe impl ::fidl_next::Wire for WireFileSignal {
25599 type Decoded<'de> = Self;
25600
25601 #[inline]
25602 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25603 }
25605}
25606
25607unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSignal
25608where
25609 ___D: ?Sized,
25610{
25611 fn decode(
25612 slot: ::fidl_next::Slot<'_, Self>,
25613 _: &mut ___D,
25614 ) -> Result<(), ::fidl_next::DecodeError> {
25615 ::fidl_next::munge!(let Self { value } = slot);
25616 let set = u32::from(*value);
25617 if set & !FileSignal::all().bits() != 0 {
25618 return Err(::fidl_next::DecodeError::InvalidBits {
25619 expected: FileSignal::all().bits() as usize,
25620 actual: set as usize,
25621 });
25622 }
25623
25624 Ok(())
25625 }
25626}
25627
25628impl ::core::convert::From<FileSignal> for WireFileSignal {
25629 fn from(natural: FileSignal) -> Self {
25630 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
25631 }
25632}
25633
25634pub const MAX_FS_NAME_BUFFER: u64 = 32;
25635
25636#[derive(Clone, Debug)]
25637#[repr(C)]
25638pub struct FilesystemInfo {
25639 pub total_bytes: u64,
25640
25641 pub used_bytes: u64,
25642
25643 pub total_nodes: u64,
25644
25645 pub used_nodes: u64,
25646
25647 pub free_shared_pool_bytes: u64,
25648
25649 pub fs_id: u64,
25650
25651 pub block_size: u32,
25652
25653 pub max_filename_size: u32,
25654
25655 pub fs_type: u32,
25656
25657 pub padding: u32,
25658
25659 pub name: [i8; 32],
25660}
25661
25662impl ::fidl_next::Encodable for FilesystemInfo {
25663 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFilesystemInfo> = unsafe {
25664 ::fidl_next::CopyOptimization::enable_if(
25665 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25666 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25667 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25668 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25669 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25670 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25671 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25672 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25673 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25674 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
25675 && <[i8; 32] as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
25676 )
25677 };
25678
25679 type Encoded = WireFilesystemInfo;
25680}
25681
25682unsafe impl<___E> ::fidl_next::Encode<___E> for FilesystemInfo
25683where
25684 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25685{
25686 #[inline]
25687 fn encode(
25688 self,
25689 encoder: &mut ___E,
25690 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25691 ) -> Result<(), ::fidl_next::EncodeError> {
25692 ::fidl_next::munge! {
25693 let Self::Encoded {
25694 total_bytes,
25695 used_bytes,
25696 total_nodes,
25697 used_nodes,
25698 free_shared_pool_bytes,
25699 fs_id,
25700 block_size,
25701 max_filename_size,
25702 fs_type,
25703 padding,
25704 name,
25705
25706 } = out;
25707 }
25708
25709 ::fidl_next::Encode::encode(self.total_bytes, encoder, total_bytes)?;
25710
25711 ::fidl_next::Encode::encode(self.used_bytes, encoder, used_bytes)?;
25712
25713 ::fidl_next::Encode::encode(self.total_nodes, encoder, total_nodes)?;
25714
25715 ::fidl_next::Encode::encode(self.used_nodes, encoder, used_nodes)?;
25716
25717 ::fidl_next::Encode::encode(self.free_shared_pool_bytes, encoder, free_shared_pool_bytes)?;
25718
25719 ::fidl_next::Encode::encode(self.fs_id, encoder, fs_id)?;
25720
25721 ::fidl_next::Encode::encode(self.block_size, encoder, block_size)?;
25722
25723 ::fidl_next::Encode::encode(self.max_filename_size, encoder, max_filename_size)?;
25724
25725 ::fidl_next::Encode::encode(self.fs_type, encoder, fs_type)?;
25726
25727 ::fidl_next::Encode::encode(self.padding, encoder, padding)?;
25728
25729 ::fidl_next::Encode::encode(self.name, encoder, name)?;
25730
25731 Ok(())
25732 }
25733}
25734
25735unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FilesystemInfo
25736where
25737 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25738{
25739 #[inline]
25740 fn encode_ref(
25741 &self,
25742 encoder: &mut ___E,
25743 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25744 ) -> Result<(), ::fidl_next::EncodeError> {
25745 ::fidl_next::munge! {
25746 let Self::Encoded {
25747 total_bytes,
25748 used_bytes,
25749 total_nodes,
25750 used_nodes,
25751 free_shared_pool_bytes,
25752 fs_id,
25753 block_size,
25754 max_filename_size,
25755 fs_type,
25756 padding,
25757 name,
25758
25759 } = out;
25760 }
25761
25762 ::fidl_next::EncodeRef::encode_ref(&self.total_bytes, encoder, total_bytes)?;
25763
25764 ::fidl_next::EncodeRef::encode_ref(&self.used_bytes, encoder, used_bytes)?;
25765
25766 ::fidl_next::EncodeRef::encode_ref(&self.total_nodes, encoder, total_nodes)?;
25767
25768 ::fidl_next::EncodeRef::encode_ref(&self.used_nodes, encoder, used_nodes)?;
25769
25770 ::fidl_next::EncodeRef::encode_ref(
25771 &self.free_shared_pool_bytes,
25772 encoder,
25773 free_shared_pool_bytes,
25774 )?;
25775
25776 ::fidl_next::EncodeRef::encode_ref(&self.fs_id, encoder, fs_id)?;
25777
25778 ::fidl_next::EncodeRef::encode_ref(&self.block_size, encoder, block_size)?;
25779
25780 ::fidl_next::EncodeRef::encode_ref(&self.max_filename_size, encoder, max_filename_size)?;
25781
25782 ::fidl_next::EncodeRef::encode_ref(&self.fs_type, encoder, fs_type)?;
25783
25784 ::fidl_next::EncodeRef::encode_ref(&self.padding, encoder, padding)?;
25785
25786 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
25787
25788 Ok(())
25789 }
25790}
25791
25792impl ::fidl_next::EncodableOption for FilesystemInfo {
25793 type EncodedOption = ::fidl_next::WireBox<'static, WireFilesystemInfo>;
25794}
25795
25796unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FilesystemInfo
25797where
25798 ___E: ::fidl_next::Encoder + ?Sized,
25799 FilesystemInfo: ::fidl_next::Encode<___E>,
25800{
25801 #[inline]
25802 fn encode_option(
25803 this: Option<Self>,
25804 encoder: &mut ___E,
25805 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25806 ) -> Result<(), ::fidl_next::EncodeError> {
25807 if let Some(inner) = this {
25808 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25809 ::fidl_next::WireBox::encode_present(out);
25810 } else {
25811 ::fidl_next::WireBox::encode_absent(out);
25812 }
25813
25814 Ok(())
25815 }
25816}
25817
25818unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FilesystemInfo
25819where
25820 ___E: ::fidl_next::Encoder + ?Sized,
25821 FilesystemInfo: ::fidl_next::EncodeRef<___E>,
25822{
25823 #[inline]
25824 fn encode_option_ref(
25825 this: Option<&Self>,
25826 encoder: &mut ___E,
25827 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25828 ) -> Result<(), ::fidl_next::EncodeError> {
25829 if let Some(inner) = this {
25830 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25831 ::fidl_next::WireBox::encode_present(out);
25832 } else {
25833 ::fidl_next::WireBox::encode_absent(out);
25834 }
25835
25836 Ok(())
25837 }
25838}
25839
25840impl ::fidl_next::FromWire<WireFilesystemInfo> for FilesystemInfo {
25841 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFilesystemInfo, Self> = unsafe {
25842 ::fidl_next::CopyOptimization::enable_if(
25843 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25844 .is_enabled()
25845 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25846 .is_enabled()
25847 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25848 .is_enabled()
25849 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25850 .is_enabled()
25851 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25852 .is_enabled()
25853 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25854 .is_enabled()
25855 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25856 .is_enabled()
25857 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25858 .is_enabled()
25859 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25860 .is_enabled()
25861 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25862 .is_enabled()
25863 && <[i8; 32] as ::fidl_next::FromWire<[i8; 32]>>::COPY_OPTIMIZATION.is_enabled(),
25864 )
25865 };
25866
25867 #[inline]
25868 fn from_wire(wire: WireFilesystemInfo) -> Self {
25869 Self {
25870 total_bytes: ::fidl_next::FromWire::from_wire(wire.total_bytes),
25871
25872 used_bytes: ::fidl_next::FromWire::from_wire(wire.used_bytes),
25873
25874 total_nodes: ::fidl_next::FromWire::from_wire(wire.total_nodes),
25875
25876 used_nodes: ::fidl_next::FromWire::from_wire(wire.used_nodes),
25877
25878 free_shared_pool_bytes: ::fidl_next::FromWire::from_wire(wire.free_shared_pool_bytes),
25879
25880 fs_id: ::fidl_next::FromWire::from_wire(wire.fs_id),
25881
25882 block_size: ::fidl_next::FromWire::from_wire(wire.block_size),
25883
25884 max_filename_size: ::fidl_next::FromWire::from_wire(wire.max_filename_size),
25885
25886 fs_type: ::fidl_next::FromWire::from_wire(wire.fs_type),
25887
25888 padding: ::fidl_next::FromWire::from_wire(wire.padding),
25889
25890 name: ::fidl_next::FromWire::from_wire(wire.name),
25891 }
25892 }
25893}
25894
25895impl ::fidl_next::FromWireRef<WireFilesystemInfo> for FilesystemInfo {
25896 #[inline]
25897 fn from_wire_ref(wire: &WireFilesystemInfo) -> Self {
25898 Self {
25899 total_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_bytes),
25900
25901 used_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_bytes),
25902
25903 total_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_nodes),
25904
25905 used_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_nodes),
25906
25907 free_shared_pool_bytes: ::fidl_next::FromWireRef::from_wire_ref(
25908 &wire.free_shared_pool_bytes,
25909 ),
25910
25911 fs_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_id),
25912
25913 block_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.block_size),
25914
25915 max_filename_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_filename_size),
25916
25917 fs_type: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_type),
25918
25919 padding: ::fidl_next::FromWireRef::from_wire_ref(&wire.padding),
25920
25921 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
25922 }
25923 }
25924}
25925
25926#[derive(Clone, Debug)]
25928#[repr(C)]
25929pub struct WireFilesystemInfo {
25930 pub total_bytes: ::fidl_next::WireU64,
25931
25932 pub used_bytes: ::fidl_next::WireU64,
25933
25934 pub total_nodes: ::fidl_next::WireU64,
25935
25936 pub used_nodes: ::fidl_next::WireU64,
25937
25938 pub free_shared_pool_bytes: ::fidl_next::WireU64,
25939
25940 pub fs_id: ::fidl_next::WireU64,
25941
25942 pub block_size: ::fidl_next::WireU32,
25943
25944 pub max_filename_size: ::fidl_next::WireU32,
25945
25946 pub fs_type: ::fidl_next::WireU32,
25947
25948 pub padding: ::fidl_next::WireU32,
25949
25950 pub name: [i8; 32],
25951}
25952
25953unsafe impl ::fidl_next::Wire for WireFilesystemInfo {
25954 type Decoded<'de> = WireFilesystemInfo;
25955
25956 #[inline]
25957 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
25958}
25959
25960unsafe impl<___D> ::fidl_next::Decode<___D> for WireFilesystemInfo
25961where
25962 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25963{
25964 fn decode(
25965 slot: ::fidl_next::Slot<'_, Self>,
25966 decoder: &mut ___D,
25967 ) -> Result<(), ::fidl_next::DecodeError> {
25968 ::fidl_next::munge! {
25969 let Self {
25970 mut total_bytes,
25971 mut used_bytes,
25972 mut total_nodes,
25973 mut used_nodes,
25974 mut free_shared_pool_bytes,
25975 mut fs_id,
25976 mut block_size,
25977 mut max_filename_size,
25978 mut fs_type,
25979 mut padding,
25980 mut name,
25981
25982 } = slot;
25983 }
25984
25985 ::fidl_next::Decode::decode(total_bytes.as_mut(), decoder)?;
25986
25987 ::fidl_next::Decode::decode(used_bytes.as_mut(), decoder)?;
25988
25989 ::fidl_next::Decode::decode(total_nodes.as_mut(), decoder)?;
25990
25991 ::fidl_next::Decode::decode(used_nodes.as_mut(), decoder)?;
25992
25993 ::fidl_next::Decode::decode(free_shared_pool_bytes.as_mut(), decoder)?;
25994
25995 ::fidl_next::Decode::decode(fs_id.as_mut(), decoder)?;
25996
25997 ::fidl_next::Decode::decode(block_size.as_mut(), decoder)?;
25998
25999 ::fidl_next::Decode::decode(max_filename_size.as_mut(), decoder)?;
26000
26001 ::fidl_next::Decode::decode(fs_type.as_mut(), decoder)?;
26002
26003 ::fidl_next::Decode::decode(padding.as_mut(), decoder)?;
26004
26005 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
26006
26007 Ok(())
26008 }
26009}
26010
26011#[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"]
26012pub const INHERITED_WRITE_PERMISSIONS: crate::Operations = crate::Operations::from_bits_retain(356);
26013
26014#[doc = " Nodes which do not have ino values should return this value\n from Readdir and GetAttr.\n"]
26015pub const INO_UNKNOWN: u64 = 18446744073709551615;
26016
26017pub const MASK_KNOWN_PERMISSIONS: crate::Flags = crate::Flags::from_bits_retain(25087);
26018
26019pub const MASK_KNOWN_PROTOCOLS: crate::Flags = crate::Flags::from_bits_retain(30069489664);
26020
26021pub const MASK_PERMISSION_FLAGS: u64 = 65535;
26022
26023pub const MASK_POSIX_FLAGS: u64 = 4294967295;
26024
26025#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
26026pub const MAX_FILENAME: u64 = 255;
26027
26028#[doc = " Bits reserved for posix protections. Native fuchsia filesystems\n are not required to set bits contained within `MODE_PROTECTION_MASK`,\n but filesystems that wish to do so may refer to sys/stat.h for their\n definitions.\n"]
26029pub const MODE_PROTECTION_MASK: u32 = 4095;
26030
26031pub const MODE_TYPE_BLOCK_DEVICE: u32 = 24576;
26032
26033pub const MODE_TYPE_DIRECTORY: u32 = 16384;
26034
26035pub const MODE_TYPE_FILE: u32 = 32768;
26036
26037#[doc = " Bits indicating node type. The canonical mechanism to check\n for a node type is to take \'mode\', bitwise AND it with the\n `MODE_TYPE_MASK`, and check exact equality against a mode type.\n"]
26038pub const MODE_TYPE_MASK: u32 = 1044480;
26039
26040pub const MODE_TYPE_SERVICE: u32 = 65536;
26041
26042pub const MODE_TYPE_SYMLINK: u32 = 40960;
26043
26044pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
26045
26046#[derive(Clone, Debug)]
26047#[repr(C)]
26048pub struct Service {}
26049
26050impl ::fidl_next::Encodable for Service {
26051 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireService> =
26052 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
26053
26054 type Encoded = WireService;
26055}
26056
26057unsafe impl<___E> ::fidl_next::Encode<___E> for Service
26058where
26059 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26060{
26061 #[inline]
26062 fn encode(
26063 self,
26064 encoder: &mut ___E,
26065 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26066 ) -> Result<(), ::fidl_next::EncodeError> {
26067 ::fidl_next::munge! {
26068 let Self::Encoded {
26069
26070 } = out;
26071 }
26072
26073 Ok(())
26074 }
26075}
26076
26077unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
26078where
26079 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26080{
26081 #[inline]
26082 fn encode_ref(
26083 &self,
26084 encoder: &mut ___E,
26085 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26086 ) -> Result<(), ::fidl_next::EncodeError> {
26087 ::fidl_next::munge! {
26088 let Self::Encoded {
26089
26090 } = out;
26091 }
26092
26093 Ok(())
26094 }
26095}
26096
26097impl ::fidl_next::EncodableOption for Service {
26098 type EncodedOption = ::fidl_next::WireBox<'static, WireService>;
26099}
26100
26101unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Service
26102where
26103 ___E: ::fidl_next::Encoder + ?Sized,
26104 Service: ::fidl_next::Encode<___E>,
26105{
26106 #[inline]
26107 fn encode_option(
26108 this: Option<Self>,
26109 encoder: &mut ___E,
26110 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26111 ) -> Result<(), ::fidl_next::EncodeError> {
26112 if let Some(inner) = this {
26113 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
26114 ::fidl_next::WireBox::encode_present(out);
26115 } else {
26116 ::fidl_next::WireBox::encode_absent(out);
26117 }
26118
26119 Ok(())
26120 }
26121}
26122
26123unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Service
26124where
26125 ___E: ::fidl_next::Encoder + ?Sized,
26126 Service: ::fidl_next::EncodeRef<___E>,
26127{
26128 #[inline]
26129 fn encode_option_ref(
26130 this: Option<&Self>,
26131 encoder: &mut ___E,
26132 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26133 ) -> Result<(), ::fidl_next::EncodeError> {
26134 if let Some(inner) = this {
26135 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
26136 ::fidl_next::WireBox::encode_present(out);
26137 } else {
26138 ::fidl_next::WireBox::encode_absent(out);
26139 }
26140
26141 Ok(())
26142 }
26143}
26144
26145impl ::fidl_next::FromWire<WireService> for Service {
26146 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireService, Self> =
26147 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
26148
26149 #[inline]
26150 fn from_wire(wire: WireService) -> Self {
26151 Self {}
26152 }
26153}
26154
26155impl ::fidl_next::FromWireRef<WireService> for Service {
26156 #[inline]
26157 fn from_wire_ref(wire: &WireService) -> Self {
26158 Self {}
26159 }
26160}
26161
26162#[derive(Clone, Debug)]
26164#[repr(C)]
26165pub struct WireService {}
26166
26167unsafe impl ::fidl_next::Wire for WireService {
26168 type Decoded<'de> = WireService;
26169
26170 #[inline]
26171 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
26172}
26173
26174unsafe impl<___D> ::fidl_next::Decode<___D> for WireService
26175where
26176 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26177{
26178 fn decode(
26179 slot: ::fidl_next::Slot<'_, Self>,
26180 decoder: &mut ___D,
26181 ) -> Result<(), ::fidl_next::DecodeError> {
26182 ::fidl_next::munge! {
26183 let Self {
26184
26185 } = slot;
26186 }
26187
26188 Ok(())
26189 }
26190}
26191
26192#[derive(Clone, Debug)]
26193pub struct SymlinkObject {
26194 pub target: Vec<u8>,
26195}
26196
26197impl ::fidl_next::Encodable for SymlinkObject {
26198 type Encoded = WireSymlinkObject<'static>;
26199}
26200
26201unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkObject
26202where
26203 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26204
26205 ___E: ::fidl_next::Encoder,
26206{
26207 #[inline]
26208 fn encode(
26209 self,
26210 encoder: &mut ___E,
26211 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26212 ) -> Result<(), ::fidl_next::EncodeError> {
26213 ::fidl_next::munge! {
26214 let Self::Encoded {
26215 target,
26216
26217 } = out;
26218 }
26219
26220 ::fidl_next::Encode::encode(self.target, encoder, target)?;
26221
26222 Ok(())
26223 }
26224}
26225
26226unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkObject
26227where
26228 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26229
26230 ___E: ::fidl_next::Encoder,
26231{
26232 #[inline]
26233 fn encode_ref(
26234 &self,
26235 encoder: &mut ___E,
26236 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26237 ) -> Result<(), ::fidl_next::EncodeError> {
26238 ::fidl_next::munge! {
26239 let Self::Encoded {
26240 target,
26241
26242 } = out;
26243 }
26244
26245 ::fidl_next::EncodeRef::encode_ref(&self.target, encoder, target)?;
26246
26247 Ok(())
26248 }
26249}
26250
26251impl ::fidl_next::EncodableOption for SymlinkObject {
26252 type EncodedOption = ::fidl_next::WireBox<'static, WireSymlinkObject<'static>>;
26253}
26254
26255unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SymlinkObject
26256where
26257 ___E: ::fidl_next::Encoder + ?Sized,
26258 SymlinkObject: ::fidl_next::Encode<___E>,
26259{
26260 #[inline]
26261 fn encode_option(
26262 this: Option<Self>,
26263 encoder: &mut ___E,
26264 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26265 ) -> Result<(), ::fidl_next::EncodeError> {
26266 if let Some(inner) = this {
26267 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
26268 ::fidl_next::WireBox::encode_present(out);
26269 } else {
26270 ::fidl_next::WireBox::encode_absent(out);
26271 }
26272
26273 Ok(())
26274 }
26275}
26276
26277unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SymlinkObject
26278where
26279 ___E: ::fidl_next::Encoder + ?Sized,
26280 SymlinkObject: ::fidl_next::EncodeRef<___E>,
26281{
26282 #[inline]
26283 fn encode_option_ref(
26284 this: Option<&Self>,
26285 encoder: &mut ___E,
26286 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26287 ) -> Result<(), ::fidl_next::EncodeError> {
26288 if let Some(inner) = this {
26289 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
26290 ::fidl_next::WireBox::encode_present(out);
26291 } else {
26292 ::fidl_next::WireBox::encode_absent(out);
26293 }
26294
26295 Ok(())
26296 }
26297}
26298
26299impl<'de> ::fidl_next::FromWire<WireSymlinkObject<'de>> for SymlinkObject {
26300 #[inline]
26301 fn from_wire(wire: WireSymlinkObject<'de>) -> Self {
26302 Self { target: ::fidl_next::FromWire::from_wire(wire.target) }
26303 }
26304}
26305
26306impl<'de> ::fidl_next::FromWireRef<WireSymlinkObject<'de>> for SymlinkObject {
26307 #[inline]
26308 fn from_wire_ref(wire: &WireSymlinkObject<'de>) -> Self {
26309 Self { target: ::fidl_next::FromWireRef::from_wire_ref(&wire.target) }
26310 }
26311}
26312
26313#[derive(Debug)]
26315#[repr(C)]
26316pub struct WireSymlinkObject<'de> {
26317 pub target: ::fidl_next::WireVector<'de, u8>,
26318}
26319
26320unsafe impl ::fidl_next::Wire for WireSymlinkObject<'static> {
26321 type Decoded<'de> = WireSymlinkObject<'de>;
26322
26323 #[inline]
26324 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
26325}
26326
26327unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkObject<'static>
26328where
26329 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26330
26331 ___D: ::fidl_next::Decoder,
26332{
26333 fn decode(
26334 slot: ::fidl_next::Slot<'_, Self>,
26335 decoder: &mut ___D,
26336 ) -> Result<(), ::fidl_next::DecodeError> {
26337 ::fidl_next::munge! {
26338 let Self {
26339 mut target,
26340
26341 } = slot;
26342 }
26343
26344 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
26345
26346 let target = unsafe { target.deref_unchecked() };
26347
26348 if target.len() > 4095 {
26349 return Err(::fidl_next::DecodeError::VectorTooLong {
26350 size: target.len() as u64,
26351 limit: 4095,
26352 });
26353 }
26354
26355 Ok(())
26356 }
26357}
26358
26359#[derive(Debug)]
26360pub enum NodeInfoDeprecated {
26361 Service(crate::Service),
26362
26363 File(crate::FileObject),
26364
26365 Directory(crate::DirectoryObject),
26366
26367 Symlink(crate::SymlinkObject),
26368}
26369
26370impl ::fidl_next::Encodable for NodeInfoDeprecated {
26371 type Encoded = WireNodeInfoDeprecated<'static>;
26372}
26373
26374unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfoDeprecated
26375where
26376 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26377
26378 ___E: ::fidl_next::Encoder,
26379
26380 ___E: ::fidl_next::fuchsia::HandleEncoder,
26381{
26382 #[inline]
26383 fn encode(
26384 self,
26385 encoder: &mut ___E,
26386 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26387 ) -> Result<(), ::fidl_next::EncodeError> {
26388 ::fidl_next::munge!(let WireNodeInfoDeprecated { raw, _phantom: _ } = out);
26389
26390 match self {
26391 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
26392 value, 1, encoder, raw,
26393 )?,
26394
26395 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileObject>(
26396 value, 2, encoder, raw,
26397 )?,
26398
26399 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
26400 ___E,
26401 crate::DirectoryObject,
26402 >(value, 3, encoder, raw)?,
26403
26404 Self::Symlink(value) => ::fidl_next::RawWireUnion::encode_as::<
26405 ___E,
26406 crate::SymlinkObject,
26407 >(value, 4, encoder, raw)?,
26408 }
26409
26410 Ok(())
26411 }
26412}
26413
26414impl ::fidl_next::EncodableOption for NodeInfoDeprecated {
26415 type EncodedOption = WireOptionalNodeInfoDeprecated<'static>;
26416}
26417
26418unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeInfoDeprecated
26419where
26420 ___E: ?Sized,
26421 NodeInfoDeprecated: ::fidl_next::Encode<___E>,
26422{
26423 #[inline]
26424 fn encode_option(
26425 this: Option<Self>,
26426 encoder: &mut ___E,
26427 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26428 ) -> Result<(), ::fidl_next::EncodeError> {
26429 ::fidl_next::munge!(let WireOptionalNodeInfoDeprecated { raw, _phantom: _ } = &mut *out);
26430
26431 if let Some(inner) = this {
26432 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
26433 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
26434 } else {
26435 ::fidl_next::RawWireUnion::encode_absent(raw);
26436 }
26437
26438 Ok(())
26439 }
26440}
26441
26442impl<'de> ::fidl_next::FromWire<WireNodeInfoDeprecated<'de>> for NodeInfoDeprecated {
26443 #[inline]
26444 fn from_wire(wire: WireNodeInfoDeprecated<'de>) -> Self {
26445 let wire = ::core::mem::ManuallyDrop::new(wire);
26446 match wire.raw.ordinal() {
26447 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
26448 wire.raw.get().read_unchecked::<crate::WireService>()
26449 })),
26450
26451 2 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
26452 wire.raw.get().read_unchecked::<crate::WireFileObject>()
26453 })),
26454
26455 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
26456 wire.raw.get().read_unchecked::<crate::WireDirectoryObject>()
26457 })),
26458
26459 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
26460 wire.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>()
26461 })),
26462
26463 _ => unsafe { ::core::hint::unreachable_unchecked() },
26464 }
26465 }
26466}
26467
26468impl<'de> ::fidl_next::FromWireOption<WireOptionalNodeInfoDeprecated<'de>>
26469 for Box<NodeInfoDeprecated>
26470{
26471 #[inline]
26472 fn from_wire_option(wire: WireOptionalNodeInfoDeprecated<'de>) -> Option<Self> {
26473 if let Some(inner) = wire.into_option() {
26474 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
26475 } else {
26476 None
26477 }
26478 }
26479}
26480
26481#[repr(transparent)]
26483pub struct WireNodeInfoDeprecated<'de> {
26484 raw: ::fidl_next::RawWireUnion,
26485 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26486}
26487
26488impl<'de> Drop for WireNodeInfoDeprecated<'de> {
26489 fn drop(&mut self) {
26490 match self.raw.ordinal() {
26491 1 => {
26492 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireService>() };
26493 }
26494
26495 2 => {
26496 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileObject>() };
26497 }
26498
26499 3 => {
26500 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryObject>() };
26501 }
26502
26503 4 => {
26504 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>() };
26505 }
26506
26507 _ => unsafe { ::core::hint::unreachable_unchecked() },
26508 }
26509 }
26510}
26511
26512unsafe impl ::fidl_next::Wire for WireNodeInfoDeprecated<'static> {
26513 type Decoded<'de> = WireNodeInfoDeprecated<'de>;
26514
26515 #[inline]
26516 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26517 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26518 ::fidl_next::RawWireUnion::zero_padding(raw);
26519 }
26520}
26521
26522pub mod node_info_deprecated {
26523 pub enum Ref<'de> {
26524 Service(&'de crate::WireService),
26525
26526 File(&'de crate::WireFileObject),
26527
26528 Directory(&'de crate::WireDirectoryObject),
26529
26530 Symlink(&'de crate::WireSymlinkObject<'de>),
26531 }
26532}
26533
26534impl<'de> WireNodeInfoDeprecated<'de> {
26535 pub fn as_ref(&self) -> crate::node_info_deprecated::Ref<'_> {
26536 match self.raw.ordinal() {
26537 1 => crate::node_info_deprecated::Ref::Service(unsafe {
26538 self.raw.get().deref_unchecked::<crate::WireService>()
26539 }),
26540
26541 2 => crate::node_info_deprecated::Ref::File(unsafe {
26542 self.raw.get().deref_unchecked::<crate::WireFileObject>()
26543 }),
26544
26545 3 => crate::node_info_deprecated::Ref::Directory(unsafe {
26546 self.raw.get().deref_unchecked::<crate::WireDirectoryObject>()
26547 }),
26548
26549 4 => crate::node_info_deprecated::Ref::Symlink(unsafe {
26550 self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>()
26551 }),
26552
26553 _ => unsafe { ::core::hint::unreachable_unchecked() },
26554 }
26555 }
26556}
26557
26558unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfoDeprecated<'static>
26559where
26560 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26561
26562 ___D: ::fidl_next::Decoder,
26563
26564 ___D: ::fidl_next::fuchsia::HandleDecoder,
26565{
26566 fn decode(
26567 mut slot: ::fidl_next::Slot<'_, Self>,
26568 decoder: &mut ___D,
26569 ) -> Result<(), ::fidl_next::DecodeError> {
26570 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26571 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
26572 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
26573
26574 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
26575
26576 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
26577 raw, decoder,
26578 )?,
26579
26580 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
26581 raw, decoder,
26582 )?,
26583
26584 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
26585 }
26586
26587 Ok(())
26588 }
26589}
26590
26591impl<'de> ::core::fmt::Debug for WireNodeInfoDeprecated<'de> {
26592 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26593 match self.raw.ordinal() {
26594 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService>().fmt(f) },
26595 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileObject>().fmt(f) },
26596 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryObject>().fmt(f) },
26597 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>().fmt(f) },
26598 _ => unsafe { ::core::hint::unreachable_unchecked() },
26599 }
26600 }
26601}
26602
26603#[repr(transparent)]
26604pub struct WireOptionalNodeInfoDeprecated<'de> {
26605 raw: ::fidl_next::RawWireUnion,
26606 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26607}
26608
26609unsafe impl ::fidl_next::Wire for WireOptionalNodeInfoDeprecated<'static> {
26610 type Decoded<'de> = WireOptionalNodeInfoDeprecated<'de>;
26611
26612 #[inline]
26613 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26614 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26615 ::fidl_next::RawWireUnion::zero_padding(raw);
26616 }
26617}
26618
26619impl<'de> WireOptionalNodeInfoDeprecated<'de> {
26620 pub fn is_some(&self) -> bool {
26621 self.raw.is_some()
26622 }
26623
26624 pub fn is_none(&self) -> bool {
26625 self.raw.is_none()
26626 }
26627
26628 pub fn as_ref(&self) -> Option<&WireNodeInfoDeprecated<'de>> {
26629 if self.is_some() {
26630 Some(unsafe { &*(self as *const Self).cast() })
26631 } else {
26632 None
26633 }
26634 }
26635
26636 pub fn into_option(self) -> Option<WireNodeInfoDeprecated<'de>> {
26637 if self.is_some() {
26638 Some(WireNodeInfoDeprecated { raw: self.raw, _phantom: ::core::marker::PhantomData })
26639 } else {
26640 None
26641 }
26642 }
26643}
26644
26645unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodeInfoDeprecated<'static>
26646where
26647 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26648
26649 ___D: ::fidl_next::Decoder,
26650
26651 ___D: ::fidl_next::fuchsia::HandleDecoder,
26652{
26653 fn decode(
26654 mut slot: ::fidl_next::Slot<'_, Self>,
26655 decoder: &mut ___D,
26656 ) -> Result<(), ::fidl_next::DecodeError> {
26657 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26658 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
26659 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
26660
26661 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
26662
26663 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
26664 raw, decoder,
26665 )?,
26666
26667 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
26668 raw, decoder,
26669 )?,
26670
26671 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
26672 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
26673 }
26674
26675 Ok(())
26676 }
26677}
26678
26679impl<'de> ::core::fmt::Debug for WireOptionalNodeInfoDeprecated<'de> {
26680 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26681 self.as_ref().fmt(f)
26682 }
26683}
26684
26685#[doc = " Flags used when opening a node reference must fall within this mask.\n"]
26686pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: crate::OpenFlags =
26687 crate::OpenFlags::from_bits_retain(46661632);
26688
26689#[doc = " All known rights.\n"]
26690pub const OPEN_RIGHTS: crate::OpenFlags = crate::OpenFlags::from_bits_retain(11);
26691
26692#[doc = " Set of permissions that are expected when opening a node as executable.\n"]
26693pub const PERM_EXECUTABLE: crate::Flags = crate::Flags::from_bits_retain(201);
26694
26695#[doc = " Set of permissions that are expected when opening a node as readable.\n"]
26696pub const PERM_READABLE: crate::Flags = crate::Flags::from_bits_retain(211);
26697
26698#[doc = " Set of permissions that are expected when opening a node as writable.\n"]
26699pub const PERM_WRITABLE: crate::Flags = crate::Flags::from_bits_retain(485);
26700
26701#[doc = " Alias for directory permission alias rw*\n"]
26702pub const RW_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(503);
26703
26704#[doc = " Alias for directory permission alias rx*\n"]
26705pub const RX_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(219);
26706
26707#[doc = " Alias for directory permission alias r*\n"]
26708pub const R_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(211);
26709
26710#[doc = " The name of the extended attribute accessible via the SELinux context attribute.\n"]
26711pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
26712
26713pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
26714
26715#[doc = " A [\'Node\'] which contains a symbolic link.\n"]
26717#[derive(Debug)]
26718pub struct Symlink;
26719
26720impl ::fidl_next::Discoverable for Symlink {
26721 const PROTOCOL_NAME: &'static str = "fuchsia.io.Symlink";
26722}
26723
26724pub mod symlink {
26725 pub mod prelude {
26726 pub use crate::{symlink, Symlink, SymlinkClientHandler, SymlinkServerHandler};
26727
26728 pub use crate::ExtendedAttributeValue;
26729
26730 pub use crate::LinkableLinkIntoRequest;
26731
26732 pub use crate::LinkableLinkIntoResponse;
26733
26734 pub use crate::MutableNodeAttributes;
26735
26736 pub use crate::NodeAttributes2;
26737
26738 pub use crate::NodeDeprecatedCloneRequest;
26739
26740 pub use crate::NodeDeprecatedGetAttrResponse;
26741
26742 pub use crate::NodeDeprecatedGetFlagsResponse;
26743
26744 pub use crate::NodeDeprecatedSetAttrRequest;
26745
26746 pub use crate::NodeDeprecatedSetAttrResponse;
26747
26748 pub use crate::NodeDeprecatedSetFlagsRequest;
26749
26750 pub use crate::NodeDeprecatedSetFlagsResponse;
26751
26752 pub use crate::NodeGetAttributesRequest;
26753
26754 pub use crate::NodeGetExtendedAttributeRequest;
26755
26756 pub use crate::NodeListExtendedAttributesRequest;
26757
26758 pub use crate::NodeOnOpenRequest;
26759
26760 pub use crate::NodeQueryFilesystemResponse;
26761
26762 pub use crate::NodeRemoveExtendedAttributeRequest;
26763
26764 pub use crate::NodeSetExtendedAttributeRequest;
26765
26766 pub use crate::NodeSetFlagsRequest;
26767
26768 pub use crate::NodeGetFlagsResponse;
26769
26770 pub use crate::NodeRemoveExtendedAttributeResponse;
26771
26772 pub use crate::NodeSetExtendedAttributeResponse;
26773
26774 pub use crate::NodeSetFlagsResponse;
26775
26776 pub use crate::NodeSyncResponse;
26777
26778 pub use crate::NodeUpdateAttributesResponse;
26779
26780 pub use crate::Representation;
26781
26782 pub use crate::SymlinkInfo;
26783
26784 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
26785
26786 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
26787
26788 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
26789 }
26790
26791 pub struct LinkInto;
26792
26793 impl ::fidl_next::Method for LinkInto {
26794 const ORDINAL: u64 = 6121399674497678964;
26795
26796 type Protocol = crate::Symlink;
26797
26798 type Request = crate::WireLinkableLinkIntoRequest<'static>;
26799
26800 type Response = ::fidl_next::WireResult<
26801 'static,
26802 crate::WireLinkableLinkIntoResponse,
26803 ::fidl_next::WireI32,
26804 >;
26805 }
26806
26807 pub struct Clone;
26808
26809 impl ::fidl_next::Method for Clone {
26810 const ORDINAL: u64 = 2366825959783828089;
26811
26812 type Protocol = crate::Symlink;
26813
26814 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
26815
26816 type Response = ::fidl_next::Never;
26817 }
26818
26819 pub struct Close;
26820
26821 impl ::fidl_next::Method for Close {
26822 const ORDINAL: u64 = 6540867515453498750;
26823
26824 type Protocol = crate::Symlink;
26825
26826 type Request = ();
26827
26828 type Response = ::fidl_next::WireResult<
26829 'static,
26830 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
26831 ::fidl_next::WireI32,
26832 >;
26833 }
26834
26835 pub struct Query;
26836
26837 impl ::fidl_next::Method for Query {
26838 const ORDINAL: u64 = 2763219980499352582;
26839
26840 type Protocol = crate::Symlink;
26841
26842 type Request = ();
26843
26844 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
26845 }
26846
26847 pub struct DeprecatedClone;
26848
26849 impl ::fidl_next::Method for DeprecatedClone {
26850 const ORDINAL: u64 = 6512600400724287855;
26851
26852 type Protocol = crate::Symlink;
26853
26854 type Request = crate::WireNodeDeprecatedCloneRequest;
26855
26856 type Response = ::fidl_next::Never;
26857 }
26858
26859 pub struct OnOpen;
26860
26861 impl ::fidl_next::Method for OnOpen {
26862 const ORDINAL: u64 = 9207534335756671346;
26863
26864 type Protocol = crate::Symlink;
26865
26866 type Request = ::fidl_next::Never;
26867
26868 type Response = crate::WireNodeOnOpenRequest<'static>;
26869 }
26870
26871 pub struct DeprecatedGetAttr;
26872
26873 impl ::fidl_next::Method for DeprecatedGetAttr {
26874 const ORDINAL: u64 = 8689798978500614909;
26875
26876 type Protocol = crate::Symlink;
26877
26878 type Request = ();
26879
26880 type Response = crate::WireNodeDeprecatedGetAttrResponse;
26881 }
26882
26883 pub struct DeprecatedSetAttr;
26884
26885 impl ::fidl_next::Method for DeprecatedSetAttr {
26886 const ORDINAL: u64 = 4721673413776871238;
26887
26888 type Protocol = crate::Symlink;
26889
26890 type Request = crate::WireNodeDeprecatedSetAttrRequest;
26891
26892 type Response = crate::WireNodeDeprecatedSetAttrResponse;
26893 }
26894
26895 pub struct DeprecatedGetFlags;
26896
26897 impl ::fidl_next::Method for DeprecatedGetFlags {
26898 const ORDINAL: u64 = 6595803110182632097;
26899
26900 type Protocol = crate::Symlink;
26901
26902 type Request = ();
26903
26904 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
26905 }
26906
26907 pub struct DeprecatedSetFlags;
26908
26909 impl ::fidl_next::Method for DeprecatedSetFlags {
26910 const ORDINAL: u64 = 5950864159036794675;
26911
26912 type Protocol = crate::Symlink;
26913
26914 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
26915
26916 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
26917 }
26918
26919 pub struct GetFlags;
26920
26921 impl ::fidl_next::Method for GetFlags {
26922 const ORDINAL: u64 = 105530239381466147;
26923
26924 type Protocol = crate::Symlink;
26925
26926 type Request = ();
26927
26928 type Response = ::fidl_next::WireFlexibleResult<
26929 'static,
26930 crate::WireNodeGetFlagsResponse,
26931 ::fidl_next::WireI32,
26932 >;
26933 }
26934
26935 pub struct SetFlags;
26936
26937 impl ::fidl_next::Method for SetFlags {
26938 const ORDINAL: u64 = 6172186066099445416;
26939
26940 type Protocol = crate::Symlink;
26941
26942 type Request = crate::WireNodeSetFlagsRequest;
26943
26944 type Response = ::fidl_next::WireFlexibleResult<
26945 'static,
26946 crate::WireNodeSetFlagsResponse,
26947 ::fidl_next::WireI32,
26948 >;
26949 }
26950
26951 pub struct QueryFilesystem;
26952
26953 impl ::fidl_next::Method for QueryFilesystem {
26954 const ORDINAL: u64 = 8013111122914313744;
26955
26956 type Protocol = crate::Symlink;
26957
26958 type Request = ();
26959
26960 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
26961 }
26962
26963 pub struct OnRepresentation;
26964
26965 impl ::fidl_next::Method for OnRepresentation {
26966 const ORDINAL: u64 = 6679970090861613324;
26967
26968 type Protocol = crate::Symlink;
26969
26970 type Request = ::fidl_next::Never;
26971
26972 type Response = crate::WireRepresentation<'static>;
26973 }
26974
26975 pub struct GetAttributes;
26976
26977 impl ::fidl_next::Method for GetAttributes {
26978 const ORDINAL: u64 = 4414537700416816443;
26979
26980 type Protocol = crate::Symlink;
26981
26982 type Request = crate::WireNodeGetAttributesRequest;
26983
26984 type Response = ::fidl_next::WireResult<
26985 'static,
26986 crate::WireNodeAttributes2<'static>,
26987 ::fidl_next::WireI32,
26988 >;
26989 }
26990
26991 pub struct UpdateAttributes;
26992
26993 impl ::fidl_next::Method for UpdateAttributes {
26994 const ORDINAL: u64 = 3677402239314018056;
26995
26996 type Protocol = crate::Symlink;
26997
26998 type Request = crate::WireMutableNodeAttributes<'static>;
26999
27000 type Response = ::fidl_next::WireResult<
27001 'static,
27002 crate::WireNodeUpdateAttributesResponse,
27003 ::fidl_next::WireI32,
27004 >;
27005 }
27006
27007 pub struct Sync;
27008
27009 impl ::fidl_next::Method for Sync {
27010 const ORDINAL: u64 = 3196473584242777161;
27011
27012 type Protocol = crate::Symlink;
27013
27014 type Request = ();
27015
27016 type Response =
27017 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
27018 }
27019
27020 pub struct ListExtendedAttributes;
27021
27022 impl ::fidl_next::Method for ListExtendedAttributes {
27023 const ORDINAL: u64 = 5431626189872037072;
27024
27025 type Protocol = crate::Symlink;
27026
27027 type Request = crate::WireNodeListExtendedAttributesRequest;
27028
27029 type Response = ::fidl_next::Never;
27030 }
27031
27032 pub struct GetExtendedAttribute;
27033
27034 impl ::fidl_next::Method for GetExtendedAttribute {
27035 const ORDINAL: u64 = 5043930208506967771;
27036
27037 type Protocol = crate::Symlink;
27038
27039 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
27040
27041 type Response = ::fidl_next::WireResult<
27042 'static,
27043 crate::WireExtendedAttributeValue<'static>,
27044 ::fidl_next::WireI32,
27045 >;
27046 }
27047
27048 pub struct SetExtendedAttribute;
27049
27050 impl ::fidl_next::Method for SetExtendedAttribute {
27051 const ORDINAL: u64 = 5374223046099989052;
27052
27053 type Protocol = crate::Symlink;
27054
27055 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
27056
27057 type Response = ::fidl_next::WireResult<
27058 'static,
27059 crate::WireNodeSetExtendedAttributeResponse,
27060 ::fidl_next::WireI32,
27061 >;
27062 }
27063
27064 pub struct RemoveExtendedAttribute;
27065
27066 impl ::fidl_next::Method for RemoveExtendedAttribute {
27067 const ORDINAL: u64 = 8794297771444732717;
27068
27069 type Protocol = crate::Symlink;
27070
27071 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
27072
27073 type Response = ::fidl_next::WireResult<
27074 'static,
27075 crate::WireNodeRemoveExtendedAttributeResponse,
27076 ::fidl_next::WireI32,
27077 >;
27078 }
27079
27080 pub struct Describe;
27081
27082 impl ::fidl_next::Method for Describe {
27083 const ORDINAL: u64 = 8371117097481679347;
27084
27085 type Protocol = crate::Symlink;
27086
27087 type Request = ();
27088
27089 type Response = ::fidl_next::WireFlexible<'static, crate::WireSymlinkInfo<'static>>;
27090 }
27091
27092 mod ___detail {
27093
27094 pub struct LinkInto<T0, T1> {
27095 dst_parent_token: T0,
27096
27097 dst: T1,
27098 }
27099
27100 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
27101 where
27102 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
27103
27104 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
27105 {
27106 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
27107 }
27108
27109 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
27110 where
27111 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27112
27113 ___E: ::fidl_next::Encoder,
27114
27115 ___E: ::fidl_next::fuchsia::HandleEncoder,
27116
27117 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
27118
27119 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
27120 {
27121 #[inline]
27122 fn encode(
27123 self,
27124 encoder: &mut ___E,
27125 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27126 ) -> Result<(), ::fidl_next::EncodeError> {
27127 ::fidl_next::munge! {
27128 let Self::Encoded {
27129 dst_parent_token,
27130 dst,
27131
27132 } = out;
27133 }
27134
27135 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
27136
27137 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
27138
27139 Ok(())
27140 }
27141 }
27142
27143 pub struct Clone<T0> {
27144 request: T0,
27145 }
27146
27147 impl<T0> ::fidl_next::Encodable for Clone<T0>
27148 where
27149 T0: ::fidl_next::Encodable<
27150 Encoded = ::fidl_next::ServerEnd<
27151 ::fidl_next_fuchsia_unknown::Cloneable,
27152 ::fidl_next::fuchsia::WireChannel,
27153 >,
27154 >,
27155 {
27156 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
27157 }
27158
27159 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
27160 where
27161 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27162
27163 ___E: ::fidl_next::fuchsia::HandleEncoder,
27164
27165 T0: ::fidl_next::Encode<
27166 ___E,
27167 Encoded = ::fidl_next::ServerEnd<
27168 ::fidl_next_fuchsia_unknown::Cloneable,
27169 ::fidl_next::fuchsia::WireChannel,
27170 >,
27171 >,
27172 {
27173 #[inline]
27174 fn encode(
27175 self,
27176 encoder: &mut ___E,
27177 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27178 ) -> Result<(), ::fidl_next::EncodeError> {
27179 ::fidl_next::munge! {
27180 let Self::Encoded {
27181 request,
27182
27183 } = out;
27184 }
27185
27186 ::fidl_next::Encode::encode(self.request, encoder, request)?;
27187
27188 Ok(())
27189 }
27190 }
27191
27192 pub struct DeprecatedClone<T0, T1> {
27193 flags: T0,
27194
27195 object: T1,
27196 }
27197
27198 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
27199 where
27200 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
27201
27202 T1: ::fidl_next::Encodable<
27203 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
27204 >,
27205 {
27206 type Encoded = crate::WireNodeDeprecatedCloneRequest;
27207 }
27208
27209 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
27210 where
27211 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27212
27213 ___E: ::fidl_next::fuchsia::HandleEncoder,
27214
27215 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
27216
27217 T1: ::fidl_next::Encode<
27218 ___E,
27219 Encoded = ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
27220 >,
27221 {
27222 #[inline]
27223 fn encode(
27224 self,
27225 encoder: &mut ___E,
27226 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27227 ) -> Result<(), ::fidl_next::EncodeError> {
27228 ::fidl_next::munge! {
27229 let Self::Encoded {
27230 flags,
27231 object,
27232
27233 } = out;
27234 }
27235
27236 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
27237
27238 ::fidl_next::Encode::encode(self.object, encoder, object)?;
27239
27240 Ok(())
27241 }
27242 }
27243
27244 pub struct OnOpen<T0, T1> {
27245 s: T0,
27246
27247 info: T1,
27248 }
27249
27250 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
27251 where
27252 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
27253
27254 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
27255 {
27256 type Encoded = crate::WireNodeOnOpenRequest<'static>;
27257 }
27258
27259 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
27260 where
27261 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27262
27263 ___E: ::fidl_next::Encoder,
27264
27265 ___E: ::fidl_next::fuchsia::HandleEncoder,
27266
27267 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
27268
27269 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
27270 {
27271 #[inline]
27272 fn encode(
27273 self,
27274 encoder: &mut ___E,
27275 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27276 ) -> Result<(), ::fidl_next::EncodeError> {
27277 ::fidl_next::munge! {
27278 let Self::Encoded {
27279 s,
27280 info,
27281
27282 } = out;
27283 }
27284
27285 ::fidl_next::Encode::encode(self.s, encoder, s)?;
27286
27287 ::fidl_next::Encode::encode(self.info, encoder, info)?;
27288
27289 Ok(())
27290 }
27291 }
27292
27293 pub struct DeprecatedSetAttr<T0, T1> {
27294 flags: T0,
27295
27296 attributes: T1,
27297 }
27298
27299 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
27300 where
27301 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
27302
27303 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
27304 {
27305 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
27306 }
27307
27308 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
27309 where
27310 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27311
27312 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
27313
27314 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
27315 {
27316 #[inline]
27317 fn encode(
27318 self,
27319 encoder: &mut ___E,
27320 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27321 ) -> Result<(), ::fidl_next::EncodeError> {
27322 ::fidl_next::munge! {
27323 let Self::Encoded {
27324 flags,
27325 attributes,
27326
27327 } = out;
27328 }
27329
27330 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
27331
27332 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
27333
27334 Ok(())
27335 }
27336 }
27337
27338 pub struct DeprecatedSetFlags<T0> {
27339 flags: T0,
27340 }
27341
27342 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
27343 where
27344 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
27345 {
27346 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
27347 }
27348
27349 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
27350 where
27351 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27352
27353 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
27354 {
27355 #[inline]
27356 fn encode(
27357 self,
27358 encoder: &mut ___E,
27359 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27360 ) -> Result<(), ::fidl_next::EncodeError> {
27361 ::fidl_next::munge! {
27362 let Self::Encoded {
27363 flags,
27364
27365 } = out;
27366 }
27367
27368 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
27369
27370 Ok(())
27371 }
27372 }
27373
27374 pub struct SetFlags<T0> {
27375 flags: T0,
27376 }
27377
27378 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
27379 where
27380 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
27381 {
27382 type Encoded = crate::WireNodeSetFlagsRequest;
27383 }
27384
27385 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
27386 where
27387 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27388
27389 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
27390 {
27391 #[inline]
27392 fn encode(
27393 self,
27394 encoder: &mut ___E,
27395 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27396 ) -> Result<(), ::fidl_next::EncodeError> {
27397 ::fidl_next::munge! {
27398 let Self::Encoded {
27399 flags,
27400
27401 } = out;
27402 }
27403
27404 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
27405
27406 Ok(())
27407 }
27408 }
27409
27410 pub struct GetAttributes<T0> {
27411 query: T0,
27412 }
27413
27414 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
27415 where
27416 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
27417 {
27418 type Encoded = crate::WireNodeGetAttributesRequest;
27419 }
27420
27421 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
27422 where
27423 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27424
27425 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
27426 {
27427 #[inline]
27428 fn encode(
27429 self,
27430 encoder: &mut ___E,
27431 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27432 ) -> Result<(), ::fidl_next::EncodeError> {
27433 ::fidl_next::munge! {
27434 let Self::Encoded {
27435 query,
27436
27437 } = out;
27438 }
27439
27440 ::fidl_next::Encode::encode(self.query, encoder, query)?;
27441
27442 Ok(())
27443 }
27444 }
27445
27446 pub struct ListExtendedAttributes<T0> {
27447 iterator: T0,
27448 }
27449
27450 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
27451 where
27452 T0: ::fidl_next::Encodable<
27453 Encoded = ::fidl_next::ServerEnd<
27454 crate::ExtendedAttributeIterator,
27455 ::fidl_next::fuchsia::WireChannel,
27456 >,
27457 >,
27458 {
27459 type Encoded = crate::WireNodeListExtendedAttributesRequest;
27460 }
27461
27462 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
27463 where
27464 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27465
27466 ___E: ::fidl_next::fuchsia::HandleEncoder,
27467
27468 T0: ::fidl_next::Encode<
27469 ___E,
27470 Encoded = ::fidl_next::ServerEnd<
27471 crate::ExtendedAttributeIterator,
27472 ::fidl_next::fuchsia::WireChannel,
27473 >,
27474 >,
27475 {
27476 #[inline]
27477 fn encode(
27478 self,
27479 encoder: &mut ___E,
27480 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27481 ) -> Result<(), ::fidl_next::EncodeError> {
27482 ::fidl_next::munge! {
27483 let Self::Encoded {
27484 iterator,
27485
27486 } = out;
27487 }
27488
27489 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
27490
27491 Ok(())
27492 }
27493 }
27494
27495 pub struct GetExtendedAttribute<T0> {
27496 name: T0,
27497 }
27498
27499 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
27500 where
27501 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
27502 {
27503 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
27504 }
27505
27506 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
27507 where
27508 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27509
27510 ___E: ::fidl_next::Encoder,
27511
27512 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
27513 {
27514 #[inline]
27515 fn encode(
27516 self,
27517 encoder: &mut ___E,
27518 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27519 ) -> Result<(), ::fidl_next::EncodeError> {
27520 ::fidl_next::munge! {
27521 let Self::Encoded {
27522 name,
27523
27524 } = out;
27525 }
27526
27527 ::fidl_next::Encode::encode(self.name, encoder, name)?;
27528
27529 Ok(())
27530 }
27531 }
27532
27533 pub struct SetExtendedAttribute<T0, T1, T2> {
27534 name: T0,
27535
27536 value: T1,
27537
27538 mode: T2,
27539 }
27540
27541 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
27542 where
27543 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
27544
27545 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
27546
27547 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
27548 {
27549 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
27550 }
27551
27552 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
27553 where
27554 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27555
27556 ___E: ::fidl_next::Encoder,
27557
27558 ___E: ::fidl_next::fuchsia::HandleEncoder,
27559
27560 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
27561
27562 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
27563
27564 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
27565 {
27566 #[inline]
27567 fn encode(
27568 self,
27569 encoder: &mut ___E,
27570 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27571 ) -> Result<(), ::fidl_next::EncodeError> {
27572 ::fidl_next::munge! {
27573 let Self::Encoded {
27574 name,
27575 value,
27576 mode,
27577
27578 } = out;
27579 }
27580
27581 ::fidl_next::Encode::encode(self.name, encoder, name)?;
27582
27583 ::fidl_next::Encode::encode(self.value, encoder, value)?;
27584
27585 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
27586
27587 Ok(())
27588 }
27589 }
27590
27591 pub struct RemoveExtendedAttribute<T0> {
27592 name: T0,
27593 }
27594
27595 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
27596 where
27597 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
27598 {
27599 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
27600 }
27601
27602 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
27603 where
27604 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27605
27606 ___E: ::fidl_next::Encoder,
27607
27608 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
27609 {
27610 #[inline]
27611 fn encode(
27612 self,
27613 encoder: &mut ___E,
27614 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27615 ) -> Result<(), ::fidl_next::EncodeError> {
27616 ::fidl_next::munge! {
27617 let Self::Encoded {
27618 name,
27619
27620 } = out;
27621 }
27622
27623 ::fidl_next::Encode::encode(self.name, encoder, name)?;
27624
27625 Ok(())
27626 }
27627 }
27628
27629 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Symlink
27630 where
27631 ___T: ::fidl_next::Transport,
27632 {
27633 type ClientSender = SymlinkClientSender<___T>;
27634 type ServerSender = SymlinkServerSender<___T>;
27635 }
27636
27637 pub struct SymlinkClientSender<___T: ::fidl_next::Transport> {
27639 #[allow(dead_code)]
27640 sender: ::fidl_next::protocol::ClientSender<___T>,
27641 }
27642
27643 impl<___T> SymlinkClientSender<___T>
27644 where
27645 ___T: ::fidl_next::Transport,
27646 {
27647 #[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"]
27648 pub fn link_into(
27649 &self,
27650
27651 dst_parent_token: impl ::fidl_next::Encode<
27652 <___T as ::fidl_next::Transport>::SendBuffer,
27653 Encoded = ::fidl_next::fuchsia::WireHandle,
27654 >,
27655
27656 dst: impl ::fidl_next::Encode<
27657 <___T as ::fidl_next::Transport>::SendBuffer,
27658 Encoded = ::fidl_next::WireString<'static>,
27659 >,
27660 ) -> Result<
27661 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
27662 ::fidl_next::EncodeError,
27663 >
27664 where
27665 <___T as ::fidl_next::Transport>::SendBuffer:
27666 ::fidl_next::encoder::InternalHandleEncoder,
27667
27668 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
27669
27670 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27671 {
27672 self.link_into_with(LinkInto { dst_parent_token, dst })
27673 }
27674
27675 #[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"]
27676 pub fn link_into_with<___R>(
27677 &self,
27678 request: ___R,
27679 ) -> Result<
27680 ::fidl_next::ResponseFuture<'_, super::LinkInto, ___T>,
27681 ::fidl_next::EncodeError,
27682 >
27683 where
27684 ___R: ::fidl_next::Encode<
27685 <___T as ::fidl_next::Transport>::SendBuffer,
27686 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
27687 >,
27688 {
27689 self.sender
27690 .send_two_way(6121399674497678964, request)
27691 .map(::fidl_next::ResponseFuture::from_untyped)
27692 }
27693
27694 pub fn clone(
27695 &self,
27696
27697 request: impl ::fidl_next::Encode<
27698 <___T as ::fidl_next::Transport>::SendBuffer,
27699 Encoded = ::fidl_next::ServerEnd<
27700 ::fidl_next_fuchsia_unknown::Cloneable,
27701 ::fidl_next::fuchsia::WireChannel,
27702 >,
27703 >,
27704 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
27705 where
27706 <___T as ::fidl_next::Transport>::SendBuffer:
27707 ::fidl_next::encoder::InternalHandleEncoder,
27708
27709 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27710 {
27711 self.clone_with(Clone { request })
27712 }
27713
27714 pub fn clone_with<___R>(
27715 &self,
27716 request: ___R,
27717 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
27718 where
27719 ___R: ::fidl_next::Encode<
27720 <___T as ::fidl_next::Transport>::SendBuffer,
27721 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
27722 >,
27723 {
27724 self.sender.send_one_way(2366825959783828089, request)
27725 }
27726
27727 #[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"]
27728 pub fn close(
27729 &self,
27730 ) -> Result<::fidl_next::ResponseFuture<'_, super::Close, ___T>, ::fidl_next::EncodeError>
27731 {
27732 self.sender
27733 .send_two_way(6540867515453498750, ())
27734 .map(::fidl_next::ResponseFuture::from_untyped)
27735 }
27736
27737 pub fn query(
27738 &self,
27739 ) -> Result<::fidl_next::ResponseFuture<'_, super::Query, ___T>, ::fidl_next::EncodeError>
27740 {
27741 self.sender
27742 .send_two_way(2763219980499352582, ())
27743 .map(::fidl_next::ResponseFuture::from_untyped)
27744 }
27745
27746 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
27747 pub fn deprecated_clone(
27748 &self,
27749
27750 flags: impl ::fidl_next::Encode<
27751 <___T as ::fidl_next::Transport>::SendBuffer,
27752 Encoded = crate::WireOpenFlags,
27753 >,
27754
27755 object: impl ::fidl_next::Encode<
27756 <___T as ::fidl_next::Transport>::SendBuffer,
27757 Encoded = ::fidl_next::ServerEnd<
27758 crate::Node,
27759 ::fidl_next::fuchsia::WireChannel,
27760 >,
27761 >,
27762 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
27763 where
27764 <___T as ::fidl_next::Transport>::SendBuffer:
27765 ::fidl_next::encoder::InternalHandleEncoder,
27766
27767 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27768 {
27769 self.deprecated_clone_with(DeprecatedClone { flags, object })
27770 }
27771
27772 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
27773 pub fn deprecated_clone_with<___R>(
27774 &self,
27775 request: ___R,
27776 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
27777 where
27778 ___R: ::fidl_next::Encode<
27779 <___T as ::fidl_next::Transport>::SendBuffer,
27780 Encoded = crate::WireNodeDeprecatedCloneRequest,
27781 >,
27782 {
27783 self.sender.send_one_way(6512600400724287855, request)
27784 }
27785
27786 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
27787 pub fn deprecated_get_attr(
27788 &self,
27789 ) -> Result<
27790 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetAttr, ___T>,
27791 ::fidl_next::EncodeError,
27792 > {
27793 self.sender
27794 .send_two_way(8689798978500614909, ())
27795 .map(::fidl_next::ResponseFuture::from_untyped)
27796 }
27797
27798 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
27799 pub fn deprecated_set_attr(
27800 &self,
27801
27802 flags: impl ::fidl_next::Encode<
27803 <___T as ::fidl_next::Transport>::SendBuffer,
27804 Encoded = crate::WireNodeAttributeFlags,
27805 >,
27806
27807 attributes: impl ::fidl_next::Encode<
27808 <___T as ::fidl_next::Transport>::SendBuffer,
27809 Encoded = crate::WireNodeAttributes,
27810 >,
27811 ) -> Result<
27812 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
27813 ::fidl_next::EncodeError,
27814 >
27815 where
27816 <___T as ::fidl_next::Transport>::SendBuffer:
27817 ::fidl_next::encoder::InternalHandleEncoder,
27818 {
27819 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
27820 }
27821
27822 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
27823 pub fn deprecated_set_attr_with<___R>(
27824 &self,
27825 request: ___R,
27826 ) -> Result<
27827 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetAttr, ___T>,
27828 ::fidl_next::EncodeError,
27829 >
27830 where
27831 ___R: ::fidl_next::Encode<
27832 <___T as ::fidl_next::Transport>::SendBuffer,
27833 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
27834 >,
27835 {
27836 self.sender
27837 .send_two_way(4721673413776871238, request)
27838 .map(::fidl_next::ResponseFuture::from_untyped)
27839 }
27840
27841 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
27842 pub fn deprecated_get_flags(
27843 &self,
27844 ) -> Result<
27845 ::fidl_next::ResponseFuture<'_, super::DeprecatedGetFlags, ___T>,
27846 ::fidl_next::EncodeError,
27847 > {
27848 self.sender
27849 .send_two_way(6595803110182632097, ())
27850 .map(::fidl_next::ResponseFuture::from_untyped)
27851 }
27852
27853 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
27854 pub fn deprecated_set_flags(
27855 &self,
27856
27857 flags: impl ::fidl_next::Encode<
27858 <___T as ::fidl_next::Transport>::SendBuffer,
27859 Encoded = crate::WireOpenFlags,
27860 >,
27861 ) -> Result<
27862 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
27863 ::fidl_next::EncodeError,
27864 >
27865 where
27866 <___T as ::fidl_next::Transport>::SendBuffer:
27867 ::fidl_next::encoder::InternalHandleEncoder,
27868 {
27869 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
27870 }
27871
27872 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
27873 pub fn deprecated_set_flags_with<___R>(
27874 &self,
27875 request: ___R,
27876 ) -> Result<
27877 ::fidl_next::ResponseFuture<'_, super::DeprecatedSetFlags, ___T>,
27878 ::fidl_next::EncodeError,
27879 >
27880 where
27881 ___R: ::fidl_next::Encode<
27882 <___T as ::fidl_next::Transport>::SendBuffer,
27883 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
27884 >,
27885 {
27886 self.sender
27887 .send_two_way(5950864159036794675, request)
27888 .map(::fidl_next::ResponseFuture::from_untyped)
27889 }
27890
27891 #[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"]
27892 pub fn get_flags(
27893 &self,
27894 ) -> Result<
27895 ::fidl_next::ResponseFuture<'_, super::GetFlags, ___T>,
27896 ::fidl_next::EncodeError,
27897 > {
27898 self.sender
27899 .send_two_way(105530239381466147, ())
27900 .map(::fidl_next::ResponseFuture::from_untyped)
27901 }
27902
27903 #[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"]
27904 pub fn set_flags(
27905 &self,
27906
27907 flags: impl ::fidl_next::Encode<
27908 <___T as ::fidl_next::Transport>::SendBuffer,
27909 Encoded = crate::WireFlags,
27910 >,
27911 ) -> Result<
27912 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
27913 ::fidl_next::EncodeError,
27914 >
27915 where
27916 <___T as ::fidl_next::Transport>::SendBuffer:
27917 ::fidl_next::encoder::InternalHandleEncoder,
27918 {
27919 self.set_flags_with(SetFlags { flags })
27920 }
27921
27922 #[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"]
27923 pub fn set_flags_with<___R>(
27924 &self,
27925 request: ___R,
27926 ) -> Result<
27927 ::fidl_next::ResponseFuture<'_, super::SetFlags, ___T>,
27928 ::fidl_next::EncodeError,
27929 >
27930 where
27931 ___R: ::fidl_next::Encode<
27932 <___T as ::fidl_next::Transport>::SendBuffer,
27933 Encoded = crate::WireNodeSetFlagsRequest,
27934 >,
27935 {
27936 self.sender
27937 .send_two_way(6172186066099445416, request)
27938 .map(::fidl_next::ResponseFuture::from_untyped)
27939 }
27940
27941 #[doc = " Query the filesystem for filesystem-specific information.\n"]
27942 pub fn query_filesystem(
27943 &self,
27944 ) -> Result<
27945 ::fidl_next::ResponseFuture<'_, super::QueryFilesystem, ___T>,
27946 ::fidl_next::EncodeError,
27947 > {
27948 self.sender
27949 .send_two_way(8013111122914313744, ())
27950 .map(::fidl_next::ResponseFuture::from_untyped)
27951 }
27952
27953 #[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"]
27954 pub fn get_attributes(
27955 &self,
27956
27957 query: impl ::fidl_next::Encode<
27958 <___T as ::fidl_next::Transport>::SendBuffer,
27959 Encoded = crate::WireNodeAttributesQuery,
27960 >,
27961 ) -> Result<
27962 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
27963 ::fidl_next::EncodeError,
27964 >
27965 where
27966 <___T as ::fidl_next::Transport>::SendBuffer:
27967 ::fidl_next::encoder::InternalHandleEncoder,
27968 {
27969 self.get_attributes_with(GetAttributes { query })
27970 }
27971
27972 #[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"]
27973 pub fn get_attributes_with<___R>(
27974 &self,
27975 request: ___R,
27976 ) -> Result<
27977 ::fidl_next::ResponseFuture<'_, super::GetAttributes, ___T>,
27978 ::fidl_next::EncodeError,
27979 >
27980 where
27981 ___R: ::fidl_next::Encode<
27982 <___T as ::fidl_next::Transport>::SendBuffer,
27983 Encoded = crate::WireNodeGetAttributesRequest,
27984 >,
27985 {
27986 self.sender
27987 .send_two_way(4414537700416816443, request)
27988 .map(::fidl_next::ResponseFuture::from_untyped)
27989 }
27990
27991 #[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"]
27992 pub fn update_attributes_with<___R>(
27993 &self,
27994 request: ___R,
27995 ) -> Result<
27996 ::fidl_next::ResponseFuture<'_, super::UpdateAttributes, ___T>,
27997 ::fidl_next::EncodeError,
27998 >
27999 where
28000 ___R: ::fidl_next::Encode<
28001 <___T as ::fidl_next::Transport>::SendBuffer,
28002 Encoded = crate::WireMutableNodeAttributes<'static>,
28003 >,
28004 {
28005 self.sender
28006 .send_two_way(3677402239314018056, request)
28007 .map(::fidl_next::ResponseFuture::from_untyped)
28008 }
28009
28010 #[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"]
28011 pub fn sync(
28012 &self,
28013 ) -> Result<::fidl_next::ResponseFuture<'_, super::Sync, ___T>, ::fidl_next::EncodeError>
28014 {
28015 self.sender
28016 .send_two_way(3196473584242777161, ())
28017 .map(::fidl_next::ResponseFuture::from_untyped)
28018 }
28019
28020 #[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"]
28021 pub fn list_extended_attributes(
28022 &self,
28023
28024 iterator: impl ::fidl_next::Encode<
28025 <___T as ::fidl_next::Transport>::SendBuffer,
28026 Encoded = ::fidl_next::ServerEnd<
28027 crate::ExtendedAttributeIterator,
28028 ::fidl_next::fuchsia::WireChannel,
28029 >,
28030 >,
28031 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
28032 where
28033 <___T as ::fidl_next::Transport>::SendBuffer:
28034 ::fidl_next::encoder::InternalHandleEncoder,
28035
28036 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
28037 {
28038 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
28039 }
28040
28041 #[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"]
28042 pub fn list_extended_attributes_with<___R>(
28043 &self,
28044 request: ___R,
28045 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
28046 where
28047 ___R: ::fidl_next::Encode<
28048 <___T as ::fidl_next::Transport>::SendBuffer,
28049 Encoded = crate::WireNodeListExtendedAttributesRequest,
28050 >,
28051 {
28052 self.sender.send_one_way(5431626189872037072, request)
28053 }
28054
28055 #[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"]
28056 pub fn get_extended_attribute(
28057 &self,
28058
28059 name: impl ::fidl_next::Encode<
28060 <___T as ::fidl_next::Transport>::SendBuffer,
28061 Encoded = ::fidl_next::WireVector<'static, u8>,
28062 >,
28063 ) -> Result<
28064 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
28065 ::fidl_next::EncodeError,
28066 >
28067 where
28068 <___T as ::fidl_next::Transport>::SendBuffer:
28069 ::fidl_next::encoder::InternalHandleEncoder,
28070
28071 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
28072 {
28073 self.get_extended_attribute_with(GetExtendedAttribute { name })
28074 }
28075
28076 #[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"]
28077 pub fn get_extended_attribute_with<___R>(
28078 &self,
28079 request: ___R,
28080 ) -> Result<
28081 ::fidl_next::ResponseFuture<'_, super::GetExtendedAttribute, ___T>,
28082 ::fidl_next::EncodeError,
28083 >
28084 where
28085 ___R: ::fidl_next::Encode<
28086 <___T as ::fidl_next::Transport>::SendBuffer,
28087 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
28088 >,
28089 {
28090 self.sender
28091 .send_two_way(5043930208506967771, request)
28092 .map(::fidl_next::ResponseFuture::from_untyped)
28093 }
28094
28095 #[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"]
28096 pub fn set_extended_attribute(
28097 &self,
28098
28099 name: impl ::fidl_next::Encode<
28100 <___T as ::fidl_next::Transport>::SendBuffer,
28101 Encoded = ::fidl_next::WireVector<'static, u8>,
28102 >,
28103
28104 value: impl ::fidl_next::Encode<
28105 <___T as ::fidl_next::Transport>::SendBuffer,
28106 Encoded = crate::WireExtendedAttributeValue<'static>,
28107 >,
28108
28109 mode: impl ::fidl_next::Encode<
28110 <___T as ::fidl_next::Transport>::SendBuffer,
28111 Encoded = crate::WireSetExtendedAttributeMode,
28112 >,
28113 ) -> Result<
28114 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
28115 ::fidl_next::EncodeError,
28116 >
28117 where
28118 <___T as ::fidl_next::Transport>::SendBuffer:
28119 ::fidl_next::encoder::InternalHandleEncoder,
28120
28121 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
28122
28123 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
28124 {
28125 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
28126 }
28127
28128 #[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"]
28129 pub fn set_extended_attribute_with<___R>(
28130 &self,
28131 request: ___R,
28132 ) -> Result<
28133 ::fidl_next::ResponseFuture<'_, super::SetExtendedAttribute, ___T>,
28134 ::fidl_next::EncodeError,
28135 >
28136 where
28137 ___R: ::fidl_next::Encode<
28138 <___T as ::fidl_next::Transport>::SendBuffer,
28139 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
28140 >,
28141 {
28142 self.sender
28143 .send_two_way(5374223046099989052, request)
28144 .map(::fidl_next::ResponseFuture::from_untyped)
28145 }
28146
28147 #[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"]
28148 pub fn remove_extended_attribute(
28149 &self,
28150
28151 name: impl ::fidl_next::Encode<
28152 <___T as ::fidl_next::Transport>::SendBuffer,
28153 Encoded = ::fidl_next::WireVector<'static, u8>,
28154 >,
28155 ) -> Result<
28156 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
28157 ::fidl_next::EncodeError,
28158 >
28159 where
28160 <___T as ::fidl_next::Transport>::SendBuffer:
28161 ::fidl_next::encoder::InternalHandleEncoder,
28162
28163 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
28164 {
28165 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
28166 }
28167
28168 #[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"]
28169 pub fn remove_extended_attribute_with<___R>(
28170 &self,
28171 request: ___R,
28172 ) -> Result<
28173 ::fidl_next::ResponseFuture<'_, super::RemoveExtendedAttribute, ___T>,
28174 ::fidl_next::EncodeError,
28175 >
28176 where
28177 ___R: ::fidl_next::Encode<
28178 <___T as ::fidl_next::Transport>::SendBuffer,
28179 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
28180 >,
28181 {
28182 self.sender
28183 .send_two_way(8794297771444732717, request)
28184 .map(::fidl_next::ResponseFuture::from_untyped)
28185 }
28186
28187 pub fn describe(
28188 &self,
28189 ) -> Result<
28190 ::fidl_next::ResponseFuture<'_, super::Describe, ___T>,
28191 ::fidl_next::EncodeError,
28192 > {
28193 self.sender
28194 .send_two_way(8371117097481679347, ())
28195 .map(::fidl_next::ResponseFuture::from_untyped)
28196 }
28197 }
28198
28199 #[repr(transparent)]
28201 pub struct SymlinkServerSender<___T: ::fidl_next::Transport> {
28202 sender: ::fidl_next::protocol::ServerSender<___T>,
28203 }
28204
28205 impl<___T> SymlinkServerSender<___T>
28206 where
28207 ___T: ::fidl_next::Transport,
28208 {
28209 #[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"]
28210 pub fn on_open(
28211 &self,
28212
28213 s: impl ::fidl_next::Encode<
28214 <___T as ::fidl_next::Transport>::SendBuffer,
28215 Encoded = ::fidl_next::WireI32,
28216 >,
28217
28218 info: impl ::fidl_next::Encode<
28219 <___T as ::fidl_next::Transport>::SendBuffer,
28220 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
28221 >,
28222 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
28223 where
28224 <___T as ::fidl_next::Transport>::SendBuffer:
28225 ::fidl_next::encoder::InternalHandleEncoder,
28226
28227 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
28228
28229 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
28230 {
28231 self.on_open_with(OnOpen { s, info })
28232 }
28233
28234 #[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"]
28235
28236 pub fn on_open_with<___R>(
28237 &self,
28238 request: ___R,
28239 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
28240 where
28241 ___R: ::fidl_next::Encode<
28242 <___T as ::fidl_next::Transport>::SendBuffer,
28243 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
28244 >,
28245 {
28246 self.sender.send_event(9207534335756671346, request)
28247 }
28248
28249 #[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"]
28250
28251 pub fn on_representation_with<___R>(
28252 &self,
28253 request: ___R,
28254 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
28255 where
28256 ___R: ::fidl_next::Encode<
28257 <___T as ::fidl_next::Transport>::SendBuffer,
28258 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
28259 >,
28260 {
28261 self.sender.send_event(6679970090861613324, request)
28262 }
28263 }
28264 }
28265}
28266
28267pub trait SymlinkClientHandler<___T: ::fidl_next::Transport> {
28271 #[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"]
28272 fn on_open(
28273 &mut self,
28274 sender: &::fidl_next::ClientSender<Symlink, ___T>,
28275
28276 event: ::fidl_next::Response<symlink::OnOpen, ___T>,
28277 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28278
28279 #[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"]
28280 fn on_representation(
28281 &mut self,
28282 sender: &::fidl_next::ClientSender<Symlink, ___T>,
28283
28284 event: ::fidl_next::Response<symlink::OnRepresentation, ___T>,
28285 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28286
28287 fn on_unknown_interaction(
28288 &mut self,
28289 sender: &::fidl_next::ClientSender<Symlink, ___T>,
28290 ordinal: u64,
28291 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
28292 sender.close();
28293 ::core::future::ready(())
28294 }
28295}
28296
28297impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Symlink
28298where
28299 ___H: SymlinkClientHandler<___T> + Send,
28300 ___T: ::fidl_next::Transport,
28301
28302 <symlink::LinkInto as ::fidl_next::Method>::Response:
28303 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28304
28305 <symlink::Close as ::fidl_next::Method>::Response:
28306 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28307
28308 <symlink::Query as ::fidl_next::Method>::Response:
28309 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28310
28311 <symlink::OnOpen as ::fidl_next::Method>::Response:
28312 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28313
28314 <symlink::DeprecatedGetAttr as ::fidl_next::Method>::Response:
28315 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28316
28317 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Response:
28318 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28319
28320 <symlink::DeprecatedGetFlags as ::fidl_next::Method>::Response:
28321 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28322
28323 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Response:
28324 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28325
28326 <symlink::GetFlags as ::fidl_next::Method>::Response:
28327 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28328
28329 <symlink::SetFlags as ::fidl_next::Method>::Response:
28330 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28331
28332 <symlink::QueryFilesystem as ::fidl_next::Method>::Response:
28333 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28334
28335 <symlink::OnRepresentation as ::fidl_next::Method>::Response:
28336 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28337
28338 <symlink::GetAttributes as ::fidl_next::Method>::Response:
28339 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28340
28341 <symlink::UpdateAttributes as ::fidl_next::Method>::Response:
28342 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28343
28344 <symlink::Sync as ::fidl_next::Method>::Response:
28345 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28346
28347 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Response:
28348 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28349
28350 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Response:
28351 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28352
28353 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
28354 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28355
28356 <symlink::Describe as ::fidl_next::Method>::Response:
28357 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28358{
28359 async fn on_event(
28360 handler: &mut ___H,
28361 sender: &::fidl_next::ClientSender<Self, ___T>,
28362 ordinal: u64,
28363 buffer: ___T::RecvBuffer,
28364 ) {
28365 match ordinal {
28366 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
28367 Ok(decoded) => handler.on_open(sender, decoded).await,
28368 Err(e) => {
28369 sender.close();
28370 }
28371 },
28372
28373 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
28374 Ok(decoded) => handler.on_representation(sender, decoded).await,
28375 Err(e) => {
28376 sender.close();
28377 }
28378 },
28379
28380 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
28381 }
28382 }
28383}
28384
28385pub trait SymlinkServerHandler<___T: ::fidl_next::Transport> {
28389 #[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"]
28390 fn link_into(
28391 &mut self,
28392 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28393
28394 request: ::fidl_next::Request<symlink::LinkInto, ___T>,
28395
28396 responder: ::fidl_next::Responder<symlink::LinkInto>,
28397 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28398
28399 fn clone(
28400 &mut self,
28401 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28402
28403 request: ::fidl_next::Request<symlink::Clone, ___T>,
28404 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28405
28406 #[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"]
28407 fn close(
28408 &mut self,
28409 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28410
28411 responder: ::fidl_next::Responder<symlink::Close>,
28412 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28413
28414 fn query(
28415 &mut self,
28416 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28417
28418 responder: ::fidl_next::Responder<symlink::Query>,
28419 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28420
28421 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
28422 fn deprecated_clone(
28423 &mut self,
28424 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28425
28426 request: ::fidl_next::Request<symlink::DeprecatedClone, ___T>,
28427 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28428
28429 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
28430 fn deprecated_get_attr(
28431 &mut self,
28432 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28433
28434 responder: ::fidl_next::Responder<symlink::DeprecatedGetAttr>,
28435 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28436
28437 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
28438 fn deprecated_set_attr(
28439 &mut self,
28440 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28441
28442 request: ::fidl_next::Request<symlink::DeprecatedSetAttr, ___T>,
28443
28444 responder: ::fidl_next::Responder<symlink::DeprecatedSetAttr>,
28445 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28446
28447 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
28448 fn deprecated_get_flags(
28449 &mut self,
28450 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28451
28452 responder: ::fidl_next::Responder<symlink::DeprecatedGetFlags>,
28453 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28454
28455 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
28456 fn deprecated_set_flags(
28457 &mut self,
28458 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28459
28460 request: ::fidl_next::Request<symlink::DeprecatedSetFlags, ___T>,
28461
28462 responder: ::fidl_next::Responder<symlink::DeprecatedSetFlags>,
28463 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28464
28465 #[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"]
28466 fn get_flags(
28467 &mut self,
28468 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28469
28470 responder: ::fidl_next::Responder<symlink::GetFlags>,
28471 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28472
28473 #[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"]
28474 fn set_flags(
28475 &mut self,
28476 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28477
28478 request: ::fidl_next::Request<symlink::SetFlags, ___T>,
28479
28480 responder: ::fidl_next::Responder<symlink::SetFlags>,
28481 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28482
28483 #[doc = " Query the filesystem for filesystem-specific information.\n"]
28484 fn query_filesystem(
28485 &mut self,
28486 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28487
28488 responder: ::fidl_next::Responder<symlink::QueryFilesystem>,
28489 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28490
28491 #[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"]
28492 fn get_attributes(
28493 &mut self,
28494 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28495
28496 request: ::fidl_next::Request<symlink::GetAttributes, ___T>,
28497
28498 responder: ::fidl_next::Responder<symlink::GetAttributes>,
28499 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28500
28501 #[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"]
28502 fn update_attributes(
28503 &mut self,
28504 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28505
28506 request: ::fidl_next::Request<symlink::UpdateAttributes, ___T>,
28507
28508 responder: ::fidl_next::Responder<symlink::UpdateAttributes>,
28509 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28510
28511 #[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"]
28512 fn sync(
28513 &mut self,
28514 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28515
28516 responder: ::fidl_next::Responder<symlink::Sync>,
28517 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28518
28519 #[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"]
28520 fn list_extended_attributes(
28521 &mut self,
28522 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28523
28524 request: ::fidl_next::Request<symlink::ListExtendedAttributes, ___T>,
28525 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28526
28527 #[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"]
28528 fn get_extended_attribute(
28529 &mut self,
28530 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28531
28532 request: ::fidl_next::Request<symlink::GetExtendedAttribute, ___T>,
28533
28534 responder: ::fidl_next::Responder<symlink::GetExtendedAttribute>,
28535 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28536
28537 #[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"]
28538 fn set_extended_attribute(
28539 &mut self,
28540 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28541
28542 request: ::fidl_next::Request<symlink::SetExtendedAttribute, ___T>,
28543
28544 responder: ::fidl_next::Responder<symlink::SetExtendedAttribute>,
28545 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28546
28547 #[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"]
28548 fn remove_extended_attribute(
28549 &mut self,
28550 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28551
28552 request: ::fidl_next::Request<symlink::RemoveExtendedAttribute, ___T>,
28553
28554 responder: ::fidl_next::Responder<symlink::RemoveExtendedAttribute>,
28555 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28556
28557 fn describe(
28558 &mut self,
28559 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28560
28561 responder: ::fidl_next::Responder<symlink::Describe>,
28562 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
28563
28564 fn on_unknown_interaction(
28565 &mut self,
28566 sender: &::fidl_next::ServerSender<Symlink, ___T>,
28567 ordinal: u64,
28568 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
28569 sender.close();
28570 ::core::future::ready(())
28571 }
28572}
28573
28574impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Symlink
28575where
28576 ___H: SymlinkServerHandler<___T> + Send,
28577 ___T: ::fidl_next::Transport,
28578
28579 <symlink::LinkInto as ::fidl_next::Method>::Request:
28580 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28581
28582 <symlink::Clone as ::fidl_next::Method>::Request:
28583 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28584
28585 <symlink::DeprecatedClone as ::fidl_next::Method>::Request:
28586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28587
28588 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Request:
28589 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28590
28591 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Request:
28592 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28593
28594 <symlink::SetFlags as ::fidl_next::Method>::Request:
28595 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28596
28597 <symlink::GetAttributes as ::fidl_next::Method>::Request:
28598 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28599
28600 <symlink::UpdateAttributes as ::fidl_next::Method>::Request:
28601 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28602
28603 <symlink::ListExtendedAttributes as ::fidl_next::Method>::Request:
28604 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28605
28606 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Request:
28607 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28608
28609 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Request:
28610 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28611
28612 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
28613 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
28614{
28615 async fn on_one_way(
28616 handler: &mut ___H,
28617 sender: &::fidl_next::ServerSender<Self, ___T>,
28618 ordinal: u64,
28619 buffer: ___T::RecvBuffer,
28620 ) {
28621 match ordinal {
28622 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
28623 Ok(decoded) => handler.clone(sender, decoded).await,
28624 Err(e) => {
28625 sender.close();
28626 }
28627 },
28628
28629 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
28630 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
28631 Err(e) => {
28632 sender.close();
28633 }
28634 },
28635
28636 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
28637 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
28638 Err(e) => {
28639 sender.close();
28640 }
28641 },
28642
28643 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
28644 }
28645 }
28646
28647 async fn on_two_way(
28648 handler: &mut ___H,
28649 sender: &::fidl_next::ServerSender<Self, ___T>,
28650 ordinal: u64,
28651 buffer: ___T::RecvBuffer,
28652 responder: ::fidl_next::protocol::Responder,
28653 ) {
28654 match ordinal {
28655 6121399674497678964 => {
28656 let responder = ::fidl_next::Responder::from_untyped(responder);
28657
28658 match ::fidl_next::DecoderExt::decode(buffer) {
28659 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
28660 Err(e) => {
28661 sender.close();
28662 }
28663 }
28664 }
28665
28666 6540867515453498750 => {
28667 let responder = ::fidl_next::Responder::from_untyped(responder);
28668
28669 handler.close(sender, responder).await;
28670 }
28671
28672 2763219980499352582 => {
28673 let responder = ::fidl_next::Responder::from_untyped(responder);
28674
28675 handler.query(sender, responder).await;
28676 }
28677
28678 8689798978500614909 => {
28679 let responder = ::fidl_next::Responder::from_untyped(responder);
28680
28681 handler.deprecated_get_attr(sender, responder).await;
28682 }
28683
28684 4721673413776871238 => {
28685 let responder = ::fidl_next::Responder::from_untyped(responder);
28686
28687 match ::fidl_next::DecoderExt::decode(buffer) {
28688 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
28689 Err(e) => {
28690 sender.close();
28691 }
28692 }
28693 }
28694
28695 6595803110182632097 => {
28696 let responder = ::fidl_next::Responder::from_untyped(responder);
28697
28698 handler.deprecated_get_flags(sender, responder).await;
28699 }
28700
28701 5950864159036794675 => {
28702 let responder = ::fidl_next::Responder::from_untyped(responder);
28703
28704 match ::fidl_next::DecoderExt::decode(buffer) {
28705 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
28706 Err(e) => {
28707 sender.close();
28708 }
28709 }
28710 }
28711
28712 105530239381466147 => {
28713 let responder = ::fidl_next::Responder::from_untyped(responder);
28714
28715 handler.get_flags(sender, responder).await;
28716 }
28717
28718 6172186066099445416 => {
28719 let responder = ::fidl_next::Responder::from_untyped(responder);
28720
28721 match ::fidl_next::DecoderExt::decode(buffer) {
28722 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
28723 Err(e) => {
28724 sender.close();
28725 }
28726 }
28727 }
28728
28729 8013111122914313744 => {
28730 let responder = ::fidl_next::Responder::from_untyped(responder);
28731
28732 handler.query_filesystem(sender, responder).await;
28733 }
28734
28735 4414537700416816443 => {
28736 let responder = ::fidl_next::Responder::from_untyped(responder);
28737
28738 match ::fidl_next::DecoderExt::decode(buffer) {
28739 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
28740 Err(e) => {
28741 sender.close();
28742 }
28743 }
28744 }
28745
28746 3677402239314018056 => {
28747 let responder = ::fidl_next::Responder::from_untyped(responder);
28748
28749 match ::fidl_next::DecoderExt::decode(buffer) {
28750 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
28751 Err(e) => {
28752 sender.close();
28753 }
28754 }
28755 }
28756
28757 3196473584242777161 => {
28758 let responder = ::fidl_next::Responder::from_untyped(responder);
28759
28760 handler.sync(sender, responder).await;
28761 }
28762
28763 5043930208506967771 => {
28764 let responder = ::fidl_next::Responder::from_untyped(responder);
28765
28766 match ::fidl_next::DecoderExt::decode(buffer) {
28767 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
28768 Err(e) => {
28769 sender.close();
28770 }
28771 }
28772 }
28773
28774 5374223046099989052 => {
28775 let responder = ::fidl_next::Responder::from_untyped(responder);
28776
28777 match ::fidl_next::DecoderExt::decode(buffer) {
28778 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
28779 Err(e) => {
28780 sender.close();
28781 }
28782 }
28783 }
28784
28785 8794297771444732717 => {
28786 let responder = ::fidl_next::Responder::from_untyped(responder);
28787
28788 match ::fidl_next::DecoderExt::decode(buffer) {
28789 Ok(decoded) => {
28790 handler.remove_extended_attribute(sender, decoded, responder).await
28791 }
28792 Err(e) => {
28793 sender.close();
28794 }
28795 }
28796 }
28797
28798 8371117097481679347 => {
28799 let responder = ::fidl_next::Responder::from_untyped(responder);
28800
28801 handler.describe(sender, responder).await;
28802 }
28803
28804 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
28805 }
28806 }
28807}
28808
28809#[doc = " Alias for directory permission alias w*\n"]
28810pub const W_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(485);
28811
28812#[derive(Clone, Copy, Debug, PartialEq, Eq)]
28813#[repr(u8)]
28814pub enum WatchEvent {
28815 Deleted = 0,
28816 Added = 1,
28817 Removed = 2,
28818 Existing = 3,
28819 Idle = 4,
28820}
28821
28822impl ::fidl_next::Encodable for WatchEvent {
28823 type Encoded = WireWatchEvent;
28824}
28825impl ::std::convert::TryFrom<u8> for WatchEvent {
28826 type Error = ::fidl_next::UnknownStrictEnumMemberError;
28827 fn try_from(value: u8) -> Result<Self, Self::Error> {
28828 match value {
28829 0 => Ok(Self::Deleted),
28830 1 => Ok(Self::Added),
28831 2 => Ok(Self::Removed),
28832 3 => Ok(Self::Existing),
28833 4 => Ok(Self::Idle),
28834
28835 _ => Err(Self::Error::new(value.into())),
28836 }
28837 }
28838}
28839
28840unsafe impl<___E> ::fidl_next::Encode<___E> for WatchEvent
28841where
28842 ___E: ?Sized,
28843{
28844 #[inline]
28845 fn encode(
28846 self,
28847 encoder: &mut ___E,
28848 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28849 ) -> Result<(), ::fidl_next::EncodeError> {
28850 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
28851 }
28852}
28853
28854unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchEvent
28855where
28856 ___E: ?Sized,
28857{
28858 #[inline]
28859 fn encode_ref(
28860 &self,
28861 encoder: &mut ___E,
28862 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28863 ) -> Result<(), ::fidl_next::EncodeError> {
28864 ::fidl_next::munge!(let WireWatchEvent { value } = out);
28865 let _ = value.write(u8::from(match *self {
28866 Self::Deleted => 0,
28867
28868 Self::Added => 1,
28869
28870 Self::Removed => 2,
28871
28872 Self::Existing => 3,
28873
28874 Self::Idle => 4,
28875 }));
28876
28877 Ok(())
28878 }
28879}
28880
28881impl ::core::convert::From<WireWatchEvent> for WatchEvent {
28882 fn from(wire: WireWatchEvent) -> Self {
28883 match u8::from(wire.value) {
28884 0 => Self::Deleted,
28885
28886 1 => Self::Added,
28887
28888 2 => Self::Removed,
28889
28890 3 => Self::Existing,
28891
28892 4 => Self::Idle,
28893
28894 _ => unsafe { ::core::hint::unreachable_unchecked() },
28895 }
28896 }
28897}
28898
28899impl ::fidl_next::FromWire<WireWatchEvent> for WatchEvent {
28900 #[inline]
28901 fn from_wire(wire: WireWatchEvent) -> Self {
28902 Self::from(wire)
28903 }
28904}
28905
28906impl ::fidl_next::FromWireRef<WireWatchEvent> for WatchEvent {
28907 #[inline]
28908 fn from_wire_ref(wire: &WireWatchEvent) -> Self {
28909 Self::from(*wire)
28910 }
28911}
28912
28913#[derive(Clone, Copy, Debug, PartialEq, Eq)]
28915#[repr(transparent)]
28916pub struct WireWatchEvent {
28917 value: u8,
28918}
28919
28920unsafe impl ::fidl_next::Wire for WireWatchEvent {
28921 type Decoded<'de> = Self;
28922
28923 #[inline]
28924 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
28925 }
28927}
28928
28929impl WireWatchEvent {
28930 pub const DELETED: WireWatchEvent = WireWatchEvent { value: 0 };
28931
28932 pub const ADDED: WireWatchEvent = WireWatchEvent { value: 1 };
28933
28934 pub const REMOVED: WireWatchEvent = WireWatchEvent { value: 2 };
28935
28936 pub const EXISTING: WireWatchEvent = WireWatchEvent { value: 3 };
28937
28938 pub const IDLE: WireWatchEvent = WireWatchEvent { value: 4 };
28939}
28940
28941unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchEvent
28942where
28943 ___D: ?Sized,
28944{
28945 fn decode(
28946 slot: ::fidl_next::Slot<'_, Self>,
28947 _: &mut ___D,
28948 ) -> Result<(), ::fidl_next::DecodeError> {
28949 ::fidl_next::munge!(let Self { value } = slot);
28950
28951 match u8::from(*value) {
28952 0 | 1 | 2 | 3 | 4 => (),
28953 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
28954 }
28955
28956 Ok(())
28957 }
28958}
28959
28960impl ::core::convert::From<WatchEvent> for WireWatchEvent {
28961 fn from(natural: WatchEvent) -> Self {
28962 match natural {
28963 WatchEvent::Deleted => WireWatchEvent::DELETED,
28964
28965 WatchEvent::Added => WireWatchEvent::ADDED,
28966
28967 WatchEvent::Removed => WireWatchEvent::REMOVED,
28968
28969 WatchEvent::Existing => WireWatchEvent::EXISTING,
28970
28971 WatchEvent::Idle => WireWatchEvent::IDLE,
28972 }
28973 }
28974}
28975
28976#[doc = " Alias for directory permission alias x*\n"]
28977pub const X_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(201);
28978
28979pub mod compat {
28981
28982 impl ::core::convert::From<crate::Operations> for ::fidl_fuchsia_io::Operations {
28983 #[inline]
28984 fn from(from: crate::Operations) -> Self {
28985 Self::from_bits_retain(from.bits())
28986 }
28987 }
28988
28989 impl ::core::convert::From<crate::SeekOrigin> for ::fidl_fuchsia_io::SeekOrigin {
28990 #[inline]
28991 fn from(from: crate::SeekOrigin) -> Self {
28992 match crate::SeekOrigin::from(from) {
28993 crate::SeekOrigin::Start => Self::Start,
28994
28995 crate::SeekOrigin::Current => Self::Current,
28996
28997 crate::SeekOrigin::End => Self::End,
28998 }
28999 }
29000 }
29001
29002 impl ::core::convert::From<crate::AdvisoryLockType> for ::fidl_fuchsia_io::AdvisoryLockType {
29003 #[inline]
29004 fn from(from: crate::AdvisoryLockType) -> Self {
29005 match crate::AdvisoryLockType::from(from) {
29006 crate::AdvisoryLockType::Read => Self::Read,
29007
29008 crate::AdvisoryLockType::Write => Self::Write,
29009
29010 crate::AdvisoryLockType::Unlock => Self::Unlock,
29011 }
29012 }
29013 }
29014
29015 #[cfg(target_os = "fuchsia")]
29016 pub type AdvisoryLockingProxy =
29019 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::AdvisoryLocking>;
29020
29021 impl ::core::convert::From<crate::AdvisoryLocking> for ::fidl_fuchsia_io::AdvisoryLockingMarker {
29022 #[inline]
29023 fn from(_: crate::AdvisoryLocking) -> Self {
29024 Self
29025 }
29026 }
29027
29028 impl ::core::convert::From<crate::AllocateMode> for ::fidl_fuchsia_io::AllocateMode {
29029 #[inline]
29030 fn from(from: crate::AllocateMode) -> Self {
29031 Self::from_bits_retain(from.bits())
29032 }
29033 }
29034
29035 impl ::core::convert::From<crate::OpenFlags> for ::fidl_fuchsia_io::OpenFlags {
29036 #[inline]
29037 fn from(from: crate::OpenFlags) -> Self {
29038 Self::from_bits_retain(from.bits())
29039 }
29040 }
29041
29042 impl ::core::convert::From<crate::NodeAttributeFlags> for ::fidl_fuchsia_io::NodeAttributeFlags {
29043 #[inline]
29044 fn from(from: crate::NodeAttributeFlags) -> Self {
29045 Self::from_bits_retain(from.bits())
29046 }
29047 }
29048
29049 impl ::core::convert::From<crate::ModeType> for ::fidl_fuchsia_io::ModeType {
29050 #[inline]
29051 fn from(from: crate::ModeType) -> Self {
29052 Self::from_bits_retain(from.bits())
29053 }
29054 }
29055
29056 impl ::core::convert::From<crate::UnlinkFlags> for ::fidl_fuchsia_io::UnlinkFlags {
29057 #[inline]
29058 fn from(from: crate::UnlinkFlags) -> Self {
29059 Self::from_bits_retain(from.bits())
29060 }
29061 }
29062
29063 impl ::core::convert::From<crate::WatchMask> for ::fidl_fuchsia_io::WatchMask {
29064 #[inline]
29065 fn from(from: crate::WatchMask) -> Self {
29066 Self::from_bits_retain(from.bits())
29067 }
29068 }
29069
29070 impl ::core::convert::From<crate::SetExtendedAttributeMode>
29071 for ::fidl_fuchsia_io::SetExtendedAttributeMode
29072 {
29073 #[inline]
29074 fn from(from: crate::SetExtendedAttributeMode) -> Self {
29075 match crate::SetExtendedAttributeMode::from(from) {
29076 crate::SetExtendedAttributeMode::Set => Self::Set,
29077
29078 crate::SetExtendedAttributeMode::Create => Self::Create,
29079
29080 crate::SetExtendedAttributeMode::Replace => Self::Replace,
29081 }
29082 }
29083 }
29084
29085 impl ::core::convert::From<crate::Flags> for ::fidl_fuchsia_io::Flags {
29086 #[inline]
29087 fn from(from: crate::Flags) -> Self {
29088 Self::from_bits_retain(from.bits())
29089 }
29090 }
29091
29092 impl ::core::convert::From<crate::NodeProtocolKinds> for ::fidl_fuchsia_io::NodeProtocolKinds {
29093 #[inline]
29094 fn from(from: crate::NodeProtocolKinds) -> Self {
29095 Self::from_bits_retain(from.bits())
29096 }
29097 }
29098
29099 impl ::core::convert::From<crate::HashAlgorithm> for ::fidl_fuchsia_io::HashAlgorithm {
29100 #[inline]
29101 fn from(from: crate::HashAlgorithm) -> Self {
29102 match crate::HashAlgorithm::from(from) {
29103 crate::HashAlgorithm::Sha256 => Self::Sha256,
29104
29105 crate::HashAlgorithm::Sha512 => Self::Sha512,
29106
29107 crate::HashAlgorithm::UnknownOrdinal_(value) => {
29108 Self::__SourceBreaking { unknown_ordinal: value }
29109 }
29110 }
29111 }
29112 }
29113
29114 impl ::core::convert::From<crate::NodeAttributesQuery> for ::fidl_fuchsia_io::NodeAttributesQuery {
29115 #[inline]
29116 fn from(from: crate::NodeAttributesQuery) -> Self {
29117 Self::from_bits_retain(from.bits())
29118 }
29119 }
29120
29121 #[cfg(target_os = "fuchsia")]
29122 pub type NodeProxy = ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Node>;
29125
29126 impl ::core::convert::From<crate::Node> for ::fidl_fuchsia_io::NodeMarker {
29127 #[inline]
29128 fn from(_: crate::Node) -> Self {
29129 Self
29130 }
29131 }
29132
29133 #[cfg(target_os = "fuchsia")]
29134 pub type DirectoryProxy =
29137 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Directory>;
29138
29139 impl ::core::convert::From<crate::Directory> for ::fidl_fuchsia_io::DirectoryMarker {
29140 #[inline]
29141 fn from(_: crate::Directory) -> Self {
29142 Self
29143 }
29144 }
29145
29146 #[cfg(target_os = "fuchsia")]
29147 pub type DirectoryWatcherProxy =
29150 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirectoryWatcher>;
29151
29152 impl ::core::convert::From<crate::DirectoryWatcher> for ::fidl_fuchsia_io::DirectoryWatcherMarker {
29153 #[inline]
29154 fn from(_: crate::DirectoryWatcher) -> Self {
29155 Self
29156 }
29157 }
29158
29159 impl ::core::convert::From<crate::DirentType> for ::fidl_fuchsia_io::DirentType {
29160 #[inline]
29161 fn from(from: crate::DirentType) -> Self {
29162 match crate::DirentType::from(from) {
29163 crate::DirentType::Unknown => Self::Unknown,
29164
29165 crate::DirentType::Directory => Self::Directory,
29166
29167 crate::DirentType::BlockDevice => Self::BlockDevice,
29168
29169 crate::DirentType::File => Self::File,
29170
29171 crate::DirentType::Symlink => Self::Symlink,
29172
29173 crate::DirentType::Service => Self::Service,
29174
29175 crate::DirentType::UnknownOrdinal_(value) => {
29176 Self::__SourceBreaking { unknown_ordinal: value }
29177 }
29178 }
29179 }
29180 }
29181
29182 #[cfg(target_os = "fuchsia")]
29183 pub type ExtendedAttributeIteratorProxy = ::fidl_next::ClientSender<
29186 ::fidl_next::fuchsia::zx::Channel,
29187 crate::ExtendedAttributeIterator,
29188 >;
29189
29190 impl ::core::convert::From<crate::ExtendedAttributeIterator>
29191 for ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker
29192 {
29193 #[inline]
29194 fn from(_: crate::ExtendedAttributeIterator) -> Self {
29195 Self
29196 }
29197 }
29198
29199 #[cfg(target_os = "fuchsia")]
29200 pub type ReadableProxy =
29203 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Readable>;
29204
29205 impl ::core::convert::From<crate::Readable> for ::fidl_fuchsia_io::ReadableMarker {
29206 #[inline]
29207 fn from(_: crate::Readable) -> Self {
29208 Self
29209 }
29210 }
29211
29212 #[cfg(target_os = "fuchsia")]
29213 pub type WritableProxy =
29216 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Writable>;
29217
29218 impl ::core::convert::From<crate::Writable> for ::fidl_fuchsia_io::WritableMarker {
29219 #[inline]
29220 fn from(_: crate::Writable) -> Self {
29221 Self
29222 }
29223 }
29224
29225 impl ::core::convert::From<crate::VmoFlags> for ::fidl_fuchsia_io::VmoFlags {
29226 #[inline]
29227 fn from(from: crate::VmoFlags) -> Self {
29228 Self::from_bits_retain(from.bits())
29229 }
29230 }
29231
29232 #[cfg(target_os = "fuchsia")]
29233 pub type LinkableProxy =
29236 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Linkable>;
29237
29238 impl ::core::convert::From<crate::Linkable> for ::fidl_fuchsia_io::LinkableMarker {
29239 #[inline]
29240 fn from(_: crate::Linkable) -> Self {
29241 Self
29242 }
29243 }
29244
29245 #[cfg(target_os = "fuchsia")]
29246 pub type FileProxy = ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::File>;
29249
29250 impl ::core::convert::From<crate::File> for ::fidl_fuchsia_io::FileMarker {
29251 #[inline]
29252 fn from(_: crate::File) -> Self {
29253 Self
29254 }
29255 }
29256
29257 impl ::core::convert::From<crate::FileSignal> for ::fidl_fuchsia_io::FileSignal {
29258 #[inline]
29259 fn from(from: crate::FileSignal) -> Self {
29260 Self::from_bits_retain(from.bits())
29261 }
29262 }
29263
29264 #[cfg(target_os = "fuchsia")]
29265 pub type SymlinkProxy =
29268 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Symlink>;
29269
29270 impl ::core::convert::From<crate::Symlink> for ::fidl_fuchsia_io::SymlinkMarker {
29271 #[inline]
29272 fn from(_: crate::Symlink) -> Self {
29273 Self
29274 }
29275 }
29276
29277 impl ::core::convert::From<crate::WatchEvent> for ::fidl_fuchsia_io::WatchEvent {
29278 #[inline]
29279 fn from(from: crate::WatchEvent) -> Self {
29280 match crate::WatchEvent::from(from) {
29281 crate::WatchEvent::Deleted => Self::Deleted,
29282
29283 crate::WatchEvent::Added => Self::Added,
29284
29285 crate::WatchEvent::Removed => Self::Removed,
29286
29287 crate::WatchEvent::Existing => Self::Existing,
29288
29289 crate::WatchEvent::Idle => Self::Idle,
29290 }
29291 }
29292 }
29293}