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 ___E: ::fidl_next::Encoder,
957{
958 #[inline]
959 fn encode(
960 self,
961 encoder: &mut ___E,
962 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
963 ) -> Result<(), ::fidl_next::EncodeError> {
964 ::fidl_next::munge! {
965 let Self::Encoded {
966 request,
967
968 } = out;
969 }
970
971 ::fidl_next::Encode::encode(self.request, encoder, request)?;
972
973 Ok(())
974 }
975}
976
977unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockingAdvisoryLockRequest
978where
979 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
980 ___E: ::fidl_next::Encoder,
981{
982 #[inline]
983 fn encode_ref(
984 &self,
985 encoder: &mut ___E,
986 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
987 ) -> Result<(), ::fidl_next::EncodeError> {
988 ::fidl_next::munge! {
989 let Self::Encoded {
990 request,
991
992 } = out;
993 }
994
995 ::fidl_next::EncodeRef::encode_ref(&self.request, encoder, request)?;
996
997 Ok(())
998 }
999}
1000
1001impl ::fidl_next::EncodableOption for AdvisoryLockingAdvisoryLockRequest {
1002 type EncodedOption =
1003 ::fidl_next::WireBox<'static, WireAdvisoryLockingAdvisoryLockRequest<'static>>;
1004}
1005
1006unsafe impl<___E> ::fidl_next::EncodeOption<___E> for AdvisoryLockingAdvisoryLockRequest
1007where
1008 ___E: ::fidl_next::Encoder + ?Sized,
1009 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::Encode<___E>,
1010{
1011 #[inline]
1012 fn encode_option(
1013 this: Option<Self>,
1014 encoder: &mut ___E,
1015 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1016 ) -> Result<(), ::fidl_next::EncodeError> {
1017 if let Some(inner) = this {
1018 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1019 ::fidl_next::WireBox::encode_present(out);
1020 } else {
1021 ::fidl_next::WireBox::encode_absent(out);
1022 }
1023
1024 Ok(())
1025 }
1026}
1027
1028unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for AdvisoryLockingAdvisoryLockRequest
1029where
1030 ___E: ::fidl_next::Encoder + ?Sized,
1031 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::EncodeRef<___E>,
1032{
1033 #[inline]
1034 fn encode_option_ref(
1035 this: Option<&Self>,
1036 encoder: &mut ___E,
1037 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1038 ) -> Result<(), ::fidl_next::EncodeError> {
1039 if let Some(inner) = this {
1040 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1041 ::fidl_next::WireBox::encode_present(out);
1042 } else {
1043 ::fidl_next::WireBox::encode_absent(out);
1044 }
1045
1046 Ok(())
1047 }
1048}
1049
1050impl<'de> ::fidl_next::FromWire<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1051 for AdvisoryLockingAdvisoryLockRequest
1052{
1053 #[inline]
1054 fn from_wire(wire: WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1055 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
1056 }
1057}
1058
1059impl<'de> ::fidl_next::FromWireRef<WireAdvisoryLockingAdvisoryLockRequest<'de>>
1060 for AdvisoryLockingAdvisoryLockRequest
1061{
1062 #[inline]
1063 fn from_wire_ref(wire: &WireAdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
1064 Self { request: ::fidl_next::FromWireRef::from_wire_ref(&wire.request) }
1065 }
1066}
1067
1068#[derive(Debug)]
1070#[repr(C)]
1071pub struct WireAdvisoryLockingAdvisoryLockRequest<'de> {
1072 pub request: crate::WireAdvisoryLockRequest<'de>,
1073}
1074
1075unsafe impl ::fidl_next::Wire for WireAdvisoryLockingAdvisoryLockRequest<'static> {
1076 type Decoded<'de> = WireAdvisoryLockingAdvisoryLockRequest<'de>;
1077
1078 #[inline]
1079 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1080}
1081
1082unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockingAdvisoryLockRequest<'static>
1083where
1084 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1085 ___D: ::fidl_next::Decoder,
1086{
1087 fn decode(
1088 slot: ::fidl_next::Slot<'_, Self>,
1089 decoder: &mut ___D,
1090 ) -> Result<(), ::fidl_next::DecodeError> {
1091 ::fidl_next::munge! {
1092 let Self {
1093 mut request,
1094
1095 } = slot;
1096 }
1097
1098 ::fidl_next::Decode::decode(request.as_mut(), decoder)?;
1099
1100 Ok(())
1101 }
1102}
1103
1104pub type AdvisoryLockingAdvisoryLockResponse = ();
1105
1106pub type WireAdvisoryLockingAdvisoryLockResponse = ();
1108
1109#[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"]
1111#[derive(Debug)]
1112pub struct AdvisoryLocking;
1113
1114pub mod advisory_locking {
1115 pub mod prelude {
1116 pub use crate::{
1117 AdvisoryLocking, AdvisoryLockingClientHandler, AdvisoryLockingServerHandler,
1118 advisory_locking,
1119 };
1120
1121 pub use crate::AdvisoryLockingAdvisoryLockRequest;
1122
1123 pub use crate::AdvisoryLockingAdvisoryLockResponse;
1124 }
1125
1126 pub struct AdvisoryLock;
1127
1128 impl ::fidl_next::Method for AdvisoryLock {
1129 const ORDINAL: u64 = 7992130864415541162;
1130
1131 type Protocol = crate::AdvisoryLocking;
1132
1133 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1134
1135 type Response = ::fidl_next::WireResult<
1136 'static,
1137 crate::WireAdvisoryLockingAdvisoryLockResponse,
1138 ::fidl_next::WireI32,
1139 >;
1140 }
1141
1142 mod ___detail {
1143
1144 pub struct AdvisoryLock<T0> {
1145 request: T0,
1146 }
1147
1148 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
1149 where
1150 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
1151 {
1152 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
1153 }
1154
1155 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
1156 where
1157 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1158 ___E: ::fidl_next::Encoder,
1159 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
1160 {
1161 #[inline]
1162 fn encode(
1163 self,
1164 encoder: &mut ___E,
1165 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1166 ) -> Result<(), ::fidl_next::EncodeError> {
1167 ::fidl_next::munge! {
1168 let Self::Encoded {
1169 request,
1170
1171 } = out;
1172 }
1173
1174 ::fidl_next::Encode::encode(self.request, encoder, request)?;
1175
1176 Ok(())
1177 }
1178 }
1179
1180 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::AdvisoryLocking
1181 where
1182 ___T: ::fidl_next::Transport,
1183 {
1184 type ClientSender = AdvisoryLockingClientSender<___T>;
1185 type ServerSender = AdvisoryLockingServerSender<___T>;
1186 }
1187
1188 #[repr(transparent)]
1190 pub struct AdvisoryLockingClientSender<___T: ::fidl_next::Transport> {
1191 #[allow(dead_code)]
1192 sender: ::fidl_next::protocol::ClientSender<___T>,
1193 }
1194
1195 impl<___T> AdvisoryLockingClientSender<___T>
1196 where
1197 ___T: ::fidl_next::Transport,
1198 {
1199 #[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"]
1200 pub fn advisory_lock(
1201 &self,
1202
1203 request: impl ::fidl_next::Encode<
1204 <___T as ::fidl_next::Transport>::SendBuffer,
1205 Encoded = crate::WireAdvisoryLockRequest<'static>,
1206 >,
1207 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
1208 where
1209 <___T as ::fidl_next::Transport>::SendBuffer:
1210 ::fidl_next::encoder::InternalHandleEncoder,
1211 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1212 {
1213 self.advisory_lock_with(AdvisoryLock { request })
1214 }
1215
1216 #[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"]
1217 pub fn advisory_lock_with<___R>(
1218 &self,
1219 request: ___R,
1220 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
1221 where
1222 ___R: ::fidl_next::Encode<
1223 <___T as ::fidl_next::Transport>::SendBuffer,
1224 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
1225 >,
1226 {
1227 ::fidl_next::TwoWayFuture::from_untyped(
1228 self.sender.send_two_way(7992130864415541162, request),
1229 )
1230 }
1231 }
1232
1233 #[repr(transparent)]
1235 pub struct AdvisoryLockingServerSender<___T: ::fidl_next::Transport> {
1236 sender: ::fidl_next::protocol::ServerSender<___T>,
1237 }
1238
1239 impl<___T> AdvisoryLockingServerSender<___T> where ___T: ::fidl_next::Transport {}
1240 }
1241}
1242
1243pub trait AdvisoryLockingClientHandler<
1247 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1248 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1249>
1250{
1251}
1252
1253impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for AdvisoryLocking
1254where
1255 ___H: AdvisoryLockingClientHandler<___T> + ::core::marker::Send,
1256 ___T: ::fidl_next::Transport,
1257 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Response:
1258 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1259{
1260 async fn on_event(
1261 handler: &mut ___H,
1262 sender: &::fidl_next::ClientSender<Self, ___T>,
1263 ordinal: u64,
1264 buffer: ___T::RecvBuffer,
1265 ) {
1266 match ordinal {
1267 ordinal => sender.close(),
1268 }
1269 }
1270}
1271
1272pub trait AdvisoryLockingServerHandler<
1276 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1277 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1278>
1279{
1280 #[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"]
1281 fn advisory_lock(
1282 &mut self,
1283 sender: &::fidl_next::ServerSender<AdvisoryLocking, ___T>,
1284
1285 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
1286
1287 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock>,
1288 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1289}
1290
1291impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for AdvisoryLocking
1292where
1293 ___H: AdvisoryLockingServerHandler<___T> + ::core::marker::Send,
1294 ___T: ::fidl_next::Transport,
1295 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Request:
1296 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1297{
1298 async fn on_one_way(
1299 handler: &mut ___H,
1300 sender: &::fidl_next::ServerSender<Self, ___T>,
1301 ordinal: u64,
1302 buffer: ___T::RecvBuffer,
1303 ) {
1304 match ordinal {
1305 ordinal => sender.close(),
1306 }
1307 }
1308
1309 async fn on_two_way(
1310 handler: &mut ___H,
1311 sender: &::fidl_next::ServerSender<Self, ___T>,
1312 ordinal: u64,
1313 buffer: ___T::RecvBuffer,
1314 responder: ::fidl_next::protocol::Responder,
1315 ) {
1316 match ordinal {
1317 7992130864415541162 => {
1318 let responder = ::fidl_next::Responder::from_untyped(responder);
1319
1320 match ::fidl_next::DecoderExt::decode(buffer) {
1321 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
1322 Err(e) => sender.close(),
1323 }
1324 }
1325
1326 ordinal => sender.close(),
1327 }
1328 }
1329}
1330
1331::fidl_next::bitflags! {
1332 #[derive(
1333 Clone,
1334 Copy,
1335 Debug,
1336 PartialEq,
1337 Eq,
1338 Hash,
1339 )]
1340 pub struct AllocateMode: u32 {
1341 const KEEP_SIZE = 1;
1342 const UNSHARE_RANGE = 2;
1343 const PUNCH_HOLE = 4;
1344 const COLLAPSE_RANGE = 8;
1345 const ZERO_RANGE = 16;
1346 const INSERT_RANGE = 32;
1347 const _ = !0;
1348 }
1349}
1350
1351impl ::fidl_next::Encodable for AllocateMode {
1352 type Encoded = WireAllocateMode;
1353}
1354
1355unsafe impl<___E> ::fidl_next::Encode<___E> for AllocateMode
1356where
1357 ___E: ?Sized,
1358{
1359 #[inline]
1360 fn encode(
1361 self,
1362 encoder: &mut ___E,
1363 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1364 ) -> Result<(), ::fidl_next::EncodeError> {
1365 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1366 }
1367}
1368
1369unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllocateMode
1370where
1371 ___E: ?Sized,
1372{
1373 #[inline]
1374 fn encode_ref(
1375 &self,
1376 _: &mut ___E,
1377 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1378 ) -> Result<(), ::fidl_next::EncodeError> {
1379 ::fidl_next::munge!(let WireAllocateMode { value } = out);
1380 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1381 Ok(())
1382 }
1383}
1384
1385impl ::core::convert::From<WireAllocateMode> for AllocateMode {
1386 fn from(wire: WireAllocateMode) -> Self {
1387 Self::from_bits_retain(u32::from(wire.value))
1388 }
1389}
1390
1391impl ::fidl_next::FromWire<WireAllocateMode> for AllocateMode {
1392 #[inline]
1393 fn from_wire(wire: WireAllocateMode) -> Self {
1394 Self::from(wire)
1395 }
1396}
1397
1398impl ::fidl_next::FromWireRef<WireAllocateMode> for AllocateMode {
1399 #[inline]
1400 fn from_wire_ref(wire: &WireAllocateMode) -> Self {
1401 Self::from(*wire)
1402 }
1403}
1404
1405#[derive(Clone, Copy, Debug)]
1407#[repr(transparent)]
1408pub struct WireAllocateMode {
1409 value: ::fidl_next::WireU32,
1410}
1411
1412unsafe impl ::fidl_next::Wire for WireAllocateMode {
1413 type Decoded<'de> = Self;
1414
1415 #[inline]
1416 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1417 }
1419}
1420
1421unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllocateMode
1422where
1423 ___D: ?Sized,
1424{
1425 fn decode(
1426 slot: ::fidl_next::Slot<'_, Self>,
1427 _: &mut ___D,
1428 ) -> Result<(), ::fidl_next::DecodeError> {
1429 Ok(())
1430 }
1431}
1432
1433impl ::core::convert::From<AllocateMode> for WireAllocateMode {
1434 fn from(natural: AllocateMode) -> Self {
1435 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1436 }
1437}
1438
1439#[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"]
1440pub type Rights = crate::Operations;
1441
1442pub type WireRights = crate::WireOperations;
1444
1445#[derive(Debug, Default)]
1446pub struct ConnectionInfo {
1447 pub rights: Option<crate::Operations>,
1448}
1449
1450impl ConnectionInfo {
1451 fn __max_ordinal(&self) -> usize {
1452 if self.rights.is_some() {
1453 return 1;
1454 }
1455
1456 0
1457 }
1458}
1459
1460impl ::fidl_next::Encodable for ConnectionInfo {
1461 type Encoded = WireConnectionInfo<'static>;
1462}
1463
1464unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectionInfo
1465where
1466 ___E: ::fidl_next::Encoder + ?Sized,
1467 ___E: ::fidl_next::fuchsia::HandleEncoder,
1468{
1469 #[inline]
1470 fn encode(
1471 mut self,
1472 encoder: &mut ___E,
1473 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1474 ) -> Result<(), ::fidl_next::EncodeError> {
1475 ::fidl_next::munge!(let WireConnectionInfo { table } = out);
1476
1477 let max_ord = self.__max_ordinal();
1478
1479 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1480 ::fidl_next::Wire::zero_padding(&mut out);
1481
1482 let mut preallocated =
1483 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1484
1485 for i in 1..=max_ord {
1486 match i {
1487 1 => {
1488 if let Some(rights) = self.rights.take() {
1489 ::fidl_next::WireEnvelope::encode_value(
1490 rights,
1491 preallocated.encoder,
1492 &mut out,
1493 )?;
1494 } else {
1495 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1496 }
1497 }
1498
1499 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1500 }
1501 unsafe {
1502 preallocated.write_next(out.assume_init_ref());
1503 }
1504 }
1505
1506 ::fidl_next::WireTable::encode_len(table, max_ord);
1507
1508 Ok(())
1509 }
1510}
1511
1512impl<'de> ::fidl_next::FromWire<WireConnectionInfo<'de>> for ConnectionInfo {
1513 #[inline]
1514 fn from_wire(wire: WireConnectionInfo<'de>) -> Self {
1515 let wire = ::core::mem::ManuallyDrop::new(wire);
1516
1517 let rights = wire.table.get(1);
1518
1519 Self {
1520 rights: rights.map(|envelope| {
1521 ::fidl_next::FromWire::from_wire(unsafe {
1522 envelope.read_unchecked::<crate::WireOperations>()
1523 })
1524 }),
1525 }
1526 }
1527}
1528
1529#[repr(C)]
1531pub struct WireConnectionInfo<'de> {
1532 table: ::fidl_next::WireTable<'de>,
1533}
1534
1535impl<'de> Drop for WireConnectionInfo<'de> {
1536 fn drop(&mut self) {
1537 let _ = self
1538 .table
1539 .get(1)
1540 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
1541 }
1542}
1543
1544unsafe impl ::fidl_next::Wire for WireConnectionInfo<'static> {
1545 type Decoded<'de> = WireConnectionInfo<'de>;
1546
1547 #[inline]
1548 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1549 ::fidl_next::munge!(let Self { table } = out);
1550 ::fidl_next::WireTable::zero_padding(table);
1551 }
1552}
1553
1554unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectionInfo<'static>
1555where
1556 ___D: ::fidl_next::Decoder + ?Sized,
1557 ___D: ::fidl_next::fuchsia::HandleDecoder,
1558{
1559 fn decode(
1560 slot: ::fidl_next::Slot<'_, Self>,
1561 decoder: &mut ___D,
1562 ) -> Result<(), ::fidl_next::DecodeError> {
1563 ::fidl_next::munge!(let Self { table } = slot);
1564
1565 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1566 match ordinal {
1567 0 => unsafe { ::core::hint::unreachable_unchecked() },
1568
1569 1 => {
1570 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
1571 slot.as_mut(),
1572 decoder,
1573 )?;
1574
1575 Ok(())
1576 }
1577
1578 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1579 }
1580 })
1581 }
1582}
1583
1584impl<'de> WireConnectionInfo<'de> {
1585 pub fn rights(&self) -> Option<&crate::WireOperations> {
1586 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1587 }
1588}
1589
1590impl<'de> ::core::fmt::Debug for WireConnectionInfo<'de> {
1591 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1592 f.debug_struct("ConnectionInfo").field("rights", &self.rights()).finish()
1593 }
1594}
1595
1596#[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"]
1597pub type Id = u64;
1598
1599pub type WireId = ::fidl_next::WireU64;
1601
1602pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
1603
1604::fidl_next::bitflags! {
1605 #[doc = " DEPRECATED - Use Flags instead.\n"]#[derive(
1606 Clone,
1607 Copy,
1608 Debug,
1609 PartialEq,
1610 Eq,
1611 Hash,
1612 )]
1613 pub struct OpenFlags: u32 {
1614 #[doc = " Can read from target object.\n"]const RIGHT_READABLE = 1;
1615 #[doc = " Can write to target object.\n"]const RIGHT_WRITABLE = 2;
1616 #[doc = " Connection can map target object executable.\n"]const RIGHT_EXECUTABLE = 8;
1617 #[doc = " Create the object if it doesn\'t exist.\n"]const CREATE = 65536;
1618 #[doc = " (with Create) Fail if the object already exists.\n"]const CREATE_IF_ABSENT = 131072;
1619 #[doc = " Truncate the object before usage.\n"]const TRUNCATE = 262144;
1620 #[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;
1621 #[doc = " Seek to the end of the object before all writes.\n"]const APPEND = 1048576;
1622 #[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;
1623 #[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;
1624 #[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;
1625 #[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;
1626 #[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;
1627 #[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;
1628 #[doc = " Open the target object as a block device.\n"]const BLOCK_DEVICE = 16777216;
1629
1630 }
1631}
1632
1633impl ::fidl_next::Encodable for OpenFlags {
1634 type Encoded = WireOpenFlags;
1635}
1636
1637unsafe impl<___E> ::fidl_next::Encode<___E> for OpenFlags
1638where
1639 ___E: ?Sized,
1640{
1641 #[inline]
1642 fn encode(
1643 self,
1644 encoder: &mut ___E,
1645 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1646 ) -> Result<(), ::fidl_next::EncodeError> {
1647 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1648 }
1649}
1650
1651unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OpenFlags
1652where
1653 ___E: ?Sized,
1654{
1655 #[inline]
1656 fn encode_ref(
1657 &self,
1658 _: &mut ___E,
1659 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1660 ) -> Result<(), ::fidl_next::EncodeError> {
1661 ::fidl_next::munge!(let WireOpenFlags { value } = out);
1662 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1663 Ok(())
1664 }
1665}
1666
1667impl ::core::convert::From<WireOpenFlags> for OpenFlags {
1668 fn from(wire: WireOpenFlags) -> Self {
1669 Self::from_bits_retain(u32::from(wire.value))
1670 }
1671}
1672
1673impl ::fidl_next::FromWire<WireOpenFlags> for OpenFlags {
1674 #[inline]
1675 fn from_wire(wire: WireOpenFlags) -> Self {
1676 Self::from(wire)
1677 }
1678}
1679
1680impl ::fidl_next::FromWireRef<WireOpenFlags> for OpenFlags {
1681 #[inline]
1682 fn from_wire_ref(wire: &WireOpenFlags) -> Self {
1683 Self::from(*wire)
1684 }
1685}
1686
1687#[derive(Clone, Copy, Debug)]
1689#[repr(transparent)]
1690pub struct WireOpenFlags {
1691 value: ::fidl_next::WireU32,
1692}
1693
1694unsafe impl ::fidl_next::Wire for WireOpenFlags {
1695 type Decoded<'de> = Self;
1696
1697 #[inline]
1698 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1699 }
1701}
1702
1703unsafe impl<___D> ::fidl_next::Decode<___D> for WireOpenFlags
1704where
1705 ___D: ?Sized,
1706{
1707 fn decode(
1708 slot: ::fidl_next::Slot<'_, Self>,
1709 _: &mut ___D,
1710 ) -> Result<(), ::fidl_next::DecodeError> {
1711 ::fidl_next::munge!(let Self { value } = slot);
1712 let set = u32::from(*value);
1713 if set & !OpenFlags::all().bits() != 0 {
1714 return Err(::fidl_next::DecodeError::InvalidBits {
1715 expected: OpenFlags::all().bits() as usize,
1716 actual: set as usize,
1717 });
1718 }
1719
1720 Ok(())
1721 }
1722}
1723
1724impl ::core::convert::From<OpenFlags> for WireOpenFlags {
1725 fn from(natural: OpenFlags) -> Self {
1726 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1727 }
1728}
1729
1730#[doc = " NodeAttributes defines generic information about a filesystem node.\n"]
1731#[derive(Clone, Debug)]
1732pub struct NodeAttributes {
1733 pub mode: u32,
1734
1735 pub id: u64,
1736
1737 pub content_size: u64,
1738
1739 pub storage_size: u64,
1740
1741 pub link_count: u64,
1742
1743 pub creation_time: u64,
1744
1745 pub modification_time: u64,
1746}
1747
1748impl ::fidl_next::Encodable for NodeAttributes {
1749 type Encoded = WireNodeAttributes;
1750}
1751
1752unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes
1753where
1754 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1755{
1756 #[inline]
1757 fn encode(
1758 self,
1759 encoder: &mut ___E,
1760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1761 ) -> Result<(), ::fidl_next::EncodeError> {
1762 ::fidl_next::munge! {
1763 let Self::Encoded {
1764 mode,
1765 id,
1766 content_size,
1767 storage_size,
1768 link_count,
1769 creation_time,
1770 modification_time,
1771
1772 } = out;
1773 }
1774
1775 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
1776
1777 ::fidl_next::Encode::encode(self.id, encoder, id)?;
1778
1779 ::fidl_next::Encode::encode(self.content_size, encoder, content_size)?;
1780
1781 ::fidl_next::Encode::encode(self.storage_size, encoder, storage_size)?;
1782
1783 ::fidl_next::Encode::encode(self.link_count, encoder, link_count)?;
1784
1785 ::fidl_next::Encode::encode(self.creation_time, encoder, creation_time)?;
1786
1787 ::fidl_next::Encode::encode(self.modification_time, encoder, modification_time)?;
1788
1789 Ok(())
1790 }
1791}
1792
1793unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes
1794where
1795 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1796{
1797 #[inline]
1798 fn encode_ref(
1799 &self,
1800 encoder: &mut ___E,
1801 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1802 ) -> Result<(), ::fidl_next::EncodeError> {
1803 ::fidl_next::munge! {
1804 let Self::Encoded {
1805 mode,
1806 id,
1807 content_size,
1808 storage_size,
1809 link_count,
1810 creation_time,
1811 modification_time,
1812
1813 } = out;
1814 }
1815
1816 ::fidl_next::EncodeRef::encode_ref(&self.mode, encoder, mode)?;
1817
1818 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
1819
1820 ::fidl_next::EncodeRef::encode_ref(&self.content_size, encoder, content_size)?;
1821
1822 ::fidl_next::EncodeRef::encode_ref(&self.storage_size, encoder, storage_size)?;
1823
1824 ::fidl_next::EncodeRef::encode_ref(&self.link_count, encoder, link_count)?;
1825
1826 ::fidl_next::EncodeRef::encode_ref(&self.creation_time, encoder, creation_time)?;
1827
1828 ::fidl_next::EncodeRef::encode_ref(&self.modification_time, encoder, modification_time)?;
1829
1830 Ok(())
1831 }
1832}
1833
1834impl ::fidl_next::EncodableOption for NodeAttributes {
1835 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes>;
1836}
1837
1838unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes
1839where
1840 ___E: ::fidl_next::Encoder + ?Sized,
1841 NodeAttributes: ::fidl_next::Encode<___E>,
1842{
1843 #[inline]
1844 fn encode_option(
1845 this: Option<Self>,
1846 encoder: &mut ___E,
1847 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1848 ) -> Result<(), ::fidl_next::EncodeError> {
1849 if let Some(inner) = this {
1850 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1851 ::fidl_next::WireBox::encode_present(out);
1852 } else {
1853 ::fidl_next::WireBox::encode_absent(out);
1854 }
1855
1856 Ok(())
1857 }
1858}
1859
1860unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes
1861where
1862 ___E: ::fidl_next::Encoder + ?Sized,
1863 NodeAttributes: ::fidl_next::EncodeRef<___E>,
1864{
1865 #[inline]
1866 fn encode_option_ref(
1867 this: Option<&Self>,
1868 encoder: &mut ___E,
1869 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1870 ) -> Result<(), ::fidl_next::EncodeError> {
1871 if let Some(inner) = this {
1872 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1873 ::fidl_next::WireBox::encode_present(out);
1874 } else {
1875 ::fidl_next::WireBox::encode_absent(out);
1876 }
1877
1878 Ok(())
1879 }
1880}
1881
1882impl ::fidl_next::FromWire<WireNodeAttributes> for NodeAttributes {
1883 #[inline]
1884 fn from_wire(wire: WireNodeAttributes) -> Self {
1885 Self {
1886 mode: ::fidl_next::FromWire::from_wire(wire.mode),
1887
1888 id: ::fidl_next::FromWire::from_wire(wire.id),
1889
1890 content_size: ::fidl_next::FromWire::from_wire(wire.content_size),
1891
1892 storage_size: ::fidl_next::FromWire::from_wire(wire.storage_size),
1893
1894 link_count: ::fidl_next::FromWire::from_wire(wire.link_count),
1895
1896 creation_time: ::fidl_next::FromWire::from_wire(wire.creation_time),
1897
1898 modification_time: ::fidl_next::FromWire::from_wire(wire.modification_time),
1899 }
1900 }
1901}
1902
1903impl ::fidl_next::FromWireRef<WireNodeAttributes> for NodeAttributes {
1904 #[inline]
1905 fn from_wire_ref(wire: &WireNodeAttributes) -> Self {
1906 Self {
1907 mode: ::fidl_next::FromWireRef::from_wire_ref(&wire.mode),
1908
1909 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
1910
1911 content_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.content_size),
1912
1913 storage_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.storage_size),
1914
1915 link_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.link_count),
1916
1917 creation_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.creation_time),
1918
1919 modification_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.modification_time),
1920 }
1921 }
1922}
1923
1924#[derive(Clone, Debug)]
1926#[repr(C)]
1927pub struct WireNodeAttributes {
1928 pub mode: ::fidl_next::WireU32,
1929
1930 pub id: ::fidl_next::WireU64,
1931
1932 pub content_size: ::fidl_next::WireU64,
1933
1934 pub storage_size: ::fidl_next::WireU64,
1935
1936 pub link_count: ::fidl_next::WireU64,
1937
1938 pub creation_time: ::fidl_next::WireU64,
1939
1940 pub modification_time: ::fidl_next::WireU64,
1941}
1942
1943unsafe impl ::fidl_next::Wire for WireNodeAttributes {
1944 type Decoded<'de> = WireNodeAttributes;
1945
1946 #[inline]
1947 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1948 unsafe {
1949 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1950 }
1951 }
1952}
1953
1954unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes
1955where
1956 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1957{
1958 fn decode(
1959 slot: ::fidl_next::Slot<'_, Self>,
1960 decoder: &mut ___D,
1961 ) -> Result<(), ::fidl_next::DecodeError> {
1962 ::fidl_next::munge! {
1963 let Self {
1964 mut mode,
1965 mut id,
1966 mut content_size,
1967 mut storage_size,
1968 mut link_count,
1969 mut creation_time,
1970 mut modification_time,
1971
1972 } = slot;
1973 }
1974
1975 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
1976
1977 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
1978
1979 ::fidl_next::Decode::decode(content_size.as_mut(), decoder)?;
1980
1981 ::fidl_next::Decode::decode(storage_size.as_mut(), decoder)?;
1982
1983 ::fidl_next::Decode::decode(link_count.as_mut(), decoder)?;
1984
1985 ::fidl_next::Decode::decode(creation_time.as_mut(), decoder)?;
1986
1987 ::fidl_next::Decode::decode(modification_time.as_mut(), decoder)?;
1988
1989 Ok(())
1990 }
1991}
1992
1993::fidl_next::bitflags! {
1994 #[doc = " The fields of \'attributes\' which are used to update the Node are indicated\n by the \'flags\' argument.\n"]#[derive(
1995 Clone,
1996 Copy,
1997 Debug,
1998 PartialEq,
1999 Eq,
2000 Hash,
2001 )]
2002 pub struct NodeAttributeFlags: u32 {
2003 const CREATION_TIME = 1;
2004 const MODIFICATION_TIME = 2;
2005
2006 }
2007}
2008
2009impl ::fidl_next::Encodable for NodeAttributeFlags {
2010 type Encoded = WireNodeAttributeFlags;
2011}
2012
2013unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributeFlags
2014where
2015 ___E: ?Sized,
2016{
2017 #[inline]
2018 fn encode(
2019 self,
2020 encoder: &mut ___E,
2021 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2022 ) -> Result<(), ::fidl_next::EncodeError> {
2023 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2024 }
2025}
2026
2027unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributeFlags
2028where
2029 ___E: ?Sized,
2030{
2031 #[inline]
2032 fn encode_ref(
2033 &self,
2034 _: &mut ___E,
2035 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2036 ) -> Result<(), ::fidl_next::EncodeError> {
2037 ::fidl_next::munge!(let WireNodeAttributeFlags { value } = out);
2038 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2039 Ok(())
2040 }
2041}
2042
2043impl ::core::convert::From<WireNodeAttributeFlags> for NodeAttributeFlags {
2044 fn from(wire: WireNodeAttributeFlags) -> Self {
2045 Self::from_bits_retain(u32::from(wire.value))
2046 }
2047}
2048
2049impl ::fidl_next::FromWire<WireNodeAttributeFlags> for NodeAttributeFlags {
2050 #[inline]
2051 fn from_wire(wire: WireNodeAttributeFlags) -> Self {
2052 Self::from(wire)
2053 }
2054}
2055
2056impl ::fidl_next::FromWireRef<WireNodeAttributeFlags> for NodeAttributeFlags {
2057 #[inline]
2058 fn from_wire_ref(wire: &WireNodeAttributeFlags) -> Self {
2059 Self::from(*wire)
2060 }
2061}
2062
2063#[derive(Clone, Copy, Debug)]
2065#[repr(transparent)]
2066pub struct WireNodeAttributeFlags {
2067 value: ::fidl_next::WireU32,
2068}
2069
2070unsafe impl ::fidl_next::Wire for WireNodeAttributeFlags {
2071 type Decoded<'de> = Self;
2072
2073 #[inline]
2074 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2075 }
2077}
2078
2079unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributeFlags
2080where
2081 ___D: ?Sized,
2082{
2083 fn decode(
2084 slot: ::fidl_next::Slot<'_, Self>,
2085 _: &mut ___D,
2086 ) -> Result<(), ::fidl_next::DecodeError> {
2087 ::fidl_next::munge!(let Self { value } = slot);
2088 let set = u32::from(*value);
2089 if set & !NodeAttributeFlags::all().bits() != 0 {
2090 return Err(::fidl_next::DecodeError::InvalidBits {
2091 expected: NodeAttributeFlags::all().bits() as usize,
2092 actual: set as usize,
2093 });
2094 }
2095
2096 Ok(())
2097 }
2098}
2099
2100impl ::core::convert::From<NodeAttributeFlags> for WireNodeAttributeFlags {
2101 fn from(natural: NodeAttributeFlags) -> Self {
2102 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2103 }
2104}
2105
2106#[derive(Clone, Debug)]
2107pub struct NodeQueryFilesystemResponse {
2108 pub s: i32,
2109
2110 pub info: Option<Box<crate::FilesystemInfo>>,
2111}
2112
2113impl ::fidl_next::Encodable for NodeQueryFilesystemResponse {
2114 type Encoded = WireNodeQueryFilesystemResponse<'static>;
2115}
2116
2117unsafe impl<___E> ::fidl_next::Encode<___E> for NodeQueryFilesystemResponse
2118where
2119 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2120 ___E: ::fidl_next::Encoder,
2121{
2122 #[inline]
2123 fn encode(
2124 self,
2125 encoder: &mut ___E,
2126 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2127 ) -> Result<(), ::fidl_next::EncodeError> {
2128 ::fidl_next::munge! {
2129 let Self::Encoded {
2130 s,
2131 info,
2132
2133 } = out;
2134 }
2135
2136 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2137
2138 ::fidl_next::Encode::encode(self.info, encoder, info)?;
2139
2140 Ok(())
2141 }
2142}
2143
2144unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeQueryFilesystemResponse
2145where
2146 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2147 ___E: ::fidl_next::Encoder,
2148{
2149 #[inline]
2150 fn encode_ref(
2151 &self,
2152 encoder: &mut ___E,
2153 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2154 ) -> Result<(), ::fidl_next::EncodeError> {
2155 ::fidl_next::munge! {
2156 let Self::Encoded {
2157 s,
2158 info,
2159
2160 } = out;
2161 }
2162
2163 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2164
2165 ::fidl_next::EncodeRef::encode_ref(&self.info, encoder, info)?;
2166
2167 Ok(())
2168 }
2169}
2170
2171impl ::fidl_next::EncodableOption for NodeQueryFilesystemResponse {
2172 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeQueryFilesystemResponse<'static>>;
2173}
2174
2175unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeQueryFilesystemResponse
2176where
2177 ___E: ::fidl_next::Encoder + ?Sized,
2178 NodeQueryFilesystemResponse: ::fidl_next::Encode<___E>,
2179{
2180 #[inline]
2181 fn encode_option(
2182 this: Option<Self>,
2183 encoder: &mut ___E,
2184 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2185 ) -> Result<(), ::fidl_next::EncodeError> {
2186 if let Some(inner) = this {
2187 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2188 ::fidl_next::WireBox::encode_present(out);
2189 } else {
2190 ::fidl_next::WireBox::encode_absent(out);
2191 }
2192
2193 Ok(())
2194 }
2195}
2196
2197unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeQueryFilesystemResponse
2198where
2199 ___E: ::fidl_next::Encoder + ?Sized,
2200 NodeQueryFilesystemResponse: ::fidl_next::EncodeRef<___E>,
2201{
2202 #[inline]
2203 fn encode_option_ref(
2204 this: Option<&Self>,
2205 encoder: &mut ___E,
2206 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2207 ) -> Result<(), ::fidl_next::EncodeError> {
2208 if let Some(inner) = this {
2209 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2210 ::fidl_next::WireBox::encode_present(out);
2211 } else {
2212 ::fidl_next::WireBox::encode_absent(out);
2213 }
2214
2215 Ok(())
2216 }
2217}
2218
2219impl<'de> ::fidl_next::FromWire<WireNodeQueryFilesystemResponse<'de>>
2220 for NodeQueryFilesystemResponse
2221{
2222 #[inline]
2223 fn from_wire(wire: WireNodeQueryFilesystemResponse<'de>) -> Self {
2224 Self {
2225 s: ::fidl_next::FromWire::from_wire(wire.s),
2226
2227 info: ::fidl_next::FromWire::from_wire(wire.info),
2228 }
2229 }
2230}
2231
2232impl<'de> ::fidl_next::FromWireRef<WireNodeQueryFilesystemResponse<'de>>
2233 for NodeQueryFilesystemResponse
2234{
2235 #[inline]
2236 fn from_wire_ref(wire: &WireNodeQueryFilesystemResponse<'de>) -> Self {
2237 Self {
2238 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2239
2240 info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info),
2241 }
2242 }
2243}
2244
2245#[derive(Debug)]
2247#[repr(C)]
2248pub struct WireNodeQueryFilesystemResponse<'de> {
2249 pub s: ::fidl_next::WireI32,
2250
2251 pub info: ::fidl_next::WireBox<'de, crate::WireFilesystemInfo>,
2252}
2253
2254unsafe impl ::fidl_next::Wire for WireNodeQueryFilesystemResponse<'static> {
2255 type Decoded<'de> = WireNodeQueryFilesystemResponse<'de>;
2256
2257 #[inline]
2258 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2259 unsafe {
2260 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2261 }
2262 }
2263}
2264
2265unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeQueryFilesystemResponse<'static>
2266where
2267 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2268 ___D: ::fidl_next::Decoder,
2269{
2270 fn decode(
2271 slot: ::fidl_next::Slot<'_, Self>,
2272 decoder: &mut ___D,
2273 ) -> Result<(), ::fidl_next::DecodeError> {
2274 ::fidl_next::munge! {
2275 let Self {
2276 mut s,
2277 mut info,
2278
2279 } = slot;
2280 }
2281
2282 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2283
2284 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
2285
2286 Ok(())
2287 }
2288}
2289
2290pub type NodeUpdateAttributesResponse = ();
2291
2292pub type WireNodeUpdateAttributesResponse = ();
2294
2295pub type NodeSyncResponse = ();
2296
2297pub type WireNodeSyncResponse = ();
2299
2300::fidl_next::bitflags! {
2301 #[derive(
2302 Clone,
2303 Copy,
2304 Debug,
2305 PartialEq,
2306 Eq,
2307 Hash,
2308 )]
2309 pub struct ModeType: u32 {
2310 const DO_NOT_USE = 2147483648;
2311
2312 }
2313}
2314
2315impl ::fidl_next::Encodable for ModeType {
2316 type Encoded = WireModeType;
2317}
2318
2319unsafe impl<___E> ::fidl_next::Encode<___E> for ModeType
2320where
2321 ___E: ?Sized,
2322{
2323 #[inline]
2324 fn encode(
2325 self,
2326 encoder: &mut ___E,
2327 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2328 ) -> Result<(), ::fidl_next::EncodeError> {
2329 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2330 }
2331}
2332
2333unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ModeType
2334where
2335 ___E: ?Sized,
2336{
2337 #[inline]
2338 fn encode_ref(
2339 &self,
2340 _: &mut ___E,
2341 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2342 ) -> Result<(), ::fidl_next::EncodeError> {
2343 ::fidl_next::munge!(let WireModeType { value } = out);
2344 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2345 Ok(())
2346 }
2347}
2348
2349impl ::core::convert::From<WireModeType> for ModeType {
2350 fn from(wire: WireModeType) -> Self {
2351 Self::from_bits_retain(u32::from(wire.value))
2352 }
2353}
2354
2355impl ::fidl_next::FromWire<WireModeType> for ModeType {
2356 #[inline]
2357 fn from_wire(wire: WireModeType) -> Self {
2358 Self::from(wire)
2359 }
2360}
2361
2362impl ::fidl_next::FromWireRef<WireModeType> for ModeType {
2363 #[inline]
2364 fn from_wire_ref(wire: &WireModeType) -> Self {
2365 Self::from(*wire)
2366 }
2367}
2368
2369#[derive(Clone, Copy, Debug)]
2371#[repr(transparent)]
2372pub struct WireModeType {
2373 value: ::fidl_next::WireU32,
2374}
2375
2376unsafe impl ::fidl_next::Wire for WireModeType {
2377 type Decoded<'de> = Self;
2378
2379 #[inline]
2380 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2381 }
2383}
2384
2385unsafe impl<___D> ::fidl_next::Decode<___D> for WireModeType
2386where
2387 ___D: ?Sized,
2388{
2389 fn decode(
2390 slot: ::fidl_next::Slot<'_, Self>,
2391 _: &mut ___D,
2392 ) -> Result<(), ::fidl_next::DecodeError> {
2393 ::fidl_next::munge!(let Self { value } = slot);
2394 let set = u32::from(*value);
2395 if set & !ModeType::all().bits() != 0 {
2396 return Err(::fidl_next::DecodeError::InvalidBits {
2397 expected: ModeType::all().bits() as usize,
2398 actual: set as usize,
2399 });
2400 }
2401
2402 Ok(())
2403 }
2404}
2405
2406impl ::core::convert::From<ModeType> for WireModeType {
2407 fn from(natural: ModeType) -> Self {
2408 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2409 }
2410}
2411
2412#[doc = " The maximum length, in bytes, of a filesystem path.\n"]
2413pub const MAX_PATH_LENGTH: u64 = 4095;
2414
2415#[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"]
2416pub type Path = String;
2417
2418pub type WirePath<'de> = ::fidl_next::WireString<'de>;
2420
2421#[derive(Clone, Debug)]
2422#[repr(C)]
2423pub struct DirectoryReadDirentsRequest {
2424 pub max_bytes: u64,
2425}
2426
2427impl ::fidl_next::Encodable for DirectoryReadDirentsRequest {
2428 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryReadDirentsRequest> = unsafe {
2429 ::fidl_next::CopyOptimization::enable_if(
2430 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2431 )
2432 };
2433
2434 type Encoded = WireDirectoryReadDirentsRequest;
2435}
2436
2437unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsRequest
2438where
2439 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2440{
2441 #[inline]
2442 fn encode(
2443 self,
2444 encoder: &mut ___E,
2445 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2446 ) -> Result<(), ::fidl_next::EncodeError> {
2447 ::fidl_next::munge! {
2448 let Self::Encoded {
2449 max_bytes,
2450
2451 } = out;
2452 }
2453
2454 ::fidl_next::Encode::encode(self.max_bytes, encoder, max_bytes)?;
2455
2456 Ok(())
2457 }
2458}
2459
2460unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsRequest
2461where
2462 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2463{
2464 #[inline]
2465 fn encode_ref(
2466 &self,
2467 encoder: &mut ___E,
2468 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2469 ) -> Result<(), ::fidl_next::EncodeError> {
2470 ::fidl_next::munge! {
2471 let Self::Encoded {
2472 max_bytes,
2473
2474 } = out;
2475 }
2476
2477 ::fidl_next::EncodeRef::encode_ref(&self.max_bytes, encoder, max_bytes)?;
2478
2479 Ok(())
2480 }
2481}
2482
2483impl ::fidl_next::EncodableOption for DirectoryReadDirentsRequest {
2484 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsRequest>;
2485}
2486
2487unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsRequest
2488where
2489 ___E: ::fidl_next::Encoder + ?Sized,
2490 DirectoryReadDirentsRequest: ::fidl_next::Encode<___E>,
2491{
2492 #[inline]
2493 fn encode_option(
2494 this: Option<Self>,
2495 encoder: &mut ___E,
2496 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2497 ) -> Result<(), ::fidl_next::EncodeError> {
2498 if let Some(inner) = this {
2499 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2500 ::fidl_next::WireBox::encode_present(out);
2501 } else {
2502 ::fidl_next::WireBox::encode_absent(out);
2503 }
2504
2505 Ok(())
2506 }
2507}
2508
2509unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsRequest
2510where
2511 ___E: ::fidl_next::Encoder + ?Sized,
2512 DirectoryReadDirentsRequest: ::fidl_next::EncodeRef<___E>,
2513{
2514 #[inline]
2515 fn encode_option_ref(
2516 this: Option<&Self>,
2517 encoder: &mut ___E,
2518 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2519 ) -> Result<(), ::fidl_next::EncodeError> {
2520 if let Some(inner) = this {
2521 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2522 ::fidl_next::WireBox::encode_present(out);
2523 } else {
2524 ::fidl_next::WireBox::encode_absent(out);
2525 }
2526
2527 Ok(())
2528 }
2529}
2530
2531impl ::fidl_next::FromWire<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2532 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryReadDirentsRequest, Self> = unsafe {
2533 ::fidl_next::CopyOptimization::enable_if(
2534 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2535 .is_enabled(),
2536 )
2537 };
2538
2539 #[inline]
2540 fn from_wire(wire: WireDirectoryReadDirentsRequest) -> Self {
2541 Self { max_bytes: ::fidl_next::FromWire::from_wire(wire.max_bytes) }
2542 }
2543}
2544
2545impl ::fidl_next::FromWireRef<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2546 #[inline]
2547 fn from_wire_ref(wire: &WireDirectoryReadDirentsRequest) -> Self {
2548 Self { max_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_bytes) }
2549 }
2550}
2551
2552#[derive(Clone, Debug)]
2554#[repr(C)]
2555pub struct WireDirectoryReadDirentsRequest {
2556 pub max_bytes: ::fidl_next::WireU64,
2557}
2558
2559unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsRequest {
2560 type Decoded<'de> = WireDirectoryReadDirentsRequest;
2561
2562 #[inline]
2563 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2564}
2565
2566unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsRequest
2567where
2568 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2569{
2570 fn decode(
2571 slot: ::fidl_next::Slot<'_, Self>,
2572 decoder: &mut ___D,
2573 ) -> Result<(), ::fidl_next::DecodeError> {
2574 ::fidl_next::munge! {
2575 let Self {
2576 mut max_bytes,
2577
2578 } = slot;
2579 }
2580
2581 ::fidl_next::Decode::decode(max_bytes.as_mut(), decoder)?;
2582
2583 Ok(())
2584 }
2585}
2586
2587#[doc = " The maximal buffer size which can be transmitted for buffered operations.\n This capacity is currently set somewhat arbitrarily.\n"]
2588pub const MAX_BUF: u64 = 8192;
2589
2590#[derive(Clone, Debug)]
2591pub struct DirectoryReadDirentsResponse {
2592 pub s: i32,
2593
2594 pub dirents: Vec<u8>,
2595}
2596
2597impl ::fidl_next::Encodable for DirectoryReadDirentsResponse {
2598 type Encoded = WireDirectoryReadDirentsResponse<'static>;
2599}
2600
2601unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsResponse
2602where
2603 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2604 ___E: ::fidl_next::Encoder,
2605{
2606 #[inline]
2607 fn encode(
2608 self,
2609 encoder: &mut ___E,
2610 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2611 ) -> Result<(), ::fidl_next::EncodeError> {
2612 ::fidl_next::munge! {
2613 let Self::Encoded {
2614 s,
2615 dirents,
2616
2617 } = out;
2618 }
2619
2620 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2621
2622 ::fidl_next::Encode::encode(self.dirents, encoder, dirents)?;
2623
2624 Ok(())
2625 }
2626}
2627
2628unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsResponse
2629where
2630 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2631 ___E: ::fidl_next::Encoder,
2632{
2633 #[inline]
2634 fn encode_ref(
2635 &self,
2636 encoder: &mut ___E,
2637 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2638 ) -> Result<(), ::fidl_next::EncodeError> {
2639 ::fidl_next::munge! {
2640 let Self::Encoded {
2641 s,
2642 dirents,
2643
2644 } = out;
2645 }
2646
2647 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2648
2649 ::fidl_next::EncodeRef::encode_ref(&self.dirents, encoder, dirents)?;
2650
2651 Ok(())
2652 }
2653}
2654
2655impl ::fidl_next::EncodableOption for DirectoryReadDirentsResponse {
2656 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryReadDirentsResponse<'static>>;
2657}
2658
2659unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryReadDirentsResponse
2660where
2661 ___E: ::fidl_next::Encoder + ?Sized,
2662 DirectoryReadDirentsResponse: ::fidl_next::Encode<___E>,
2663{
2664 #[inline]
2665 fn encode_option(
2666 this: Option<Self>,
2667 encoder: &mut ___E,
2668 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2669 ) -> Result<(), ::fidl_next::EncodeError> {
2670 if let Some(inner) = this {
2671 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2672 ::fidl_next::WireBox::encode_present(out);
2673 } else {
2674 ::fidl_next::WireBox::encode_absent(out);
2675 }
2676
2677 Ok(())
2678 }
2679}
2680
2681unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryReadDirentsResponse
2682where
2683 ___E: ::fidl_next::Encoder + ?Sized,
2684 DirectoryReadDirentsResponse: ::fidl_next::EncodeRef<___E>,
2685{
2686 #[inline]
2687 fn encode_option_ref(
2688 this: Option<&Self>,
2689 encoder: &mut ___E,
2690 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2691 ) -> Result<(), ::fidl_next::EncodeError> {
2692 if let Some(inner) = this {
2693 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2694 ::fidl_next::WireBox::encode_present(out);
2695 } else {
2696 ::fidl_next::WireBox::encode_absent(out);
2697 }
2698
2699 Ok(())
2700 }
2701}
2702
2703impl<'de> ::fidl_next::FromWire<WireDirectoryReadDirentsResponse<'de>>
2704 for DirectoryReadDirentsResponse
2705{
2706 #[inline]
2707 fn from_wire(wire: WireDirectoryReadDirentsResponse<'de>) -> Self {
2708 Self {
2709 s: ::fidl_next::FromWire::from_wire(wire.s),
2710
2711 dirents: ::fidl_next::FromWire::from_wire(wire.dirents),
2712 }
2713 }
2714}
2715
2716impl<'de> ::fidl_next::FromWireRef<WireDirectoryReadDirentsResponse<'de>>
2717 for DirectoryReadDirentsResponse
2718{
2719 #[inline]
2720 fn from_wire_ref(wire: &WireDirectoryReadDirentsResponse<'de>) -> Self {
2721 Self {
2722 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
2723
2724 dirents: ::fidl_next::FromWireRef::from_wire_ref(&wire.dirents),
2725 }
2726 }
2727}
2728
2729#[derive(Debug)]
2731#[repr(C)]
2732pub struct WireDirectoryReadDirentsResponse<'de> {
2733 pub s: ::fidl_next::WireI32,
2734
2735 pub dirents: ::fidl_next::WireVector<'de, u8>,
2736}
2737
2738unsafe impl ::fidl_next::Wire for WireDirectoryReadDirentsResponse<'static> {
2739 type Decoded<'de> = WireDirectoryReadDirentsResponse<'de>;
2740
2741 #[inline]
2742 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2743 unsafe {
2744 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2745 }
2746 }
2747}
2748
2749unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsResponse<'static>
2750where
2751 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2752 ___D: ::fidl_next::Decoder,
2753{
2754 fn decode(
2755 slot: ::fidl_next::Slot<'_, Self>,
2756 decoder: &mut ___D,
2757 ) -> Result<(), ::fidl_next::DecodeError> {
2758 ::fidl_next::munge! {
2759 let Self {
2760 mut s,
2761 mut dirents,
2762
2763 } = slot;
2764 }
2765
2766 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2767
2768 ::fidl_next::Decode::decode(dirents.as_mut(), decoder)?;
2769
2770 let dirents = unsafe { dirents.deref_unchecked() };
2771
2772 if dirents.len() > 8192 {
2773 return Err(::fidl_next::DecodeError::VectorTooLong {
2774 size: dirents.len() as u64,
2775 limit: 8192,
2776 });
2777 }
2778
2779 Ok(())
2780 }
2781}
2782
2783#[derive(Clone, Debug)]
2784#[repr(C)]
2785pub struct DirectoryRewindResponse {
2786 pub s: i32,
2787}
2788
2789impl ::fidl_next::Encodable for DirectoryRewindResponse {
2790 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryRewindResponse> = unsafe {
2791 ::fidl_next::CopyOptimization::enable_if(
2792 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2793 )
2794 };
2795
2796 type Encoded = WireDirectoryRewindResponse;
2797}
2798
2799unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRewindResponse
2800where
2801 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2802{
2803 #[inline]
2804 fn encode(
2805 self,
2806 encoder: &mut ___E,
2807 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2808 ) -> Result<(), ::fidl_next::EncodeError> {
2809 ::fidl_next::munge! {
2810 let Self::Encoded {
2811 s,
2812
2813 } = out;
2814 }
2815
2816 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2817
2818 Ok(())
2819 }
2820}
2821
2822unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryRewindResponse
2823where
2824 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2825{
2826 #[inline]
2827 fn encode_ref(
2828 &self,
2829 encoder: &mut ___E,
2830 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2831 ) -> Result<(), ::fidl_next::EncodeError> {
2832 ::fidl_next::munge! {
2833 let Self::Encoded {
2834 s,
2835
2836 } = out;
2837 }
2838
2839 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2840
2841 Ok(())
2842 }
2843}
2844
2845impl ::fidl_next::EncodableOption for DirectoryRewindResponse {
2846 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRewindResponse>;
2847}
2848
2849unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRewindResponse
2850where
2851 ___E: ::fidl_next::Encoder + ?Sized,
2852 DirectoryRewindResponse: ::fidl_next::Encode<___E>,
2853{
2854 #[inline]
2855 fn encode_option(
2856 this: Option<Self>,
2857 encoder: &mut ___E,
2858 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2859 ) -> Result<(), ::fidl_next::EncodeError> {
2860 if let Some(inner) = this {
2861 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2862 ::fidl_next::WireBox::encode_present(out);
2863 } else {
2864 ::fidl_next::WireBox::encode_absent(out);
2865 }
2866
2867 Ok(())
2868 }
2869}
2870
2871unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryRewindResponse
2872where
2873 ___E: ::fidl_next::Encoder + ?Sized,
2874 DirectoryRewindResponse: ::fidl_next::EncodeRef<___E>,
2875{
2876 #[inline]
2877 fn encode_option_ref(
2878 this: Option<&Self>,
2879 encoder: &mut ___E,
2880 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2881 ) -> Result<(), ::fidl_next::EncodeError> {
2882 if let Some(inner) = this {
2883 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2884 ::fidl_next::WireBox::encode_present(out);
2885 } else {
2886 ::fidl_next::WireBox::encode_absent(out);
2887 }
2888
2889 Ok(())
2890 }
2891}
2892
2893impl ::fidl_next::FromWire<WireDirectoryRewindResponse> for DirectoryRewindResponse {
2894 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryRewindResponse, Self> = unsafe {
2895 ::fidl_next::CopyOptimization::enable_if(
2896 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
2897 .is_enabled(),
2898 )
2899 };
2900
2901 #[inline]
2902 fn from_wire(wire: WireDirectoryRewindResponse) -> Self {
2903 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
2904 }
2905}
2906
2907impl ::fidl_next::FromWireRef<WireDirectoryRewindResponse> for DirectoryRewindResponse {
2908 #[inline]
2909 fn from_wire_ref(wire: &WireDirectoryRewindResponse) -> Self {
2910 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
2911 }
2912}
2913
2914#[derive(Clone, Debug)]
2916#[repr(C)]
2917pub struct WireDirectoryRewindResponse {
2918 pub s: ::fidl_next::WireI32,
2919}
2920
2921unsafe impl ::fidl_next::Wire for WireDirectoryRewindResponse {
2922 type Decoded<'de> = WireDirectoryRewindResponse;
2923
2924 #[inline]
2925 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2926}
2927
2928unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRewindResponse
2929where
2930 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2931{
2932 fn decode(
2933 slot: ::fidl_next::Slot<'_, Self>,
2934 decoder: &mut ___D,
2935 ) -> Result<(), ::fidl_next::DecodeError> {
2936 ::fidl_next::munge! {
2937 let Self {
2938 mut s,
2939
2940 } = slot;
2941 }
2942
2943 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2944
2945 Ok(())
2946 }
2947}
2948
2949#[derive(Debug)]
2950#[repr(C)]
2951pub struct DirectoryGetTokenResponse {
2952 pub s: i32,
2953
2954 pub token: Option<::fidl_next::fuchsia::zx::Handle>,
2955}
2956
2957impl ::fidl_next::Encodable for DirectoryGetTokenResponse {
2958 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryGetTokenResponse> = unsafe {
2959 ::fidl_next::CopyOptimization::enable_if(
2960 true
2961
2962 && <
2963 i32 as ::fidl_next::Encodable
2964 >::COPY_OPTIMIZATION.is_enabled()
2965
2966 && <
2967 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
2968 >::COPY_OPTIMIZATION.is_enabled()
2969
2970 )
2971 };
2972
2973 type Encoded = WireDirectoryGetTokenResponse;
2974}
2975
2976unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryGetTokenResponse
2977where
2978 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2979 ___E: ::fidl_next::fuchsia::HandleEncoder,
2980{
2981 #[inline]
2982 fn encode(
2983 self,
2984 encoder: &mut ___E,
2985 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2986 ) -> Result<(), ::fidl_next::EncodeError> {
2987 ::fidl_next::munge! {
2988 let Self::Encoded {
2989 s,
2990 token,
2991
2992 } = out;
2993 }
2994
2995 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2996
2997 ::fidl_next::Encode::encode(self.token, encoder, token)?;
2998
2999 Ok(())
3000 }
3001}
3002
3003impl ::fidl_next::EncodableOption for DirectoryGetTokenResponse {
3004 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryGetTokenResponse>;
3005}
3006
3007unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryGetTokenResponse
3008where
3009 ___E: ::fidl_next::Encoder + ?Sized,
3010 DirectoryGetTokenResponse: ::fidl_next::Encode<___E>,
3011{
3012 #[inline]
3013 fn encode_option(
3014 this: Option<Self>,
3015 encoder: &mut ___E,
3016 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3017 ) -> Result<(), ::fidl_next::EncodeError> {
3018 if let Some(inner) = this {
3019 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3020 ::fidl_next::WireBox::encode_present(out);
3021 } else {
3022 ::fidl_next::WireBox::encode_absent(out);
3023 }
3024
3025 Ok(())
3026 }
3027}
3028
3029impl ::fidl_next::FromWire<WireDirectoryGetTokenResponse> for DirectoryGetTokenResponse {
3030 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryGetTokenResponse, Self> = unsafe {
3031 ::fidl_next::CopyOptimization::enable_if(
3032 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3033 .is_enabled()
3034 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
3035 ::fidl_next::fuchsia::WireOptionalHandle,
3036 >>::COPY_OPTIMIZATION
3037 .is_enabled(),
3038 )
3039 };
3040
3041 #[inline]
3042 fn from_wire(wire: WireDirectoryGetTokenResponse) -> Self {
3043 Self {
3044 s: ::fidl_next::FromWire::from_wire(wire.s),
3045
3046 token: ::fidl_next::FromWire::from_wire(wire.token),
3047 }
3048 }
3049}
3050
3051#[derive(Debug)]
3053#[repr(C)]
3054pub struct WireDirectoryGetTokenResponse {
3055 pub s: ::fidl_next::WireI32,
3056
3057 pub token: ::fidl_next::fuchsia::WireOptionalHandle,
3058}
3059
3060unsafe impl ::fidl_next::Wire for WireDirectoryGetTokenResponse {
3061 type Decoded<'de> = WireDirectoryGetTokenResponse;
3062
3063 #[inline]
3064 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3065}
3066
3067unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryGetTokenResponse
3068where
3069 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3070 ___D: ::fidl_next::fuchsia::HandleDecoder,
3071{
3072 fn decode(
3073 slot: ::fidl_next::Slot<'_, Self>,
3074 decoder: &mut ___D,
3075 ) -> Result<(), ::fidl_next::DecodeError> {
3076 ::fidl_next::munge! {
3077 let Self {
3078 mut s,
3079 mut token,
3080
3081 } = slot;
3082 }
3083
3084 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3085
3086 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
3087
3088 Ok(())
3089 }
3090}
3091
3092#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
3093pub const MAX_NAME_LENGTH: u64 = 255;
3094
3095#[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"]
3096pub type Name = String;
3097
3098pub type WireName<'de> = ::fidl_next::WireString<'de>;
3100
3101#[derive(Debug)]
3102pub struct DirectoryLinkRequest {
3103 pub src: String,
3104
3105 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
3106
3107 pub dst: String,
3108}
3109
3110impl ::fidl_next::Encodable for DirectoryLinkRequest {
3111 type Encoded = WireDirectoryLinkRequest<'static>;
3112}
3113
3114unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkRequest
3115where
3116 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3117 ___E: ::fidl_next::Encoder,
3118 ___E: ::fidl_next::fuchsia::HandleEncoder,
3119{
3120 #[inline]
3121 fn encode(
3122 self,
3123 encoder: &mut ___E,
3124 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3125 ) -> Result<(), ::fidl_next::EncodeError> {
3126 ::fidl_next::munge! {
3127 let Self::Encoded {
3128 src,
3129 dst_parent_token,
3130 dst,
3131
3132 } = out;
3133 }
3134
3135 ::fidl_next::Encode::encode(self.src, encoder, src)?;
3136
3137 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
3138
3139 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
3140
3141 Ok(())
3142 }
3143}
3144
3145impl ::fidl_next::EncodableOption for DirectoryLinkRequest {
3146 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkRequest<'static>>;
3147}
3148
3149unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkRequest
3150where
3151 ___E: ::fidl_next::Encoder + ?Sized,
3152 DirectoryLinkRequest: ::fidl_next::Encode<___E>,
3153{
3154 #[inline]
3155 fn encode_option(
3156 this: Option<Self>,
3157 encoder: &mut ___E,
3158 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3159 ) -> Result<(), ::fidl_next::EncodeError> {
3160 if let Some(inner) = this {
3161 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3162 ::fidl_next::WireBox::encode_present(out);
3163 } else {
3164 ::fidl_next::WireBox::encode_absent(out);
3165 }
3166
3167 Ok(())
3168 }
3169}
3170
3171impl<'de> ::fidl_next::FromWire<WireDirectoryLinkRequest<'de>> for DirectoryLinkRequest {
3172 #[inline]
3173 fn from_wire(wire: WireDirectoryLinkRequest<'de>) -> Self {
3174 Self {
3175 src: ::fidl_next::FromWire::from_wire(wire.src),
3176
3177 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
3178
3179 dst: ::fidl_next::FromWire::from_wire(wire.dst),
3180 }
3181 }
3182}
3183
3184#[derive(Debug)]
3186#[repr(C)]
3187pub struct WireDirectoryLinkRequest<'de> {
3188 pub src: ::fidl_next::WireString<'de>,
3189
3190 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
3191
3192 pub dst: ::fidl_next::WireString<'de>,
3193}
3194
3195unsafe impl ::fidl_next::Wire for WireDirectoryLinkRequest<'static> {
3196 type Decoded<'de> = WireDirectoryLinkRequest<'de>;
3197
3198 #[inline]
3199 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3200 unsafe {
3201 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
3202 }
3203 }
3204}
3205
3206unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkRequest<'static>
3207where
3208 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3209 ___D: ::fidl_next::Decoder,
3210 ___D: ::fidl_next::fuchsia::HandleDecoder,
3211{
3212 fn decode(
3213 slot: ::fidl_next::Slot<'_, Self>,
3214 decoder: &mut ___D,
3215 ) -> Result<(), ::fidl_next::DecodeError> {
3216 ::fidl_next::munge! {
3217 let Self {
3218 mut src,
3219 mut dst_parent_token,
3220 mut dst,
3221
3222 } = slot;
3223 }
3224
3225 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
3226
3227 let src = unsafe { src.deref_unchecked() };
3228
3229 if src.len() > 255 {
3230 return Err(::fidl_next::DecodeError::VectorTooLong {
3231 size: src.len() as u64,
3232 limit: 255,
3233 });
3234 }
3235
3236 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
3237
3238 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
3239
3240 let dst = unsafe { dst.deref_unchecked() };
3241
3242 if dst.len() > 255 {
3243 return Err(::fidl_next::DecodeError::VectorTooLong {
3244 size: dst.len() as u64,
3245 limit: 255,
3246 });
3247 }
3248
3249 Ok(())
3250 }
3251}
3252
3253#[derive(Clone, Debug)]
3254#[repr(C)]
3255pub struct DirectoryLinkResponse {
3256 pub s: i32,
3257}
3258
3259impl ::fidl_next::Encodable for DirectoryLinkResponse {
3260 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryLinkResponse> = unsafe {
3261 ::fidl_next::CopyOptimization::enable_if(
3262 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3263 )
3264 };
3265
3266 type Encoded = WireDirectoryLinkResponse;
3267}
3268
3269unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkResponse
3270where
3271 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3272{
3273 #[inline]
3274 fn encode(
3275 self,
3276 encoder: &mut ___E,
3277 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3278 ) -> Result<(), ::fidl_next::EncodeError> {
3279 ::fidl_next::munge! {
3280 let Self::Encoded {
3281 s,
3282
3283 } = out;
3284 }
3285
3286 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3287
3288 Ok(())
3289 }
3290}
3291
3292unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryLinkResponse
3293where
3294 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3295{
3296 #[inline]
3297 fn encode_ref(
3298 &self,
3299 encoder: &mut ___E,
3300 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3301 ) -> Result<(), ::fidl_next::EncodeError> {
3302 ::fidl_next::munge! {
3303 let Self::Encoded {
3304 s,
3305
3306 } = out;
3307 }
3308
3309 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
3310
3311 Ok(())
3312 }
3313}
3314
3315impl ::fidl_next::EncodableOption for DirectoryLinkResponse {
3316 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryLinkResponse>;
3317}
3318
3319unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryLinkResponse
3320where
3321 ___E: ::fidl_next::Encoder + ?Sized,
3322 DirectoryLinkResponse: ::fidl_next::Encode<___E>,
3323{
3324 #[inline]
3325 fn encode_option(
3326 this: Option<Self>,
3327 encoder: &mut ___E,
3328 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3329 ) -> Result<(), ::fidl_next::EncodeError> {
3330 if let Some(inner) = this {
3331 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3332 ::fidl_next::WireBox::encode_present(out);
3333 } else {
3334 ::fidl_next::WireBox::encode_absent(out);
3335 }
3336
3337 Ok(())
3338 }
3339}
3340
3341unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryLinkResponse
3342where
3343 ___E: ::fidl_next::Encoder + ?Sized,
3344 DirectoryLinkResponse: ::fidl_next::EncodeRef<___E>,
3345{
3346 #[inline]
3347 fn encode_option_ref(
3348 this: Option<&Self>,
3349 encoder: &mut ___E,
3350 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3351 ) -> Result<(), ::fidl_next::EncodeError> {
3352 if let Some(inner) = this {
3353 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3354 ::fidl_next::WireBox::encode_present(out);
3355 } else {
3356 ::fidl_next::WireBox::encode_absent(out);
3357 }
3358
3359 Ok(())
3360 }
3361}
3362
3363impl ::fidl_next::FromWire<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3364 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryLinkResponse, Self> = unsafe {
3365 ::fidl_next::CopyOptimization::enable_if(
3366 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
3367 .is_enabled(),
3368 )
3369 };
3370
3371 #[inline]
3372 fn from_wire(wire: WireDirectoryLinkResponse) -> Self {
3373 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
3374 }
3375}
3376
3377impl ::fidl_next::FromWireRef<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3378 #[inline]
3379 fn from_wire_ref(wire: &WireDirectoryLinkResponse) -> Self {
3380 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
3381 }
3382}
3383
3384#[derive(Clone, Debug)]
3386#[repr(C)]
3387pub struct WireDirectoryLinkResponse {
3388 pub s: ::fidl_next::WireI32,
3389}
3390
3391unsafe impl ::fidl_next::Wire for WireDirectoryLinkResponse {
3392 type Decoded<'de> = WireDirectoryLinkResponse;
3393
3394 #[inline]
3395 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3396}
3397
3398unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkResponse
3399where
3400 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3401{
3402 fn decode(
3403 slot: ::fidl_next::Slot<'_, Self>,
3404 decoder: &mut ___D,
3405 ) -> Result<(), ::fidl_next::DecodeError> {
3406 ::fidl_next::munge! {
3407 let Self {
3408 mut s,
3409
3410 } = slot;
3411 }
3412
3413 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3414
3415 Ok(())
3416 }
3417}
3418
3419::fidl_next::bitflags! {
3420 #[derive(
3421 Clone,
3422 Copy,
3423 Debug,
3424 PartialEq,
3425 Eq,
3426 Hash,
3427 )]
3428 pub struct UnlinkFlags: u64 {
3429 #[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;
3430 const _ = !0;
3431 }
3432}
3433
3434impl ::fidl_next::Encodable for UnlinkFlags {
3435 type Encoded = WireUnlinkFlags;
3436}
3437
3438unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkFlags
3439where
3440 ___E: ?Sized,
3441{
3442 #[inline]
3443 fn encode(
3444 self,
3445 encoder: &mut ___E,
3446 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3447 ) -> Result<(), ::fidl_next::EncodeError> {
3448 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
3449 }
3450}
3451
3452unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkFlags
3453where
3454 ___E: ?Sized,
3455{
3456 #[inline]
3457 fn encode_ref(
3458 &self,
3459 _: &mut ___E,
3460 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3461 ) -> Result<(), ::fidl_next::EncodeError> {
3462 ::fidl_next::munge!(let WireUnlinkFlags { value } = out);
3463 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
3464 Ok(())
3465 }
3466}
3467
3468impl ::core::convert::From<WireUnlinkFlags> for UnlinkFlags {
3469 fn from(wire: WireUnlinkFlags) -> Self {
3470 Self::from_bits_retain(u64::from(wire.value))
3471 }
3472}
3473
3474impl ::fidl_next::FromWire<WireUnlinkFlags> for UnlinkFlags {
3475 #[inline]
3476 fn from_wire(wire: WireUnlinkFlags) -> Self {
3477 Self::from(wire)
3478 }
3479}
3480
3481impl ::fidl_next::FromWireRef<WireUnlinkFlags> for UnlinkFlags {
3482 #[inline]
3483 fn from_wire_ref(wire: &WireUnlinkFlags) -> Self {
3484 Self::from(*wire)
3485 }
3486}
3487
3488#[derive(Clone, Copy, Debug)]
3490#[repr(transparent)]
3491pub struct WireUnlinkFlags {
3492 value: ::fidl_next::WireU64,
3493}
3494
3495unsafe impl ::fidl_next::Wire for WireUnlinkFlags {
3496 type Decoded<'de> = Self;
3497
3498 #[inline]
3499 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3500 }
3502}
3503
3504unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkFlags
3505where
3506 ___D: ?Sized,
3507{
3508 fn decode(
3509 slot: ::fidl_next::Slot<'_, Self>,
3510 _: &mut ___D,
3511 ) -> Result<(), ::fidl_next::DecodeError> {
3512 Ok(())
3513 }
3514}
3515
3516impl ::core::convert::From<UnlinkFlags> for WireUnlinkFlags {
3517 fn from(natural: UnlinkFlags) -> Self {
3518 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
3519 }
3520}
3521
3522#[derive(Clone, Debug, Default)]
3523pub struct UnlinkOptions {
3524 pub flags: Option<crate::UnlinkFlags>,
3525}
3526
3527impl UnlinkOptions {
3528 fn __max_ordinal(&self) -> usize {
3529 if self.flags.is_some() {
3530 return 1;
3531 }
3532
3533 0
3534 }
3535}
3536
3537impl ::fidl_next::Encodable for UnlinkOptions {
3538 type Encoded = WireUnlinkOptions<'static>;
3539}
3540
3541unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkOptions
3542where
3543 ___E: ::fidl_next::Encoder + ?Sized,
3544{
3545 #[inline]
3546 fn encode(
3547 mut self,
3548 encoder: &mut ___E,
3549 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3550 ) -> Result<(), ::fidl_next::EncodeError> {
3551 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3552
3553 let max_ord = self.__max_ordinal();
3554
3555 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3556 ::fidl_next::Wire::zero_padding(&mut out);
3557
3558 let mut preallocated =
3559 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3560
3561 for i in 1..=max_ord {
3562 match i {
3563 1 => {
3564 if let Some(flags) = self.flags.take() {
3565 ::fidl_next::WireEnvelope::encode_value(
3566 flags,
3567 preallocated.encoder,
3568 &mut out,
3569 )?;
3570 } else {
3571 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3572 }
3573 }
3574
3575 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3576 }
3577 unsafe {
3578 preallocated.write_next(out.assume_init_ref());
3579 }
3580 }
3581
3582 ::fidl_next::WireTable::encode_len(table, max_ord);
3583
3584 Ok(())
3585 }
3586}
3587
3588unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkOptions
3589where
3590 ___E: ::fidl_next::Encoder + ?Sized,
3591{
3592 #[inline]
3593 fn encode_ref(
3594 &self,
3595 encoder: &mut ___E,
3596 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3597 ) -> Result<(), ::fidl_next::EncodeError> {
3598 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3599
3600 let max_ord = self.__max_ordinal();
3601
3602 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3603 ::fidl_next::Wire::zero_padding(&mut out);
3604
3605 let mut preallocated =
3606 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3607
3608 for i in 1..=max_ord {
3609 match i {
3610 1 => {
3611 if let Some(flags) = &self.flags {
3612 ::fidl_next::WireEnvelope::encode_value(
3613 flags,
3614 preallocated.encoder,
3615 &mut out,
3616 )?;
3617 } else {
3618 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3619 }
3620 }
3621
3622 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3623 }
3624 unsafe {
3625 preallocated.write_next(out.assume_init_ref());
3626 }
3627 }
3628
3629 ::fidl_next::WireTable::encode_len(table, max_ord);
3630
3631 Ok(())
3632 }
3633}
3634
3635impl<'de> ::fidl_next::FromWire<WireUnlinkOptions<'de>> for UnlinkOptions {
3636 #[inline]
3637 fn from_wire(wire: WireUnlinkOptions<'de>) -> Self {
3638 let wire = ::core::mem::ManuallyDrop::new(wire);
3639
3640 let flags = wire.table.get(1);
3641
3642 Self {
3643 flags: flags.map(|envelope| {
3644 ::fidl_next::FromWire::from_wire(unsafe {
3645 envelope.read_unchecked::<crate::WireUnlinkFlags>()
3646 })
3647 }),
3648 }
3649 }
3650}
3651
3652impl<'de> ::fidl_next::FromWireRef<WireUnlinkOptions<'de>> for UnlinkOptions {
3653 #[inline]
3654 fn from_wire_ref(wire: &WireUnlinkOptions<'de>) -> Self {
3655 Self {
3656 flags: wire.table.get(1).map(|envelope| {
3657 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3658 envelope.deref_unchecked::<crate::WireUnlinkFlags>()
3659 })
3660 }),
3661 }
3662 }
3663}
3664
3665#[repr(C)]
3667pub struct WireUnlinkOptions<'de> {
3668 table: ::fidl_next::WireTable<'de>,
3669}
3670
3671impl<'de> Drop for WireUnlinkOptions<'de> {
3672 fn drop(&mut self) {
3673 let _ = self
3674 .table
3675 .get(1)
3676 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireUnlinkFlags>() });
3677 }
3678}
3679
3680unsafe impl ::fidl_next::Wire for WireUnlinkOptions<'static> {
3681 type Decoded<'de> = WireUnlinkOptions<'de>;
3682
3683 #[inline]
3684 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3685 ::fidl_next::munge!(let Self { table } = out);
3686 ::fidl_next::WireTable::zero_padding(table);
3687 }
3688}
3689
3690unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkOptions<'static>
3691where
3692 ___D: ::fidl_next::Decoder + ?Sized,
3693{
3694 fn decode(
3695 slot: ::fidl_next::Slot<'_, Self>,
3696 decoder: &mut ___D,
3697 ) -> Result<(), ::fidl_next::DecodeError> {
3698 ::fidl_next::munge!(let Self { table } = slot);
3699
3700 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3701 match ordinal {
3702 0 => unsafe { ::core::hint::unreachable_unchecked() },
3703
3704 1 => {
3705 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireUnlinkFlags>(
3706 slot.as_mut(),
3707 decoder,
3708 )?;
3709
3710 Ok(())
3711 }
3712
3713 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3714 }
3715 })
3716 }
3717}
3718
3719impl<'de> WireUnlinkOptions<'de> {
3720 pub fn flags(&self) -> Option<&crate::WireUnlinkFlags> {
3721 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3722 }
3723}
3724
3725impl<'de> ::core::fmt::Debug for WireUnlinkOptions<'de> {
3726 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3727 f.debug_struct("UnlinkOptions").field("flags", &self.flags()).finish()
3728 }
3729}
3730
3731#[derive(Clone, Debug)]
3732pub struct DirectoryUnlinkRequest {
3733 pub name: String,
3734
3735 pub options: crate::UnlinkOptions,
3736}
3737
3738impl ::fidl_next::Encodable for DirectoryUnlinkRequest {
3739 type Encoded = WireDirectoryUnlinkRequest<'static>;
3740}
3741
3742unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryUnlinkRequest
3743where
3744 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3745 ___E: ::fidl_next::Encoder,
3746{
3747 #[inline]
3748 fn encode(
3749 self,
3750 encoder: &mut ___E,
3751 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3752 ) -> Result<(), ::fidl_next::EncodeError> {
3753 ::fidl_next::munge! {
3754 let Self::Encoded {
3755 name,
3756 options,
3757
3758 } = out;
3759 }
3760
3761 ::fidl_next::Encode::encode(self.name, encoder, name)?;
3762
3763 ::fidl_next::Encode::encode(self.options, encoder, options)?;
3764
3765 Ok(())
3766 }
3767}
3768
3769unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryUnlinkRequest
3770where
3771 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3772 ___E: ::fidl_next::Encoder,
3773{
3774 #[inline]
3775 fn encode_ref(
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::EncodeRef::encode_ref(&self.name, encoder, name)?;
3789
3790 ::fidl_next::EncodeRef::encode_ref(&self.options, encoder, options)?;
3791
3792 Ok(())
3793 }
3794}
3795
3796impl ::fidl_next::EncodableOption for DirectoryUnlinkRequest {
3797 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryUnlinkRequest<'static>>;
3798}
3799
3800unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryUnlinkRequest
3801where
3802 ___E: ::fidl_next::Encoder + ?Sized,
3803 DirectoryUnlinkRequest: ::fidl_next::Encode<___E>,
3804{
3805 #[inline]
3806 fn encode_option(
3807 this: Option<Self>,
3808 encoder: &mut ___E,
3809 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3810 ) -> Result<(), ::fidl_next::EncodeError> {
3811 if let Some(inner) = this {
3812 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3813 ::fidl_next::WireBox::encode_present(out);
3814 } else {
3815 ::fidl_next::WireBox::encode_absent(out);
3816 }
3817
3818 Ok(())
3819 }
3820}
3821
3822unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryUnlinkRequest
3823where
3824 ___E: ::fidl_next::Encoder + ?Sized,
3825 DirectoryUnlinkRequest: ::fidl_next::EncodeRef<___E>,
3826{
3827 #[inline]
3828 fn encode_option_ref(
3829 this: Option<&Self>,
3830 encoder: &mut ___E,
3831 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3832 ) -> Result<(), ::fidl_next::EncodeError> {
3833 if let Some(inner) = this {
3834 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3835 ::fidl_next::WireBox::encode_present(out);
3836 } else {
3837 ::fidl_next::WireBox::encode_absent(out);
3838 }
3839
3840 Ok(())
3841 }
3842}
3843
3844impl<'de> ::fidl_next::FromWire<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
3845 #[inline]
3846 fn from_wire(wire: WireDirectoryUnlinkRequest<'de>) -> Self {
3847 Self {
3848 name: ::fidl_next::FromWire::from_wire(wire.name),
3849
3850 options: ::fidl_next::FromWire::from_wire(wire.options),
3851 }
3852 }
3853}
3854
3855impl<'de> ::fidl_next::FromWireRef<WireDirectoryUnlinkRequest<'de>> for DirectoryUnlinkRequest {
3856 #[inline]
3857 fn from_wire_ref(wire: &WireDirectoryUnlinkRequest<'de>) -> Self {
3858 Self {
3859 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
3860
3861 options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options),
3862 }
3863 }
3864}
3865
3866#[derive(Debug)]
3868#[repr(C)]
3869pub struct WireDirectoryUnlinkRequest<'de> {
3870 pub name: ::fidl_next::WireString<'de>,
3871
3872 pub options: crate::WireUnlinkOptions<'de>,
3873}
3874
3875unsafe impl ::fidl_next::Wire for WireDirectoryUnlinkRequest<'static> {
3876 type Decoded<'de> = WireDirectoryUnlinkRequest<'de>;
3877
3878 #[inline]
3879 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3880}
3881
3882unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryUnlinkRequest<'static>
3883where
3884 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3885 ___D: ::fidl_next::Decoder,
3886{
3887 fn decode(
3888 slot: ::fidl_next::Slot<'_, Self>,
3889 decoder: &mut ___D,
3890 ) -> Result<(), ::fidl_next::DecodeError> {
3891 ::fidl_next::munge! {
3892 let Self {
3893 mut name,
3894 mut options,
3895
3896 } = slot;
3897 }
3898
3899 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
3900
3901 let name = unsafe { name.deref_unchecked() };
3902
3903 if name.len() > 255 {
3904 return Err(::fidl_next::DecodeError::VectorTooLong {
3905 size: name.len() as u64,
3906 limit: 255,
3907 });
3908 }
3909
3910 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
3911
3912 Ok(())
3913 }
3914}
3915
3916pub type DirectoryUnlinkResponse = ();
3917
3918pub type WireDirectoryUnlinkResponse = ();
3920
3921#[doc = " The type to identify a connection to a node.\n It represents a capability: a reference to a node with associated rights.\n"]
3922pub type Token = ::fidl_next::fuchsia::zx::Event;
3923
3924pub type WireToken = ::fidl_next::fuchsia::WireEvent;
3926
3927#[derive(Debug)]
3928pub struct DirectoryRenameRequest {
3929 pub src: String,
3930
3931 pub dst_parent_token: ::fidl_next::fuchsia::zx::Event,
3932
3933 pub dst: String,
3934}
3935
3936impl ::fidl_next::Encodable for DirectoryRenameRequest {
3937 type Encoded = WireDirectoryRenameRequest<'static>;
3938}
3939
3940unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRenameRequest
3941where
3942 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3943 ___E: ::fidl_next::Encoder,
3944 ___E: ::fidl_next::fuchsia::HandleEncoder,
3945{
3946 #[inline]
3947 fn encode(
3948 self,
3949 encoder: &mut ___E,
3950 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3951 ) -> Result<(), ::fidl_next::EncodeError> {
3952 ::fidl_next::munge! {
3953 let Self::Encoded {
3954 src,
3955 dst_parent_token,
3956 dst,
3957
3958 } = out;
3959 }
3960
3961 ::fidl_next::Encode::encode(self.src, encoder, src)?;
3962
3963 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
3964
3965 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
3966
3967 Ok(())
3968 }
3969}
3970
3971impl ::fidl_next::EncodableOption for DirectoryRenameRequest {
3972 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryRenameRequest<'static>>;
3973}
3974
3975unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRenameRequest
3976where
3977 ___E: ::fidl_next::Encoder + ?Sized,
3978 DirectoryRenameRequest: ::fidl_next::Encode<___E>,
3979{
3980 #[inline]
3981 fn encode_option(
3982 this: Option<Self>,
3983 encoder: &mut ___E,
3984 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3985 ) -> Result<(), ::fidl_next::EncodeError> {
3986 if let Some(inner) = this {
3987 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3988 ::fidl_next::WireBox::encode_present(out);
3989 } else {
3990 ::fidl_next::WireBox::encode_absent(out);
3991 }
3992
3993 Ok(())
3994 }
3995}
3996
3997impl<'de> ::fidl_next::FromWire<WireDirectoryRenameRequest<'de>> for DirectoryRenameRequest {
3998 #[inline]
3999 fn from_wire(wire: WireDirectoryRenameRequest<'de>) -> Self {
4000 Self {
4001 src: ::fidl_next::FromWire::from_wire(wire.src),
4002
4003 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
4004
4005 dst: ::fidl_next::FromWire::from_wire(wire.dst),
4006 }
4007 }
4008}
4009
4010#[derive(Debug)]
4012#[repr(C)]
4013pub struct WireDirectoryRenameRequest<'de> {
4014 pub src: ::fidl_next::WireString<'de>,
4015
4016 pub dst_parent_token: ::fidl_next::fuchsia::WireEvent,
4017
4018 pub dst: ::fidl_next::WireString<'de>,
4019}
4020
4021unsafe impl ::fidl_next::Wire for WireDirectoryRenameRequest<'static> {
4022 type Decoded<'de> = WireDirectoryRenameRequest<'de>;
4023
4024 #[inline]
4025 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4026 unsafe {
4027 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
4028 }
4029 }
4030}
4031
4032unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRenameRequest<'static>
4033where
4034 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4035 ___D: ::fidl_next::Decoder,
4036 ___D: ::fidl_next::fuchsia::HandleDecoder,
4037{
4038 fn decode(
4039 slot: ::fidl_next::Slot<'_, Self>,
4040 decoder: &mut ___D,
4041 ) -> Result<(), ::fidl_next::DecodeError> {
4042 ::fidl_next::munge! {
4043 let Self {
4044 mut src,
4045 mut dst_parent_token,
4046 mut dst,
4047
4048 } = slot;
4049 }
4050
4051 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
4052
4053 let src = unsafe { src.deref_unchecked() };
4054
4055 if src.len() > 255 {
4056 return Err(::fidl_next::DecodeError::VectorTooLong {
4057 size: src.len() as u64,
4058 limit: 255,
4059 });
4060 }
4061
4062 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
4063
4064 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
4065
4066 let dst = unsafe { dst.deref_unchecked() };
4067
4068 if dst.len() > 255 {
4069 return Err(::fidl_next::DecodeError::VectorTooLong {
4070 size: dst.len() as u64,
4071 limit: 255,
4072 });
4073 }
4074
4075 Ok(())
4076 }
4077}
4078
4079pub type DirectoryRenameResponse = ();
4080
4081pub type WireDirectoryRenameResponse = ();
4083
4084::fidl_next::bitflags! {
4085 #[derive(
4086 Clone,
4087 Copy,
4088 Debug,
4089 PartialEq,
4090 Eq,
4091 Hash,
4092 )]
4093 pub struct WatchMask: u32 {
4094 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.\n"]const DELETED = 1;
4095 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.\n"]const ADDED = 2;
4096 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.\n"]const REMOVED = 4;
4097 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.\n"]const EXISTING = 8;
4098 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.\n"]const IDLE = 16;
4099
4100 }
4101}
4102
4103impl ::fidl_next::Encodable for WatchMask {
4104 type Encoded = WireWatchMask;
4105}
4106
4107unsafe impl<___E> ::fidl_next::Encode<___E> for WatchMask
4108where
4109 ___E: ?Sized,
4110{
4111 #[inline]
4112 fn encode(
4113 self,
4114 encoder: &mut ___E,
4115 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4116 ) -> Result<(), ::fidl_next::EncodeError> {
4117 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
4118 }
4119}
4120
4121unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchMask
4122where
4123 ___E: ?Sized,
4124{
4125 #[inline]
4126 fn encode_ref(
4127 &self,
4128 _: &mut ___E,
4129 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4130 ) -> Result<(), ::fidl_next::EncodeError> {
4131 ::fidl_next::munge!(let WireWatchMask { value } = out);
4132 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
4133 Ok(())
4134 }
4135}
4136
4137impl ::core::convert::From<WireWatchMask> for WatchMask {
4138 fn from(wire: WireWatchMask) -> Self {
4139 Self::from_bits_retain(u32::from(wire.value))
4140 }
4141}
4142
4143impl ::fidl_next::FromWire<WireWatchMask> for WatchMask {
4144 #[inline]
4145 fn from_wire(wire: WireWatchMask) -> Self {
4146 Self::from(wire)
4147 }
4148}
4149
4150impl ::fidl_next::FromWireRef<WireWatchMask> for WatchMask {
4151 #[inline]
4152 fn from_wire_ref(wire: &WireWatchMask) -> Self {
4153 Self::from(*wire)
4154 }
4155}
4156
4157#[derive(Clone, Copy, Debug)]
4159#[repr(transparent)]
4160pub struct WireWatchMask {
4161 value: ::fidl_next::WireU32,
4162}
4163
4164unsafe impl ::fidl_next::Wire for WireWatchMask {
4165 type Decoded<'de> = Self;
4166
4167 #[inline]
4168 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4169 }
4171}
4172
4173unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchMask
4174where
4175 ___D: ?Sized,
4176{
4177 fn decode(
4178 slot: ::fidl_next::Slot<'_, Self>,
4179 _: &mut ___D,
4180 ) -> Result<(), ::fidl_next::DecodeError> {
4181 ::fidl_next::munge!(let Self { value } = slot);
4182 let set = u32::from(*value);
4183 if set & !WatchMask::all().bits() != 0 {
4184 return Err(::fidl_next::DecodeError::InvalidBits {
4185 expected: WatchMask::all().bits() as usize,
4186 actual: set as usize,
4187 });
4188 }
4189
4190 Ok(())
4191 }
4192}
4193
4194impl ::core::convert::From<WatchMask> for WireWatchMask {
4195 fn from(natural: WatchMask) -> Self {
4196 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
4197 }
4198}
4199
4200#[derive(Debug)]
4201#[repr(C)]
4202pub struct DirectoryWatchRequest {
4203 pub mask: crate::WatchMask,
4204
4205 pub options: u32,
4206
4207 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel>,
4208}
4209
4210impl ::fidl_next::Encodable for DirectoryWatchRequest {
4211 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchRequest> = unsafe {
4212 ::fidl_next::CopyOptimization::enable_if(
4213 true && <crate::WatchMask as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4214 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4215 && <::fidl_next::ServerEnd<
4216 crate::DirectoryWatcher,
4217 ::fidl_next::fuchsia::zx::Channel,
4218 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4219 .is_enabled(),
4220 )
4221 };
4222
4223 type Encoded = WireDirectoryWatchRequest;
4224}
4225
4226unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchRequest
4227where
4228 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4229 ___E: ::fidl_next::fuchsia::HandleEncoder,
4230{
4231 #[inline]
4232 fn encode(
4233 self,
4234 encoder: &mut ___E,
4235 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4236 ) -> Result<(), ::fidl_next::EncodeError> {
4237 ::fidl_next::munge! {
4238 let Self::Encoded {
4239 mask,
4240 options,
4241 watcher,
4242
4243 } = out;
4244 }
4245
4246 ::fidl_next::Encode::encode(self.mask, encoder, mask)?;
4247
4248 ::fidl_next::Encode::encode(self.options, encoder, options)?;
4249
4250 ::fidl_next::Encode::encode(self.watcher, encoder, watcher)?;
4251
4252 Ok(())
4253 }
4254}
4255
4256impl ::fidl_next::EncodableOption for DirectoryWatchRequest {
4257 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchRequest>;
4258}
4259
4260unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchRequest
4261where
4262 ___E: ::fidl_next::Encoder + ?Sized,
4263 DirectoryWatchRequest: ::fidl_next::Encode<___E>,
4264{
4265 #[inline]
4266 fn encode_option(
4267 this: Option<Self>,
4268 encoder: &mut ___E,
4269 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4270 ) -> Result<(), ::fidl_next::EncodeError> {
4271 if let Some(inner) = this {
4272 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4273 ::fidl_next::WireBox::encode_present(out);
4274 } else {
4275 ::fidl_next::WireBox::encode_absent(out);
4276 }
4277
4278 Ok(())
4279 }
4280}
4281
4282impl ::fidl_next::FromWire<WireDirectoryWatchRequest> for DirectoryWatchRequest {
4283 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchRequest, Self> = unsafe {
4284 ::fidl_next::CopyOptimization::enable_if(
4285 true
4286
4287 && <
4288 crate::WatchMask as ::fidl_next::FromWire<crate::WireWatchMask>
4289 >::COPY_OPTIMIZATION.is_enabled()
4290
4291 && <
4292 u32 as ::fidl_next::FromWire<::fidl_next::WireU32>
4293 >::COPY_OPTIMIZATION.is_enabled()
4294
4295 && <
4296 ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>>
4297 >::COPY_OPTIMIZATION.is_enabled()
4298
4299 )
4300 };
4301
4302 #[inline]
4303 fn from_wire(wire: WireDirectoryWatchRequest) -> Self {
4304 Self {
4305 mask: ::fidl_next::FromWire::from_wire(wire.mask),
4306
4307 options: ::fidl_next::FromWire::from_wire(wire.options),
4308
4309 watcher: ::fidl_next::FromWire::from_wire(wire.watcher),
4310 }
4311 }
4312}
4313
4314#[derive(Debug)]
4316#[repr(C)]
4317pub struct WireDirectoryWatchRequest {
4318 pub mask: crate::WireWatchMask,
4319
4320 pub options: ::fidl_next::WireU32,
4321
4322 pub watcher: ::fidl_next::ServerEnd<crate::DirectoryWatcher, ::fidl_next::fuchsia::WireChannel>,
4323}
4324
4325unsafe impl ::fidl_next::Wire for WireDirectoryWatchRequest {
4326 type Decoded<'de> = WireDirectoryWatchRequest;
4327
4328 #[inline]
4329 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4330}
4331
4332unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchRequest
4333where
4334 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4335 ___D: ::fidl_next::fuchsia::HandleDecoder,
4336{
4337 fn decode(
4338 slot: ::fidl_next::Slot<'_, Self>,
4339 decoder: &mut ___D,
4340 ) -> Result<(), ::fidl_next::DecodeError> {
4341 ::fidl_next::munge! {
4342 let Self {
4343 mut mask,
4344 mut options,
4345 mut watcher,
4346
4347 } = slot;
4348 }
4349
4350 ::fidl_next::Decode::decode(mask.as_mut(), decoder)?;
4351
4352 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
4353
4354 ::fidl_next::Decode::decode(watcher.as_mut(), decoder)?;
4355
4356 Ok(())
4357 }
4358}
4359
4360#[derive(Clone, Debug)]
4361#[repr(C)]
4362pub struct DirectoryWatchResponse {
4363 pub s: i32,
4364}
4365
4366impl ::fidl_next::Encodable for DirectoryWatchResponse {
4367 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryWatchResponse> = unsafe {
4368 ::fidl_next::CopyOptimization::enable_if(
4369 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4370 )
4371 };
4372
4373 type Encoded = WireDirectoryWatchResponse;
4374}
4375
4376unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchResponse
4377where
4378 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4379{
4380 #[inline]
4381 fn encode(
4382 self,
4383 encoder: &mut ___E,
4384 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4385 ) -> Result<(), ::fidl_next::EncodeError> {
4386 ::fidl_next::munge! {
4387 let Self::Encoded {
4388 s,
4389
4390 } = out;
4391 }
4392
4393 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4394
4395 Ok(())
4396 }
4397}
4398
4399unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryWatchResponse
4400where
4401 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4402{
4403 #[inline]
4404 fn encode_ref(
4405 &self,
4406 encoder: &mut ___E,
4407 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4408 ) -> Result<(), ::fidl_next::EncodeError> {
4409 ::fidl_next::munge! {
4410 let Self::Encoded {
4411 s,
4412
4413 } = out;
4414 }
4415
4416 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
4417
4418 Ok(())
4419 }
4420}
4421
4422impl ::fidl_next::EncodableOption for DirectoryWatchResponse {
4423 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryWatchResponse>;
4424}
4425
4426unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryWatchResponse
4427where
4428 ___E: ::fidl_next::Encoder + ?Sized,
4429 DirectoryWatchResponse: ::fidl_next::Encode<___E>,
4430{
4431 #[inline]
4432 fn encode_option(
4433 this: Option<Self>,
4434 encoder: &mut ___E,
4435 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4436 ) -> Result<(), ::fidl_next::EncodeError> {
4437 if let Some(inner) = this {
4438 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4439 ::fidl_next::WireBox::encode_present(out);
4440 } else {
4441 ::fidl_next::WireBox::encode_absent(out);
4442 }
4443
4444 Ok(())
4445 }
4446}
4447
4448unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryWatchResponse
4449where
4450 ___E: ::fidl_next::Encoder + ?Sized,
4451 DirectoryWatchResponse: ::fidl_next::EncodeRef<___E>,
4452{
4453 #[inline]
4454 fn encode_option_ref(
4455 this: Option<&Self>,
4456 encoder: &mut ___E,
4457 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4458 ) -> Result<(), ::fidl_next::EncodeError> {
4459 if let Some(inner) = this {
4460 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4461 ::fidl_next::WireBox::encode_present(out);
4462 } else {
4463 ::fidl_next::WireBox::encode_absent(out);
4464 }
4465
4466 Ok(())
4467 }
4468}
4469
4470impl ::fidl_next::FromWire<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4471 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryWatchResponse, Self> = unsafe {
4472 ::fidl_next::CopyOptimization::enable_if(
4473 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
4474 .is_enabled(),
4475 )
4476 };
4477
4478 #[inline]
4479 fn from_wire(wire: WireDirectoryWatchResponse) -> Self {
4480 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
4481 }
4482}
4483
4484impl ::fidl_next::FromWireRef<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4485 #[inline]
4486 fn from_wire_ref(wire: &WireDirectoryWatchResponse) -> Self {
4487 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
4488 }
4489}
4490
4491#[derive(Clone, Debug)]
4493#[repr(C)]
4494pub struct WireDirectoryWatchResponse {
4495 pub s: ::fidl_next::WireI32,
4496}
4497
4498unsafe impl ::fidl_next::Wire for WireDirectoryWatchResponse {
4499 type Decoded<'de> = WireDirectoryWatchResponse;
4500
4501 #[inline]
4502 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4503}
4504
4505unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchResponse
4506where
4507 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4508{
4509 fn decode(
4510 slot: ::fidl_next::Slot<'_, Self>,
4511 decoder: &mut ___D,
4512 ) -> Result<(), ::fidl_next::DecodeError> {
4513 ::fidl_next::munge! {
4514 let Self {
4515 mut s,
4516
4517 } = slot;
4518 }
4519
4520 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4521
4522 Ok(())
4523 }
4524}
4525
4526#[derive(Debug)]
4527pub struct NodeOnOpenRequest {
4528 pub s: i32,
4529
4530 pub info: Option<Box<crate::NodeInfoDeprecated>>,
4531}
4532
4533impl ::fidl_next::Encodable for NodeOnOpenRequest {
4534 type Encoded = WireNodeOnOpenRequest<'static>;
4535}
4536
4537unsafe impl<___E> ::fidl_next::Encode<___E> for NodeOnOpenRequest
4538where
4539 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4540 ___E: ::fidl_next::Encoder,
4541 ___E: ::fidl_next::fuchsia::HandleEncoder,
4542{
4543 #[inline]
4544 fn encode(
4545 self,
4546 encoder: &mut ___E,
4547 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4548 ) -> Result<(), ::fidl_next::EncodeError> {
4549 ::fidl_next::munge! {
4550 let Self::Encoded {
4551 s,
4552 info,
4553
4554 } = out;
4555 }
4556
4557 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4558
4559 ::fidl_next::Encode::encode(self.info, encoder, info)?;
4560
4561 Ok(())
4562 }
4563}
4564
4565impl ::fidl_next::EncodableOption for NodeOnOpenRequest {
4566 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeOnOpenRequest<'static>>;
4567}
4568
4569unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeOnOpenRequest
4570where
4571 ___E: ::fidl_next::Encoder + ?Sized,
4572 NodeOnOpenRequest: ::fidl_next::Encode<___E>,
4573{
4574 #[inline]
4575 fn encode_option(
4576 this: Option<Self>,
4577 encoder: &mut ___E,
4578 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4579 ) -> Result<(), ::fidl_next::EncodeError> {
4580 if let Some(inner) = this {
4581 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4582 ::fidl_next::WireBox::encode_present(out);
4583 } else {
4584 ::fidl_next::WireBox::encode_absent(out);
4585 }
4586
4587 Ok(())
4588 }
4589}
4590
4591impl<'de> ::fidl_next::FromWire<WireNodeOnOpenRequest<'de>> for NodeOnOpenRequest {
4592 #[inline]
4593 fn from_wire(wire: WireNodeOnOpenRequest<'de>) -> Self {
4594 Self {
4595 s: ::fidl_next::FromWire::from_wire(wire.s),
4596
4597 info: ::fidl_next::FromWire::from_wire(wire.info),
4598 }
4599 }
4600}
4601
4602#[derive(Debug)]
4604#[repr(C)]
4605pub struct WireNodeOnOpenRequest<'de> {
4606 pub s: ::fidl_next::WireI32,
4607
4608 pub info: crate::WireOptionalNodeInfoDeprecated<'de>,
4609}
4610
4611unsafe impl ::fidl_next::Wire for WireNodeOnOpenRequest<'static> {
4612 type Decoded<'de> = WireNodeOnOpenRequest<'de>;
4613
4614 #[inline]
4615 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4616 unsafe {
4617 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
4618 }
4619 }
4620}
4621
4622unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeOnOpenRequest<'static>
4623where
4624 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4625 ___D: ::fidl_next::Decoder,
4626 ___D: ::fidl_next::fuchsia::HandleDecoder,
4627{
4628 fn decode(
4629 slot: ::fidl_next::Slot<'_, Self>,
4630 decoder: &mut ___D,
4631 ) -> Result<(), ::fidl_next::DecodeError> {
4632 ::fidl_next::munge! {
4633 let Self {
4634 mut s,
4635 mut info,
4636
4637 } = slot;
4638 }
4639
4640 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4641
4642 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
4643
4644 Ok(())
4645 }
4646}
4647
4648pub type SymlinkTarget = Vec<u8>;
4649
4650pub type WireSymlinkTarget<'de> = ::fidl_next::WireVector<'de, u8>;
4652
4653#[derive(Debug)]
4654#[repr(C)]
4655pub struct NodeListExtendedAttributesRequest {
4656 pub iterator:
4657 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::zx::Channel>,
4658}
4659
4660impl ::fidl_next::Encodable for NodeListExtendedAttributesRequest {
4661 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4662 Self,
4663 WireNodeListExtendedAttributesRequest,
4664 > = unsafe {
4665 ::fidl_next::CopyOptimization::enable_if(
4666 true && <::fidl_next::ServerEnd<
4667 crate::ExtendedAttributeIterator,
4668 ::fidl_next::fuchsia::zx::Channel,
4669 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4670 .is_enabled(),
4671 )
4672 };
4673
4674 type Encoded = WireNodeListExtendedAttributesRequest;
4675}
4676
4677unsafe impl<___E> ::fidl_next::Encode<___E> for NodeListExtendedAttributesRequest
4678where
4679 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4680 ___E: ::fidl_next::fuchsia::HandleEncoder,
4681{
4682 #[inline]
4683 fn encode(
4684 self,
4685 encoder: &mut ___E,
4686 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4687 ) -> Result<(), ::fidl_next::EncodeError> {
4688 ::fidl_next::munge! {
4689 let Self::Encoded {
4690 iterator,
4691
4692 } = out;
4693 }
4694
4695 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
4696
4697 Ok(())
4698 }
4699}
4700
4701impl ::fidl_next::EncodableOption for NodeListExtendedAttributesRequest {
4702 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeListExtendedAttributesRequest>;
4703}
4704
4705unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeListExtendedAttributesRequest
4706where
4707 ___E: ::fidl_next::Encoder + ?Sized,
4708 NodeListExtendedAttributesRequest: ::fidl_next::Encode<___E>,
4709{
4710 #[inline]
4711 fn encode_option(
4712 this: Option<Self>,
4713 encoder: &mut ___E,
4714 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4715 ) -> Result<(), ::fidl_next::EncodeError> {
4716 if let Some(inner) = this {
4717 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4718 ::fidl_next::WireBox::encode_present(out);
4719 } else {
4720 ::fidl_next::WireBox::encode_absent(out);
4721 }
4722
4723 Ok(())
4724 }
4725}
4726
4727impl ::fidl_next::FromWire<WireNodeListExtendedAttributesRequest>
4728 for NodeListExtendedAttributesRequest
4729{
4730 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4731 WireNodeListExtendedAttributesRequest,
4732 Self,
4733 > = unsafe {
4734 ::fidl_next::CopyOptimization::enable_if(
4735 true && <::fidl_next::ServerEnd<
4736 crate::ExtendedAttributeIterator,
4737 ::fidl_next::fuchsia::zx::Channel,
4738 > as ::fidl_next::FromWire<
4739 ::fidl_next::ServerEnd<
4740 crate::ExtendedAttributeIterator,
4741 ::fidl_next::fuchsia::WireChannel,
4742 >,
4743 >>::COPY_OPTIMIZATION
4744 .is_enabled(),
4745 )
4746 };
4747
4748 #[inline]
4749 fn from_wire(wire: WireNodeListExtendedAttributesRequest) -> Self {
4750 Self { iterator: ::fidl_next::FromWire::from_wire(wire.iterator) }
4751 }
4752}
4753
4754#[derive(Debug)]
4756#[repr(C)]
4757pub struct WireNodeListExtendedAttributesRequest {
4758 pub iterator:
4759 ::fidl_next::ServerEnd<crate::ExtendedAttributeIterator, ::fidl_next::fuchsia::WireChannel>,
4760}
4761
4762unsafe impl ::fidl_next::Wire for WireNodeListExtendedAttributesRequest {
4763 type Decoded<'de> = WireNodeListExtendedAttributesRequest;
4764
4765 #[inline]
4766 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4767}
4768
4769unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeListExtendedAttributesRequest
4770where
4771 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4772 ___D: ::fidl_next::fuchsia::HandleDecoder,
4773{
4774 fn decode(
4775 slot: ::fidl_next::Slot<'_, Self>,
4776 decoder: &mut ___D,
4777 ) -> Result<(), ::fidl_next::DecodeError> {
4778 ::fidl_next::munge! {
4779 let Self {
4780 mut iterator,
4781
4782 } = slot;
4783 }
4784
4785 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
4786
4787 Ok(())
4788 }
4789}
4790
4791#[doc = " The maximum size for an extended attribute name.\n"]
4792pub const MAX_ATTRIBUTE_NAME: u64 = 255;
4793
4794#[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"]
4795pub type ExtendedAttributeName = Vec<u8>;
4796
4797pub type WireExtendedAttributeName<'de> = ::fidl_next::WireVector<'de, u8>;
4799
4800#[derive(Clone, Debug)]
4801pub struct NodeGetExtendedAttributeRequest {
4802 pub name: Vec<u8>,
4803}
4804
4805impl ::fidl_next::Encodable for NodeGetExtendedAttributeRequest {
4806 type Encoded = WireNodeGetExtendedAttributeRequest<'static>;
4807}
4808
4809unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetExtendedAttributeRequest
4810where
4811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4812 ___E: ::fidl_next::Encoder,
4813{
4814 #[inline]
4815 fn encode(
4816 self,
4817 encoder: &mut ___E,
4818 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4819 ) -> Result<(), ::fidl_next::EncodeError> {
4820 ::fidl_next::munge! {
4821 let Self::Encoded {
4822 name,
4823
4824 } = out;
4825 }
4826
4827 ::fidl_next::Encode::encode(self.name, encoder, name)?;
4828
4829 Ok(())
4830 }
4831}
4832
4833unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetExtendedAttributeRequest
4834where
4835 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4836 ___E: ::fidl_next::Encoder,
4837{
4838 #[inline]
4839 fn encode_ref(
4840 &self,
4841 encoder: &mut ___E,
4842 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4843 ) -> Result<(), ::fidl_next::EncodeError> {
4844 ::fidl_next::munge! {
4845 let Self::Encoded {
4846 name,
4847
4848 } = out;
4849 }
4850
4851 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
4852
4853 Ok(())
4854 }
4855}
4856
4857impl ::fidl_next::EncodableOption for NodeGetExtendedAttributeRequest {
4858 type EncodedOption =
4859 ::fidl_next::WireBox<'static, WireNodeGetExtendedAttributeRequest<'static>>;
4860}
4861
4862unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetExtendedAttributeRequest
4863where
4864 ___E: ::fidl_next::Encoder + ?Sized,
4865 NodeGetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
4866{
4867 #[inline]
4868 fn encode_option(
4869 this: Option<Self>,
4870 encoder: &mut ___E,
4871 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4872 ) -> Result<(), ::fidl_next::EncodeError> {
4873 if let Some(inner) = this {
4874 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4875 ::fidl_next::WireBox::encode_present(out);
4876 } else {
4877 ::fidl_next::WireBox::encode_absent(out);
4878 }
4879
4880 Ok(())
4881 }
4882}
4883
4884unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetExtendedAttributeRequest
4885where
4886 ___E: ::fidl_next::Encoder + ?Sized,
4887 NodeGetExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
4888{
4889 #[inline]
4890 fn encode_option_ref(
4891 this: Option<&Self>,
4892 encoder: &mut ___E,
4893 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4894 ) -> Result<(), ::fidl_next::EncodeError> {
4895 if let Some(inner) = this {
4896 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4897 ::fidl_next::WireBox::encode_present(out);
4898 } else {
4899 ::fidl_next::WireBox::encode_absent(out);
4900 }
4901
4902 Ok(())
4903 }
4904}
4905
4906impl<'de> ::fidl_next::FromWire<WireNodeGetExtendedAttributeRequest<'de>>
4907 for NodeGetExtendedAttributeRequest
4908{
4909 #[inline]
4910 fn from_wire(wire: WireNodeGetExtendedAttributeRequest<'de>) -> Self {
4911 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
4912 }
4913}
4914
4915impl<'de> ::fidl_next::FromWireRef<WireNodeGetExtendedAttributeRequest<'de>>
4916 for NodeGetExtendedAttributeRequest
4917{
4918 #[inline]
4919 fn from_wire_ref(wire: &WireNodeGetExtendedAttributeRequest<'de>) -> Self {
4920 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
4921 }
4922}
4923
4924#[derive(Debug)]
4926#[repr(C)]
4927pub struct WireNodeGetExtendedAttributeRequest<'de> {
4928 pub name: ::fidl_next::WireVector<'de, u8>,
4929}
4930
4931unsafe impl ::fidl_next::Wire for WireNodeGetExtendedAttributeRequest<'static> {
4932 type Decoded<'de> = WireNodeGetExtendedAttributeRequest<'de>;
4933
4934 #[inline]
4935 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4936}
4937
4938unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetExtendedAttributeRequest<'static>
4939where
4940 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4941 ___D: ::fidl_next::Decoder,
4942{
4943 fn decode(
4944 slot: ::fidl_next::Slot<'_, Self>,
4945 decoder: &mut ___D,
4946 ) -> Result<(), ::fidl_next::DecodeError> {
4947 ::fidl_next::munge! {
4948 let Self {
4949 mut name,
4950
4951 } = slot;
4952 }
4953
4954 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
4955
4956 let name = unsafe { name.deref_unchecked() };
4957
4958 if name.len() > 255 {
4959 return Err(::fidl_next::DecodeError::VectorTooLong {
4960 size: name.len() as u64,
4961 limit: 255,
4962 });
4963 }
4964
4965 Ok(())
4966 }
4967}
4968
4969#[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"]
4970pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768;
4971
4972#[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"]
4973#[derive(Debug)]
4974pub enum ExtendedAttributeValue {
4975 Bytes(Vec<u8>),
4976
4977 Buffer(::fidl_next::fuchsia::zx::Vmo),
4978
4979 UnknownOrdinal_(u64),
4980}
4981
4982impl ::fidl_next::Encodable for ExtendedAttributeValue {
4983 type Encoded = WireExtendedAttributeValue<'static>;
4984}
4985
4986unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeValue
4987where
4988 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4989 ___E: ::fidl_next::Encoder,
4990 ___E: ::fidl_next::fuchsia::HandleEncoder,
4991{
4992 #[inline]
4993 fn encode(
4994 self,
4995 encoder: &mut ___E,
4996 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4997 ) -> Result<(), ::fidl_next::EncodeError> {
4998 ::fidl_next::munge!(let WireExtendedAttributeValue { raw, _phantom: _ } = out);
4999
5000 match self {
5001 Self::Bytes(value) => {
5002 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
5003 }
5004
5005 Self::Buffer(value) => ::fidl_next::RawWireUnion::encode_as::<
5006 ___E,
5007 ::fidl_next::fuchsia::zx::Vmo,
5008 >(value, 2, encoder, raw)?,
5009
5010 Self::UnknownOrdinal_(ordinal) => {
5011 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
5012 }
5013 }
5014
5015 Ok(())
5016 }
5017}
5018
5019impl ::fidl_next::EncodableOption for ExtendedAttributeValue {
5020 type EncodedOption = WireOptionalExtendedAttributeValue<'static>;
5021}
5022
5023unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeValue
5024where
5025 ___E: ?Sized,
5026 ExtendedAttributeValue: ::fidl_next::Encode<___E>,
5027{
5028 #[inline]
5029 fn encode_option(
5030 this: Option<Self>,
5031 encoder: &mut ___E,
5032 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5033 ) -> Result<(), ::fidl_next::EncodeError> {
5034 ::fidl_next::munge!(let WireOptionalExtendedAttributeValue { raw, _phantom: _ } = &mut *out);
5035
5036 if let Some(inner) = this {
5037 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5038 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
5039 } else {
5040 ::fidl_next::RawWireUnion::encode_absent(raw);
5041 }
5042
5043 Ok(())
5044 }
5045}
5046
5047impl<'de> ::fidl_next::FromWire<WireExtendedAttributeValue<'de>> for ExtendedAttributeValue {
5048 #[inline]
5049 fn from_wire(wire: WireExtendedAttributeValue<'de>) -> Self {
5050 let wire = ::core::mem::ManuallyDrop::new(wire);
5051 match wire.raw.ordinal() {
5052 1 => Self::Bytes(::fidl_next::FromWire::from_wire(unsafe {
5053 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
5054 })),
5055
5056 2 => Self::Buffer(::fidl_next::FromWire::from_wire(unsafe {
5057 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireVmo>()
5058 })),
5059
5060 _ => unsafe { ::core::hint::unreachable_unchecked() },
5061 }
5062 }
5063}
5064
5065impl<'de> ::fidl_next::FromWireOption<WireOptionalExtendedAttributeValue<'de>>
5066 for Box<ExtendedAttributeValue>
5067{
5068 #[inline]
5069 fn from_wire_option(wire: WireOptionalExtendedAttributeValue<'de>) -> Option<Self> {
5070 if let Some(inner) = wire.into_option() {
5071 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
5072 } else {
5073 None
5074 }
5075 }
5076}
5077
5078#[repr(transparent)]
5080pub struct WireExtendedAttributeValue<'de> {
5081 raw: ::fidl_next::RawWireUnion,
5082 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5083}
5084
5085impl<'de> Drop for WireExtendedAttributeValue<'de> {
5086 fn drop(&mut self) {
5087 match self.raw.ordinal() {
5088 1 => {
5089 let _ =
5090 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
5091 }
5092
5093 2 => {
5094 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireVmo>() };
5095 }
5096
5097 _ => (),
5098 }
5099 }
5100}
5101
5102unsafe impl ::fidl_next::Wire for WireExtendedAttributeValue<'static> {
5103 type Decoded<'de> = WireExtendedAttributeValue<'de>;
5104
5105 #[inline]
5106 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5107 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5108 ::fidl_next::RawWireUnion::zero_padding(raw);
5109 }
5110}
5111
5112pub mod extended_attribute_value {
5113 pub enum Ref<'de> {
5114 Bytes(&'de ::fidl_next::WireVector<'de, u8>),
5115
5116 Buffer(&'de ::fidl_next::fuchsia::WireVmo),
5117
5118 UnknownOrdinal_(u64),
5119 }
5120}
5121
5122impl<'de> WireExtendedAttributeValue<'de> {
5123 pub fn as_ref(&self) -> crate::extended_attribute_value::Ref<'_> {
5124 match self.raw.ordinal() {
5125 1 => crate::extended_attribute_value::Ref::Bytes(unsafe {
5126 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
5127 }),
5128
5129 2 => crate::extended_attribute_value::Ref::Buffer(unsafe {
5130 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireVmo>()
5131 }),
5132
5133 unknown => crate::extended_attribute_value::Ref::UnknownOrdinal_(unknown),
5134 }
5135 }
5136}
5137
5138unsafe impl<___D> ::fidl_next::Decode<___D> for WireExtendedAttributeValue<'static>
5139where
5140 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5141 ___D: ::fidl_next::Decoder,
5142 ___D: ::fidl_next::fuchsia::HandleDecoder,
5143{
5144 fn decode(
5145 mut slot: ::fidl_next::Slot<'_, Self>,
5146 decoder: &mut ___D,
5147 ) -> Result<(), ::fidl_next::DecodeError> {
5148 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5149 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5150 1 => {
5151 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5152 raw, decoder,
5153 )?
5154 }
5155
5156 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
5157 raw, decoder,
5158 )?,
5159
5160 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5161 }
5162
5163 Ok(())
5164 }
5165}
5166
5167impl<'de> ::core::fmt::Debug for WireExtendedAttributeValue<'de> {
5168 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5169 match self.raw.ordinal() {
5170 1 => unsafe {
5171 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
5172 },
5173 2 => unsafe {
5174 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireVmo>().fmt(f)
5175 },
5176 _ => unsafe { ::core::hint::unreachable_unchecked() },
5177 }
5178 }
5179}
5180
5181#[repr(transparent)]
5182pub struct WireOptionalExtendedAttributeValue<'de> {
5183 raw: ::fidl_next::RawWireUnion,
5184 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5185}
5186
5187unsafe impl ::fidl_next::Wire for WireOptionalExtendedAttributeValue<'static> {
5188 type Decoded<'de> = WireOptionalExtendedAttributeValue<'de>;
5189
5190 #[inline]
5191 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5192 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5193 ::fidl_next::RawWireUnion::zero_padding(raw);
5194 }
5195}
5196
5197impl<'de> WireOptionalExtendedAttributeValue<'de> {
5198 pub fn is_some(&self) -> bool {
5199 self.raw.is_some()
5200 }
5201
5202 pub fn is_none(&self) -> bool {
5203 self.raw.is_none()
5204 }
5205
5206 pub fn as_ref(&self) -> Option<&WireExtendedAttributeValue<'de>> {
5207 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
5208 }
5209
5210 pub fn into_option(self) -> Option<WireExtendedAttributeValue<'de>> {
5211 if self.is_some() {
5212 Some(WireExtendedAttributeValue {
5213 raw: self.raw,
5214 _phantom: ::core::marker::PhantomData,
5215 })
5216 } else {
5217 None
5218 }
5219 }
5220}
5221
5222unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExtendedAttributeValue<'static>
5223where
5224 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5225 ___D: ::fidl_next::Decoder,
5226 ___D: ::fidl_next::fuchsia::HandleDecoder,
5227{
5228 fn decode(
5229 mut slot: ::fidl_next::Slot<'_, Self>,
5230 decoder: &mut ___D,
5231 ) -> Result<(), ::fidl_next::DecodeError> {
5232 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5233 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5234 1 => {
5235 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
5236 raw, decoder,
5237 )?
5238 }
5239
5240 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
5241 raw, decoder,
5242 )?,
5243
5244 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5245 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5246 }
5247
5248 Ok(())
5249 }
5250}
5251
5252impl<'de> ::core::fmt::Debug for WireOptionalExtendedAttributeValue<'de> {
5253 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5254 self.as_ref().fmt(f)
5255 }
5256}
5257
5258#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5259#[repr(u32)]
5260pub enum SetExtendedAttributeMode {
5261 Set = 1,
5262 Create = 2,
5263 Replace = 3,
5264}
5265
5266impl ::fidl_next::Encodable for SetExtendedAttributeMode {
5267 type Encoded = WireSetExtendedAttributeMode;
5268}
5269impl ::std::convert::TryFrom<u32> for SetExtendedAttributeMode {
5270 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5271 fn try_from(value: u32) -> Result<Self, Self::Error> {
5272 match value {
5273 1 => Ok(Self::Set),
5274 2 => Ok(Self::Create),
5275 3 => Ok(Self::Replace),
5276
5277 _ => Err(Self::Error::new(value.into())),
5278 }
5279 }
5280}
5281
5282unsafe impl<___E> ::fidl_next::Encode<___E> for SetExtendedAttributeMode
5283where
5284 ___E: ?Sized,
5285{
5286 #[inline]
5287 fn encode(
5288 self,
5289 encoder: &mut ___E,
5290 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5291 ) -> Result<(), ::fidl_next::EncodeError> {
5292 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5293 }
5294}
5295
5296unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SetExtendedAttributeMode
5297where
5298 ___E: ?Sized,
5299{
5300 #[inline]
5301 fn encode_ref(
5302 &self,
5303 encoder: &mut ___E,
5304 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5305 ) -> Result<(), ::fidl_next::EncodeError> {
5306 ::fidl_next::munge!(let WireSetExtendedAttributeMode { value } = out);
5307 let _ = value.write(::fidl_next::WireU32::from(match *self {
5308 Self::Set => 1,
5309
5310 Self::Create => 2,
5311
5312 Self::Replace => 3,
5313 }));
5314
5315 Ok(())
5316 }
5317}
5318
5319impl ::core::convert::From<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5320 fn from(wire: WireSetExtendedAttributeMode) -> Self {
5321 match u32::from(wire.value) {
5322 1 => Self::Set,
5323
5324 2 => Self::Create,
5325
5326 3 => Self::Replace,
5327
5328 _ => unsafe { ::core::hint::unreachable_unchecked() },
5329 }
5330 }
5331}
5332
5333impl ::fidl_next::FromWire<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5334 #[inline]
5335 fn from_wire(wire: WireSetExtendedAttributeMode) -> Self {
5336 Self::from(wire)
5337 }
5338}
5339
5340impl ::fidl_next::FromWireRef<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5341 #[inline]
5342 fn from_wire_ref(wire: &WireSetExtendedAttributeMode) -> Self {
5343 Self::from(*wire)
5344 }
5345}
5346
5347#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5349#[repr(transparent)]
5350pub struct WireSetExtendedAttributeMode {
5351 value: ::fidl_next::WireU32,
5352}
5353
5354unsafe impl ::fidl_next::Wire for WireSetExtendedAttributeMode {
5355 type Decoded<'de> = Self;
5356
5357 #[inline]
5358 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5359 }
5361}
5362
5363impl WireSetExtendedAttributeMode {
5364 pub const SET: WireSetExtendedAttributeMode =
5365 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(1) };
5366
5367 pub const CREATE: WireSetExtendedAttributeMode =
5368 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(2) };
5369
5370 pub const REPLACE: WireSetExtendedAttributeMode =
5371 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(3) };
5372}
5373
5374unsafe impl<___D> ::fidl_next::Decode<___D> for WireSetExtendedAttributeMode
5375where
5376 ___D: ?Sized,
5377{
5378 fn decode(
5379 slot: ::fidl_next::Slot<'_, Self>,
5380 _: &mut ___D,
5381 ) -> Result<(), ::fidl_next::DecodeError> {
5382 ::fidl_next::munge!(let Self { value } = slot);
5383
5384 match u32::from(*value) {
5385 1 | 2 | 3 => (),
5386 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
5387 }
5388
5389 Ok(())
5390 }
5391}
5392
5393impl ::core::convert::From<SetExtendedAttributeMode> for WireSetExtendedAttributeMode {
5394 fn from(natural: SetExtendedAttributeMode) -> Self {
5395 match natural {
5396 SetExtendedAttributeMode::Set => WireSetExtendedAttributeMode::SET,
5397
5398 SetExtendedAttributeMode::Create => WireSetExtendedAttributeMode::CREATE,
5399
5400 SetExtendedAttributeMode::Replace => WireSetExtendedAttributeMode::REPLACE,
5401 }
5402 }
5403}
5404
5405#[derive(Debug)]
5406pub struct NodeSetExtendedAttributeRequest {
5407 pub name: Vec<u8>,
5408
5409 pub value: crate::ExtendedAttributeValue,
5410
5411 pub mode: crate::SetExtendedAttributeMode,
5412}
5413
5414impl ::fidl_next::Encodable for NodeSetExtendedAttributeRequest {
5415 type Encoded = WireNodeSetExtendedAttributeRequest<'static>;
5416}
5417
5418unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetExtendedAttributeRequest
5419where
5420 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5421 ___E: ::fidl_next::Encoder,
5422 ___E: ::fidl_next::fuchsia::HandleEncoder,
5423{
5424 #[inline]
5425 fn encode(
5426 self,
5427 encoder: &mut ___E,
5428 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5429 ) -> Result<(), ::fidl_next::EncodeError> {
5430 ::fidl_next::munge! {
5431 let Self::Encoded {
5432 name,
5433 value,
5434 mode,
5435
5436 } = out;
5437 }
5438
5439 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5440
5441 ::fidl_next::Encode::encode(self.value, encoder, value)?;
5442
5443 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
5444
5445 Ok(())
5446 }
5447}
5448
5449impl ::fidl_next::EncodableOption for NodeSetExtendedAttributeRequest {
5450 type EncodedOption =
5451 ::fidl_next::WireBox<'static, WireNodeSetExtendedAttributeRequest<'static>>;
5452}
5453
5454unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetExtendedAttributeRequest
5455where
5456 ___E: ::fidl_next::Encoder + ?Sized,
5457 NodeSetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5458{
5459 #[inline]
5460 fn encode_option(
5461 this: Option<Self>,
5462 encoder: &mut ___E,
5463 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5464 ) -> Result<(), ::fidl_next::EncodeError> {
5465 if let Some(inner) = this {
5466 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5467 ::fidl_next::WireBox::encode_present(out);
5468 } else {
5469 ::fidl_next::WireBox::encode_absent(out);
5470 }
5471
5472 Ok(())
5473 }
5474}
5475
5476impl<'de> ::fidl_next::FromWire<WireNodeSetExtendedAttributeRequest<'de>>
5477 for NodeSetExtendedAttributeRequest
5478{
5479 #[inline]
5480 fn from_wire(wire: WireNodeSetExtendedAttributeRequest<'de>) -> Self {
5481 Self {
5482 name: ::fidl_next::FromWire::from_wire(wire.name),
5483
5484 value: ::fidl_next::FromWire::from_wire(wire.value),
5485
5486 mode: ::fidl_next::FromWire::from_wire(wire.mode),
5487 }
5488 }
5489}
5490
5491#[derive(Debug)]
5493#[repr(C)]
5494pub struct WireNodeSetExtendedAttributeRequest<'de> {
5495 pub name: ::fidl_next::WireVector<'de, u8>,
5496
5497 pub value: crate::WireExtendedAttributeValue<'de>,
5498
5499 pub mode: crate::WireSetExtendedAttributeMode,
5500}
5501
5502unsafe impl ::fidl_next::Wire for WireNodeSetExtendedAttributeRequest<'static> {
5503 type Decoded<'de> = WireNodeSetExtendedAttributeRequest<'de>;
5504
5505 #[inline]
5506 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5507 unsafe {
5508 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
5509 }
5510 }
5511}
5512
5513unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetExtendedAttributeRequest<'static>
5514where
5515 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5516 ___D: ::fidl_next::Decoder,
5517 ___D: ::fidl_next::fuchsia::HandleDecoder,
5518{
5519 fn decode(
5520 slot: ::fidl_next::Slot<'_, Self>,
5521 decoder: &mut ___D,
5522 ) -> Result<(), ::fidl_next::DecodeError> {
5523 ::fidl_next::munge! {
5524 let Self {
5525 mut name,
5526 mut value,
5527 mut mode,
5528
5529 } = slot;
5530 }
5531
5532 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5533
5534 let name = unsafe { name.deref_unchecked() };
5535
5536 if name.len() > 255 {
5537 return Err(::fidl_next::DecodeError::VectorTooLong {
5538 size: name.len() as u64,
5539 limit: 255,
5540 });
5541 }
5542
5543 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
5544
5545 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
5546
5547 Ok(())
5548 }
5549}
5550
5551pub type NodeSetExtendedAttributeResponse = ();
5552
5553pub type WireNodeSetExtendedAttributeResponse = ();
5555
5556#[derive(Clone, Debug)]
5557pub struct NodeRemoveExtendedAttributeRequest {
5558 pub name: Vec<u8>,
5559}
5560
5561impl ::fidl_next::Encodable for NodeRemoveExtendedAttributeRequest {
5562 type Encoded = WireNodeRemoveExtendedAttributeRequest<'static>;
5563}
5564
5565unsafe impl<___E> ::fidl_next::Encode<___E> for NodeRemoveExtendedAttributeRequest
5566where
5567 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5568 ___E: ::fidl_next::Encoder,
5569{
5570 #[inline]
5571 fn encode(
5572 self,
5573 encoder: &mut ___E,
5574 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5575 ) -> Result<(), ::fidl_next::EncodeError> {
5576 ::fidl_next::munge! {
5577 let Self::Encoded {
5578 name,
5579
5580 } = out;
5581 }
5582
5583 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5584
5585 Ok(())
5586 }
5587}
5588
5589unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeRemoveExtendedAttributeRequest
5590where
5591 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5592 ___E: ::fidl_next::Encoder,
5593{
5594 #[inline]
5595 fn encode_ref(
5596 &self,
5597 encoder: &mut ___E,
5598 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5599 ) -> Result<(), ::fidl_next::EncodeError> {
5600 ::fidl_next::munge! {
5601 let Self::Encoded {
5602 name,
5603
5604 } = out;
5605 }
5606
5607 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
5608
5609 Ok(())
5610 }
5611}
5612
5613impl ::fidl_next::EncodableOption for NodeRemoveExtendedAttributeRequest {
5614 type EncodedOption =
5615 ::fidl_next::WireBox<'static, WireNodeRemoveExtendedAttributeRequest<'static>>;
5616}
5617
5618unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeRemoveExtendedAttributeRequest
5619where
5620 ___E: ::fidl_next::Encoder + ?Sized,
5621 NodeRemoveExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5622{
5623 #[inline]
5624 fn encode_option(
5625 this: Option<Self>,
5626 encoder: &mut ___E,
5627 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5628 ) -> Result<(), ::fidl_next::EncodeError> {
5629 if let Some(inner) = this {
5630 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5631 ::fidl_next::WireBox::encode_present(out);
5632 } else {
5633 ::fidl_next::WireBox::encode_absent(out);
5634 }
5635
5636 Ok(())
5637 }
5638}
5639
5640unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeRemoveExtendedAttributeRequest
5641where
5642 ___E: ::fidl_next::Encoder + ?Sized,
5643 NodeRemoveExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
5644{
5645 #[inline]
5646 fn encode_option_ref(
5647 this: Option<&Self>,
5648 encoder: &mut ___E,
5649 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5650 ) -> Result<(), ::fidl_next::EncodeError> {
5651 if let Some(inner) = this {
5652 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5653 ::fidl_next::WireBox::encode_present(out);
5654 } else {
5655 ::fidl_next::WireBox::encode_absent(out);
5656 }
5657
5658 Ok(())
5659 }
5660}
5661
5662impl<'de> ::fidl_next::FromWire<WireNodeRemoveExtendedAttributeRequest<'de>>
5663 for NodeRemoveExtendedAttributeRequest
5664{
5665 #[inline]
5666 fn from_wire(wire: WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
5667 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
5668 }
5669}
5670
5671impl<'de> ::fidl_next::FromWireRef<WireNodeRemoveExtendedAttributeRequest<'de>>
5672 for NodeRemoveExtendedAttributeRequest
5673{
5674 #[inline]
5675 fn from_wire_ref(wire: &WireNodeRemoveExtendedAttributeRequest<'de>) -> Self {
5676 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
5677 }
5678}
5679
5680#[derive(Debug)]
5682#[repr(C)]
5683pub struct WireNodeRemoveExtendedAttributeRequest<'de> {
5684 pub name: ::fidl_next::WireVector<'de, u8>,
5685}
5686
5687unsafe impl ::fidl_next::Wire for WireNodeRemoveExtendedAttributeRequest<'static> {
5688 type Decoded<'de> = WireNodeRemoveExtendedAttributeRequest<'de>;
5689
5690 #[inline]
5691 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5692}
5693
5694unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeRemoveExtendedAttributeRequest<'static>
5695where
5696 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5697 ___D: ::fidl_next::Decoder,
5698{
5699 fn decode(
5700 slot: ::fidl_next::Slot<'_, Self>,
5701 decoder: &mut ___D,
5702 ) -> Result<(), ::fidl_next::DecodeError> {
5703 ::fidl_next::munge! {
5704 let Self {
5705 mut name,
5706
5707 } = slot;
5708 }
5709
5710 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5711
5712 let name = unsafe { name.deref_unchecked() };
5713
5714 if name.len() > 255 {
5715 return Err(::fidl_next::DecodeError::VectorTooLong {
5716 size: name.len() as u64,
5717 limit: 255,
5718 });
5719 }
5720
5721 Ok(())
5722 }
5723}
5724
5725pub type NodeRemoveExtendedAttributeResponse = ();
5726
5727pub type WireNodeRemoveExtendedAttributeResponse = ();
5729
5730pub type DirectoryCreateSymlinkResponse = ();
5731
5732pub type WireDirectoryCreateSymlinkResponse = ();
5734
5735pub type NodeSetFlagsResponse = ();
5736
5737pub type WireNodeSetFlagsResponse = ();
5739
5740#[derive(Clone, Debug)]
5741pub struct NodeDeprecatedGetAttrResponse {
5742 pub s: i32,
5743
5744 pub attributes: crate::NodeAttributes,
5745}
5746
5747impl ::fidl_next::Encodable for NodeDeprecatedGetAttrResponse {
5748 type Encoded = WireNodeDeprecatedGetAttrResponse;
5749}
5750
5751unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetAttrResponse
5752where
5753 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5754{
5755 #[inline]
5756 fn encode(
5757 self,
5758 encoder: &mut ___E,
5759 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5760 ) -> Result<(), ::fidl_next::EncodeError> {
5761 ::fidl_next::munge! {
5762 let Self::Encoded {
5763 s,
5764 attributes,
5765
5766 } = out;
5767 }
5768
5769 ::fidl_next::Encode::encode(self.s, encoder, s)?;
5770
5771 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
5772
5773 Ok(())
5774 }
5775}
5776
5777unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetAttrResponse
5778where
5779 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5780{
5781 #[inline]
5782 fn encode_ref(
5783 &self,
5784 encoder: &mut ___E,
5785 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5786 ) -> Result<(), ::fidl_next::EncodeError> {
5787 ::fidl_next::munge! {
5788 let Self::Encoded {
5789 s,
5790 attributes,
5791
5792 } = out;
5793 }
5794
5795 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
5796
5797 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
5798
5799 Ok(())
5800 }
5801}
5802
5803impl ::fidl_next::EncodableOption for NodeDeprecatedGetAttrResponse {
5804 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetAttrResponse>;
5805}
5806
5807unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetAttrResponse
5808where
5809 ___E: ::fidl_next::Encoder + ?Sized,
5810 NodeDeprecatedGetAttrResponse: ::fidl_next::Encode<___E>,
5811{
5812 #[inline]
5813 fn encode_option(
5814 this: Option<Self>,
5815 encoder: &mut ___E,
5816 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5817 ) -> Result<(), ::fidl_next::EncodeError> {
5818 if let Some(inner) = this {
5819 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5820 ::fidl_next::WireBox::encode_present(out);
5821 } else {
5822 ::fidl_next::WireBox::encode_absent(out);
5823 }
5824
5825 Ok(())
5826 }
5827}
5828
5829unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetAttrResponse
5830where
5831 ___E: ::fidl_next::Encoder + ?Sized,
5832 NodeDeprecatedGetAttrResponse: ::fidl_next::EncodeRef<___E>,
5833{
5834 #[inline]
5835 fn encode_option_ref(
5836 this: Option<&Self>,
5837 encoder: &mut ___E,
5838 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5839 ) -> Result<(), ::fidl_next::EncodeError> {
5840 if let Some(inner) = this {
5841 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5842 ::fidl_next::WireBox::encode_present(out);
5843 } else {
5844 ::fidl_next::WireBox::encode_absent(out);
5845 }
5846
5847 Ok(())
5848 }
5849}
5850
5851impl ::fidl_next::FromWire<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
5852 #[inline]
5853 fn from_wire(wire: WireNodeDeprecatedGetAttrResponse) -> Self {
5854 Self {
5855 s: ::fidl_next::FromWire::from_wire(wire.s),
5856
5857 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
5858 }
5859 }
5860}
5861
5862impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetAttrResponse> for NodeDeprecatedGetAttrResponse {
5863 #[inline]
5864 fn from_wire_ref(wire: &WireNodeDeprecatedGetAttrResponse) -> Self {
5865 Self {
5866 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
5867
5868 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
5869 }
5870 }
5871}
5872
5873#[derive(Clone, Debug)]
5875#[repr(C)]
5876pub struct WireNodeDeprecatedGetAttrResponse {
5877 pub s: ::fidl_next::WireI32,
5878
5879 pub attributes: crate::WireNodeAttributes,
5880}
5881
5882unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetAttrResponse {
5883 type Decoded<'de> = WireNodeDeprecatedGetAttrResponse;
5884
5885 #[inline]
5886 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5887 unsafe {
5888 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
5889 }
5890 }
5891}
5892
5893unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetAttrResponse
5894where
5895 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5896{
5897 fn decode(
5898 slot: ::fidl_next::Slot<'_, Self>,
5899 decoder: &mut ___D,
5900 ) -> Result<(), ::fidl_next::DecodeError> {
5901 ::fidl_next::munge! {
5902 let Self {
5903 mut s,
5904 mut attributes,
5905
5906 } = slot;
5907 }
5908
5909 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
5910
5911 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
5912
5913 Ok(())
5914 }
5915}
5916
5917#[derive(Clone, Debug)]
5918pub struct NodeDeprecatedSetAttrRequest {
5919 pub flags: crate::NodeAttributeFlags,
5920
5921 pub attributes: crate::NodeAttributes,
5922}
5923
5924impl ::fidl_next::Encodable for NodeDeprecatedSetAttrRequest {
5925 type Encoded = WireNodeDeprecatedSetAttrRequest;
5926}
5927
5928unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrRequest
5929where
5930 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5931{
5932 #[inline]
5933 fn encode(
5934 self,
5935 encoder: &mut ___E,
5936 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5937 ) -> Result<(), ::fidl_next::EncodeError> {
5938 ::fidl_next::munge! {
5939 let Self::Encoded {
5940 flags,
5941 attributes,
5942
5943 } = out;
5944 }
5945
5946 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
5947
5948 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
5949
5950 Ok(())
5951 }
5952}
5953
5954unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrRequest
5955where
5956 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5957{
5958 #[inline]
5959 fn encode_ref(
5960 &self,
5961 encoder: &mut ___E,
5962 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5963 ) -> Result<(), ::fidl_next::EncodeError> {
5964 ::fidl_next::munge! {
5965 let Self::Encoded {
5966 flags,
5967 attributes,
5968
5969 } = out;
5970 }
5971
5972 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
5973
5974 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
5975
5976 Ok(())
5977 }
5978}
5979
5980impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrRequest {
5981 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrRequest>;
5982}
5983
5984unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrRequest
5985where
5986 ___E: ::fidl_next::Encoder + ?Sized,
5987 NodeDeprecatedSetAttrRequest: ::fidl_next::Encode<___E>,
5988{
5989 #[inline]
5990 fn encode_option(
5991 this: Option<Self>,
5992 encoder: &mut ___E,
5993 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5994 ) -> Result<(), ::fidl_next::EncodeError> {
5995 if let Some(inner) = this {
5996 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5997 ::fidl_next::WireBox::encode_present(out);
5998 } else {
5999 ::fidl_next::WireBox::encode_absent(out);
6000 }
6001
6002 Ok(())
6003 }
6004}
6005
6006unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrRequest
6007where
6008 ___E: ::fidl_next::Encoder + ?Sized,
6009 NodeDeprecatedSetAttrRequest: ::fidl_next::EncodeRef<___E>,
6010{
6011 #[inline]
6012 fn encode_option_ref(
6013 this: Option<&Self>,
6014 encoder: &mut ___E,
6015 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6016 ) -> Result<(), ::fidl_next::EncodeError> {
6017 if let Some(inner) = this {
6018 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6019 ::fidl_next::WireBox::encode_present(out);
6020 } else {
6021 ::fidl_next::WireBox::encode_absent(out);
6022 }
6023
6024 Ok(())
6025 }
6026}
6027
6028impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6029 #[inline]
6030 fn from_wire(wire: WireNodeDeprecatedSetAttrRequest) -> Self {
6031 Self {
6032 flags: ::fidl_next::FromWire::from_wire(wire.flags),
6033
6034 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
6035 }
6036 }
6037}
6038
6039impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrRequest> for NodeDeprecatedSetAttrRequest {
6040 #[inline]
6041 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrRequest) -> Self {
6042 Self {
6043 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
6044
6045 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
6046 }
6047 }
6048}
6049
6050#[derive(Clone, Debug)]
6052#[repr(C)]
6053pub struct WireNodeDeprecatedSetAttrRequest {
6054 pub flags: crate::WireNodeAttributeFlags,
6055
6056 pub attributes: crate::WireNodeAttributes,
6057}
6058
6059unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrRequest {
6060 type Decoded<'de> = WireNodeDeprecatedSetAttrRequest;
6061
6062 #[inline]
6063 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6064 unsafe {
6065 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
6066 }
6067 }
6068}
6069
6070unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrRequest
6071where
6072 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6073{
6074 fn decode(
6075 slot: ::fidl_next::Slot<'_, Self>,
6076 decoder: &mut ___D,
6077 ) -> Result<(), ::fidl_next::DecodeError> {
6078 ::fidl_next::munge! {
6079 let Self {
6080 mut flags,
6081 mut attributes,
6082
6083 } = slot;
6084 }
6085
6086 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6087
6088 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
6089
6090 Ok(())
6091 }
6092}
6093
6094#[derive(Clone, Debug)]
6095#[repr(C)]
6096pub struct NodeDeprecatedSetAttrResponse {
6097 pub s: i32,
6098}
6099
6100impl ::fidl_next::Encodable for NodeDeprecatedSetAttrResponse {
6101 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6102 Self,
6103 WireNodeDeprecatedSetAttrResponse,
6104 > = unsafe {
6105 ::fidl_next::CopyOptimization::enable_if(
6106 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6107 )
6108 };
6109
6110 type Encoded = WireNodeDeprecatedSetAttrResponse;
6111}
6112
6113unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetAttrResponse
6114where
6115 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6116{
6117 #[inline]
6118 fn encode(
6119 self,
6120 encoder: &mut ___E,
6121 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6122 ) -> Result<(), ::fidl_next::EncodeError> {
6123 ::fidl_next::munge! {
6124 let Self::Encoded {
6125 s,
6126
6127 } = out;
6128 }
6129
6130 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6131
6132 Ok(())
6133 }
6134}
6135
6136unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetAttrResponse
6137where
6138 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6139{
6140 #[inline]
6141 fn encode_ref(
6142 &self,
6143 encoder: &mut ___E,
6144 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6145 ) -> Result<(), ::fidl_next::EncodeError> {
6146 ::fidl_next::munge! {
6147 let Self::Encoded {
6148 s,
6149
6150 } = out;
6151 }
6152
6153 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6154
6155 Ok(())
6156 }
6157}
6158
6159impl ::fidl_next::EncodableOption for NodeDeprecatedSetAttrResponse {
6160 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetAttrResponse>;
6161}
6162
6163unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetAttrResponse
6164where
6165 ___E: ::fidl_next::Encoder + ?Sized,
6166 NodeDeprecatedSetAttrResponse: ::fidl_next::Encode<___E>,
6167{
6168 #[inline]
6169 fn encode_option(
6170 this: Option<Self>,
6171 encoder: &mut ___E,
6172 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6173 ) -> Result<(), ::fidl_next::EncodeError> {
6174 if let Some(inner) = this {
6175 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6176 ::fidl_next::WireBox::encode_present(out);
6177 } else {
6178 ::fidl_next::WireBox::encode_absent(out);
6179 }
6180
6181 Ok(())
6182 }
6183}
6184
6185unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetAttrResponse
6186where
6187 ___E: ::fidl_next::Encoder + ?Sized,
6188 NodeDeprecatedSetAttrResponse: ::fidl_next::EncodeRef<___E>,
6189{
6190 #[inline]
6191 fn encode_option_ref(
6192 this: Option<&Self>,
6193 encoder: &mut ___E,
6194 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6195 ) -> Result<(), ::fidl_next::EncodeError> {
6196 if let Some(inner) = this {
6197 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6198 ::fidl_next::WireBox::encode_present(out);
6199 } else {
6200 ::fidl_next::WireBox::encode_absent(out);
6201 }
6202
6203 Ok(())
6204 }
6205}
6206
6207impl ::fidl_next::FromWire<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6208 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6209 WireNodeDeprecatedSetAttrResponse,
6210 Self,
6211 > = unsafe {
6212 ::fidl_next::CopyOptimization::enable_if(
6213 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
6214 .is_enabled(),
6215 )
6216 };
6217
6218 #[inline]
6219 fn from_wire(wire: WireNodeDeprecatedSetAttrResponse) -> Self {
6220 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
6221 }
6222}
6223
6224impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetAttrResponse> for NodeDeprecatedSetAttrResponse {
6225 #[inline]
6226 fn from_wire_ref(wire: &WireNodeDeprecatedSetAttrResponse) -> Self {
6227 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
6228 }
6229}
6230
6231#[derive(Clone, Debug)]
6233#[repr(C)]
6234pub struct WireNodeDeprecatedSetAttrResponse {
6235 pub s: ::fidl_next::WireI32,
6236}
6237
6238unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetAttrResponse {
6239 type Decoded<'de> = WireNodeDeprecatedSetAttrResponse;
6240
6241 #[inline]
6242 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6243}
6244
6245unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetAttrResponse
6246where
6247 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6248{
6249 fn decode(
6250 slot: ::fidl_next::Slot<'_, Self>,
6251 decoder: &mut ___D,
6252 ) -> Result<(), ::fidl_next::DecodeError> {
6253 ::fidl_next::munge! {
6254 let Self {
6255 mut s,
6256
6257 } = slot;
6258 }
6259
6260 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6261
6262 Ok(())
6263 }
6264}
6265
6266#[derive(Clone, Debug)]
6267#[repr(C)]
6268pub struct NodeDeprecatedGetFlagsResponse {
6269 pub s: i32,
6270
6271 pub flags: crate::OpenFlags,
6272}
6273
6274impl ::fidl_next::Encodable for NodeDeprecatedGetFlagsResponse {
6275 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6276 Self,
6277 WireNodeDeprecatedGetFlagsResponse,
6278 > = unsafe {
6279 ::fidl_next::CopyOptimization::enable_if(
6280 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
6281 && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6282 )
6283 };
6284
6285 type Encoded = WireNodeDeprecatedGetFlagsResponse;
6286}
6287
6288unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetFlagsResponse
6289where
6290 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6291{
6292 #[inline]
6293 fn encode(
6294 self,
6295 encoder: &mut ___E,
6296 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6297 ) -> Result<(), ::fidl_next::EncodeError> {
6298 ::fidl_next::munge! {
6299 let Self::Encoded {
6300 s,
6301 flags,
6302
6303 } = out;
6304 }
6305
6306 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6307
6308 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6309
6310 Ok(())
6311 }
6312}
6313
6314unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetFlagsResponse
6315where
6316 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6317{
6318 #[inline]
6319 fn encode_ref(
6320 &self,
6321 encoder: &mut ___E,
6322 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6323 ) -> Result<(), ::fidl_next::EncodeError> {
6324 ::fidl_next::munge! {
6325 let Self::Encoded {
6326 s,
6327 flags,
6328
6329 } = out;
6330 }
6331
6332 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6333
6334 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6335
6336 Ok(())
6337 }
6338}
6339
6340impl ::fidl_next::EncodableOption for NodeDeprecatedGetFlagsResponse {
6341 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedGetFlagsResponse>;
6342}
6343
6344unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedGetFlagsResponse
6345where
6346 ___E: ::fidl_next::Encoder + ?Sized,
6347 NodeDeprecatedGetFlagsResponse: ::fidl_next::Encode<___E>,
6348{
6349 #[inline]
6350 fn encode_option(
6351 this: Option<Self>,
6352 encoder: &mut ___E,
6353 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6354 ) -> Result<(), ::fidl_next::EncodeError> {
6355 if let Some(inner) = this {
6356 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6357 ::fidl_next::WireBox::encode_present(out);
6358 } else {
6359 ::fidl_next::WireBox::encode_absent(out);
6360 }
6361
6362 Ok(())
6363 }
6364}
6365
6366unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedGetFlagsResponse
6367where
6368 ___E: ::fidl_next::Encoder + ?Sized,
6369 NodeDeprecatedGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6370{
6371 #[inline]
6372 fn encode_option_ref(
6373 this: Option<&Self>,
6374 encoder: &mut ___E,
6375 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6376 ) -> Result<(), ::fidl_next::EncodeError> {
6377 if let Some(inner) = this {
6378 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6379 ::fidl_next::WireBox::encode_present(out);
6380 } else {
6381 ::fidl_next::WireBox::encode_absent(out);
6382 }
6383
6384 Ok(())
6385 }
6386}
6387
6388impl ::fidl_next::FromWire<WireNodeDeprecatedGetFlagsResponse> for NodeDeprecatedGetFlagsResponse {
6389 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6390 WireNodeDeprecatedGetFlagsResponse,
6391 Self,
6392 > = unsafe {
6393 ::fidl_next::CopyOptimization::enable_if(
6394 true
6395
6396 && <
6397 i32 as ::fidl_next::FromWire<::fidl_next::WireI32>
6398 >::COPY_OPTIMIZATION.is_enabled()
6399
6400 && <
6401 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
6402 >::COPY_OPTIMIZATION.is_enabled()
6403
6404 )
6405 };
6406
6407 #[inline]
6408 fn from_wire(wire: WireNodeDeprecatedGetFlagsResponse) -> Self {
6409 Self {
6410 s: ::fidl_next::FromWire::from_wire(wire.s),
6411
6412 flags: ::fidl_next::FromWire::from_wire(wire.flags),
6413 }
6414 }
6415}
6416
6417impl ::fidl_next::FromWireRef<WireNodeDeprecatedGetFlagsResponse>
6418 for NodeDeprecatedGetFlagsResponse
6419{
6420 #[inline]
6421 fn from_wire_ref(wire: &WireNodeDeprecatedGetFlagsResponse) -> Self {
6422 Self {
6423 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
6424
6425 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
6426 }
6427 }
6428}
6429
6430#[derive(Clone, Debug)]
6432#[repr(C)]
6433pub struct WireNodeDeprecatedGetFlagsResponse {
6434 pub s: ::fidl_next::WireI32,
6435
6436 pub flags: crate::WireOpenFlags,
6437}
6438
6439unsafe impl ::fidl_next::Wire for WireNodeDeprecatedGetFlagsResponse {
6440 type Decoded<'de> = WireNodeDeprecatedGetFlagsResponse;
6441
6442 #[inline]
6443 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6444}
6445
6446unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetFlagsResponse
6447where
6448 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6449{
6450 fn decode(
6451 slot: ::fidl_next::Slot<'_, Self>,
6452 decoder: &mut ___D,
6453 ) -> Result<(), ::fidl_next::DecodeError> {
6454 ::fidl_next::munge! {
6455 let Self {
6456 mut s,
6457 mut flags,
6458
6459 } = slot;
6460 }
6461
6462 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6463
6464 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6465
6466 Ok(())
6467 }
6468}
6469
6470#[derive(Clone, Debug)]
6471#[repr(C)]
6472pub struct NodeDeprecatedSetFlagsRequest {
6473 pub flags: crate::OpenFlags,
6474}
6475
6476impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsRequest {
6477 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6478 Self,
6479 WireNodeDeprecatedSetFlagsRequest,
6480 > = unsafe {
6481 ::fidl_next::CopyOptimization::enable_if(
6482 true && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6483 )
6484 };
6485
6486 type Encoded = WireNodeDeprecatedSetFlagsRequest;
6487}
6488
6489unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsRequest
6490where
6491 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6492{
6493 #[inline]
6494 fn encode(
6495 self,
6496 encoder: &mut ___E,
6497 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6498 ) -> Result<(), ::fidl_next::EncodeError> {
6499 ::fidl_next::munge! {
6500 let Self::Encoded {
6501 flags,
6502
6503 } = out;
6504 }
6505
6506 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6507
6508 Ok(())
6509 }
6510}
6511
6512unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsRequest
6513where
6514 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6515{
6516 #[inline]
6517 fn encode_ref(
6518 &self,
6519 encoder: &mut ___E,
6520 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6521 ) -> Result<(), ::fidl_next::EncodeError> {
6522 ::fidl_next::munge! {
6523 let Self::Encoded {
6524 flags,
6525
6526 } = out;
6527 }
6528
6529 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6530
6531 Ok(())
6532 }
6533}
6534
6535impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsRequest {
6536 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsRequest>;
6537}
6538
6539unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsRequest
6540where
6541 ___E: ::fidl_next::Encoder + ?Sized,
6542 NodeDeprecatedSetFlagsRequest: ::fidl_next::Encode<___E>,
6543{
6544 #[inline]
6545 fn encode_option(
6546 this: Option<Self>,
6547 encoder: &mut ___E,
6548 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6549 ) -> Result<(), ::fidl_next::EncodeError> {
6550 if let Some(inner) = this {
6551 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6552 ::fidl_next::WireBox::encode_present(out);
6553 } else {
6554 ::fidl_next::WireBox::encode_absent(out);
6555 }
6556
6557 Ok(())
6558 }
6559}
6560
6561unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsRequest
6562where
6563 ___E: ::fidl_next::Encoder + ?Sized,
6564 NodeDeprecatedSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
6565{
6566 #[inline]
6567 fn encode_option_ref(
6568 this: Option<&Self>,
6569 encoder: &mut ___E,
6570 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6571 ) -> Result<(), ::fidl_next::EncodeError> {
6572 if let Some(inner) = this {
6573 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6574 ::fidl_next::WireBox::encode_present(out);
6575 } else {
6576 ::fidl_next::WireBox::encode_absent(out);
6577 }
6578
6579 Ok(())
6580 }
6581}
6582
6583impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
6584 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6585 WireNodeDeprecatedSetFlagsRequest,
6586 Self,
6587 > = unsafe {
6588 ::fidl_next::CopyOptimization::enable_if(
6589 true
6590
6591 && <
6592 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
6593 >::COPY_OPTIMIZATION.is_enabled()
6594
6595 )
6596 };
6597
6598 #[inline]
6599 fn from_wire(wire: WireNodeDeprecatedSetFlagsRequest) -> Self {
6600 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
6601 }
6602}
6603
6604impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
6605 #[inline]
6606 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsRequest) -> Self {
6607 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
6608 }
6609}
6610
6611#[derive(Clone, Debug)]
6613#[repr(C)]
6614pub struct WireNodeDeprecatedSetFlagsRequest {
6615 pub flags: crate::WireOpenFlags,
6616}
6617
6618unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsRequest {
6619 type Decoded<'de> = WireNodeDeprecatedSetFlagsRequest;
6620
6621 #[inline]
6622 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6623}
6624
6625unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsRequest
6626where
6627 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6628{
6629 fn decode(
6630 slot: ::fidl_next::Slot<'_, Self>,
6631 decoder: &mut ___D,
6632 ) -> Result<(), ::fidl_next::DecodeError> {
6633 ::fidl_next::munge! {
6634 let Self {
6635 mut flags,
6636
6637 } = slot;
6638 }
6639
6640 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6641
6642 Ok(())
6643 }
6644}
6645
6646#[derive(Clone, Debug)]
6647#[repr(C)]
6648pub struct NodeDeprecatedSetFlagsResponse {
6649 pub s: i32,
6650}
6651
6652impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsResponse {
6653 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6654 Self,
6655 WireNodeDeprecatedSetFlagsResponse,
6656 > = unsafe {
6657 ::fidl_next::CopyOptimization::enable_if(
6658 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6659 )
6660 };
6661
6662 type Encoded = WireNodeDeprecatedSetFlagsResponse;
6663}
6664
6665unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsResponse
6666where
6667 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6668{
6669 #[inline]
6670 fn encode(
6671 self,
6672 encoder: &mut ___E,
6673 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6674 ) -> Result<(), ::fidl_next::EncodeError> {
6675 ::fidl_next::munge! {
6676 let Self::Encoded {
6677 s,
6678
6679 } = out;
6680 }
6681
6682 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6683
6684 Ok(())
6685 }
6686}
6687
6688unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsResponse
6689where
6690 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6691{
6692 #[inline]
6693 fn encode_ref(
6694 &self,
6695 encoder: &mut ___E,
6696 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6697 ) -> Result<(), ::fidl_next::EncodeError> {
6698 ::fidl_next::munge! {
6699 let Self::Encoded {
6700 s,
6701
6702 } = out;
6703 }
6704
6705 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6706
6707 Ok(())
6708 }
6709}
6710
6711impl ::fidl_next::EncodableOption for NodeDeprecatedSetFlagsResponse {
6712 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedSetFlagsResponse>;
6713}
6714
6715unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedSetFlagsResponse
6716where
6717 ___E: ::fidl_next::Encoder + ?Sized,
6718 NodeDeprecatedSetFlagsResponse: ::fidl_next::Encode<___E>,
6719{
6720 #[inline]
6721 fn encode_option(
6722 this: Option<Self>,
6723 encoder: &mut ___E,
6724 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6725 ) -> Result<(), ::fidl_next::EncodeError> {
6726 if let Some(inner) = this {
6727 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6728 ::fidl_next::WireBox::encode_present(out);
6729 } else {
6730 ::fidl_next::WireBox::encode_absent(out);
6731 }
6732
6733 Ok(())
6734 }
6735}
6736
6737unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeDeprecatedSetFlagsResponse
6738where
6739 ___E: ::fidl_next::Encoder + ?Sized,
6740 NodeDeprecatedSetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6741{
6742 #[inline]
6743 fn encode_option_ref(
6744 this: Option<&Self>,
6745 encoder: &mut ___E,
6746 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6747 ) -> Result<(), ::fidl_next::EncodeError> {
6748 if let Some(inner) = this {
6749 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6750 ::fidl_next::WireBox::encode_present(out);
6751 } else {
6752 ::fidl_next::WireBox::encode_absent(out);
6753 }
6754
6755 Ok(())
6756 }
6757}
6758
6759impl ::fidl_next::FromWire<WireNodeDeprecatedSetFlagsResponse> for NodeDeprecatedSetFlagsResponse {
6760 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6761 WireNodeDeprecatedSetFlagsResponse,
6762 Self,
6763 > = unsafe {
6764 ::fidl_next::CopyOptimization::enable_if(
6765 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
6766 .is_enabled(),
6767 )
6768 };
6769
6770 #[inline]
6771 fn from_wire(wire: WireNodeDeprecatedSetFlagsResponse) -> Self {
6772 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
6773 }
6774}
6775
6776impl ::fidl_next::FromWireRef<WireNodeDeprecatedSetFlagsResponse>
6777 for NodeDeprecatedSetFlagsResponse
6778{
6779 #[inline]
6780 fn from_wire_ref(wire: &WireNodeDeprecatedSetFlagsResponse) -> Self {
6781 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
6782 }
6783}
6784
6785#[derive(Clone, Debug)]
6787#[repr(C)]
6788pub struct WireNodeDeprecatedSetFlagsResponse {
6789 pub s: ::fidl_next::WireI32,
6790}
6791
6792unsafe impl ::fidl_next::Wire for WireNodeDeprecatedSetFlagsResponse {
6793 type Decoded<'de> = WireNodeDeprecatedSetFlagsResponse;
6794
6795 #[inline]
6796 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6797}
6798
6799unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsResponse
6800where
6801 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6802{
6803 fn decode(
6804 slot: ::fidl_next::Slot<'_, Self>,
6805 decoder: &mut ___D,
6806 ) -> Result<(), ::fidl_next::DecodeError> {
6807 ::fidl_next::munge! {
6808 let Self {
6809 mut s,
6810
6811 } = slot;
6812 }
6813
6814 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6815
6816 Ok(())
6817 }
6818}
6819
6820::fidl_next::bitflags! {
6821 #[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(
6822 Clone,
6823 Copy,
6824 Debug,
6825 PartialEq,
6826 Eq,
6827 Hash,
6828 )]
6829 pub struct Flags: u64 {
6830 #[doc = " Allows opening child nodes with [`PROTOCOL_SERVICE`].\n"]const PERM_CONNECT = 1;
6831 #[doc = " Read byte contents of a file.\n"]const PERM_READ_BYTES = 2;
6832 #[doc = " Write byte contents to a file.\n"]const PERM_WRITE_BYTES = 4;
6833 #[doc = " Execute byte contents of a file.\n"]const PERM_EXECUTE = 8;
6834 #[doc = " Get/query attributes of a node.\n"]const PERM_GET_ATTRIBUTES = 16;
6835 #[doc = " Set/update attributes of a node.\n"]const PERM_UPDATE_ATTRIBUTES = 32;
6836 #[doc = " Enumerate (list) directory entries.\n"]const PERM_ENUMERATE = 64;
6837 #[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;
6838 #[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;
6839 #[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;
6840 #[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;
6841 #[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;
6842 #[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;
6843 #[doc = " Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.\n"]const PROTOCOL_DIRECTORY = 524288;
6844 #[doc = " Caller accepts [`fuchsia.io/File`] protocol.\n"]const PROTOCOL_FILE = 8589934592;
6845 #[doc = " Caller accepts [`fuchsia.io/Symlink`] protocol.\n"]const PROTOCOL_SYMLINK = 17179869184;
6846 #[doc = " Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.\n"]const FLAG_SEND_REPRESENTATION = 1099511627776;
6847 #[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;
6848 #[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;
6849 #[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;
6850 #[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;
6851 #[doc = " Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.\n"]const FILE_TRUNCATE = 262144;
6852 const _ = !0;
6853 }
6854}
6855
6856impl ::fidl_next::Encodable for Flags {
6857 type Encoded = WireFlags;
6858}
6859
6860unsafe impl<___E> ::fidl_next::Encode<___E> for Flags
6861where
6862 ___E: ?Sized,
6863{
6864 #[inline]
6865 fn encode(
6866 self,
6867 encoder: &mut ___E,
6868 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6869 ) -> Result<(), ::fidl_next::EncodeError> {
6870 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
6871 }
6872}
6873
6874unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Flags
6875where
6876 ___E: ?Sized,
6877{
6878 #[inline]
6879 fn encode_ref(
6880 &self,
6881 _: &mut ___E,
6882 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6883 ) -> Result<(), ::fidl_next::EncodeError> {
6884 ::fidl_next::munge!(let WireFlags { value } = out);
6885 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
6886 Ok(())
6887 }
6888}
6889
6890impl ::core::convert::From<WireFlags> for Flags {
6891 fn from(wire: WireFlags) -> Self {
6892 Self::from_bits_retain(u64::from(wire.value))
6893 }
6894}
6895
6896impl ::fidl_next::FromWire<WireFlags> for Flags {
6897 #[inline]
6898 fn from_wire(wire: WireFlags) -> Self {
6899 Self::from(wire)
6900 }
6901}
6902
6903impl ::fidl_next::FromWireRef<WireFlags> for Flags {
6904 #[inline]
6905 fn from_wire_ref(wire: &WireFlags) -> Self {
6906 Self::from(*wire)
6907 }
6908}
6909
6910#[derive(Clone, Copy, Debug)]
6912#[repr(transparent)]
6913pub struct WireFlags {
6914 value: ::fidl_next::WireU64,
6915}
6916
6917unsafe impl ::fidl_next::Wire for WireFlags {
6918 type Decoded<'de> = Self;
6919
6920 #[inline]
6921 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6922 }
6924}
6925
6926unsafe impl<___D> ::fidl_next::Decode<___D> for WireFlags
6927where
6928 ___D: ?Sized,
6929{
6930 fn decode(
6931 slot: ::fidl_next::Slot<'_, Self>,
6932 _: &mut ___D,
6933 ) -> Result<(), ::fidl_next::DecodeError> {
6934 Ok(())
6935 }
6936}
6937
6938impl ::core::convert::From<Flags> for WireFlags {
6939 fn from(natural: Flags) -> Self {
6940 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
6941 }
6942}
6943
6944#[derive(Clone, Debug)]
6945#[repr(C)]
6946pub struct NodeGetFlagsResponse {
6947 pub flags: crate::Flags,
6948}
6949
6950impl ::fidl_next::Encodable for NodeGetFlagsResponse {
6951 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetFlagsResponse> = unsafe {
6952 ::fidl_next::CopyOptimization::enable_if(
6953 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6954 )
6955 };
6956
6957 type Encoded = WireNodeGetFlagsResponse;
6958}
6959
6960unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetFlagsResponse
6961where
6962 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6963{
6964 #[inline]
6965 fn encode(
6966 self,
6967 encoder: &mut ___E,
6968 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6969 ) -> Result<(), ::fidl_next::EncodeError> {
6970 ::fidl_next::munge! {
6971 let Self::Encoded {
6972 flags,
6973
6974 } = out;
6975 }
6976
6977 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6978
6979 Ok(())
6980 }
6981}
6982
6983unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetFlagsResponse
6984where
6985 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6986{
6987 #[inline]
6988 fn encode_ref(
6989 &self,
6990 encoder: &mut ___E,
6991 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6992 ) -> Result<(), ::fidl_next::EncodeError> {
6993 ::fidl_next::munge! {
6994 let Self::Encoded {
6995 flags,
6996
6997 } = out;
6998 }
6999
7000 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
7001
7002 Ok(())
7003 }
7004}
7005
7006impl ::fidl_next::EncodableOption for NodeGetFlagsResponse {
7007 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetFlagsResponse>;
7008}
7009
7010unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetFlagsResponse
7011where
7012 ___E: ::fidl_next::Encoder + ?Sized,
7013 NodeGetFlagsResponse: ::fidl_next::Encode<___E>,
7014{
7015 #[inline]
7016 fn encode_option(
7017 this: Option<Self>,
7018 encoder: &mut ___E,
7019 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7020 ) -> Result<(), ::fidl_next::EncodeError> {
7021 if let Some(inner) = this {
7022 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7023 ::fidl_next::WireBox::encode_present(out);
7024 } else {
7025 ::fidl_next::WireBox::encode_absent(out);
7026 }
7027
7028 Ok(())
7029 }
7030}
7031
7032unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetFlagsResponse
7033where
7034 ___E: ::fidl_next::Encoder + ?Sized,
7035 NodeGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
7036{
7037 #[inline]
7038 fn encode_option_ref(
7039 this: Option<&Self>,
7040 encoder: &mut ___E,
7041 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7042 ) -> Result<(), ::fidl_next::EncodeError> {
7043 if let Some(inner) = this {
7044 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7045 ::fidl_next::WireBox::encode_present(out);
7046 } else {
7047 ::fidl_next::WireBox::encode_absent(out);
7048 }
7049
7050 Ok(())
7051 }
7052}
7053
7054impl ::fidl_next::FromWire<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7055 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetFlagsResponse, Self> = unsafe {
7056 ::fidl_next::CopyOptimization::enable_if(
7057 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
7058 .is_enabled(),
7059 )
7060 };
7061
7062 #[inline]
7063 fn from_wire(wire: WireNodeGetFlagsResponse) -> Self {
7064 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7065 }
7066}
7067
7068impl ::fidl_next::FromWireRef<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
7069 #[inline]
7070 fn from_wire_ref(wire: &WireNodeGetFlagsResponse) -> Self {
7071 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7072 }
7073}
7074
7075#[derive(Clone, Debug)]
7077#[repr(C)]
7078pub struct WireNodeGetFlagsResponse {
7079 pub flags: crate::WireFlags,
7080}
7081
7082unsafe impl ::fidl_next::Wire for WireNodeGetFlagsResponse {
7083 type Decoded<'de> = WireNodeGetFlagsResponse;
7084
7085 #[inline]
7086 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7087}
7088
7089unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetFlagsResponse
7090where
7091 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7092{
7093 fn decode(
7094 slot: ::fidl_next::Slot<'_, Self>,
7095 decoder: &mut ___D,
7096 ) -> Result<(), ::fidl_next::DecodeError> {
7097 ::fidl_next::munge! {
7098 let Self {
7099 mut flags,
7100
7101 } = slot;
7102 }
7103
7104 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
7105
7106 Ok(())
7107 }
7108}
7109
7110#[derive(Clone, Debug)]
7111#[repr(C)]
7112pub struct NodeSetFlagsRequest {
7113 pub flags: crate::Flags,
7114}
7115
7116impl ::fidl_next::Encodable for NodeSetFlagsRequest {
7117 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeSetFlagsRequest> = unsafe {
7118 ::fidl_next::CopyOptimization::enable_if(
7119 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
7120 )
7121 };
7122
7123 type Encoded = WireNodeSetFlagsRequest;
7124}
7125
7126unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetFlagsRequest
7127where
7128 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7129{
7130 #[inline]
7131 fn encode(
7132 self,
7133 encoder: &mut ___E,
7134 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7135 ) -> Result<(), ::fidl_next::EncodeError> {
7136 ::fidl_next::munge! {
7137 let Self::Encoded {
7138 flags,
7139
7140 } = out;
7141 }
7142
7143 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
7144
7145 Ok(())
7146 }
7147}
7148
7149unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetFlagsRequest
7150where
7151 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7152{
7153 #[inline]
7154 fn encode_ref(
7155 &self,
7156 encoder: &mut ___E,
7157 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7158 ) -> Result<(), ::fidl_next::EncodeError> {
7159 ::fidl_next::munge! {
7160 let Self::Encoded {
7161 flags,
7162
7163 } = out;
7164 }
7165
7166 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
7167
7168 Ok(())
7169 }
7170}
7171
7172impl ::fidl_next::EncodableOption for NodeSetFlagsRequest {
7173 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeSetFlagsRequest>;
7174}
7175
7176unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeSetFlagsRequest
7177where
7178 ___E: ::fidl_next::Encoder + ?Sized,
7179 NodeSetFlagsRequest: ::fidl_next::Encode<___E>,
7180{
7181 #[inline]
7182 fn encode_option(
7183 this: Option<Self>,
7184 encoder: &mut ___E,
7185 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7186 ) -> Result<(), ::fidl_next::EncodeError> {
7187 if let Some(inner) = this {
7188 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7189 ::fidl_next::WireBox::encode_present(out);
7190 } else {
7191 ::fidl_next::WireBox::encode_absent(out);
7192 }
7193
7194 Ok(())
7195 }
7196}
7197
7198unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeSetFlagsRequest
7199where
7200 ___E: ::fidl_next::Encoder + ?Sized,
7201 NodeSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
7202{
7203 #[inline]
7204 fn encode_option_ref(
7205 this: Option<&Self>,
7206 encoder: &mut ___E,
7207 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7208 ) -> Result<(), ::fidl_next::EncodeError> {
7209 if let Some(inner) = this {
7210 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7211 ::fidl_next::WireBox::encode_present(out);
7212 } else {
7213 ::fidl_next::WireBox::encode_absent(out);
7214 }
7215
7216 Ok(())
7217 }
7218}
7219
7220impl ::fidl_next::FromWire<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
7221 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeSetFlagsRequest, Self> = unsafe {
7222 ::fidl_next::CopyOptimization::enable_if(
7223 true && <crate::Flags as ::fidl_next::FromWire<crate::WireFlags>>::COPY_OPTIMIZATION
7224 .is_enabled(),
7225 )
7226 };
7227
7228 #[inline]
7229 fn from_wire(wire: WireNodeSetFlagsRequest) -> Self {
7230 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
7231 }
7232}
7233
7234impl ::fidl_next::FromWireRef<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
7235 #[inline]
7236 fn from_wire_ref(wire: &WireNodeSetFlagsRequest) -> Self {
7237 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
7238 }
7239}
7240
7241#[derive(Clone, Debug)]
7243#[repr(C)]
7244pub struct WireNodeSetFlagsRequest {
7245 pub flags: crate::WireFlags,
7246}
7247
7248unsafe impl ::fidl_next::Wire for WireNodeSetFlagsRequest {
7249 type Decoded<'de> = WireNodeSetFlagsRequest;
7250
7251 #[inline]
7252 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7253}
7254
7255unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetFlagsRequest
7256where
7257 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7258{
7259 fn decode(
7260 slot: ::fidl_next::Slot<'_, Self>,
7261 decoder: &mut ___D,
7262 ) -> Result<(), ::fidl_next::DecodeError> {
7263 ::fidl_next::munge! {
7264 let Self {
7265 mut flags,
7266
7267 } = slot;
7268 }
7269
7270 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
7271
7272 Ok(())
7273 }
7274}
7275
7276#[doc = " The maximum size for passing the SELinux context as an attribute.\n"]
7277pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256;
7278
7279#[doc = " Used in places where empty structs are needed, such as empty union members, to avoid creating\n new struct types.\n"]
7280#[derive(Clone, Debug)]
7281#[repr(C)]
7282pub struct EmptyStruct {}
7283
7284impl ::fidl_next::Encodable for EmptyStruct {
7285 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireEmptyStruct> =
7286 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
7287
7288 type Encoded = WireEmptyStruct;
7289}
7290
7291unsafe impl<___E> ::fidl_next::Encode<___E> for EmptyStruct
7292where
7293 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7294{
7295 #[inline]
7296 fn encode(
7297 self,
7298 encoder: &mut ___E,
7299 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7300 ) -> Result<(), ::fidl_next::EncodeError> {
7301 ::fidl_next::munge! {
7302 let Self::Encoded {
7303
7304 } = out;
7305 }
7306
7307 Ok(())
7308 }
7309}
7310
7311unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EmptyStruct
7312where
7313 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7314{
7315 #[inline]
7316 fn encode_ref(
7317 &self,
7318 encoder: &mut ___E,
7319 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7320 ) -> Result<(), ::fidl_next::EncodeError> {
7321 ::fidl_next::munge! {
7322 let Self::Encoded {
7323
7324 } = out;
7325 }
7326
7327 Ok(())
7328 }
7329}
7330
7331impl ::fidl_next::EncodableOption for EmptyStruct {
7332 type EncodedOption = ::fidl_next::WireBox<'static, WireEmptyStruct>;
7333}
7334
7335unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EmptyStruct
7336where
7337 ___E: ::fidl_next::Encoder + ?Sized,
7338 EmptyStruct: ::fidl_next::Encode<___E>,
7339{
7340 #[inline]
7341 fn encode_option(
7342 this: Option<Self>,
7343 encoder: &mut ___E,
7344 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7345 ) -> Result<(), ::fidl_next::EncodeError> {
7346 if let Some(inner) = this {
7347 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7348 ::fidl_next::WireBox::encode_present(out);
7349 } else {
7350 ::fidl_next::WireBox::encode_absent(out);
7351 }
7352
7353 Ok(())
7354 }
7355}
7356
7357unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for EmptyStruct
7358where
7359 ___E: ::fidl_next::Encoder + ?Sized,
7360 EmptyStruct: ::fidl_next::EncodeRef<___E>,
7361{
7362 #[inline]
7363 fn encode_option_ref(
7364 this: Option<&Self>,
7365 encoder: &mut ___E,
7366 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7367 ) -> Result<(), ::fidl_next::EncodeError> {
7368 if let Some(inner) = this {
7369 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7370 ::fidl_next::WireBox::encode_present(out);
7371 } else {
7372 ::fidl_next::WireBox::encode_absent(out);
7373 }
7374
7375 Ok(())
7376 }
7377}
7378
7379impl ::fidl_next::FromWire<WireEmptyStruct> for EmptyStruct {
7380 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireEmptyStruct, Self> =
7381 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
7382
7383 #[inline]
7384 fn from_wire(wire: WireEmptyStruct) -> Self {
7385 Self {}
7386 }
7387}
7388
7389impl ::fidl_next::FromWireRef<WireEmptyStruct> for EmptyStruct {
7390 #[inline]
7391 fn from_wire_ref(wire: &WireEmptyStruct) -> Self {
7392 Self {}
7393 }
7394}
7395
7396#[derive(Clone, Debug)]
7398#[repr(C)]
7399pub struct WireEmptyStruct {}
7400
7401unsafe impl ::fidl_next::Wire for WireEmptyStruct {
7402 type Decoded<'de> = WireEmptyStruct;
7403
7404 #[inline]
7405 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7406}
7407
7408unsafe impl<___D> ::fidl_next::Decode<___D> for WireEmptyStruct
7409where
7410 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7411{
7412 fn decode(
7413 slot: ::fidl_next::Slot<'_, Self>,
7414 decoder: &mut ___D,
7415 ) -> Result<(), ::fidl_next::DecodeError> {
7416 ::fidl_next::munge! {
7417 let Self {
7418
7419 } = slot;
7420 }
7421
7422 Ok(())
7423 }
7424}
7425
7426#[derive(Clone, Debug)]
7427pub enum SelinuxContext {
7428 Data(Vec<u8>),
7429
7430 UseExtendedAttributes(crate::EmptyStruct),
7431
7432 UnknownOrdinal_(u64),
7433}
7434
7435impl ::fidl_next::Encodable for SelinuxContext {
7436 type Encoded = WireSelinuxContext<'static>;
7437}
7438
7439unsafe impl<___E> ::fidl_next::Encode<___E> for SelinuxContext
7440where
7441 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7442 ___E: ::fidl_next::Encoder,
7443{
7444 #[inline]
7445 fn encode(
7446 self,
7447 encoder: &mut ___E,
7448 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7449 ) -> Result<(), ::fidl_next::EncodeError> {
7450 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
7451
7452 match self {
7453 Self::Data(value) => {
7454 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
7455 }
7456
7457 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7458 ___E,
7459 crate::EmptyStruct,
7460 >(value, 2, encoder, raw)?,
7461
7462 Self::UnknownOrdinal_(ordinal) => {
7463 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7464 }
7465 }
7466
7467 Ok(())
7468 }
7469}
7470
7471unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelinuxContext
7472where
7473 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7474 ___E: ::fidl_next::Encoder,
7475{
7476 #[inline]
7477 fn encode_ref(
7478 &self,
7479 encoder: &mut ___E,
7480 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7481 ) -> Result<(), ::fidl_next::EncodeError> {
7482 ::fidl_next::munge!(let WireSelinuxContext { raw, _phantom: _ } = out);
7483
7484 match self {
7485 Self::Data(value) => {
7486 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 1, encoder, raw)?
7487 }
7488
7489 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7490 ___E,
7491 &crate::EmptyStruct,
7492 >(value, 2, encoder, raw)?,
7493
7494 Self::UnknownOrdinal_(ordinal) => {
7495 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7496 }
7497 }
7498
7499 Ok(())
7500 }
7501}
7502
7503impl ::fidl_next::EncodableOption for SelinuxContext {
7504 type EncodedOption = WireOptionalSelinuxContext<'static>;
7505}
7506
7507unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SelinuxContext
7508where
7509 ___E: ?Sized,
7510 SelinuxContext: ::fidl_next::Encode<___E>,
7511{
7512 #[inline]
7513 fn encode_option(
7514 this: Option<Self>,
7515 encoder: &mut ___E,
7516 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7517 ) -> Result<(), ::fidl_next::EncodeError> {
7518 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
7519
7520 if let Some(inner) = this {
7521 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7522 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7523 } else {
7524 ::fidl_next::RawWireUnion::encode_absent(raw);
7525 }
7526
7527 Ok(())
7528 }
7529}
7530
7531unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SelinuxContext
7532where
7533 ___E: ?Sized,
7534 SelinuxContext: ::fidl_next::EncodeRef<___E>,
7535{
7536 #[inline]
7537 fn encode_option_ref(
7538 this: Option<&Self>,
7539 encoder: &mut ___E,
7540 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7541 ) -> Result<(), ::fidl_next::EncodeError> {
7542 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw, _phantom: _ } = &mut *out);
7543
7544 if let Some(inner) = this {
7545 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7546 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7547 } else {
7548 ::fidl_next::RawWireUnion::encode_absent(raw);
7549 }
7550
7551 Ok(())
7552 }
7553}
7554
7555impl<'de> ::fidl_next::FromWire<WireSelinuxContext<'de>> for SelinuxContext {
7556 #[inline]
7557 fn from_wire(wire: WireSelinuxContext<'de>) -> Self {
7558 let wire = ::core::mem::ManuallyDrop::new(wire);
7559 match wire.raw.ordinal() {
7560 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
7561 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
7562 })),
7563
7564 2 => Self::UseExtendedAttributes(::fidl_next::FromWire::from_wire(unsafe {
7565 wire.raw.get().read_unchecked::<crate::WireEmptyStruct>()
7566 })),
7567
7568 _ => unsafe { ::core::hint::unreachable_unchecked() },
7569 }
7570 }
7571}
7572
7573impl<'de> ::fidl_next::FromWireRef<WireSelinuxContext<'de>> for SelinuxContext {
7574 #[inline]
7575 fn from_wire_ref(wire: &WireSelinuxContext<'de>) -> Self {
7576 match wire.raw.ordinal() {
7577 1 => Self::Data(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7578 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
7579 })),
7580
7581 2 => Self::UseExtendedAttributes(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7582 wire.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7583 })),
7584
7585 _ => unsafe { ::core::hint::unreachable_unchecked() },
7586 }
7587 }
7588}
7589
7590impl<'de> ::fidl_next::FromWireOption<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
7591 #[inline]
7592 fn from_wire_option(wire: WireOptionalSelinuxContext<'de>) -> Option<Self> {
7593 if let Some(inner) = wire.into_option() {
7594 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
7595 } else {
7596 None
7597 }
7598 }
7599}
7600
7601impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalSelinuxContext<'de>> for Box<SelinuxContext> {
7602 #[inline]
7603 fn from_wire_option_ref(wire: &WireOptionalSelinuxContext<'de>) -> Option<Self> {
7604 if let Some(inner) = wire.as_ref() {
7605 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7606 } else {
7607 None
7608 }
7609 }
7610}
7611
7612#[repr(transparent)]
7614pub struct WireSelinuxContext<'de> {
7615 raw: ::fidl_next::RawWireUnion,
7616 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7617}
7618
7619impl<'de> Drop for WireSelinuxContext<'de> {
7620 fn drop(&mut self) {
7621 match self.raw.ordinal() {
7622 1 => {
7623 let _ =
7624 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
7625 }
7626
7627 2 => {
7628 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEmptyStruct>() };
7629 }
7630
7631 _ => (),
7632 }
7633 }
7634}
7635
7636unsafe impl ::fidl_next::Wire for WireSelinuxContext<'static> {
7637 type Decoded<'de> = WireSelinuxContext<'de>;
7638
7639 #[inline]
7640 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7641 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7642 ::fidl_next::RawWireUnion::zero_padding(raw);
7643 }
7644}
7645
7646pub mod selinux_context {
7647 pub enum Ref<'de> {
7648 Data(&'de ::fidl_next::WireVector<'de, u8>),
7649
7650 UseExtendedAttributes(&'de crate::WireEmptyStruct),
7651
7652 UnknownOrdinal_(u64),
7653 }
7654}
7655
7656impl<'de> WireSelinuxContext<'de> {
7657 pub fn as_ref(&self) -> crate::selinux_context::Ref<'_> {
7658 match self.raw.ordinal() {
7659 1 => crate::selinux_context::Ref::Data(unsafe {
7660 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
7661 }),
7662
7663 2 => crate::selinux_context::Ref::UseExtendedAttributes(unsafe {
7664 self.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7665 }),
7666
7667 unknown => crate::selinux_context::Ref::UnknownOrdinal_(unknown),
7668 }
7669 }
7670}
7671
7672unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelinuxContext<'static>
7673where
7674 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7675 ___D: ::fidl_next::Decoder,
7676{
7677 fn decode(
7678 mut slot: ::fidl_next::Slot<'_, Self>,
7679 decoder: &mut ___D,
7680 ) -> Result<(), ::fidl_next::DecodeError> {
7681 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7682 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7683 1 => {
7684 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
7685 raw, decoder,
7686 )?
7687 }
7688
7689 2 => {
7690 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7691 }
7692
7693 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7694 }
7695
7696 Ok(())
7697 }
7698}
7699
7700impl<'de> ::core::fmt::Debug for WireSelinuxContext<'de> {
7701 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7702 match self.raw.ordinal() {
7703 1 => unsafe {
7704 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
7705 },
7706 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireEmptyStruct>().fmt(f) },
7707 _ => unsafe { ::core::hint::unreachable_unchecked() },
7708 }
7709 }
7710}
7711
7712#[repr(transparent)]
7713pub struct WireOptionalSelinuxContext<'de> {
7714 raw: ::fidl_next::RawWireUnion,
7715 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7716}
7717
7718unsafe impl ::fidl_next::Wire for WireOptionalSelinuxContext<'static> {
7719 type Decoded<'de> = WireOptionalSelinuxContext<'de>;
7720
7721 #[inline]
7722 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7723 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7724 ::fidl_next::RawWireUnion::zero_padding(raw);
7725 }
7726}
7727
7728impl<'de> WireOptionalSelinuxContext<'de> {
7729 pub fn is_some(&self) -> bool {
7730 self.raw.is_some()
7731 }
7732
7733 pub fn is_none(&self) -> bool {
7734 self.raw.is_none()
7735 }
7736
7737 pub fn as_ref(&self) -> Option<&WireSelinuxContext<'de>> {
7738 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7739 }
7740
7741 pub fn into_option(self) -> Option<WireSelinuxContext<'de>> {
7742 if self.is_some() {
7743 Some(WireSelinuxContext { raw: self.raw, _phantom: ::core::marker::PhantomData })
7744 } else {
7745 None
7746 }
7747 }
7748}
7749
7750unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalSelinuxContext<'static>
7751where
7752 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7753 ___D: ::fidl_next::Decoder,
7754{
7755 fn decode(
7756 mut slot: ::fidl_next::Slot<'_, Self>,
7757 decoder: &mut ___D,
7758 ) -> Result<(), ::fidl_next::DecodeError> {
7759 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7760 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7761 1 => {
7762 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
7763 raw, decoder,
7764 )?
7765 }
7766
7767 2 => {
7768 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7769 }
7770
7771 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7772 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7773 }
7774
7775 Ok(())
7776 }
7777}
7778
7779impl<'de> ::core::fmt::Debug for WireOptionalSelinuxContext<'de> {
7780 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7781 self.as_ref().fmt(f)
7782 }
7783}
7784
7785#[derive(Clone, Debug, Default)]
7786pub struct MutableNodeAttributes {
7787 pub creation_time: Option<u64>,
7788
7789 pub modification_time: Option<u64>,
7790
7791 pub mode: Option<u32>,
7792
7793 pub uid: Option<u32>,
7794
7795 pub gid: Option<u32>,
7796
7797 pub rdev: Option<u64>,
7798
7799 pub access_time: Option<u64>,
7800
7801 pub casefold: Option<bool>,
7802
7803 pub selinux_context: Option<crate::SelinuxContext>,
7804
7805 pub wrapping_key_id: Option<[u8; 16]>,
7806}
7807
7808impl MutableNodeAttributes {
7809 fn __max_ordinal(&self) -> usize {
7810 if self.wrapping_key_id.is_some() {
7811 return 10;
7812 }
7813
7814 if self.selinux_context.is_some() {
7815 return 9;
7816 }
7817
7818 if self.casefold.is_some() {
7819 return 8;
7820 }
7821
7822 if self.access_time.is_some() {
7823 return 7;
7824 }
7825
7826 if self.rdev.is_some() {
7827 return 6;
7828 }
7829
7830 if self.gid.is_some() {
7831 return 5;
7832 }
7833
7834 if self.uid.is_some() {
7835 return 4;
7836 }
7837
7838 if self.mode.is_some() {
7839 return 3;
7840 }
7841
7842 if self.modification_time.is_some() {
7843 return 2;
7844 }
7845
7846 if self.creation_time.is_some() {
7847 return 1;
7848 }
7849
7850 0
7851 }
7852}
7853
7854impl ::fidl_next::Encodable for MutableNodeAttributes {
7855 type Encoded = WireMutableNodeAttributes<'static>;
7856}
7857
7858unsafe impl<___E> ::fidl_next::Encode<___E> for MutableNodeAttributes
7859where
7860 ___E: ::fidl_next::Encoder + ?Sized,
7861{
7862 #[inline]
7863 fn encode(
7864 mut self,
7865 encoder: &mut ___E,
7866 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7867 ) -> Result<(), ::fidl_next::EncodeError> {
7868 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
7869
7870 let max_ord = self.__max_ordinal();
7871
7872 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7873 ::fidl_next::Wire::zero_padding(&mut out);
7874
7875 let mut preallocated =
7876 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7877
7878 for i in 1..=max_ord {
7879 match i {
7880 10 => {
7881 if let Some(wrapping_key_id) = self.wrapping_key_id.take() {
7882 ::fidl_next::WireEnvelope::encode_value(
7883 wrapping_key_id,
7884 preallocated.encoder,
7885 &mut out,
7886 )?;
7887 } else {
7888 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7889 }
7890 }
7891
7892 9 => {
7893 if let Some(selinux_context) = self.selinux_context.take() {
7894 ::fidl_next::WireEnvelope::encode_value(
7895 selinux_context,
7896 preallocated.encoder,
7897 &mut out,
7898 )?;
7899 } else {
7900 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7901 }
7902 }
7903
7904 8 => {
7905 if let Some(casefold) = self.casefold.take() {
7906 ::fidl_next::WireEnvelope::encode_value(
7907 casefold,
7908 preallocated.encoder,
7909 &mut out,
7910 )?;
7911 } else {
7912 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7913 }
7914 }
7915
7916 7 => {
7917 if let Some(access_time) = self.access_time.take() {
7918 ::fidl_next::WireEnvelope::encode_value(
7919 access_time,
7920 preallocated.encoder,
7921 &mut out,
7922 )?;
7923 } else {
7924 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7925 }
7926 }
7927
7928 6 => {
7929 if let Some(rdev) = self.rdev.take() {
7930 ::fidl_next::WireEnvelope::encode_value(
7931 rdev,
7932 preallocated.encoder,
7933 &mut out,
7934 )?;
7935 } else {
7936 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7937 }
7938 }
7939
7940 5 => {
7941 if let Some(gid) = self.gid.take() {
7942 ::fidl_next::WireEnvelope::encode_value(
7943 gid,
7944 preallocated.encoder,
7945 &mut out,
7946 )?;
7947 } else {
7948 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7949 }
7950 }
7951
7952 4 => {
7953 if let Some(uid) = self.uid.take() {
7954 ::fidl_next::WireEnvelope::encode_value(
7955 uid,
7956 preallocated.encoder,
7957 &mut out,
7958 )?;
7959 } else {
7960 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7961 }
7962 }
7963
7964 3 => {
7965 if let Some(mode) = self.mode.take() {
7966 ::fidl_next::WireEnvelope::encode_value(
7967 mode,
7968 preallocated.encoder,
7969 &mut out,
7970 )?;
7971 } else {
7972 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7973 }
7974 }
7975
7976 2 => {
7977 if let Some(modification_time) = self.modification_time.take() {
7978 ::fidl_next::WireEnvelope::encode_value(
7979 modification_time,
7980 preallocated.encoder,
7981 &mut out,
7982 )?;
7983 } else {
7984 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7985 }
7986 }
7987
7988 1 => {
7989 if let Some(creation_time) = self.creation_time.take() {
7990 ::fidl_next::WireEnvelope::encode_value(
7991 creation_time,
7992 preallocated.encoder,
7993 &mut out,
7994 )?;
7995 } else {
7996 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7997 }
7998 }
7999
8000 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8001 }
8002 unsafe {
8003 preallocated.write_next(out.assume_init_ref());
8004 }
8005 }
8006
8007 ::fidl_next::WireTable::encode_len(table, max_ord);
8008
8009 Ok(())
8010 }
8011}
8012
8013unsafe impl<___E> ::fidl_next::EncodeRef<___E> for MutableNodeAttributes
8014where
8015 ___E: ::fidl_next::Encoder + ?Sized,
8016{
8017 #[inline]
8018 fn encode_ref(
8019 &self,
8020 encoder: &mut ___E,
8021 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8022 ) -> Result<(), ::fidl_next::EncodeError> {
8023 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
8024
8025 let max_ord = self.__max_ordinal();
8026
8027 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8028 ::fidl_next::Wire::zero_padding(&mut out);
8029
8030 let mut preallocated =
8031 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8032
8033 for i in 1..=max_ord {
8034 match i {
8035 10 => {
8036 if let Some(wrapping_key_id) = &self.wrapping_key_id {
8037 ::fidl_next::WireEnvelope::encode_value(
8038 wrapping_key_id,
8039 preallocated.encoder,
8040 &mut out,
8041 )?;
8042 } else {
8043 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8044 }
8045 }
8046
8047 9 => {
8048 if let Some(selinux_context) = &self.selinux_context {
8049 ::fidl_next::WireEnvelope::encode_value(
8050 selinux_context,
8051 preallocated.encoder,
8052 &mut out,
8053 )?;
8054 } else {
8055 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8056 }
8057 }
8058
8059 8 => {
8060 if let Some(casefold) = &self.casefold {
8061 ::fidl_next::WireEnvelope::encode_value(
8062 casefold,
8063 preallocated.encoder,
8064 &mut out,
8065 )?;
8066 } else {
8067 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8068 }
8069 }
8070
8071 7 => {
8072 if let Some(access_time) = &self.access_time {
8073 ::fidl_next::WireEnvelope::encode_value(
8074 access_time,
8075 preallocated.encoder,
8076 &mut out,
8077 )?;
8078 } else {
8079 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8080 }
8081 }
8082
8083 6 => {
8084 if let Some(rdev) = &self.rdev {
8085 ::fidl_next::WireEnvelope::encode_value(
8086 rdev,
8087 preallocated.encoder,
8088 &mut out,
8089 )?;
8090 } else {
8091 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8092 }
8093 }
8094
8095 5 => {
8096 if let Some(gid) = &self.gid {
8097 ::fidl_next::WireEnvelope::encode_value(
8098 gid,
8099 preallocated.encoder,
8100 &mut out,
8101 )?;
8102 } else {
8103 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8104 }
8105 }
8106
8107 4 => {
8108 if let Some(uid) = &self.uid {
8109 ::fidl_next::WireEnvelope::encode_value(
8110 uid,
8111 preallocated.encoder,
8112 &mut out,
8113 )?;
8114 } else {
8115 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8116 }
8117 }
8118
8119 3 => {
8120 if let Some(mode) = &self.mode {
8121 ::fidl_next::WireEnvelope::encode_value(
8122 mode,
8123 preallocated.encoder,
8124 &mut out,
8125 )?;
8126 } else {
8127 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8128 }
8129 }
8130
8131 2 => {
8132 if let Some(modification_time) = &self.modification_time {
8133 ::fidl_next::WireEnvelope::encode_value(
8134 modification_time,
8135 preallocated.encoder,
8136 &mut out,
8137 )?;
8138 } else {
8139 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8140 }
8141 }
8142
8143 1 => {
8144 if let Some(creation_time) = &self.creation_time {
8145 ::fidl_next::WireEnvelope::encode_value(
8146 creation_time,
8147 preallocated.encoder,
8148 &mut out,
8149 )?;
8150 } else {
8151 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8152 }
8153 }
8154
8155 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8156 }
8157 unsafe {
8158 preallocated.write_next(out.assume_init_ref());
8159 }
8160 }
8161
8162 ::fidl_next::WireTable::encode_len(table, max_ord);
8163
8164 Ok(())
8165 }
8166}
8167
8168impl<'de> ::fidl_next::FromWire<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
8169 #[inline]
8170 fn from_wire(wire: WireMutableNodeAttributes<'de>) -> Self {
8171 let wire = ::core::mem::ManuallyDrop::new(wire);
8172
8173 let creation_time = wire.table.get(1);
8174
8175 let modification_time = wire.table.get(2);
8176
8177 let mode = wire.table.get(3);
8178
8179 let uid = wire.table.get(4);
8180
8181 let gid = wire.table.get(5);
8182
8183 let rdev = wire.table.get(6);
8184
8185 let access_time = wire.table.get(7);
8186
8187 let casefold = wire.table.get(8);
8188
8189 let selinux_context = wire.table.get(9);
8190
8191 let wrapping_key_id = wire.table.get(10);
8192
8193 Self {
8194 creation_time: creation_time.map(|envelope| {
8195 ::fidl_next::FromWire::from_wire(unsafe {
8196 envelope.read_unchecked::<::fidl_next::WireU64>()
8197 })
8198 }),
8199
8200 modification_time: modification_time.map(|envelope| {
8201 ::fidl_next::FromWire::from_wire(unsafe {
8202 envelope.read_unchecked::<::fidl_next::WireU64>()
8203 })
8204 }),
8205
8206 mode: mode.map(|envelope| {
8207 ::fidl_next::FromWire::from_wire(unsafe {
8208 envelope.read_unchecked::<::fidl_next::WireU32>()
8209 })
8210 }),
8211
8212 uid: uid.map(|envelope| {
8213 ::fidl_next::FromWire::from_wire(unsafe {
8214 envelope.read_unchecked::<::fidl_next::WireU32>()
8215 })
8216 }),
8217
8218 gid: gid.map(|envelope| {
8219 ::fidl_next::FromWire::from_wire(unsafe {
8220 envelope.read_unchecked::<::fidl_next::WireU32>()
8221 })
8222 }),
8223
8224 rdev: rdev.map(|envelope| {
8225 ::fidl_next::FromWire::from_wire(unsafe {
8226 envelope.read_unchecked::<::fidl_next::WireU64>()
8227 })
8228 }),
8229
8230 access_time: access_time.map(|envelope| {
8231 ::fidl_next::FromWire::from_wire(unsafe {
8232 envelope.read_unchecked::<::fidl_next::WireU64>()
8233 })
8234 }),
8235
8236 casefold: casefold.map(|envelope| {
8237 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
8238 }),
8239
8240 selinux_context: selinux_context.map(|envelope| {
8241 ::fidl_next::FromWire::from_wire(unsafe {
8242 envelope.read_unchecked::<crate::WireSelinuxContext<'de>>()
8243 })
8244 }),
8245
8246 wrapping_key_id: wrapping_key_id.map(|envelope| {
8247 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<[u8; 16]>() })
8248 }),
8249 }
8250 }
8251}
8252
8253impl<'de> ::fidl_next::FromWireRef<WireMutableNodeAttributes<'de>> for MutableNodeAttributes {
8254 #[inline]
8255 fn from_wire_ref(wire: &WireMutableNodeAttributes<'de>) -> Self {
8256 Self {
8257 creation_time: wire.table.get(1).map(|envelope| {
8258 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8259 envelope.deref_unchecked::<::fidl_next::WireU64>()
8260 })
8261 }),
8262
8263 modification_time: wire.table.get(2).map(|envelope| {
8264 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8265 envelope.deref_unchecked::<::fidl_next::WireU64>()
8266 })
8267 }),
8268
8269 mode: wire.table.get(3).map(|envelope| {
8270 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8271 envelope.deref_unchecked::<::fidl_next::WireU32>()
8272 })
8273 }),
8274
8275 uid: wire.table.get(4).map(|envelope| {
8276 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8277 envelope.deref_unchecked::<::fidl_next::WireU32>()
8278 })
8279 }),
8280
8281 gid: wire.table.get(5).map(|envelope| {
8282 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8283 envelope.deref_unchecked::<::fidl_next::WireU32>()
8284 })
8285 }),
8286
8287 rdev: wire.table.get(6).map(|envelope| {
8288 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8289 envelope.deref_unchecked::<::fidl_next::WireU64>()
8290 })
8291 }),
8292
8293 access_time: wire.table.get(7).map(|envelope| {
8294 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8295 envelope.deref_unchecked::<::fidl_next::WireU64>()
8296 })
8297 }),
8298
8299 casefold: wire.table.get(8).map(|envelope| {
8300 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8301 envelope.deref_unchecked::<bool>()
8302 })
8303 }),
8304
8305 selinux_context: wire.table.get(9).map(|envelope| {
8306 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8307 envelope.deref_unchecked::<crate::WireSelinuxContext<'de>>()
8308 })
8309 }),
8310
8311 wrapping_key_id: wire.table.get(10).map(|envelope| {
8312 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8313 envelope.deref_unchecked::<[u8; 16]>()
8314 })
8315 }),
8316 }
8317 }
8318}
8319
8320#[repr(C)]
8322pub struct WireMutableNodeAttributes<'de> {
8323 table: ::fidl_next::WireTable<'de>,
8324}
8325
8326impl<'de> Drop for WireMutableNodeAttributes<'de> {
8327 fn drop(&mut self) {
8328 let _ = self
8329 .table
8330 .get(1)
8331 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8332
8333 let _ = self
8334 .table
8335 .get(2)
8336 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8337
8338 let _ = self
8339 .table
8340 .get(3)
8341 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8342
8343 let _ = self
8344 .table
8345 .get(4)
8346 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8347
8348 let _ = self
8349 .table
8350 .get(5)
8351 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
8352
8353 let _ = self
8354 .table
8355 .get(6)
8356 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8357
8358 let _ = self
8359 .table
8360 .get(7)
8361 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
8362
8363 let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
8364
8365 let _ = self
8366 .table
8367 .get(9)
8368 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireSelinuxContext<'de>>() });
8369
8370 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<[u8; 16]>() });
8371 }
8372}
8373
8374unsafe impl ::fidl_next::Wire for WireMutableNodeAttributes<'static> {
8375 type Decoded<'de> = WireMutableNodeAttributes<'de>;
8376
8377 #[inline]
8378 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8379 ::fidl_next::munge!(let Self { table } = out);
8380 ::fidl_next::WireTable::zero_padding(table);
8381 }
8382}
8383
8384unsafe impl<___D> ::fidl_next::Decode<___D> for WireMutableNodeAttributes<'static>
8385where
8386 ___D: ::fidl_next::Decoder + ?Sized,
8387{
8388 fn decode(
8389 slot: ::fidl_next::Slot<'_, Self>,
8390 decoder: &mut ___D,
8391 ) -> Result<(), ::fidl_next::DecodeError> {
8392 ::fidl_next::munge!(let Self { table } = slot);
8393
8394 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8395 match ordinal {
8396 0 => unsafe { ::core::hint::unreachable_unchecked() },
8397
8398 1 => {
8399 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8400 slot.as_mut(),
8401 decoder,
8402 )?;
8403
8404 Ok(())
8405 }
8406
8407 2 => {
8408 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8409 slot.as_mut(),
8410 decoder,
8411 )?;
8412
8413 Ok(())
8414 }
8415
8416 3 => {
8417 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8418 slot.as_mut(),
8419 decoder,
8420 )?;
8421
8422 Ok(())
8423 }
8424
8425 4 => {
8426 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8427 slot.as_mut(),
8428 decoder,
8429 )?;
8430
8431 Ok(())
8432 }
8433
8434 5 => {
8435 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
8436 slot.as_mut(),
8437 decoder,
8438 )?;
8439
8440 Ok(())
8441 }
8442
8443 6 => {
8444 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8445 slot.as_mut(),
8446 decoder,
8447 )?;
8448
8449 Ok(())
8450 }
8451
8452 7 => {
8453 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8454 slot.as_mut(),
8455 decoder,
8456 )?;
8457
8458 Ok(())
8459 }
8460
8461 8 => {
8462 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
8463
8464 Ok(())
8465 }
8466
8467 9 => {
8468 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireSelinuxContext<'static>>(
8469 slot.as_mut(),
8470 decoder,
8471 )?;
8472
8473 Ok(())
8474 }
8475
8476 10 => {
8477 ::fidl_next::WireEnvelope::decode_as::<___D, [u8; 16]>(slot.as_mut(), decoder)?;
8478
8479 Ok(())
8480 }
8481
8482 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8483 }
8484 })
8485 }
8486}
8487
8488impl<'de> WireMutableNodeAttributes<'de> {
8489 pub fn creation_time(&self) -> Option<&::fidl_next::WireU64> {
8490 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8491 }
8492
8493 pub fn modification_time(&self) -> Option<&::fidl_next::WireU64> {
8494 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8495 }
8496
8497 pub fn mode(&self) -> Option<&::fidl_next::WireU32> {
8498 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8499 }
8500
8501 pub fn uid(&self) -> Option<&::fidl_next::WireU32> {
8502 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8503 }
8504
8505 pub fn gid(&self) -> Option<&::fidl_next::WireU32> {
8506 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8507 }
8508
8509 pub fn rdev(&self) -> Option<&::fidl_next::WireU64> {
8510 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8511 }
8512
8513 pub fn access_time(&self) -> Option<&::fidl_next::WireU64> {
8514 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
8515 }
8516
8517 pub fn casefold(&self) -> Option<&bool> {
8518 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
8519 }
8520
8521 pub fn selinux_context(&self) -> Option<&crate::WireSelinuxContext<'de>> {
8522 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
8523 }
8524
8525 pub fn wrapping_key_id(&self) -> Option<&[u8; 16]> {
8526 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
8527 }
8528}
8529
8530impl<'de> ::core::fmt::Debug for WireMutableNodeAttributes<'de> {
8531 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8532 f.debug_struct("MutableNodeAttributes")
8533 .field("creation_time", &self.creation_time())
8534 .field("modification_time", &self.modification_time())
8535 .field("mode", &self.mode())
8536 .field("uid", &self.uid())
8537 .field("gid", &self.gid())
8538 .field("rdev", &self.rdev())
8539 .field("access_time", &self.access_time())
8540 .field("casefold", &self.casefold())
8541 .field("selinux_context", &self.selinux_context())
8542 .field("wrapping_key_id", &self.wrapping_key_id())
8543 .finish()
8544 }
8545}
8546
8547::fidl_next::bitflags! {
8548 #[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(
8549 Clone,
8550 Copy,
8551 Debug,
8552 PartialEq,
8553 Eq,
8554 Hash,
8555 )]
8556 pub struct NodeProtocolKinds: u64 {
8557 #[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;
8558 #[doc = " The directory representation of a node.\n\n The connection will speak the [`Directory`] protocol.\n"]const DIRECTORY = 2;
8559 #[doc = " The file representation of a node.\n\n The connection will speak the [`File`] protocol.\n"]const FILE = 4;
8560 #[doc = " The symlink representation of a node.\n\n The connection will speak the [`Symlink`] protocol.\n"]const SYMLINK = 8;
8561 const _ = !0;
8562 }
8563}
8564
8565impl ::fidl_next::Encodable for NodeProtocolKinds {
8566 type Encoded = WireNodeProtocolKinds;
8567}
8568
8569unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProtocolKinds
8570where
8571 ___E: ?Sized,
8572{
8573 #[inline]
8574 fn encode(
8575 self,
8576 encoder: &mut ___E,
8577 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8578 ) -> Result<(), ::fidl_next::EncodeError> {
8579 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8580 }
8581}
8582
8583unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProtocolKinds
8584where
8585 ___E: ?Sized,
8586{
8587 #[inline]
8588 fn encode_ref(
8589 &self,
8590 _: &mut ___E,
8591 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8592 ) -> Result<(), ::fidl_next::EncodeError> {
8593 ::fidl_next::munge!(let WireNodeProtocolKinds { value } = out);
8594 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
8595 Ok(())
8596 }
8597}
8598
8599impl ::core::convert::From<WireNodeProtocolKinds> for NodeProtocolKinds {
8600 fn from(wire: WireNodeProtocolKinds) -> Self {
8601 Self::from_bits_retain(u64::from(wire.value))
8602 }
8603}
8604
8605impl ::fidl_next::FromWire<WireNodeProtocolKinds> for NodeProtocolKinds {
8606 #[inline]
8607 fn from_wire(wire: WireNodeProtocolKinds) -> Self {
8608 Self::from(wire)
8609 }
8610}
8611
8612impl ::fidl_next::FromWireRef<WireNodeProtocolKinds> for NodeProtocolKinds {
8613 #[inline]
8614 fn from_wire_ref(wire: &WireNodeProtocolKinds) -> Self {
8615 Self::from(*wire)
8616 }
8617}
8618
8619#[derive(Clone, Copy, Debug)]
8621#[repr(transparent)]
8622pub struct WireNodeProtocolKinds {
8623 value: ::fidl_next::WireU64,
8624}
8625
8626unsafe impl ::fidl_next::Wire for WireNodeProtocolKinds {
8627 type Decoded<'de> = Self;
8628
8629 #[inline]
8630 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8631 }
8633}
8634
8635unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProtocolKinds
8636where
8637 ___D: ?Sized,
8638{
8639 fn decode(
8640 slot: ::fidl_next::Slot<'_, Self>,
8641 _: &mut ___D,
8642 ) -> Result<(), ::fidl_next::DecodeError> {
8643 Ok(())
8644 }
8645}
8646
8647impl ::core::convert::From<NodeProtocolKinds> for WireNodeProtocolKinds {
8648 fn from(natural: NodeProtocolKinds) -> Self {
8649 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
8650 }
8651}
8652
8653#[doc = " Denotes which hash algorithm is used to build the merkle tree for\n fsverity-enabled files.\n"]
8654#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8655#[repr(u8)]
8656pub enum HashAlgorithm {
8657 Sha256 = 1,
8658 Sha512 = 2,
8659 UnknownOrdinal_(u8),
8660}
8661
8662impl ::fidl_next::Encodable for HashAlgorithm {
8663 type Encoded = WireHashAlgorithm;
8664}
8665impl ::std::convert::From<u8> for HashAlgorithm {
8666 fn from(value: u8) -> Self {
8667 match value {
8668 1 => Self::Sha256,
8669 2 => Self::Sha512,
8670
8671 _ => Self::UnknownOrdinal_(value),
8672 }
8673 }
8674}
8675
8676unsafe impl<___E> ::fidl_next::Encode<___E> for HashAlgorithm
8677where
8678 ___E: ?Sized,
8679{
8680 #[inline]
8681 fn encode(
8682 self,
8683 encoder: &mut ___E,
8684 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8685 ) -> Result<(), ::fidl_next::EncodeError> {
8686 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8687 }
8688}
8689
8690unsafe impl<___E> ::fidl_next::EncodeRef<___E> for HashAlgorithm
8691where
8692 ___E: ?Sized,
8693{
8694 #[inline]
8695 fn encode_ref(
8696 &self,
8697 encoder: &mut ___E,
8698 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8699 ) -> Result<(), ::fidl_next::EncodeError> {
8700 ::fidl_next::munge!(let WireHashAlgorithm { value } = out);
8701 let _ = value.write(u8::from(match *self {
8702 Self::Sha256 => 1,
8703
8704 Self::Sha512 => 2,
8705
8706 Self::UnknownOrdinal_(value) => value,
8707 }));
8708
8709 Ok(())
8710 }
8711}
8712
8713impl ::core::convert::From<WireHashAlgorithm> for HashAlgorithm {
8714 fn from(wire: WireHashAlgorithm) -> Self {
8715 match u8::from(wire.value) {
8716 1 => Self::Sha256,
8717
8718 2 => Self::Sha512,
8719
8720 value => Self::UnknownOrdinal_(value),
8721 }
8722 }
8723}
8724
8725impl ::fidl_next::FromWire<WireHashAlgorithm> for HashAlgorithm {
8726 #[inline]
8727 fn from_wire(wire: WireHashAlgorithm) -> Self {
8728 Self::from(wire)
8729 }
8730}
8731
8732impl ::fidl_next::FromWireRef<WireHashAlgorithm> for HashAlgorithm {
8733 #[inline]
8734 fn from_wire_ref(wire: &WireHashAlgorithm) -> Self {
8735 Self::from(*wire)
8736 }
8737}
8738
8739#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8741#[repr(transparent)]
8742pub struct WireHashAlgorithm {
8743 value: u8,
8744}
8745
8746unsafe impl ::fidl_next::Wire for WireHashAlgorithm {
8747 type Decoded<'de> = Self;
8748
8749 #[inline]
8750 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8751 }
8753}
8754
8755impl WireHashAlgorithm {
8756 pub const SHA256: WireHashAlgorithm = WireHashAlgorithm { value: 1 };
8757
8758 pub const SHA512: WireHashAlgorithm = WireHashAlgorithm { value: 2 };
8759}
8760
8761unsafe impl<___D> ::fidl_next::Decode<___D> for WireHashAlgorithm
8762where
8763 ___D: ?Sized,
8764{
8765 fn decode(
8766 slot: ::fidl_next::Slot<'_, Self>,
8767 _: &mut ___D,
8768 ) -> Result<(), ::fidl_next::DecodeError> {
8769 Ok(())
8770 }
8771}
8772
8773impl ::core::convert::From<HashAlgorithm> for WireHashAlgorithm {
8774 fn from(natural: HashAlgorithm) -> Self {
8775 match natural {
8776 HashAlgorithm::Sha256 => WireHashAlgorithm::SHA256,
8777
8778 HashAlgorithm::Sha512 => WireHashAlgorithm::SHA512,
8779
8780 HashAlgorithm::UnknownOrdinal_(value) => WireHashAlgorithm { value: u8::from(value) },
8781 }
8782 }
8783}
8784
8785#[doc = " Set of options used to enable verity on a file.\n"]
8786#[derive(Clone, Debug, Default)]
8787pub struct VerificationOptions {
8788 pub hash_algorithm: Option<crate::HashAlgorithm>,
8789
8790 pub salt: Option<Vec<u8>>,
8791}
8792
8793impl VerificationOptions {
8794 fn __max_ordinal(&self) -> usize {
8795 if self.salt.is_some() {
8796 return 2;
8797 }
8798
8799 if self.hash_algorithm.is_some() {
8800 return 1;
8801 }
8802
8803 0
8804 }
8805}
8806
8807impl ::fidl_next::Encodable for VerificationOptions {
8808 type Encoded = WireVerificationOptions<'static>;
8809}
8810
8811unsafe impl<___E> ::fidl_next::Encode<___E> for VerificationOptions
8812where
8813 ___E: ::fidl_next::Encoder + ?Sized,
8814{
8815 #[inline]
8816 fn encode(
8817 mut self,
8818 encoder: &mut ___E,
8819 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8820 ) -> Result<(), ::fidl_next::EncodeError> {
8821 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
8822
8823 let max_ord = self.__max_ordinal();
8824
8825 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8826 ::fidl_next::Wire::zero_padding(&mut out);
8827
8828 let mut preallocated =
8829 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8830
8831 for i in 1..=max_ord {
8832 match i {
8833 2 => {
8834 if let Some(salt) = self.salt.take() {
8835 ::fidl_next::WireEnvelope::encode_value(
8836 salt,
8837 preallocated.encoder,
8838 &mut out,
8839 )?;
8840 } else {
8841 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8842 }
8843 }
8844
8845 1 => {
8846 if let Some(hash_algorithm) = self.hash_algorithm.take() {
8847 ::fidl_next::WireEnvelope::encode_value(
8848 hash_algorithm,
8849 preallocated.encoder,
8850 &mut out,
8851 )?;
8852 } else {
8853 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8854 }
8855 }
8856
8857 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8858 }
8859 unsafe {
8860 preallocated.write_next(out.assume_init_ref());
8861 }
8862 }
8863
8864 ::fidl_next::WireTable::encode_len(table, max_ord);
8865
8866 Ok(())
8867 }
8868}
8869
8870unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VerificationOptions
8871where
8872 ___E: ::fidl_next::Encoder + ?Sized,
8873{
8874 #[inline]
8875 fn encode_ref(
8876 &self,
8877 encoder: &mut ___E,
8878 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8879 ) -> Result<(), ::fidl_next::EncodeError> {
8880 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
8881
8882 let max_ord = self.__max_ordinal();
8883
8884 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8885 ::fidl_next::Wire::zero_padding(&mut out);
8886
8887 let mut preallocated =
8888 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8889
8890 for i in 1..=max_ord {
8891 match i {
8892 2 => {
8893 if let Some(salt) = &self.salt {
8894 ::fidl_next::WireEnvelope::encode_value(
8895 salt,
8896 preallocated.encoder,
8897 &mut out,
8898 )?;
8899 } else {
8900 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8901 }
8902 }
8903
8904 1 => {
8905 if let Some(hash_algorithm) = &self.hash_algorithm {
8906 ::fidl_next::WireEnvelope::encode_value(
8907 hash_algorithm,
8908 preallocated.encoder,
8909 &mut out,
8910 )?;
8911 } else {
8912 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8913 }
8914 }
8915
8916 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8917 }
8918 unsafe {
8919 preallocated.write_next(out.assume_init_ref());
8920 }
8921 }
8922
8923 ::fidl_next::WireTable::encode_len(table, max_ord);
8924
8925 Ok(())
8926 }
8927}
8928
8929impl<'de> ::fidl_next::FromWire<WireVerificationOptions<'de>> for VerificationOptions {
8930 #[inline]
8931 fn from_wire(wire: WireVerificationOptions<'de>) -> Self {
8932 let wire = ::core::mem::ManuallyDrop::new(wire);
8933
8934 let hash_algorithm = wire.table.get(1);
8935
8936 let salt = wire.table.get(2);
8937
8938 Self {
8939 hash_algorithm: hash_algorithm.map(|envelope| {
8940 ::fidl_next::FromWire::from_wire(unsafe {
8941 envelope.read_unchecked::<crate::WireHashAlgorithm>()
8942 })
8943 }),
8944
8945 salt: salt.map(|envelope| {
8946 ::fidl_next::FromWire::from_wire(unsafe {
8947 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
8948 })
8949 }),
8950 }
8951 }
8952}
8953
8954impl<'de> ::fidl_next::FromWireRef<WireVerificationOptions<'de>> for VerificationOptions {
8955 #[inline]
8956 fn from_wire_ref(wire: &WireVerificationOptions<'de>) -> Self {
8957 Self {
8958 hash_algorithm: wire.table.get(1).map(|envelope| {
8959 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8960 envelope.deref_unchecked::<crate::WireHashAlgorithm>()
8961 })
8962 }),
8963
8964 salt: wire.table.get(2).map(|envelope| {
8965 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8966 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
8967 })
8968 }),
8969 }
8970 }
8971}
8972
8973#[repr(C)]
8975pub struct WireVerificationOptions<'de> {
8976 table: ::fidl_next::WireTable<'de>,
8977}
8978
8979impl<'de> Drop for WireVerificationOptions<'de> {
8980 fn drop(&mut self) {
8981 let _ = self
8982 .table
8983 .get(1)
8984 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireHashAlgorithm>() });
8985
8986 let _ = self.table.get(2).map(|envelope| unsafe {
8987 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
8988 });
8989 }
8990}
8991
8992unsafe impl ::fidl_next::Wire for WireVerificationOptions<'static> {
8993 type Decoded<'de> = WireVerificationOptions<'de>;
8994
8995 #[inline]
8996 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8997 ::fidl_next::munge!(let Self { table } = out);
8998 ::fidl_next::WireTable::zero_padding(table);
8999 }
9000}
9001
9002unsafe impl<___D> ::fidl_next::Decode<___D> for WireVerificationOptions<'static>
9003where
9004 ___D: ::fidl_next::Decoder + ?Sized,
9005{
9006 fn decode(
9007 slot: ::fidl_next::Slot<'_, Self>,
9008 decoder: &mut ___D,
9009 ) -> Result<(), ::fidl_next::DecodeError> {
9010 ::fidl_next::munge!(let Self { table } = slot);
9011
9012 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9013 match ordinal {
9014 0 => unsafe { ::core::hint::unreachable_unchecked() },
9015
9016 1 => {
9017 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireHashAlgorithm>(
9018 slot.as_mut(),
9019 decoder,
9020 )?;
9021
9022 Ok(())
9023 }
9024
9025 2 => {
9026 ::fidl_next::WireEnvelope::decode_as::<
9027 ___D,
9028 ::fidl_next::WireVector<'static, u8>,
9029 >(slot.as_mut(), decoder)?;
9030
9031 let salt = unsafe {
9032 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
9033 };
9034
9035 if salt.len() > 32 {
9036 return Err(::fidl_next::DecodeError::VectorTooLong {
9037 size: salt.len() as u64,
9038 limit: 32,
9039 });
9040 }
9041
9042 Ok(())
9043 }
9044
9045 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9046 }
9047 })
9048 }
9049}
9050
9051impl<'de> WireVerificationOptions<'de> {
9052 pub fn hash_algorithm(&self) -> Option<&crate::WireHashAlgorithm> {
9053 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9054 }
9055
9056 pub fn salt(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
9057 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9058 }
9059}
9060
9061impl<'de> ::core::fmt::Debug for WireVerificationOptions<'de> {
9062 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9063 f.debug_struct("VerificationOptions")
9064 .field("hash_algorithm", &self.hash_algorithm())
9065 .field("salt", &self.salt())
9066 .finish()
9067 }
9068}
9069
9070#[derive(Clone, Debug, Default)]
9071pub struct ImmutableNodeAttributes {
9072 pub protocols: Option<crate::NodeProtocolKinds>,
9073
9074 pub abilities: Option<crate::Operations>,
9075
9076 pub content_size: Option<u64>,
9077
9078 pub storage_size: Option<u64>,
9079
9080 pub link_count: Option<u64>,
9081
9082 pub id: Option<u64>,
9083
9084 pub change_time: Option<u64>,
9085
9086 pub options: Option<crate::VerificationOptions>,
9087
9088 pub root_hash: Option<Vec<u8>>,
9089
9090 pub verity_enabled: Option<bool>,
9091}
9092
9093impl ImmutableNodeAttributes {
9094 fn __max_ordinal(&self) -> usize {
9095 if self.verity_enabled.is_some() {
9096 return 10;
9097 }
9098
9099 if self.root_hash.is_some() {
9100 return 9;
9101 }
9102
9103 if self.options.is_some() {
9104 return 8;
9105 }
9106
9107 if self.change_time.is_some() {
9108 return 7;
9109 }
9110
9111 if self.id.is_some() {
9112 return 6;
9113 }
9114
9115 if self.link_count.is_some() {
9116 return 5;
9117 }
9118
9119 if self.storage_size.is_some() {
9120 return 4;
9121 }
9122
9123 if self.content_size.is_some() {
9124 return 3;
9125 }
9126
9127 if self.abilities.is_some() {
9128 return 2;
9129 }
9130
9131 if self.protocols.is_some() {
9132 return 1;
9133 }
9134
9135 0
9136 }
9137}
9138
9139impl ::fidl_next::Encodable for ImmutableNodeAttributes {
9140 type Encoded = WireImmutableNodeAttributes<'static>;
9141}
9142
9143unsafe impl<___E> ::fidl_next::Encode<___E> for ImmutableNodeAttributes
9144where
9145 ___E: ::fidl_next::Encoder + ?Sized,
9146{
9147 #[inline]
9148 fn encode(
9149 mut self,
9150 encoder: &mut ___E,
9151 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9152 ) -> Result<(), ::fidl_next::EncodeError> {
9153 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
9154
9155 let max_ord = self.__max_ordinal();
9156
9157 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9158 ::fidl_next::Wire::zero_padding(&mut out);
9159
9160 let mut preallocated =
9161 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9162
9163 for i in 1..=max_ord {
9164 match i {
9165 10 => {
9166 if let Some(verity_enabled) = self.verity_enabled.take() {
9167 ::fidl_next::WireEnvelope::encode_value(
9168 verity_enabled,
9169 preallocated.encoder,
9170 &mut out,
9171 )?;
9172 } else {
9173 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9174 }
9175 }
9176
9177 9 => {
9178 if let Some(root_hash) = self.root_hash.take() {
9179 ::fidl_next::WireEnvelope::encode_value(
9180 root_hash,
9181 preallocated.encoder,
9182 &mut out,
9183 )?;
9184 } else {
9185 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9186 }
9187 }
9188
9189 8 => {
9190 if let Some(options) = self.options.take() {
9191 ::fidl_next::WireEnvelope::encode_value(
9192 options,
9193 preallocated.encoder,
9194 &mut out,
9195 )?;
9196 } else {
9197 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9198 }
9199 }
9200
9201 7 => {
9202 if let Some(change_time) = self.change_time.take() {
9203 ::fidl_next::WireEnvelope::encode_value(
9204 change_time,
9205 preallocated.encoder,
9206 &mut out,
9207 )?;
9208 } else {
9209 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9210 }
9211 }
9212
9213 6 => {
9214 if let Some(id) = self.id.take() {
9215 ::fidl_next::WireEnvelope::encode_value(
9216 id,
9217 preallocated.encoder,
9218 &mut out,
9219 )?;
9220 } else {
9221 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9222 }
9223 }
9224
9225 5 => {
9226 if let Some(link_count) = self.link_count.take() {
9227 ::fidl_next::WireEnvelope::encode_value(
9228 link_count,
9229 preallocated.encoder,
9230 &mut out,
9231 )?;
9232 } else {
9233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9234 }
9235 }
9236
9237 4 => {
9238 if let Some(storage_size) = self.storage_size.take() {
9239 ::fidl_next::WireEnvelope::encode_value(
9240 storage_size,
9241 preallocated.encoder,
9242 &mut out,
9243 )?;
9244 } else {
9245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9246 }
9247 }
9248
9249 3 => {
9250 if let Some(content_size) = self.content_size.take() {
9251 ::fidl_next::WireEnvelope::encode_value(
9252 content_size,
9253 preallocated.encoder,
9254 &mut out,
9255 )?;
9256 } else {
9257 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9258 }
9259 }
9260
9261 2 => {
9262 if let Some(abilities) = self.abilities.take() {
9263 ::fidl_next::WireEnvelope::encode_value(
9264 abilities,
9265 preallocated.encoder,
9266 &mut out,
9267 )?;
9268 } else {
9269 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9270 }
9271 }
9272
9273 1 => {
9274 if let Some(protocols) = self.protocols.take() {
9275 ::fidl_next::WireEnvelope::encode_value(
9276 protocols,
9277 preallocated.encoder,
9278 &mut out,
9279 )?;
9280 } else {
9281 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9282 }
9283 }
9284
9285 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9286 }
9287 unsafe {
9288 preallocated.write_next(out.assume_init_ref());
9289 }
9290 }
9291
9292 ::fidl_next::WireTable::encode_len(table, max_ord);
9293
9294 Ok(())
9295 }
9296}
9297
9298unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ImmutableNodeAttributes
9299where
9300 ___E: ::fidl_next::Encoder + ?Sized,
9301{
9302 #[inline]
9303 fn encode_ref(
9304 &self,
9305 encoder: &mut ___E,
9306 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9307 ) -> Result<(), ::fidl_next::EncodeError> {
9308 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
9309
9310 let max_ord = self.__max_ordinal();
9311
9312 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9313 ::fidl_next::Wire::zero_padding(&mut out);
9314
9315 let mut preallocated =
9316 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9317
9318 for i in 1..=max_ord {
9319 match i {
9320 10 => {
9321 if let Some(verity_enabled) = &self.verity_enabled {
9322 ::fidl_next::WireEnvelope::encode_value(
9323 verity_enabled,
9324 preallocated.encoder,
9325 &mut out,
9326 )?;
9327 } else {
9328 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9329 }
9330 }
9331
9332 9 => {
9333 if let Some(root_hash) = &self.root_hash {
9334 ::fidl_next::WireEnvelope::encode_value(
9335 root_hash,
9336 preallocated.encoder,
9337 &mut out,
9338 )?;
9339 } else {
9340 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9341 }
9342 }
9343
9344 8 => {
9345 if let Some(options) = &self.options {
9346 ::fidl_next::WireEnvelope::encode_value(
9347 options,
9348 preallocated.encoder,
9349 &mut out,
9350 )?;
9351 } else {
9352 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9353 }
9354 }
9355
9356 7 => {
9357 if let Some(change_time) = &self.change_time {
9358 ::fidl_next::WireEnvelope::encode_value(
9359 change_time,
9360 preallocated.encoder,
9361 &mut out,
9362 )?;
9363 } else {
9364 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9365 }
9366 }
9367
9368 6 => {
9369 if let Some(id) = &self.id {
9370 ::fidl_next::WireEnvelope::encode_value(
9371 id,
9372 preallocated.encoder,
9373 &mut out,
9374 )?;
9375 } else {
9376 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9377 }
9378 }
9379
9380 5 => {
9381 if let Some(link_count) = &self.link_count {
9382 ::fidl_next::WireEnvelope::encode_value(
9383 link_count,
9384 preallocated.encoder,
9385 &mut out,
9386 )?;
9387 } else {
9388 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9389 }
9390 }
9391
9392 4 => {
9393 if let Some(storage_size) = &self.storage_size {
9394 ::fidl_next::WireEnvelope::encode_value(
9395 storage_size,
9396 preallocated.encoder,
9397 &mut out,
9398 )?;
9399 } else {
9400 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9401 }
9402 }
9403
9404 3 => {
9405 if let Some(content_size) = &self.content_size {
9406 ::fidl_next::WireEnvelope::encode_value(
9407 content_size,
9408 preallocated.encoder,
9409 &mut out,
9410 )?;
9411 } else {
9412 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9413 }
9414 }
9415
9416 2 => {
9417 if let Some(abilities) = &self.abilities {
9418 ::fidl_next::WireEnvelope::encode_value(
9419 abilities,
9420 preallocated.encoder,
9421 &mut out,
9422 )?;
9423 } else {
9424 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9425 }
9426 }
9427
9428 1 => {
9429 if let Some(protocols) = &self.protocols {
9430 ::fidl_next::WireEnvelope::encode_value(
9431 protocols,
9432 preallocated.encoder,
9433 &mut out,
9434 )?;
9435 } else {
9436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9437 }
9438 }
9439
9440 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9441 }
9442 unsafe {
9443 preallocated.write_next(out.assume_init_ref());
9444 }
9445 }
9446
9447 ::fidl_next::WireTable::encode_len(table, max_ord);
9448
9449 Ok(())
9450 }
9451}
9452
9453impl<'de> ::fidl_next::FromWire<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
9454 #[inline]
9455 fn from_wire(wire: WireImmutableNodeAttributes<'de>) -> Self {
9456 let wire = ::core::mem::ManuallyDrop::new(wire);
9457
9458 let protocols = wire.table.get(1);
9459
9460 let abilities = wire.table.get(2);
9461
9462 let content_size = wire.table.get(3);
9463
9464 let storage_size = wire.table.get(4);
9465
9466 let link_count = wire.table.get(5);
9467
9468 let id = wire.table.get(6);
9469
9470 let change_time = wire.table.get(7);
9471
9472 let options = wire.table.get(8);
9473
9474 let root_hash = wire.table.get(9);
9475
9476 let verity_enabled = wire.table.get(10);
9477
9478 Self {
9479 protocols: protocols.map(|envelope| {
9480 ::fidl_next::FromWire::from_wire(unsafe {
9481 envelope.read_unchecked::<crate::WireNodeProtocolKinds>()
9482 })
9483 }),
9484
9485 abilities: abilities.map(|envelope| {
9486 ::fidl_next::FromWire::from_wire(unsafe {
9487 envelope.read_unchecked::<crate::WireOperations>()
9488 })
9489 }),
9490
9491 content_size: content_size.map(|envelope| {
9492 ::fidl_next::FromWire::from_wire(unsafe {
9493 envelope.read_unchecked::<::fidl_next::WireU64>()
9494 })
9495 }),
9496
9497 storage_size: storage_size.map(|envelope| {
9498 ::fidl_next::FromWire::from_wire(unsafe {
9499 envelope.read_unchecked::<::fidl_next::WireU64>()
9500 })
9501 }),
9502
9503 link_count: link_count.map(|envelope| {
9504 ::fidl_next::FromWire::from_wire(unsafe {
9505 envelope.read_unchecked::<::fidl_next::WireU64>()
9506 })
9507 }),
9508
9509 id: id.map(|envelope| {
9510 ::fidl_next::FromWire::from_wire(unsafe {
9511 envelope.read_unchecked::<::fidl_next::WireU64>()
9512 })
9513 }),
9514
9515 change_time: change_time.map(|envelope| {
9516 ::fidl_next::FromWire::from_wire(unsafe {
9517 envelope.read_unchecked::<::fidl_next::WireU64>()
9518 })
9519 }),
9520
9521 options: options.map(|envelope| {
9522 ::fidl_next::FromWire::from_wire(unsafe {
9523 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
9524 })
9525 }),
9526
9527 root_hash: root_hash.map(|envelope| {
9528 ::fidl_next::FromWire::from_wire(unsafe {
9529 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9530 })
9531 }),
9532
9533 verity_enabled: verity_enabled.map(|envelope| {
9534 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
9535 }),
9536 }
9537 }
9538}
9539
9540impl<'de> ::fidl_next::FromWireRef<WireImmutableNodeAttributes<'de>> for ImmutableNodeAttributes {
9541 #[inline]
9542 fn from_wire_ref(wire: &WireImmutableNodeAttributes<'de>) -> Self {
9543 Self {
9544 protocols: wire.table.get(1).map(|envelope| {
9545 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9546 envelope.deref_unchecked::<crate::WireNodeProtocolKinds>()
9547 })
9548 }),
9549
9550 abilities: wire.table.get(2).map(|envelope| {
9551 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9552 envelope.deref_unchecked::<crate::WireOperations>()
9553 })
9554 }),
9555
9556 content_size: wire.table.get(3).map(|envelope| {
9557 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9558 envelope.deref_unchecked::<::fidl_next::WireU64>()
9559 })
9560 }),
9561
9562 storage_size: wire.table.get(4).map(|envelope| {
9563 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9564 envelope.deref_unchecked::<::fidl_next::WireU64>()
9565 })
9566 }),
9567
9568 link_count: wire.table.get(5).map(|envelope| {
9569 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9570 envelope.deref_unchecked::<::fidl_next::WireU64>()
9571 })
9572 }),
9573
9574 id: wire.table.get(6).map(|envelope| {
9575 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9576 envelope.deref_unchecked::<::fidl_next::WireU64>()
9577 })
9578 }),
9579
9580 change_time: wire.table.get(7).map(|envelope| {
9581 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9582 envelope.deref_unchecked::<::fidl_next::WireU64>()
9583 })
9584 }),
9585
9586 options: wire.table.get(8).map(|envelope| {
9587 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9588 envelope.deref_unchecked::<crate::WireVerificationOptions<'de>>()
9589 })
9590 }),
9591
9592 root_hash: wire.table.get(9).map(|envelope| {
9593 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9594 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
9595 })
9596 }),
9597
9598 verity_enabled: wire.table.get(10).map(|envelope| {
9599 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9600 envelope.deref_unchecked::<bool>()
9601 })
9602 }),
9603 }
9604 }
9605}
9606
9607#[repr(C)]
9609pub struct WireImmutableNodeAttributes<'de> {
9610 table: ::fidl_next::WireTable<'de>,
9611}
9612
9613impl<'de> Drop for WireImmutableNodeAttributes<'de> {
9614 fn drop(&mut self) {
9615 let _ = self
9616 .table
9617 .get(1)
9618 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeProtocolKinds>() });
9619
9620 let _ = self
9621 .table
9622 .get(2)
9623 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOperations>() });
9624
9625 let _ = self
9626 .table
9627 .get(3)
9628 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9629
9630 let _ = self
9631 .table
9632 .get(4)
9633 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9634
9635 let _ = self
9636 .table
9637 .get(5)
9638 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9639
9640 let _ = self
9641 .table
9642 .get(6)
9643 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9644
9645 let _ = self
9646 .table
9647 .get(7)
9648 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
9649
9650 let _ = self.table.get(8).map(|envelope| unsafe {
9651 envelope.read_unchecked::<crate::WireVerificationOptions<'de>>()
9652 });
9653
9654 let _ = self.table.get(9).map(|envelope| unsafe {
9655 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
9656 });
9657
9658 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9659 }
9660}
9661
9662unsafe impl ::fidl_next::Wire for WireImmutableNodeAttributes<'static> {
9663 type Decoded<'de> = WireImmutableNodeAttributes<'de>;
9664
9665 #[inline]
9666 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9667 ::fidl_next::munge!(let Self { table } = out);
9668 ::fidl_next::WireTable::zero_padding(table);
9669 }
9670}
9671
9672unsafe impl<___D> ::fidl_next::Decode<___D> for WireImmutableNodeAttributes<'static>
9673where
9674 ___D: ::fidl_next::Decoder + ?Sized,
9675{
9676 fn decode(
9677 slot: ::fidl_next::Slot<'_, Self>,
9678 decoder: &mut ___D,
9679 ) -> Result<(), ::fidl_next::DecodeError> {
9680 ::fidl_next::munge!(let Self { table } = slot);
9681
9682 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9683 match ordinal {
9684 0 => unsafe { ::core::hint::unreachable_unchecked() },
9685
9686 1 => {
9687 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeProtocolKinds>(
9688 slot.as_mut(),
9689 decoder,
9690 )?;
9691
9692 Ok(())
9693 }
9694
9695 2 => {
9696 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
9697 slot.as_mut(),
9698 decoder,
9699 )?;
9700
9701 Ok(())
9702 }
9703
9704 3 => {
9705 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9706 slot.as_mut(),
9707 decoder,
9708 )?;
9709
9710 Ok(())
9711 }
9712
9713 4 => {
9714 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9715 slot.as_mut(),
9716 decoder,
9717 )?;
9718
9719 Ok(())
9720 }
9721
9722 5 => {
9723 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9724 slot.as_mut(),
9725 decoder,
9726 )?;
9727
9728 Ok(())
9729 }
9730
9731 6 => {
9732 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9733 slot.as_mut(),
9734 decoder,
9735 )?;
9736
9737 Ok(())
9738 }
9739
9740 7 => {
9741 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
9742 slot.as_mut(),
9743 decoder,
9744 )?;
9745
9746 Ok(())
9747 }
9748
9749 8 => {
9750 ::fidl_next::WireEnvelope::decode_as::<
9751 ___D,
9752 crate::WireVerificationOptions<'static>,
9753 >(slot.as_mut(), decoder)?;
9754
9755 Ok(())
9756 }
9757
9758 9 => {
9759 ::fidl_next::WireEnvelope::decode_as::<
9760 ___D,
9761 ::fidl_next::WireVector<'static, u8>,
9762 >(slot.as_mut(), decoder)?;
9763
9764 let root_hash = unsafe {
9765 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
9766 };
9767
9768 if root_hash.len() > 64 {
9769 return Err(::fidl_next::DecodeError::VectorTooLong {
9770 size: root_hash.len() as u64,
9771 limit: 64,
9772 });
9773 }
9774
9775 Ok(())
9776 }
9777
9778 10 => {
9779 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9780
9781 Ok(())
9782 }
9783
9784 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9785 }
9786 })
9787 }
9788}
9789
9790impl<'de> WireImmutableNodeAttributes<'de> {
9791 pub fn protocols(&self) -> Option<&crate::WireNodeProtocolKinds> {
9792 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9793 }
9794
9795 pub fn abilities(&self) -> Option<&crate::WireOperations> {
9796 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9797 }
9798
9799 pub fn content_size(&self) -> Option<&::fidl_next::WireU64> {
9800 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9801 }
9802
9803 pub fn storage_size(&self) -> Option<&::fidl_next::WireU64> {
9804 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9805 }
9806
9807 pub fn link_count(&self) -> Option<&::fidl_next::WireU64> {
9808 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9809 }
9810
9811 pub fn id(&self) -> Option<&::fidl_next::WireU64> {
9812 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9813 }
9814
9815 pub fn change_time(&self) -> Option<&::fidl_next::WireU64> {
9816 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9817 }
9818
9819 pub fn options(&self) -> Option<&crate::WireVerificationOptions<'de>> {
9820 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9821 }
9822
9823 pub fn root_hash(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
9824 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
9825 }
9826
9827 pub fn verity_enabled(&self) -> Option<&bool> {
9828 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
9829 }
9830}
9831
9832impl<'de> ::core::fmt::Debug for WireImmutableNodeAttributes<'de> {
9833 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9834 f.debug_struct("ImmutableNodeAttributes")
9835 .field("protocols", &self.protocols())
9836 .field("abilities", &self.abilities())
9837 .field("content_size", &self.content_size())
9838 .field("storage_size", &self.storage_size())
9839 .field("link_count", &self.link_count())
9840 .field("id", &self.id())
9841 .field("change_time", &self.change_time())
9842 .field("options", &self.options())
9843 .field("root_hash", &self.root_hash())
9844 .field("verity_enabled", &self.verity_enabled())
9845 .finish()
9846 }
9847}
9848
9849#[derive(Clone, Debug)]
9850pub struct NodeAttributes2 {
9851 pub mutable_attributes: crate::MutableNodeAttributes,
9852
9853 pub immutable_attributes: crate::ImmutableNodeAttributes,
9854}
9855
9856impl ::fidl_next::Encodable for NodeAttributes2 {
9857 type Encoded = WireNodeAttributes2<'static>;
9858}
9859
9860unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes2
9861where
9862 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9863 ___E: ::fidl_next::Encoder,
9864{
9865 #[inline]
9866 fn encode(
9867 self,
9868 encoder: &mut ___E,
9869 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9870 ) -> Result<(), ::fidl_next::EncodeError> {
9871 ::fidl_next::munge! {
9872 let Self::Encoded {
9873 mutable_attributes,
9874 immutable_attributes,
9875
9876 } = out;
9877 }
9878
9879 ::fidl_next::Encode::encode(self.mutable_attributes, encoder, mutable_attributes)?;
9880
9881 ::fidl_next::Encode::encode(self.immutable_attributes, encoder, immutable_attributes)?;
9882
9883 Ok(())
9884 }
9885}
9886
9887unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes2
9888where
9889 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9890 ___E: ::fidl_next::Encoder,
9891{
9892 #[inline]
9893 fn encode_ref(
9894 &self,
9895 encoder: &mut ___E,
9896 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9897 ) -> Result<(), ::fidl_next::EncodeError> {
9898 ::fidl_next::munge! {
9899 let Self::Encoded {
9900 mutable_attributes,
9901 immutable_attributes,
9902
9903 } = out;
9904 }
9905
9906 ::fidl_next::EncodeRef::encode_ref(&self.mutable_attributes, encoder, mutable_attributes)?;
9907
9908 ::fidl_next::EncodeRef::encode_ref(
9909 &self.immutable_attributes,
9910 encoder,
9911 immutable_attributes,
9912 )?;
9913
9914 Ok(())
9915 }
9916}
9917
9918impl ::fidl_next::EncodableOption for NodeAttributes2 {
9919 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeAttributes2<'static>>;
9920}
9921
9922unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeAttributes2
9923where
9924 ___E: ::fidl_next::Encoder + ?Sized,
9925 NodeAttributes2: ::fidl_next::Encode<___E>,
9926{
9927 #[inline]
9928 fn encode_option(
9929 this: Option<Self>,
9930 encoder: &mut ___E,
9931 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9932 ) -> Result<(), ::fidl_next::EncodeError> {
9933 if let Some(inner) = this {
9934 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9935 ::fidl_next::WireBox::encode_present(out);
9936 } else {
9937 ::fidl_next::WireBox::encode_absent(out);
9938 }
9939
9940 Ok(())
9941 }
9942}
9943
9944unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeAttributes2
9945where
9946 ___E: ::fidl_next::Encoder + ?Sized,
9947 NodeAttributes2: ::fidl_next::EncodeRef<___E>,
9948{
9949 #[inline]
9950 fn encode_option_ref(
9951 this: Option<&Self>,
9952 encoder: &mut ___E,
9953 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9954 ) -> Result<(), ::fidl_next::EncodeError> {
9955 if let Some(inner) = this {
9956 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9957 ::fidl_next::WireBox::encode_present(out);
9958 } else {
9959 ::fidl_next::WireBox::encode_absent(out);
9960 }
9961
9962 Ok(())
9963 }
9964}
9965
9966impl<'de> ::fidl_next::FromWire<WireNodeAttributes2<'de>> for NodeAttributes2 {
9967 #[inline]
9968 fn from_wire(wire: WireNodeAttributes2<'de>) -> Self {
9969 Self {
9970 mutable_attributes: ::fidl_next::FromWire::from_wire(wire.mutable_attributes),
9971
9972 immutable_attributes: ::fidl_next::FromWire::from_wire(wire.immutable_attributes),
9973 }
9974 }
9975}
9976
9977impl<'de> ::fidl_next::FromWireRef<WireNodeAttributes2<'de>> for NodeAttributes2 {
9978 #[inline]
9979 fn from_wire_ref(wire: &WireNodeAttributes2<'de>) -> Self {
9980 Self {
9981 mutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.mutable_attributes),
9982
9983 immutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(
9984 &wire.immutable_attributes,
9985 ),
9986 }
9987 }
9988}
9989
9990#[derive(Debug)]
9992#[repr(C)]
9993pub struct WireNodeAttributes2<'de> {
9994 pub mutable_attributes: crate::WireMutableNodeAttributes<'de>,
9995
9996 pub immutable_attributes: crate::WireImmutableNodeAttributes<'de>,
9997}
9998
9999unsafe impl ::fidl_next::Wire for WireNodeAttributes2<'static> {
10000 type Decoded<'de> = WireNodeAttributes2<'de>;
10001
10002 #[inline]
10003 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10004}
10005
10006unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes2<'static>
10007where
10008 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10009 ___D: ::fidl_next::Decoder,
10010{
10011 fn decode(
10012 slot: ::fidl_next::Slot<'_, Self>,
10013 decoder: &mut ___D,
10014 ) -> Result<(), ::fidl_next::DecodeError> {
10015 ::fidl_next::munge! {
10016 let Self {
10017 mut mutable_attributes,
10018 mut immutable_attributes,
10019
10020 } = slot;
10021 }
10022
10023 ::fidl_next::Decode::decode(mutable_attributes.as_mut(), decoder)?;
10024
10025 ::fidl_next::Decode::decode(immutable_attributes.as_mut(), decoder)?;
10026
10027 Ok(())
10028 }
10029}
10030
10031#[doc = " Information that describes the target node.\n"]
10032#[derive(Clone, Debug, Default)]
10033pub struct NodeInfo {
10034 pub attributes: Option<crate::NodeAttributes2>,
10035}
10036
10037impl NodeInfo {
10038 fn __max_ordinal(&self) -> usize {
10039 if self.attributes.is_some() {
10040 return 1;
10041 }
10042
10043 0
10044 }
10045}
10046
10047impl ::fidl_next::Encodable for NodeInfo {
10048 type Encoded = WireNodeInfo<'static>;
10049}
10050
10051unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfo
10052where
10053 ___E: ::fidl_next::Encoder + ?Sized,
10054{
10055 #[inline]
10056 fn encode(
10057 mut self,
10058 encoder: &mut ___E,
10059 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10060 ) -> Result<(), ::fidl_next::EncodeError> {
10061 ::fidl_next::munge!(let WireNodeInfo { table } = out);
10062
10063 let max_ord = self.__max_ordinal();
10064
10065 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10066 ::fidl_next::Wire::zero_padding(&mut out);
10067
10068 let mut preallocated =
10069 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10070
10071 for i in 1..=max_ord {
10072 match i {
10073 1 => {
10074 if let Some(attributes) = self.attributes.take() {
10075 ::fidl_next::WireEnvelope::encode_value(
10076 attributes,
10077 preallocated.encoder,
10078 &mut out,
10079 )?;
10080 } else {
10081 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10082 }
10083 }
10084
10085 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10086 }
10087 unsafe {
10088 preallocated.write_next(out.assume_init_ref());
10089 }
10090 }
10091
10092 ::fidl_next::WireTable::encode_len(table, max_ord);
10093
10094 Ok(())
10095 }
10096}
10097
10098unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeInfo
10099where
10100 ___E: ::fidl_next::Encoder + ?Sized,
10101{
10102 #[inline]
10103 fn encode_ref(
10104 &self,
10105 encoder: &mut ___E,
10106 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10107 ) -> Result<(), ::fidl_next::EncodeError> {
10108 ::fidl_next::munge!(let WireNodeInfo { table } = out);
10109
10110 let max_ord = self.__max_ordinal();
10111
10112 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10113 ::fidl_next::Wire::zero_padding(&mut out);
10114
10115 let mut preallocated =
10116 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10117
10118 for i in 1..=max_ord {
10119 match i {
10120 1 => {
10121 if let Some(attributes) = &self.attributes {
10122 ::fidl_next::WireEnvelope::encode_value(
10123 attributes,
10124 preallocated.encoder,
10125 &mut out,
10126 )?;
10127 } else {
10128 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10129 }
10130 }
10131
10132 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10133 }
10134 unsafe {
10135 preallocated.write_next(out.assume_init_ref());
10136 }
10137 }
10138
10139 ::fidl_next::WireTable::encode_len(table, max_ord);
10140
10141 Ok(())
10142 }
10143}
10144
10145impl<'de> ::fidl_next::FromWire<WireNodeInfo<'de>> for NodeInfo {
10146 #[inline]
10147 fn from_wire(wire: WireNodeInfo<'de>) -> Self {
10148 let wire = ::core::mem::ManuallyDrop::new(wire);
10149
10150 let attributes = wire.table.get(1);
10151
10152 Self {
10153 attributes: attributes.map(|envelope| {
10154 ::fidl_next::FromWire::from_wire(unsafe {
10155 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10156 })
10157 }),
10158 }
10159 }
10160}
10161
10162impl<'de> ::fidl_next::FromWireRef<WireNodeInfo<'de>> for NodeInfo {
10163 #[inline]
10164 fn from_wire_ref(wire: &WireNodeInfo<'de>) -> Self {
10165 Self {
10166 attributes: wire.table.get(1).map(|envelope| {
10167 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10168 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
10169 })
10170 }),
10171 }
10172 }
10173}
10174
10175#[repr(C)]
10177pub struct WireNodeInfo<'de> {
10178 table: ::fidl_next::WireTable<'de>,
10179}
10180
10181impl<'de> Drop for WireNodeInfo<'de> {
10182 fn drop(&mut self) {
10183 let _ = self.table.get(1).map(|envelope| unsafe {
10184 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10185 });
10186 }
10187}
10188
10189unsafe impl ::fidl_next::Wire for WireNodeInfo<'static> {
10190 type Decoded<'de> = WireNodeInfo<'de>;
10191
10192 #[inline]
10193 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10194 ::fidl_next::munge!(let Self { table } = out);
10195 ::fidl_next::WireTable::zero_padding(table);
10196 }
10197}
10198
10199unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfo<'static>
10200where
10201 ___D: ::fidl_next::Decoder + ?Sized,
10202{
10203 fn decode(
10204 slot: ::fidl_next::Slot<'_, Self>,
10205 decoder: &mut ___D,
10206 ) -> Result<(), ::fidl_next::DecodeError> {
10207 ::fidl_next::munge!(let Self { table } = slot);
10208
10209 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10210 match ordinal {
10211 0 => unsafe { ::core::hint::unreachable_unchecked() },
10212
10213 1 => {
10214 ::fidl_next::WireEnvelope::decode_as::<
10215 ___D,
10216 crate::WireNodeAttributes2<'static>,
10217 >(slot.as_mut(), decoder)?;
10218
10219 Ok(())
10220 }
10221
10222 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10223 }
10224 })
10225 }
10226}
10227
10228impl<'de> WireNodeInfo<'de> {
10229 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10230 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10231 }
10232}
10233
10234impl<'de> ::core::fmt::Debug for WireNodeInfo<'de> {
10235 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10236 f.debug_struct("NodeInfo").field("attributes", &self.attributes()).finish()
10237 }
10238}
10239
10240#[derive(Clone, Debug, Default)]
10241pub struct DirectoryInfo {
10242 pub attributes: Option<crate::NodeAttributes2>,
10243}
10244
10245impl DirectoryInfo {
10246 fn __max_ordinal(&self) -> usize {
10247 if self.attributes.is_some() {
10248 return 1;
10249 }
10250
10251 0
10252 }
10253}
10254
10255impl ::fidl_next::Encodable for DirectoryInfo {
10256 type Encoded = WireDirectoryInfo<'static>;
10257}
10258
10259unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryInfo
10260where
10261 ___E: ::fidl_next::Encoder + ?Sized,
10262{
10263 #[inline]
10264 fn encode(
10265 mut self,
10266 encoder: &mut ___E,
10267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10268 ) -> Result<(), ::fidl_next::EncodeError> {
10269 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
10270
10271 let max_ord = self.__max_ordinal();
10272
10273 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10274 ::fidl_next::Wire::zero_padding(&mut out);
10275
10276 let mut preallocated =
10277 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10278
10279 for i in 1..=max_ord {
10280 match i {
10281 1 => {
10282 if let Some(attributes) = self.attributes.take() {
10283 ::fidl_next::WireEnvelope::encode_value(
10284 attributes,
10285 preallocated.encoder,
10286 &mut out,
10287 )?;
10288 } else {
10289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10290 }
10291 }
10292
10293 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10294 }
10295 unsafe {
10296 preallocated.write_next(out.assume_init_ref());
10297 }
10298 }
10299
10300 ::fidl_next::WireTable::encode_len(table, max_ord);
10301
10302 Ok(())
10303 }
10304}
10305
10306unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryInfo
10307where
10308 ___E: ::fidl_next::Encoder + ?Sized,
10309{
10310 #[inline]
10311 fn encode_ref(
10312 &self,
10313 encoder: &mut ___E,
10314 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10315 ) -> Result<(), ::fidl_next::EncodeError> {
10316 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
10317
10318 let max_ord = self.__max_ordinal();
10319
10320 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10321 ::fidl_next::Wire::zero_padding(&mut out);
10322
10323 let mut preallocated =
10324 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10325
10326 for i in 1..=max_ord {
10327 match i {
10328 1 => {
10329 if let Some(attributes) = &self.attributes {
10330 ::fidl_next::WireEnvelope::encode_value(
10331 attributes,
10332 preallocated.encoder,
10333 &mut out,
10334 )?;
10335 } else {
10336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10337 }
10338 }
10339
10340 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10341 }
10342 unsafe {
10343 preallocated.write_next(out.assume_init_ref());
10344 }
10345 }
10346
10347 ::fidl_next::WireTable::encode_len(table, max_ord);
10348
10349 Ok(())
10350 }
10351}
10352
10353impl<'de> ::fidl_next::FromWire<WireDirectoryInfo<'de>> for DirectoryInfo {
10354 #[inline]
10355 fn from_wire(wire: WireDirectoryInfo<'de>) -> Self {
10356 let wire = ::core::mem::ManuallyDrop::new(wire);
10357
10358 let attributes = wire.table.get(1);
10359
10360 Self {
10361 attributes: attributes.map(|envelope| {
10362 ::fidl_next::FromWire::from_wire(unsafe {
10363 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10364 })
10365 }),
10366 }
10367 }
10368}
10369
10370impl<'de> ::fidl_next::FromWireRef<WireDirectoryInfo<'de>> for DirectoryInfo {
10371 #[inline]
10372 fn from_wire_ref(wire: &WireDirectoryInfo<'de>) -> Self {
10373 Self {
10374 attributes: wire.table.get(1).map(|envelope| {
10375 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10376 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
10377 })
10378 }),
10379 }
10380 }
10381}
10382
10383#[repr(C)]
10385pub struct WireDirectoryInfo<'de> {
10386 table: ::fidl_next::WireTable<'de>,
10387}
10388
10389impl<'de> Drop for WireDirectoryInfo<'de> {
10390 fn drop(&mut self) {
10391 let _ = self.table.get(1).map(|envelope| unsafe {
10392 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10393 });
10394 }
10395}
10396
10397unsafe impl ::fidl_next::Wire for WireDirectoryInfo<'static> {
10398 type Decoded<'de> = WireDirectoryInfo<'de>;
10399
10400 #[inline]
10401 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10402 ::fidl_next::munge!(let Self { table } = out);
10403 ::fidl_next::WireTable::zero_padding(table);
10404 }
10405}
10406
10407unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryInfo<'static>
10408where
10409 ___D: ::fidl_next::Decoder + ?Sized,
10410{
10411 fn decode(
10412 slot: ::fidl_next::Slot<'_, Self>,
10413 decoder: &mut ___D,
10414 ) -> Result<(), ::fidl_next::DecodeError> {
10415 ::fidl_next::munge!(let Self { table } = slot);
10416
10417 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10418 match ordinal {
10419 0 => unsafe { ::core::hint::unreachable_unchecked() },
10420
10421 1 => {
10422 ::fidl_next::WireEnvelope::decode_as::<
10423 ___D,
10424 crate::WireNodeAttributes2<'static>,
10425 >(slot.as_mut(), decoder)?;
10426
10427 Ok(())
10428 }
10429
10430 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10431 }
10432 })
10433 }
10434}
10435
10436impl<'de> WireDirectoryInfo<'de> {
10437 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10438 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10439 }
10440}
10441
10442impl<'de> ::core::fmt::Debug for WireDirectoryInfo<'de> {
10443 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10444 f.debug_struct("DirectoryInfo").field("attributes", &self.attributes()).finish()
10445 }
10446}
10447
10448#[doc = " Auxiliary data for the file representation of a node.\n"]
10449#[derive(Debug, Default)]
10450pub struct FileInfo {
10451 pub is_append: Option<bool>,
10452
10453 pub observer: Option<::fidl_next::fuchsia::zx::Event>,
10454
10455 pub stream: Option<::fidl_next::fuchsia::zx::Stream>,
10456
10457 pub attributes: Option<crate::NodeAttributes2>,
10458}
10459
10460impl FileInfo {
10461 fn __max_ordinal(&self) -> usize {
10462 if self.attributes.is_some() {
10463 return 4;
10464 }
10465
10466 if self.stream.is_some() {
10467 return 3;
10468 }
10469
10470 if self.observer.is_some() {
10471 return 2;
10472 }
10473
10474 if self.is_append.is_some() {
10475 return 1;
10476 }
10477
10478 0
10479 }
10480}
10481
10482impl ::fidl_next::Encodable for FileInfo {
10483 type Encoded = WireFileInfo<'static>;
10484}
10485
10486unsafe impl<___E> ::fidl_next::Encode<___E> for FileInfo
10487where
10488 ___E: ::fidl_next::Encoder + ?Sized,
10489 ___E: ::fidl_next::fuchsia::HandleEncoder,
10490{
10491 #[inline]
10492 fn encode(
10493 mut self,
10494 encoder: &mut ___E,
10495 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10496 ) -> Result<(), ::fidl_next::EncodeError> {
10497 ::fidl_next::munge!(let WireFileInfo { table } = out);
10498
10499 let max_ord = self.__max_ordinal();
10500
10501 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10502 ::fidl_next::Wire::zero_padding(&mut out);
10503
10504 let mut preallocated =
10505 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10506
10507 for i in 1..=max_ord {
10508 match i {
10509 4 => {
10510 if let Some(attributes) = self.attributes.take() {
10511 ::fidl_next::WireEnvelope::encode_value(
10512 attributes,
10513 preallocated.encoder,
10514 &mut out,
10515 )?;
10516 } else {
10517 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10518 }
10519 }
10520
10521 3 => {
10522 if let Some(stream) = self.stream.take() {
10523 ::fidl_next::WireEnvelope::encode_value(
10524 stream,
10525 preallocated.encoder,
10526 &mut out,
10527 )?;
10528 } else {
10529 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10530 }
10531 }
10532
10533 2 => {
10534 if let Some(observer) = self.observer.take() {
10535 ::fidl_next::WireEnvelope::encode_value(
10536 observer,
10537 preallocated.encoder,
10538 &mut out,
10539 )?;
10540 } else {
10541 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10542 }
10543 }
10544
10545 1 => {
10546 if let Some(is_append) = self.is_append.take() {
10547 ::fidl_next::WireEnvelope::encode_value(
10548 is_append,
10549 preallocated.encoder,
10550 &mut out,
10551 )?;
10552 } else {
10553 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10554 }
10555 }
10556
10557 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10558 }
10559 unsafe {
10560 preallocated.write_next(out.assume_init_ref());
10561 }
10562 }
10563
10564 ::fidl_next::WireTable::encode_len(table, max_ord);
10565
10566 Ok(())
10567 }
10568}
10569
10570impl<'de> ::fidl_next::FromWire<WireFileInfo<'de>> for FileInfo {
10571 #[inline]
10572 fn from_wire(wire: WireFileInfo<'de>) -> Self {
10573 let wire = ::core::mem::ManuallyDrop::new(wire);
10574
10575 let is_append = wire.table.get(1);
10576
10577 let observer = wire.table.get(2);
10578
10579 let stream = wire.table.get(3);
10580
10581 let attributes = wire.table.get(4);
10582
10583 Self {
10584 is_append: is_append.map(|envelope| {
10585 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10586 }),
10587
10588 observer: observer.map(|envelope| {
10589 ::fidl_next::FromWire::from_wire(unsafe {
10590 envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
10591 })
10592 }),
10593
10594 stream: stream.map(|envelope| {
10595 ::fidl_next::FromWire::from_wire(unsafe {
10596 envelope.read_unchecked::<::fidl_next::fuchsia::WireStream>()
10597 })
10598 }),
10599
10600 attributes: attributes.map(|envelope| {
10601 ::fidl_next::FromWire::from_wire(unsafe {
10602 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10603 })
10604 }),
10605 }
10606 }
10607}
10608
10609#[repr(C)]
10611pub struct WireFileInfo<'de> {
10612 table: ::fidl_next::WireTable<'de>,
10613}
10614
10615impl<'de> Drop for WireFileInfo<'de> {
10616 fn drop(&mut self) {
10617 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10618
10619 let _ = self.table.get(2).map(|envelope| unsafe {
10620 envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
10621 });
10622
10623 let _ = self.table.get(3).map(|envelope| unsafe {
10624 envelope.read_unchecked::<::fidl_next::fuchsia::WireStream>()
10625 });
10626
10627 let _ = self.table.get(4).map(|envelope| unsafe {
10628 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10629 });
10630 }
10631}
10632
10633unsafe impl ::fidl_next::Wire for WireFileInfo<'static> {
10634 type Decoded<'de> = WireFileInfo<'de>;
10635
10636 #[inline]
10637 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10638 ::fidl_next::munge!(let Self { table } = out);
10639 ::fidl_next::WireTable::zero_padding(table);
10640 }
10641}
10642
10643unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileInfo<'static>
10644where
10645 ___D: ::fidl_next::Decoder + ?Sized,
10646 ___D: ::fidl_next::fuchsia::HandleDecoder,
10647{
10648 fn decode(
10649 slot: ::fidl_next::Slot<'_, Self>,
10650 decoder: &mut ___D,
10651 ) -> Result<(), ::fidl_next::DecodeError> {
10652 ::fidl_next::munge!(let Self { table } = slot);
10653
10654 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10655 match ordinal {
10656 0 => unsafe { ::core::hint::unreachable_unchecked() },
10657
10658 1 => {
10659 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10660
10661 Ok(())
10662 }
10663
10664 2 => {
10665 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
10666 slot.as_mut(),
10667 decoder,
10668 )?;
10669
10670 Ok(())
10671 }
10672
10673 3 => {
10674 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireStream>(
10675 slot.as_mut(),
10676 decoder,
10677 )?;
10678
10679 Ok(())
10680 }
10681
10682 4 => {
10683 ::fidl_next::WireEnvelope::decode_as::<
10684 ___D,
10685 crate::WireNodeAttributes2<'static>,
10686 >(slot.as_mut(), decoder)?;
10687
10688 Ok(())
10689 }
10690
10691 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10692 }
10693 })
10694 }
10695}
10696
10697impl<'de> WireFileInfo<'de> {
10698 pub fn is_append(&self) -> Option<&bool> {
10699 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10700 }
10701
10702 pub fn observer(&self) -> Option<&::fidl_next::fuchsia::WireEvent> {
10703 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10704 }
10705
10706 pub fn stream(&self) -> Option<&::fidl_next::fuchsia::WireStream> {
10707 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10708 }
10709
10710 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10711 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10712 }
10713}
10714
10715impl<'de> ::core::fmt::Debug for WireFileInfo<'de> {
10716 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10717 f.debug_struct("FileInfo")
10718 .field("is_append", &self.is_append())
10719 .field("observer", &self.observer())
10720 .field("stream", &self.stream())
10721 .field("attributes", &self.attributes())
10722 .finish()
10723 }
10724}
10725
10726#[derive(Clone, Debug, Default)]
10727pub struct SymlinkInfo {
10728 pub target: Option<Vec<u8>>,
10729
10730 pub attributes: Option<crate::NodeAttributes2>,
10731}
10732
10733impl SymlinkInfo {
10734 fn __max_ordinal(&self) -> usize {
10735 if self.attributes.is_some() {
10736 return 2;
10737 }
10738
10739 if self.target.is_some() {
10740 return 1;
10741 }
10742
10743 0
10744 }
10745}
10746
10747impl ::fidl_next::Encodable for SymlinkInfo {
10748 type Encoded = WireSymlinkInfo<'static>;
10749}
10750
10751unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkInfo
10752where
10753 ___E: ::fidl_next::Encoder + ?Sized,
10754{
10755 #[inline]
10756 fn encode(
10757 mut self,
10758 encoder: &mut ___E,
10759 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10760 ) -> Result<(), ::fidl_next::EncodeError> {
10761 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
10762
10763 let max_ord = self.__max_ordinal();
10764
10765 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10766 ::fidl_next::Wire::zero_padding(&mut out);
10767
10768 let mut preallocated =
10769 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10770
10771 for i in 1..=max_ord {
10772 match i {
10773 2 => {
10774 if let Some(attributes) = self.attributes.take() {
10775 ::fidl_next::WireEnvelope::encode_value(
10776 attributes,
10777 preallocated.encoder,
10778 &mut out,
10779 )?;
10780 } else {
10781 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10782 }
10783 }
10784
10785 1 => {
10786 if let Some(target) = self.target.take() {
10787 ::fidl_next::WireEnvelope::encode_value(
10788 target,
10789 preallocated.encoder,
10790 &mut out,
10791 )?;
10792 } else {
10793 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10794 }
10795 }
10796
10797 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10798 }
10799 unsafe {
10800 preallocated.write_next(out.assume_init_ref());
10801 }
10802 }
10803
10804 ::fidl_next::WireTable::encode_len(table, max_ord);
10805
10806 Ok(())
10807 }
10808}
10809
10810unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkInfo
10811where
10812 ___E: ::fidl_next::Encoder + ?Sized,
10813{
10814 #[inline]
10815 fn encode_ref(
10816 &self,
10817 encoder: &mut ___E,
10818 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10819 ) -> Result<(), ::fidl_next::EncodeError> {
10820 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
10821
10822 let max_ord = self.__max_ordinal();
10823
10824 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10825 ::fidl_next::Wire::zero_padding(&mut out);
10826
10827 let mut preallocated =
10828 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10829
10830 for i in 1..=max_ord {
10831 match i {
10832 2 => {
10833 if let Some(attributes) = &self.attributes {
10834 ::fidl_next::WireEnvelope::encode_value(
10835 attributes,
10836 preallocated.encoder,
10837 &mut out,
10838 )?;
10839 } else {
10840 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10841 }
10842 }
10843
10844 1 => {
10845 if let Some(target) = &self.target {
10846 ::fidl_next::WireEnvelope::encode_value(
10847 target,
10848 preallocated.encoder,
10849 &mut out,
10850 )?;
10851 } else {
10852 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10853 }
10854 }
10855
10856 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10857 }
10858 unsafe {
10859 preallocated.write_next(out.assume_init_ref());
10860 }
10861 }
10862
10863 ::fidl_next::WireTable::encode_len(table, max_ord);
10864
10865 Ok(())
10866 }
10867}
10868
10869impl<'de> ::fidl_next::FromWire<WireSymlinkInfo<'de>> for SymlinkInfo {
10870 #[inline]
10871 fn from_wire(wire: WireSymlinkInfo<'de>) -> Self {
10872 let wire = ::core::mem::ManuallyDrop::new(wire);
10873
10874 let target = wire.table.get(1);
10875
10876 let attributes = wire.table.get(2);
10877
10878 Self {
10879 target: target.map(|envelope| {
10880 ::fidl_next::FromWire::from_wire(unsafe {
10881 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
10882 })
10883 }),
10884
10885 attributes: attributes.map(|envelope| {
10886 ::fidl_next::FromWire::from_wire(unsafe {
10887 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10888 })
10889 }),
10890 }
10891 }
10892}
10893
10894impl<'de> ::fidl_next::FromWireRef<WireSymlinkInfo<'de>> for SymlinkInfo {
10895 #[inline]
10896 fn from_wire_ref(wire: &WireSymlinkInfo<'de>) -> Self {
10897 Self {
10898 target: wire.table.get(1).map(|envelope| {
10899 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10900 envelope.deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
10901 })
10902 }),
10903
10904 attributes: wire.table.get(2).map(|envelope| {
10905 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10906 envelope.deref_unchecked::<crate::WireNodeAttributes2<'de>>()
10907 })
10908 }),
10909 }
10910 }
10911}
10912
10913#[repr(C)]
10915pub struct WireSymlinkInfo<'de> {
10916 table: ::fidl_next::WireTable<'de>,
10917}
10918
10919impl<'de> Drop for WireSymlinkInfo<'de> {
10920 fn drop(&mut self) {
10921 let _ = self.table.get(1).map(|envelope| unsafe {
10922 envelope.read_unchecked::<::fidl_next::WireVector<'de, u8>>()
10923 });
10924
10925 let _ = self.table.get(2).map(|envelope| unsafe {
10926 envelope.read_unchecked::<crate::WireNodeAttributes2<'de>>()
10927 });
10928 }
10929}
10930
10931unsafe impl ::fidl_next::Wire for WireSymlinkInfo<'static> {
10932 type Decoded<'de> = WireSymlinkInfo<'de>;
10933
10934 #[inline]
10935 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10936 ::fidl_next::munge!(let Self { table } = out);
10937 ::fidl_next::WireTable::zero_padding(table);
10938 }
10939}
10940
10941unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkInfo<'static>
10942where
10943 ___D: ::fidl_next::Decoder + ?Sized,
10944{
10945 fn decode(
10946 slot: ::fidl_next::Slot<'_, Self>,
10947 decoder: &mut ___D,
10948 ) -> Result<(), ::fidl_next::DecodeError> {
10949 ::fidl_next::munge!(let Self { table } = slot);
10950
10951 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10952 match ordinal {
10953 0 => unsafe { ::core::hint::unreachable_unchecked() },
10954
10955 1 => {
10956 ::fidl_next::WireEnvelope::decode_as::<
10957 ___D,
10958 ::fidl_next::WireVector<'static, u8>,
10959 >(slot.as_mut(), decoder)?;
10960
10961 let target = unsafe {
10962 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
10963 };
10964
10965 if target.len() > 4095 {
10966 return Err(::fidl_next::DecodeError::VectorTooLong {
10967 size: target.len() as u64,
10968 limit: 4095,
10969 });
10970 }
10971
10972 Ok(())
10973 }
10974
10975 2 => {
10976 ::fidl_next::WireEnvelope::decode_as::<
10977 ___D,
10978 crate::WireNodeAttributes2<'static>,
10979 >(slot.as_mut(), decoder)?;
10980
10981 Ok(())
10982 }
10983
10984 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10985 }
10986 })
10987 }
10988}
10989
10990impl<'de> WireSymlinkInfo<'de> {
10991 pub fn target(&self) -> Option<&::fidl_next::WireVector<'de, u8>> {
10992 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10993 }
10994
10995 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2<'de>> {
10996 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10997 }
10998}
10999
11000impl<'de> ::core::fmt::Debug for WireSymlinkInfo<'de> {
11001 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11002 f.debug_struct("SymlinkInfo")
11003 .field("target", &self.target())
11004 .field("attributes", &self.attributes())
11005 .finish()
11006 }
11007}
11008
11009#[derive(Debug)]
11010pub enum Representation {
11011 Node(crate::NodeInfo),
11012
11013 Directory(crate::DirectoryInfo),
11014
11015 File(crate::FileInfo),
11016
11017 Symlink(crate::SymlinkInfo),
11018
11019 UnknownOrdinal_(u64),
11020}
11021
11022impl ::fidl_next::Encodable for Representation {
11023 type Encoded = WireRepresentation<'static>;
11024}
11025
11026unsafe impl<___E> ::fidl_next::Encode<___E> for Representation
11027where
11028 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11029 ___E: ::fidl_next::Encoder,
11030 ___E: ::fidl_next::fuchsia::HandleEncoder,
11031{
11032 #[inline]
11033 fn encode(
11034 self,
11035 encoder: &mut ___E,
11036 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11037 ) -> Result<(), ::fidl_next::EncodeError> {
11038 ::fidl_next::munge!(let WireRepresentation { raw, _phantom: _ } = out);
11039
11040 match self {
11041 Self::Node(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::NodeInfo>(
11042 value, 1, encoder, raw,
11043 )?,
11044
11045 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
11046 ___E,
11047 crate::DirectoryInfo,
11048 >(value, 2, encoder, raw)?,
11049
11050 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileInfo>(
11051 value, 3, encoder, raw,
11052 )?,
11053
11054 Self::Symlink(value) => {
11055 ::fidl_next::RawWireUnion::encode_as::<___E, crate::SymlinkInfo>(
11056 value, 4, encoder, raw,
11057 )?
11058 }
11059
11060 Self::UnknownOrdinal_(ordinal) => {
11061 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
11062 }
11063 }
11064
11065 Ok(())
11066 }
11067}
11068
11069impl ::fidl_next::EncodableOption for Representation {
11070 type EncodedOption = WireOptionalRepresentation<'static>;
11071}
11072
11073unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Representation
11074where
11075 ___E: ?Sized,
11076 Representation: ::fidl_next::Encode<___E>,
11077{
11078 #[inline]
11079 fn encode_option(
11080 this: Option<Self>,
11081 encoder: &mut ___E,
11082 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11083 ) -> Result<(), ::fidl_next::EncodeError> {
11084 ::fidl_next::munge!(let WireOptionalRepresentation { raw, _phantom: _ } = &mut *out);
11085
11086 if let Some(inner) = this {
11087 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11088 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11089 } else {
11090 ::fidl_next::RawWireUnion::encode_absent(raw);
11091 }
11092
11093 Ok(())
11094 }
11095}
11096
11097impl<'de> ::fidl_next::FromWire<WireRepresentation<'de>> for Representation {
11098 #[inline]
11099 fn from_wire(wire: WireRepresentation<'de>) -> Self {
11100 let wire = ::core::mem::ManuallyDrop::new(wire);
11101 match wire.raw.ordinal() {
11102 1 => Self::Node(::fidl_next::FromWire::from_wire(unsafe {
11103 wire.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>()
11104 })),
11105
11106 2 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
11107 wire.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>()
11108 })),
11109
11110 3 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
11111 wire.raw.get().read_unchecked::<crate::WireFileInfo<'de>>()
11112 })),
11113
11114 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
11115 wire.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>()
11116 })),
11117
11118 _ => unsafe { ::core::hint::unreachable_unchecked() },
11119 }
11120 }
11121}
11122
11123impl<'de> ::fidl_next::FromWireOption<WireOptionalRepresentation<'de>> for Box<Representation> {
11124 #[inline]
11125 fn from_wire_option(wire: WireOptionalRepresentation<'de>) -> Option<Self> {
11126 if let Some(inner) = wire.into_option() {
11127 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
11128 } else {
11129 None
11130 }
11131 }
11132}
11133
11134#[repr(transparent)]
11136pub struct WireRepresentation<'de> {
11137 raw: ::fidl_next::RawWireUnion,
11138 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11139}
11140
11141impl<'de> Drop for WireRepresentation<'de> {
11142 fn drop(&mut self) {
11143 match self.raw.ordinal() {
11144 1 => {
11145 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireNodeInfo<'de>>() };
11146 }
11147
11148 2 => {
11149 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryInfo<'de>>() };
11150 }
11151
11152 3 => {
11153 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileInfo<'de>>() };
11154 }
11155
11156 4 => {
11157 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkInfo<'de>>() };
11158 }
11159
11160 _ => (),
11161 }
11162 }
11163}
11164
11165unsafe impl ::fidl_next::Wire for WireRepresentation<'static> {
11166 type Decoded<'de> = WireRepresentation<'de>;
11167
11168 #[inline]
11169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11170 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11171 ::fidl_next::RawWireUnion::zero_padding(raw);
11172 }
11173}
11174
11175pub mod representation {
11176 pub enum Ref<'de> {
11177 Node(&'de crate::WireNodeInfo<'de>),
11178
11179 Directory(&'de crate::WireDirectoryInfo<'de>),
11180
11181 File(&'de crate::WireFileInfo<'de>),
11182
11183 Symlink(&'de crate::WireSymlinkInfo<'de>),
11184
11185 UnknownOrdinal_(u64),
11186 }
11187}
11188
11189impl<'de> WireRepresentation<'de> {
11190 pub fn as_ref(&self) -> crate::representation::Ref<'_> {
11191 match self.raw.ordinal() {
11192 1 => crate::representation::Ref::Node(unsafe {
11193 self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>()
11194 }),
11195
11196 2 => crate::representation::Ref::Directory(unsafe {
11197 self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>()
11198 }),
11199
11200 3 => crate::representation::Ref::File(unsafe {
11201 self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>()
11202 }),
11203
11204 4 => crate::representation::Ref::Symlink(unsafe {
11205 self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>()
11206 }),
11207
11208 unknown => crate::representation::Ref::UnknownOrdinal_(unknown),
11209 }
11210 }
11211}
11212
11213unsafe impl<___D> ::fidl_next::Decode<___D> for WireRepresentation<'static>
11214where
11215 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11216 ___D: ::fidl_next::Decoder,
11217 ___D: ::fidl_next::fuchsia::HandleDecoder,
11218{
11219 fn decode(
11220 mut slot: ::fidl_next::Slot<'_, Self>,
11221 decoder: &mut ___D,
11222 ) -> Result<(), ::fidl_next::DecodeError> {
11223 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11224 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11225 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
11226 raw, decoder,
11227 )?,
11228
11229 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
11230 raw, decoder,
11231 )?,
11232
11233 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
11234 raw, decoder,
11235 )?,
11236
11237 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
11238 raw, decoder,
11239 )?,
11240
11241 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11242 }
11243
11244 Ok(())
11245 }
11246}
11247
11248impl<'de> ::core::fmt::Debug for WireRepresentation<'de> {
11249 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11250 match self.raw.ordinal() {
11251 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireNodeInfo<'_>>().fmt(f) },
11252 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryInfo<'_>>().fmt(f) },
11253 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileInfo<'_>>().fmt(f) },
11254 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkInfo<'_>>().fmt(f) },
11255 _ => unsafe { ::core::hint::unreachable_unchecked() },
11256 }
11257 }
11258}
11259
11260#[repr(transparent)]
11261pub struct WireOptionalRepresentation<'de> {
11262 raw: ::fidl_next::RawWireUnion,
11263 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11264}
11265
11266unsafe impl ::fidl_next::Wire for WireOptionalRepresentation<'static> {
11267 type Decoded<'de> = WireOptionalRepresentation<'de>;
11268
11269 #[inline]
11270 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11271 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11272 ::fidl_next::RawWireUnion::zero_padding(raw);
11273 }
11274}
11275
11276impl<'de> WireOptionalRepresentation<'de> {
11277 pub fn is_some(&self) -> bool {
11278 self.raw.is_some()
11279 }
11280
11281 pub fn is_none(&self) -> bool {
11282 self.raw.is_none()
11283 }
11284
11285 pub fn as_ref(&self) -> Option<&WireRepresentation<'de>> {
11286 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
11287 }
11288
11289 pub fn into_option(self) -> Option<WireRepresentation<'de>> {
11290 if self.is_some() {
11291 Some(WireRepresentation { raw: self.raw, _phantom: ::core::marker::PhantomData })
11292 } else {
11293 None
11294 }
11295 }
11296}
11297
11298unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRepresentation<'static>
11299where
11300 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11301 ___D: ::fidl_next::Decoder,
11302 ___D: ::fidl_next::fuchsia::HandleDecoder,
11303{
11304 fn decode(
11305 mut slot: ::fidl_next::Slot<'_, Self>,
11306 decoder: &mut ___D,
11307 ) -> Result<(), ::fidl_next::DecodeError> {
11308 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11309 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11310 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo<'static>>(
11311 raw, decoder,
11312 )?,
11313
11314 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo<'static>>(
11315 raw, decoder,
11316 )?,
11317
11318 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo<'static>>(
11319 raw, decoder,
11320 )?,
11321
11322 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo<'static>>(
11323 raw, decoder,
11324 )?,
11325
11326 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11327 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11328 }
11329
11330 Ok(())
11331 }
11332}
11333
11334impl<'de> ::core::fmt::Debug for WireOptionalRepresentation<'de> {
11335 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11336 self.as_ref().fmt(f)
11337 }
11338}
11339
11340::fidl_next::bitflags! {
11341 #[derive(
11342 Clone,
11343 Copy,
11344 Debug,
11345 PartialEq,
11346 Eq,
11347 Hash,
11348 )]
11349 pub struct NodeAttributesQuery: u64 {
11350 #[doc = " Requests [`NodeAttributes.protocols`].\n"]const PROTOCOLS = 1;
11351 #[doc = " Requests [`NodeAttributes.abilities`].\n"]const ABILITIES = 2;
11352 #[doc = " Requests [`NodeAttributes.content_size`].\n"]const CONTENT_SIZE = 4;
11353 #[doc = " Requests [`NodeAttributes.storage_size`].\n"]const STORAGE_SIZE = 8;
11354 #[doc = " Requests [`NodeAttributes.link_count`].\n"]const LINK_COUNT = 16;
11355 #[doc = " Requests [`NodeAttributes.id`].\n"]const ID = 32;
11356 #[doc = " Requests [`NodeAttributes.creation_time`].\n"]const CREATION_TIME = 64;
11357 #[doc = " Requests [`NodeAttributes.modification_time`].\n"]const MODIFICATION_TIME = 128;
11358 #[doc = " Posix attributes.\n"]const MODE = 256;
11359 const UID = 512;
11360 const GID = 1024;
11361 const RDEV = 2048;
11362 const ACCESS_TIME = 4096;
11363 const CHANGE_TIME = 8192;
11364 #[doc = " Verity attributes.\n"]const OPTIONS = 16384;
11365 const ROOT_HASH = 32768;
11366 const VERITY_ENABLED = 65536;
11367 #[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;
11368 #[doc = " Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.\n"]const SELINUX_CONTEXT = 262144;
11369 #[doc = " fscrypt attribute.\n"]const WRAPPING_KEY_ID = 524288;
11370 #[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;
11371 const _ = !0;
11372 }
11373}
11374
11375impl ::fidl_next::Encodable for NodeAttributesQuery {
11376 type Encoded = WireNodeAttributesQuery;
11377}
11378
11379unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributesQuery
11380where
11381 ___E: ?Sized,
11382{
11383 #[inline]
11384 fn encode(
11385 self,
11386 encoder: &mut ___E,
11387 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11388 ) -> Result<(), ::fidl_next::EncodeError> {
11389 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
11390 }
11391}
11392
11393unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributesQuery
11394where
11395 ___E: ?Sized,
11396{
11397 #[inline]
11398 fn encode_ref(
11399 &self,
11400 _: &mut ___E,
11401 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11402 ) -> Result<(), ::fidl_next::EncodeError> {
11403 ::fidl_next::munge!(let WireNodeAttributesQuery { value } = out);
11404 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
11405 Ok(())
11406 }
11407}
11408
11409impl ::core::convert::From<WireNodeAttributesQuery> for NodeAttributesQuery {
11410 fn from(wire: WireNodeAttributesQuery) -> Self {
11411 Self::from_bits_retain(u64::from(wire.value))
11412 }
11413}
11414
11415impl ::fidl_next::FromWire<WireNodeAttributesQuery> for NodeAttributesQuery {
11416 #[inline]
11417 fn from_wire(wire: WireNodeAttributesQuery) -> Self {
11418 Self::from(wire)
11419 }
11420}
11421
11422impl ::fidl_next::FromWireRef<WireNodeAttributesQuery> for NodeAttributesQuery {
11423 #[inline]
11424 fn from_wire_ref(wire: &WireNodeAttributesQuery) -> Self {
11425 Self::from(*wire)
11426 }
11427}
11428
11429#[derive(Clone, Copy, Debug)]
11431#[repr(transparent)]
11432pub struct WireNodeAttributesQuery {
11433 value: ::fidl_next::WireU64,
11434}
11435
11436unsafe impl ::fidl_next::Wire for WireNodeAttributesQuery {
11437 type Decoded<'de> = Self;
11438
11439 #[inline]
11440 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11441 }
11443}
11444
11445unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributesQuery
11446where
11447 ___D: ?Sized,
11448{
11449 fn decode(
11450 slot: ::fidl_next::Slot<'_, Self>,
11451 _: &mut ___D,
11452 ) -> Result<(), ::fidl_next::DecodeError> {
11453 Ok(())
11454 }
11455}
11456
11457impl ::core::convert::From<NodeAttributesQuery> for WireNodeAttributesQuery {
11458 fn from(natural: NodeAttributesQuery) -> Self {
11459 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
11460 }
11461}
11462
11463#[derive(Clone, Debug)]
11464#[repr(C)]
11465pub struct NodeGetAttributesRequest {
11466 pub query: crate::NodeAttributesQuery,
11467}
11468
11469impl ::fidl_next::Encodable for NodeGetAttributesRequest {
11470 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeGetAttributesRequest> = unsafe {
11471 ::fidl_next::CopyOptimization::enable_if(
11472 true && <crate::NodeAttributesQuery as ::fidl_next::Encodable>::COPY_OPTIMIZATION
11473 .is_enabled(),
11474 )
11475 };
11476
11477 type Encoded = WireNodeGetAttributesRequest;
11478}
11479
11480unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetAttributesRequest
11481where
11482 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11483{
11484 #[inline]
11485 fn encode(
11486 self,
11487 encoder: &mut ___E,
11488 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11489 ) -> Result<(), ::fidl_next::EncodeError> {
11490 ::fidl_next::munge! {
11491 let Self::Encoded {
11492 query,
11493
11494 } = out;
11495 }
11496
11497 ::fidl_next::Encode::encode(self.query, encoder, query)?;
11498
11499 Ok(())
11500 }
11501}
11502
11503unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetAttributesRequest
11504where
11505 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11506{
11507 #[inline]
11508 fn encode_ref(
11509 &self,
11510 encoder: &mut ___E,
11511 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11512 ) -> Result<(), ::fidl_next::EncodeError> {
11513 ::fidl_next::munge! {
11514 let Self::Encoded {
11515 query,
11516
11517 } = out;
11518 }
11519
11520 ::fidl_next::EncodeRef::encode_ref(&self.query, encoder, query)?;
11521
11522 Ok(())
11523 }
11524}
11525
11526impl ::fidl_next::EncodableOption for NodeGetAttributesRequest {
11527 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeGetAttributesRequest>;
11528}
11529
11530unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeGetAttributesRequest
11531where
11532 ___E: ::fidl_next::Encoder + ?Sized,
11533 NodeGetAttributesRequest: ::fidl_next::Encode<___E>,
11534{
11535 #[inline]
11536 fn encode_option(
11537 this: Option<Self>,
11538 encoder: &mut ___E,
11539 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11540 ) -> Result<(), ::fidl_next::EncodeError> {
11541 if let Some(inner) = this {
11542 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11543 ::fidl_next::WireBox::encode_present(out);
11544 } else {
11545 ::fidl_next::WireBox::encode_absent(out);
11546 }
11547
11548 Ok(())
11549 }
11550}
11551
11552unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NodeGetAttributesRequest
11553where
11554 ___E: ::fidl_next::Encoder + ?Sized,
11555 NodeGetAttributesRequest: ::fidl_next::EncodeRef<___E>,
11556{
11557 #[inline]
11558 fn encode_option_ref(
11559 this: Option<&Self>,
11560 encoder: &mut ___E,
11561 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11562 ) -> Result<(), ::fidl_next::EncodeError> {
11563 if let Some(inner) = this {
11564 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11565 ::fidl_next::WireBox::encode_present(out);
11566 } else {
11567 ::fidl_next::WireBox::encode_absent(out);
11568 }
11569
11570 Ok(())
11571 }
11572}
11573
11574impl ::fidl_next::FromWire<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
11575 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeGetAttributesRequest, Self> = unsafe {
11576 ::fidl_next::CopyOptimization::enable_if(
11577 true && <crate::NodeAttributesQuery as ::fidl_next::FromWire<
11578 crate::WireNodeAttributesQuery,
11579 >>::COPY_OPTIMIZATION
11580 .is_enabled(),
11581 )
11582 };
11583
11584 #[inline]
11585 fn from_wire(wire: WireNodeGetAttributesRequest) -> Self {
11586 Self { query: ::fidl_next::FromWire::from_wire(wire.query) }
11587 }
11588}
11589
11590impl ::fidl_next::FromWireRef<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
11591 #[inline]
11592 fn from_wire_ref(wire: &WireNodeGetAttributesRequest) -> Self {
11593 Self { query: ::fidl_next::FromWireRef::from_wire_ref(&wire.query) }
11594 }
11595}
11596
11597#[derive(Clone, Debug)]
11599#[repr(C)]
11600pub struct WireNodeGetAttributesRequest {
11601 pub query: crate::WireNodeAttributesQuery,
11602}
11603
11604unsafe impl ::fidl_next::Wire for WireNodeGetAttributesRequest {
11605 type Decoded<'de> = WireNodeGetAttributesRequest;
11606
11607 #[inline]
11608 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
11609}
11610
11611unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetAttributesRequest
11612where
11613 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11614{
11615 fn decode(
11616 slot: ::fidl_next::Slot<'_, Self>,
11617 decoder: &mut ___D,
11618 ) -> Result<(), ::fidl_next::DecodeError> {
11619 ::fidl_next::munge! {
11620 let Self {
11621 mut query,
11622
11623 } = slot;
11624 }
11625
11626 ::fidl_next::Decode::decode(query.as_mut(), decoder)?;
11627
11628 Ok(())
11629 }
11630}
11631
11632#[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"]
11633#[derive(Clone, Debug, Default)]
11634pub struct Options {
11635 pub attributes: Option<crate::NodeAttributesQuery>,
11636
11637 pub create_attributes: Option<crate::MutableNodeAttributes>,
11638}
11639
11640impl Options {
11641 fn __max_ordinal(&self) -> usize {
11642 if self.create_attributes.is_some() {
11643 return 2;
11644 }
11645
11646 if self.attributes.is_some() {
11647 return 1;
11648 }
11649
11650 0
11651 }
11652}
11653
11654impl ::fidl_next::Encodable for Options {
11655 type Encoded = WireOptions<'static>;
11656}
11657
11658unsafe impl<___E> ::fidl_next::Encode<___E> for Options
11659where
11660 ___E: ::fidl_next::Encoder + ?Sized,
11661{
11662 #[inline]
11663 fn encode(
11664 mut self,
11665 encoder: &mut ___E,
11666 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11667 ) -> Result<(), ::fidl_next::EncodeError> {
11668 ::fidl_next::munge!(let WireOptions { table } = out);
11669
11670 let max_ord = self.__max_ordinal();
11671
11672 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11673 ::fidl_next::Wire::zero_padding(&mut out);
11674
11675 let mut preallocated =
11676 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11677
11678 for i in 1..=max_ord {
11679 match i {
11680 2 => {
11681 if let Some(create_attributes) = self.create_attributes.take() {
11682 ::fidl_next::WireEnvelope::encode_value(
11683 create_attributes,
11684 preallocated.encoder,
11685 &mut out,
11686 )?;
11687 } else {
11688 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11689 }
11690 }
11691
11692 1 => {
11693 if let Some(attributes) = self.attributes.take() {
11694 ::fidl_next::WireEnvelope::encode_value(
11695 attributes,
11696 preallocated.encoder,
11697 &mut out,
11698 )?;
11699 } else {
11700 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11701 }
11702 }
11703
11704 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11705 }
11706 unsafe {
11707 preallocated.write_next(out.assume_init_ref());
11708 }
11709 }
11710
11711 ::fidl_next::WireTable::encode_len(table, max_ord);
11712
11713 Ok(())
11714 }
11715}
11716
11717unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Options
11718where
11719 ___E: ::fidl_next::Encoder + ?Sized,
11720{
11721 #[inline]
11722 fn encode_ref(
11723 &self,
11724 encoder: &mut ___E,
11725 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11726 ) -> Result<(), ::fidl_next::EncodeError> {
11727 ::fidl_next::munge!(let WireOptions { table } = out);
11728
11729 let max_ord = self.__max_ordinal();
11730
11731 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11732 ::fidl_next::Wire::zero_padding(&mut out);
11733
11734 let mut preallocated =
11735 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11736
11737 for i in 1..=max_ord {
11738 match i {
11739 2 => {
11740 if let Some(create_attributes) = &self.create_attributes {
11741 ::fidl_next::WireEnvelope::encode_value(
11742 create_attributes,
11743 preallocated.encoder,
11744 &mut out,
11745 )?;
11746 } else {
11747 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11748 }
11749 }
11750
11751 1 => {
11752 if let Some(attributes) = &self.attributes {
11753 ::fidl_next::WireEnvelope::encode_value(
11754 attributes,
11755 preallocated.encoder,
11756 &mut out,
11757 )?;
11758 } else {
11759 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11760 }
11761 }
11762
11763 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11764 }
11765 unsafe {
11766 preallocated.write_next(out.assume_init_ref());
11767 }
11768 }
11769
11770 ::fidl_next::WireTable::encode_len(table, max_ord);
11771
11772 Ok(())
11773 }
11774}
11775
11776impl<'de> ::fidl_next::FromWire<WireOptions<'de>> for Options {
11777 #[inline]
11778 fn from_wire(wire: WireOptions<'de>) -> Self {
11779 let wire = ::core::mem::ManuallyDrop::new(wire);
11780
11781 let attributes = wire.table.get(1);
11782
11783 let create_attributes = wire.table.get(2);
11784
11785 Self {
11786 attributes: attributes.map(|envelope| {
11787 ::fidl_next::FromWire::from_wire(unsafe {
11788 envelope.read_unchecked::<crate::WireNodeAttributesQuery>()
11789 })
11790 }),
11791
11792 create_attributes: create_attributes.map(|envelope| {
11793 ::fidl_next::FromWire::from_wire(unsafe {
11794 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
11795 })
11796 }),
11797 }
11798 }
11799}
11800
11801impl<'de> ::fidl_next::FromWireRef<WireOptions<'de>> for Options {
11802 #[inline]
11803 fn from_wire_ref(wire: &WireOptions<'de>) -> Self {
11804 Self {
11805 attributes: wire.table.get(1).map(|envelope| {
11806 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11807 envelope.deref_unchecked::<crate::WireNodeAttributesQuery>()
11808 })
11809 }),
11810
11811 create_attributes: wire.table.get(2).map(|envelope| {
11812 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11813 envelope.deref_unchecked::<crate::WireMutableNodeAttributes<'de>>()
11814 })
11815 }),
11816 }
11817 }
11818}
11819
11820#[repr(C)]
11822pub struct WireOptions<'de> {
11823 table: ::fidl_next::WireTable<'de>,
11824}
11825
11826impl<'de> Drop for WireOptions<'de> {
11827 fn drop(&mut self) {
11828 let _ = self
11829 .table
11830 .get(1)
11831 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireNodeAttributesQuery>() });
11832
11833 let _ = self.table.get(2).map(|envelope| unsafe {
11834 envelope.read_unchecked::<crate::WireMutableNodeAttributes<'de>>()
11835 });
11836 }
11837}
11838
11839unsafe impl ::fidl_next::Wire for WireOptions<'static> {
11840 type Decoded<'de> = WireOptions<'de>;
11841
11842 #[inline]
11843 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11844 ::fidl_next::munge!(let Self { table } = out);
11845 ::fidl_next::WireTable::zero_padding(table);
11846 }
11847}
11848
11849unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptions<'static>
11850where
11851 ___D: ::fidl_next::Decoder + ?Sized,
11852{
11853 fn decode(
11854 slot: ::fidl_next::Slot<'_, Self>,
11855 decoder: &mut ___D,
11856 ) -> Result<(), ::fidl_next::DecodeError> {
11857 ::fidl_next::munge!(let Self { table } = slot);
11858
11859 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11860 match ordinal {
11861 0 => unsafe { ::core::hint::unreachable_unchecked() },
11862
11863 1 => {
11864 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributesQuery>(
11865 slot.as_mut(),
11866 decoder,
11867 )?;
11868
11869 Ok(())
11870 }
11871
11872 2 => {
11873 ::fidl_next::WireEnvelope::decode_as::<
11874 ___D,
11875 crate::WireMutableNodeAttributes<'static>,
11876 >(slot.as_mut(), decoder)?;
11877
11878 Ok(())
11879 }
11880
11881 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11882 }
11883 })
11884 }
11885}
11886
11887impl<'de> WireOptions<'de> {
11888 pub fn attributes(&self) -> Option<&crate::WireNodeAttributesQuery> {
11889 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11890 }
11891
11892 pub fn create_attributes(&self) -> Option<&crate::WireMutableNodeAttributes<'de>> {
11893 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11894 }
11895}
11896
11897impl<'de> ::core::fmt::Debug for WireOptions<'de> {
11898 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11899 f.debug_struct("Options")
11900 .field("attributes", &self.attributes())
11901 .field("create_attributes", &self.create_attributes())
11902 .finish()
11903 }
11904}
11905
11906#[derive(Debug)]
11907pub struct DirectoryOpenRequest {
11908 pub path: String,
11909
11910 pub flags: crate::Flags,
11911
11912 pub options: crate::Options,
11913
11914 pub object: ::fidl_next::fuchsia::zx::Channel,
11915}
11916
11917impl ::fidl_next::Encodable for DirectoryOpenRequest {
11918 type Encoded = WireDirectoryOpenRequest<'static>;
11919}
11920
11921unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryOpenRequest
11922where
11923 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11924 ___E: ::fidl_next::Encoder,
11925 ___E: ::fidl_next::fuchsia::HandleEncoder,
11926{
11927 #[inline]
11928 fn encode(
11929 self,
11930 encoder: &mut ___E,
11931 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11932 ) -> Result<(), ::fidl_next::EncodeError> {
11933 ::fidl_next::munge! {
11934 let Self::Encoded {
11935 path,
11936 flags,
11937 options,
11938 object,
11939
11940 } = out;
11941 }
11942
11943 ::fidl_next::Encode::encode(self.path, encoder, path)?;
11944
11945 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
11946
11947 ::fidl_next::Encode::encode(self.options, encoder, options)?;
11948
11949 ::fidl_next::Encode::encode(self.object, encoder, object)?;
11950
11951 Ok(())
11952 }
11953}
11954
11955impl ::fidl_next::EncodableOption for DirectoryOpenRequest {
11956 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryOpenRequest<'static>>;
11957}
11958
11959unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryOpenRequest
11960where
11961 ___E: ::fidl_next::Encoder + ?Sized,
11962 DirectoryOpenRequest: ::fidl_next::Encode<___E>,
11963{
11964 #[inline]
11965 fn encode_option(
11966 this: Option<Self>,
11967 encoder: &mut ___E,
11968 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11969 ) -> Result<(), ::fidl_next::EncodeError> {
11970 if let Some(inner) = this {
11971 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11972 ::fidl_next::WireBox::encode_present(out);
11973 } else {
11974 ::fidl_next::WireBox::encode_absent(out);
11975 }
11976
11977 Ok(())
11978 }
11979}
11980
11981impl<'de> ::fidl_next::FromWire<WireDirectoryOpenRequest<'de>> for DirectoryOpenRequest {
11982 #[inline]
11983 fn from_wire(wire: WireDirectoryOpenRequest<'de>) -> Self {
11984 Self {
11985 path: ::fidl_next::FromWire::from_wire(wire.path),
11986
11987 flags: ::fidl_next::FromWire::from_wire(wire.flags),
11988
11989 options: ::fidl_next::FromWire::from_wire(wire.options),
11990
11991 object: ::fidl_next::FromWire::from_wire(wire.object),
11992 }
11993 }
11994}
11995
11996#[derive(Debug)]
11998#[repr(C)]
11999pub struct WireDirectoryOpenRequest<'de> {
12000 pub path: ::fidl_next::WireString<'de>,
12001
12002 pub flags: crate::WireFlags,
12003
12004 pub options: crate::WireOptions<'de>,
12005
12006 pub object: ::fidl_next::fuchsia::WireChannel,
12007}
12008
12009unsafe impl ::fidl_next::Wire for WireDirectoryOpenRequest<'static> {
12010 type Decoded<'de> = WireDirectoryOpenRequest<'de>;
12011
12012 #[inline]
12013 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12014 unsafe {
12015 out.as_mut_ptr().cast::<u8>().add(44).write_bytes(0, 4);
12016 }
12017 }
12018}
12019
12020unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryOpenRequest<'static>
12021where
12022 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12023 ___D: ::fidl_next::Decoder,
12024 ___D: ::fidl_next::fuchsia::HandleDecoder,
12025{
12026 fn decode(
12027 slot: ::fidl_next::Slot<'_, Self>,
12028 decoder: &mut ___D,
12029 ) -> Result<(), ::fidl_next::DecodeError> {
12030 ::fidl_next::munge! {
12031 let Self {
12032 mut path,
12033 mut flags,
12034 mut options,
12035 mut object,
12036
12037 } = slot;
12038 }
12039
12040 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
12041
12042 let path = unsafe { path.deref_unchecked() };
12043
12044 if path.len() > 4095 {
12045 return Err(::fidl_next::DecodeError::VectorTooLong {
12046 size: path.len() as u64,
12047 limit: 4095,
12048 });
12049 }
12050
12051 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
12052
12053 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
12054
12055 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
12056
12057 Ok(())
12058 }
12059}
12060
12061#[derive(Debug)]
12062#[repr(C)]
12063pub struct NodeDeprecatedCloneRequest {
12064 pub flags: crate::OpenFlags,
12065
12066 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
12067}
12068
12069impl ::fidl_next::Encodable for NodeDeprecatedCloneRequest {
12070 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireNodeDeprecatedCloneRequest> = unsafe {
12071 ::fidl_next::CopyOptimization::enable_if(
12072 true
12073
12074 && <
12075 crate::OpenFlags as ::fidl_next::Encodable
12076 >::COPY_OPTIMIZATION.is_enabled()
12077
12078 && <
12079 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
12080 >::COPY_OPTIMIZATION.is_enabled()
12081
12082 )
12083 };
12084
12085 type Encoded = WireNodeDeprecatedCloneRequest;
12086}
12087
12088unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedCloneRequest
12089where
12090 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12091 ___E: ::fidl_next::fuchsia::HandleEncoder,
12092{
12093 #[inline]
12094 fn encode(
12095 self,
12096 encoder: &mut ___E,
12097 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12098 ) -> Result<(), ::fidl_next::EncodeError> {
12099 ::fidl_next::munge! {
12100 let Self::Encoded {
12101 flags,
12102 object,
12103
12104 } = out;
12105 }
12106
12107 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12108
12109 ::fidl_next::Encode::encode(self.object, encoder, object)?;
12110
12111 Ok(())
12112 }
12113}
12114
12115impl ::fidl_next::EncodableOption for NodeDeprecatedCloneRequest {
12116 type EncodedOption = ::fidl_next::WireBox<'static, WireNodeDeprecatedCloneRequest>;
12117}
12118
12119unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeDeprecatedCloneRequest
12120where
12121 ___E: ::fidl_next::Encoder + ?Sized,
12122 NodeDeprecatedCloneRequest: ::fidl_next::Encode<___E>,
12123{
12124 #[inline]
12125 fn encode_option(
12126 this: Option<Self>,
12127 encoder: &mut ___E,
12128 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12129 ) -> Result<(), ::fidl_next::EncodeError> {
12130 if let Some(inner) = this {
12131 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12132 ::fidl_next::WireBox::encode_present(out);
12133 } else {
12134 ::fidl_next::WireBox::encode_absent(out);
12135 }
12136
12137 Ok(())
12138 }
12139}
12140
12141impl ::fidl_next::FromWire<WireNodeDeprecatedCloneRequest> for NodeDeprecatedCloneRequest {
12142 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireNodeDeprecatedCloneRequest, Self> = unsafe {
12143 ::fidl_next::CopyOptimization::enable_if(
12144 true
12145
12146 && <
12147 crate::OpenFlags as ::fidl_next::FromWire<crate::WireOpenFlags>
12148 >::COPY_OPTIMIZATION.is_enabled()
12149
12150 && <
12151 ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>>
12152 >::COPY_OPTIMIZATION.is_enabled()
12153
12154 )
12155 };
12156
12157 #[inline]
12158 fn from_wire(wire: WireNodeDeprecatedCloneRequest) -> Self {
12159 Self {
12160 flags: ::fidl_next::FromWire::from_wire(wire.flags),
12161
12162 object: ::fidl_next::FromWire::from_wire(wire.object),
12163 }
12164 }
12165}
12166
12167#[derive(Debug)]
12169#[repr(C)]
12170pub struct WireNodeDeprecatedCloneRequest {
12171 pub flags: crate::WireOpenFlags,
12172
12173 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
12174}
12175
12176unsafe impl ::fidl_next::Wire for WireNodeDeprecatedCloneRequest {
12177 type Decoded<'de> = WireNodeDeprecatedCloneRequest;
12178
12179 #[inline]
12180 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
12181}
12182
12183unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedCloneRequest
12184where
12185 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12186 ___D: ::fidl_next::fuchsia::HandleDecoder,
12187{
12188 fn decode(
12189 slot: ::fidl_next::Slot<'_, Self>,
12190 decoder: &mut ___D,
12191 ) -> Result<(), ::fidl_next::DecodeError> {
12192 ::fidl_next::munge! {
12193 let Self {
12194 mut flags,
12195 mut object,
12196
12197 } = slot;
12198 }
12199
12200 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
12201
12202 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
12203
12204 Ok(())
12205 }
12206}
12207
12208#[doc = " Node defines the minimal interface for entities which can be accessed in a filesystem.\n"]
12210#[derive(Debug)]
12211pub struct Node;
12212
12213impl ::fidl_next::Discoverable for Node {
12214 const PROTOCOL_NAME: &'static str = "fuchsia.io.Node";
12215}
12216
12217pub mod node {
12218 pub mod prelude {
12219 pub use crate::{Node, NodeClientHandler, NodeServerHandler, node};
12220
12221 pub use crate::ExtendedAttributeValue;
12222
12223 pub use crate::MutableNodeAttributes;
12224
12225 pub use crate::NodeAttributes2;
12226
12227 pub use crate::NodeDeprecatedCloneRequest;
12228
12229 pub use crate::NodeDeprecatedGetAttrResponse;
12230
12231 pub use crate::NodeDeprecatedGetFlagsResponse;
12232
12233 pub use crate::NodeDeprecatedSetAttrRequest;
12234
12235 pub use crate::NodeDeprecatedSetAttrResponse;
12236
12237 pub use crate::NodeDeprecatedSetFlagsRequest;
12238
12239 pub use crate::NodeDeprecatedSetFlagsResponse;
12240
12241 pub use crate::NodeGetAttributesRequest;
12242
12243 pub use crate::NodeGetExtendedAttributeRequest;
12244
12245 pub use crate::NodeListExtendedAttributesRequest;
12246
12247 pub use crate::NodeOnOpenRequest;
12248
12249 pub use crate::NodeQueryFilesystemResponse;
12250
12251 pub use crate::NodeRemoveExtendedAttributeRequest;
12252
12253 pub use crate::NodeSetExtendedAttributeRequest;
12254
12255 pub use crate::NodeSetFlagsRequest;
12256
12257 pub use crate::NodeGetFlagsResponse;
12258
12259 pub use crate::NodeRemoveExtendedAttributeResponse;
12260
12261 pub use crate::NodeSetExtendedAttributeResponse;
12262
12263 pub use crate::NodeSetFlagsResponse;
12264
12265 pub use crate::NodeSyncResponse;
12266
12267 pub use crate::NodeUpdateAttributesResponse;
12268
12269 pub use crate::Representation;
12270
12271 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
12272
12273 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
12274
12275 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
12276 }
12277
12278 pub struct Clone;
12279
12280 impl ::fidl_next::Method for Clone {
12281 const ORDINAL: u64 = 2366825959783828089;
12282
12283 type Protocol = crate::Node;
12284
12285 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
12286
12287 type Response = ::fidl_next::Never;
12288 }
12289
12290 pub struct Close;
12291
12292 impl ::fidl_next::Method for Close {
12293 const ORDINAL: u64 = 6540867515453498750;
12294
12295 type Protocol = crate::Node;
12296
12297 type Request = ();
12298
12299 type Response = ::fidl_next::WireResult<
12300 'static,
12301 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
12302 ::fidl_next::WireI32,
12303 >;
12304 }
12305
12306 pub struct Query;
12307
12308 impl ::fidl_next::Method for Query {
12309 const ORDINAL: u64 = 2763219980499352582;
12310
12311 type Protocol = crate::Node;
12312
12313 type Request = ();
12314
12315 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
12316 }
12317
12318 pub struct DeprecatedClone;
12319
12320 impl ::fidl_next::Method for DeprecatedClone {
12321 const ORDINAL: u64 = 6512600400724287855;
12322
12323 type Protocol = crate::Node;
12324
12325 type Request = crate::WireNodeDeprecatedCloneRequest;
12326
12327 type Response = ::fidl_next::Never;
12328 }
12329
12330 pub struct OnOpen;
12331
12332 impl ::fidl_next::Method for OnOpen {
12333 const ORDINAL: u64 = 9207534335756671346;
12334
12335 type Protocol = crate::Node;
12336
12337 type Request = ::fidl_next::Never;
12338
12339 type Response = crate::WireNodeOnOpenRequest<'static>;
12340 }
12341
12342 pub struct DeprecatedGetAttr;
12343
12344 impl ::fidl_next::Method for DeprecatedGetAttr {
12345 const ORDINAL: u64 = 8689798978500614909;
12346
12347 type Protocol = crate::Node;
12348
12349 type Request = ();
12350
12351 type Response = crate::WireNodeDeprecatedGetAttrResponse;
12352 }
12353
12354 pub struct DeprecatedSetAttr;
12355
12356 impl ::fidl_next::Method for DeprecatedSetAttr {
12357 const ORDINAL: u64 = 4721673413776871238;
12358
12359 type Protocol = crate::Node;
12360
12361 type Request = crate::WireNodeDeprecatedSetAttrRequest;
12362
12363 type Response = crate::WireNodeDeprecatedSetAttrResponse;
12364 }
12365
12366 pub struct DeprecatedGetFlags;
12367
12368 impl ::fidl_next::Method for DeprecatedGetFlags {
12369 const ORDINAL: u64 = 6595803110182632097;
12370
12371 type Protocol = crate::Node;
12372
12373 type Request = ();
12374
12375 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
12376 }
12377
12378 pub struct DeprecatedSetFlags;
12379
12380 impl ::fidl_next::Method for DeprecatedSetFlags {
12381 const ORDINAL: u64 = 5950864159036794675;
12382
12383 type Protocol = crate::Node;
12384
12385 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
12386
12387 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
12388 }
12389
12390 pub struct GetFlags;
12391
12392 impl ::fidl_next::Method for GetFlags {
12393 const ORDINAL: u64 = 105530239381466147;
12394
12395 type Protocol = crate::Node;
12396
12397 type Request = ();
12398
12399 type Response = ::fidl_next::WireFlexibleResult<
12400 'static,
12401 crate::WireNodeGetFlagsResponse,
12402 ::fidl_next::WireI32,
12403 >;
12404 }
12405
12406 pub struct SetFlags;
12407
12408 impl ::fidl_next::Method for SetFlags {
12409 const ORDINAL: u64 = 6172186066099445416;
12410
12411 type Protocol = crate::Node;
12412
12413 type Request = crate::WireNodeSetFlagsRequest;
12414
12415 type Response = ::fidl_next::WireFlexibleResult<
12416 'static,
12417 crate::WireNodeSetFlagsResponse,
12418 ::fidl_next::WireI32,
12419 >;
12420 }
12421
12422 pub struct QueryFilesystem;
12423
12424 impl ::fidl_next::Method for QueryFilesystem {
12425 const ORDINAL: u64 = 8013111122914313744;
12426
12427 type Protocol = crate::Node;
12428
12429 type Request = ();
12430
12431 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
12432 }
12433
12434 pub struct OnRepresentation;
12435
12436 impl ::fidl_next::Method for OnRepresentation {
12437 const ORDINAL: u64 = 6679970090861613324;
12438
12439 type Protocol = crate::Node;
12440
12441 type Request = ::fidl_next::Never;
12442
12443 type Response = crate::WireRepresentation<'static>;
12444 }
12445
12446 pub struct GetAttributes;
12447
12448 impl ::fidl_next::Method for GetAttributes {
12449 const ORDINAL: u64 = 4414537700416816443;
12450
12451 type Protocol = crate::Node;
12452
12453 type Request = crate::WireNodeGetAttributesRequest;
12454
12455 type Response = ::fidl_next::WireResult<
12456 'static,
12457 crate::WireNodeAttributes2<'static>,
12458 ::fidl_next::WireI32,
12459 >;
12460 }
12461
12462 pub struct UpdateAttributes;
12463
12464 impl ::fidl_next::Method for UpdateAttributes {
12465 const ORDINAL: u64 = 3677402239314018056;
12466
12467 type Protocol = crate::Node;
12468
12469 type Request = crate::WireMutableNodeAttributes<'static>;
12470
12471 type Response = ::fidl_next::WireResult<
12472 'static,
12473 crate::WireNodeUpdateAttributesResponse,
12474 ::fidl_next::WireI32,
12475 >;
12476 }
12477
12478 pub struct Sync;
12479
12480 impl ::fidl_next::Method for Sync {
12481 const ORDINAL: u64 = 3196473584242777161;
12482
12483 type Protocol = crate::Node;
12484
12485 type Request = ();
12486
12487 type Response =
12488 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
12489 }
12490
12491 pub struct ListExtendedAttributes;
12492
12493 impl ::fidl_next::Method for ListExtendedAttributes {
12494 const ORDINAL: u64 = 5431626189872037072;
12495
12496 type Protocol = crate::Node;
12497
12498 type Request = crate::WireNodeListExtendedAttributesRequest;
12499
12500 type Response = ::fidl_next::Never;
12501 }
12502
12503 pub struct GetExtendedAttribute;
12504
12505 impl ::fidl_next::Method for GetExtendedAttribute {
12506 const ORDINAL: u64 = 5043930208506967771;
12507
12508 type Protocol = crate::Node;
12509
12510 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
12511
12512 type Response = ::fidl_next::WireResult<
12513 'static,
12514 crate::WireExtendedAttributeValue<'static>,
12515 ::fidl_next::WireI32,
12516 >;
12517 }
12518
12519 pub struct SetExtendedAttribute;
12520
12521 impl ::fidl_next::Method for SetExtendedAttribute {
12522 const ORDINAL: u64 = 5374223046099989052;
12523
12524 type Protocol = crate::Node;
12525
12526 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
12527
12528 type Response = ::fidl_next::WireResult<
12529 'static,
12530 crate::WireNodeSetExtendedAttributeResponse,
12531 ::fidl_next::WireI32,
12532 >;
12533 }
12534
12535 pub struct RemoveExtendedAttribute;
12536
12537 impl ::fidl_next::Method for RemoveExtendedAttribute {
12538 const ORDINAL: u64 = 8794297771444732717;
12539
12540 type Protocol = crate::Node;
12541
12542 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
12543
12544 type Response = ::fidl_next::WireResult<
12545 'static,
12546 crate::WireNodeRemoveExtendedAttributeResponse,
12547 ::fidl_next::WireI32,
12548 >;
12549 }
12550
12551 mod ___detail {
12552
12553 pub struct Clone<T0> {
12554 request: T0,
12555 }
12556
12557 impl<T0> ::fidl_next::Encodable for Clone<T0>
12558 where
12559 T0: ::fidl_next::Encodable<
12560 Encoded = ::fidl_next::ServerEnd<
12561 ::fidl_next_fuchsia_unknown::Cloneable,
12562 ::fidl_next::fuchsia::WireChannel,
12563 >,
12564 >,
12565 {
12566 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
12567 }
12568
12569 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
12570 where
12571 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12572 ___E: ::fidl_next::fuchsia::HandleEncoder,
12573 T0: ::fidl_next::Encode<
12574 ___E,
12575 Encoded = ::fidl_next::ServerEnd<
12576 ::fidl_next_fuchsia_unknown::Cloneable,
12577 ::fidl_next::fuchsia::WireChannel,
12578 >,
12579 >,
12580 {
12581 #[inline]
12582 fn encode(
12583 self,
12584 encoder: &mut ___E,
12585 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12586 ) -> Result<(), ::fidl_next::EncodeError> {
12587 ::fidl_next::munge! {
12588 let Self::Encoded {
12589 request,
12590
12591 } = out;
12592 }
12593
12594 ::fidl_next::Encode::encode(self.request, encoder, request)?;
12595
12596 Ok(())
12597 }
12598 }
12599
12600 pub struct DeprecatedClone<T0, T1> {
12601 flags: T0,
12602
12603 object: T1,
12604 }
12605
12606 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
12607 where
12608 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
12609 T1: ::fidl_next::Encodable<
12610 Encoded = ::fidl_next::ServerEnd<
12611 crate::Node,
12612 ::fidl_next::fuchsia::WireChannel,
12613 >,
12614 >,
12615 {
12616 type Encoded = crate::WireNodeDeprecatedCloneRequest;
12617 }
12618
12619 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
12620 where
12621 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12622 ___E: ::fidl_next::fuchsia::HandleEncoder,
12623 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
12624 T1: ::fidl_next::Encode<
12625 ___E,
12626 Encoded = ::fidl_next::ServerEnd<
12627 crate::Node,
12628 ::fidl_next::fuchsia::WireChannel,
12629 >,
12630 >,
12631 {
12632 #[inline]
12633 fn encode(
12634 self,
12635 encoder: &mut ___E,
12636 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12637 ) -> Result<(), ::fidl_next::EncodeError> {
12638 ::fidl_next::munge! {
12639 let Self::Encoded {
12640 flags,
12641 object,
12642
12643 } = out;
12644 }
12645
12646 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12647
12648 ::fidl_next::Encode::encode(self.object, encoder, object)?;
12649
12650 Ok(())
12651 }
12652 }
12653
12654 pub struct OnOpen<T0, T1> {
12655 s: T0,
12656
12657 info: T1,
12658 }
12659
12660 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
12661 where
12662 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
12663 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
12664 {
12665 type Encoded = crate::WireNodeOnOpenRequest<'static>;
12666 }
12667
12668 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
12669 where
12670 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12671 ___E: ::fidl_next::Encoder,
12672 ___E: ::fidl_next::fuchsia::HandleEncoder,
12673 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
12674 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
12675 {
12676 #[inline]
12677 fn encode(
12678 self,
12679 encoder: &mut ___E,
12680 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12681 ) -> Result<(), ::fidl_next::EncodeError> {
12682 ::fidl_next::munge! {
12683 let Self::Encoded {
12684 s,
12685 info,
12686
12687 } = out;
12688 }
12689
12690 ::fidl_next::Encode::encode(self.s, encoder, s)?;
12691
12692 ::fidl_next::Encode::encode(self.info, encoder, info)?;
12693
12694 Ok(())
12695 }
12696 }
12697
12698 pub struct DeprecatedSetAttr<T0, T1> {
12699 flags: T0,
12700
12701 attributes: T1,
12702 }
12703
12704 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
12705 where
12706 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
12707 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
12708 {
12709 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
12710 }
12711
12712 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
12713 where
12714 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12715 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
12716 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
12717 {
12718 #[inline]
12719 fn encode(
12720 self,
12721 encoder: &mut ___E,
12722 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12723 ) -> Result<(), ::fidl_next::EncodeError> {
12724 ::fidl_next::munge! {
12725 let Self::Encoded {
12726 flags,
12727 attributes,
12728
12729 } = out;
12730 }
12731
12732 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12733
12734 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
12735
12736 Ok(())
12737 }
12738 }
12739
12740 pub struct DeprecatedSetFlags<T0> {
12741 flags: T0,
12742 }
12743
12744 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
12745 where
12746 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
12747 {
12748 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
12749 }
12750
12751 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
12752 where
12753 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12754 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
12755 {
12756 #[inline]
12757 fn encode(
12758 self,
12759 encoder: &mut ___E,
12760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12761 ) -> Result<(), ::fidl_next::EncodeError> {
12762 ::fidl_next::munge! {
12763 let Self::Encoded {
12764 flags,
12765
12766 } = out;
12767 }
12768
12769 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12770
12771 Ok(())
12772 }
12773 }
12774
12775 pub struct SetFlags<T0> {
12776 flags: T0,
12777 }
12778
12779 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
12780 where
12781 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
12782 {
12783 type Encoded = crate::WireNodeSetFlagsRequest;
12784 }
12785
12786 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
12787 where
12788 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12789 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
12790 {
12791 #[inline]
12792 fn encode(
12793 self,
12794 encoder: &mut ___E,
12795 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12796 ) -> Result<(), ::fidl_next::EncodeError> {
12797 ::fidl_next::munge! {
12798 let Self::Encoded {
12799 flags,
12800
12801 } = out;
12802 }
12803
12804 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12805
12806 Ok(())
12807 }
12808 }
12809
12810 pub struct GetAttributes<T0> {
12811 query: T0,
12812 }
12813
12814 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
12815 where
12816 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
12817 {
12818 type Encoded = crate::WireNodeGetAttributesRequest;
12819 }
12820
12821 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
12822 where
12823 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12824 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
12825 {
12826 #[inline]
12827 fn encode(
12828 self,
12829 encoder: &mut ___E,
12830 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12831 ) -> Result<(), ::fidl_next::EncodeError> {
12832 ::fidl_next::munge! {
12833 let Self::Encoded {
12834 query,
12835
12836 } = out;
12837 }
12838
12839 ::fidl_next::Encode::encode(self.query, encoder, query)?;
12840
12841 Ok(())
12842 }
12843 }
12844
12845 pub struct ListExtendedAttributes<T0> {
12846 iterator: T0,
12847 }
12848
12849 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
12850 where
12851 T0: ::fidl_next::Encodable<
12852 Encoded = ::fidl_next::ServerEnd<
12853 crate::ExtendedAttributeIterator,
12854 ::fidl_next::fuchsia::WireChannel,
12855 >,
12856 >,
12857 {
12858 type Encoded = crate::WireNodeListExtendedAttributesRequest;
12859 }
12860
12861 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
12862 where
12863 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12864 ___E: ::fidl_next::fuchsia::HandleEncoder,
12865 T0: ::fidl_next::Encode<
12866 ___E,
12867 Encoded = ::fidl_next::ServerEnd<
12868 crate::ExtendedAttributeIterator,
12869 ::fidl_next::fuchsia::WireChannel,
12870 >,
12871 >,
12872 {
12873 #[inline]
12874 fn encode(
12875 self,
12876 encoder: &mut ___E,
12877 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12878 ) -> Result<(), ::fidl_next::EncodeError> {
12879 ::fidl_next::munge! {
12880 let Self::Encoded {
12881 iterator,
12882
12883 } = out;
12884 }
12885
12886 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
12887
12888 Ok(())
12889 }
12890 }
12891
12892 pub struct GetExtendedAttribute<T0> {
12893 name: T0,
12894 }
12895
12896 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
12897 where
12898 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12899 {
12900 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
12901 }
12902
12903 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
12904 where
12905 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12906 ___E: ::fidl_next::Encoder,
12907 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12908 {
12909 #[inline]
12910 fn encode(
12911 self,
12912 encoder: &mut ___E,
12913 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12914 ) -> Result<(), ::fidl_next::EncodeError> {
12915 ::fidl_next::munge! {
12916 let Self::Encoded {
12917 name,
12918
12919 } = out;
12920 }
12921
12922 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12923
12924 Ok(())
12925 }
12926 }
12927
12928 pub struct SetExtendedAttribute<T0, T1, T2> {
12929 name: T0,
12930
12931 value: T1,
12932
12933 mode: T2,
12934 }
12935
12936 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
12937 where
12938 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12939 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
12940 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
12941 {
12942 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
12943 }
12944
12945 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
12946 where
12947 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12948 ___E: ::fidl_next::Encoder,
12949 ___E: ::fidl_next::fuchsia::HandleEncoder,
12950 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12951 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
12952 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
12953 {
12954 #[inline]
12955 fn encode(
12956 self,
12957 encoder: &mut ___E,
12958 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12959 ) -> Result<(), ::fidl_next::EncodeError> {
12960 ::fidl_next::munge! {
12961 let Self::Encoded {
12962 name,
12963 value,
12964 mode,
12965
12966 } = out;
12967 }
12968
12969 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12970
12971 ::fidl_next::Encode::encode(self.value, encoder, value)?;
12972
12973 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
12974
12975 Ok(())
12976 }
12977 }
12978
12979 pub struct RemoveExtendedAttribute<T0> {
12980 name: T0,
12981 }
12982
12983 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
12984 where
12985 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
12986 {
12987 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
12988 }
12989
12990 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
12991 where
12992 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12993 ___E: ::fidl_next::Encoder,
12994 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
12995 {
12996 #[inline]
12997 fn encode(
12998 self,
12999 encoder: &mut ___E,
13000 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13001 ) -> Result<(), ::fidl_next::EncodeError> {
13002 ::fidl_next::munge! {
13003 let Self::Encoded {
13004 name,
13005
13006 } = out;
13007 }
13008
13009 ::fidl_next::Encode::encode(self.name, encoder, name)?;
13010
13011 Ok(())
13012 }
13013 }
13014
13015 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Node
13016 where
13017 ___T: ::fidl_next::Transport,
13018 {
13019 type ClientSender = NodeClientSender<___T>;
13020 type ServerSender = NodeServerSender<___T>;
13021 }
13022
13023 #[repr(transparent)]
13025 pub struct NodeClientSender<___T: ::fidl_next::Transport> {
13026 #[allow(dead_code)]
13027 sender: ::fidl_next::protocol::ClientSender<___T>,
13028 }
13029
13030 impl<___T> NodeClientSender<___T>
13031 where
13032 ___T: ::fidl_next::Transport,
13033 {
13034 pub fn clone(
13035 &self,
13036
13037 request: impl ::fidl_next::Encode<
13038 <___T as ::fidl_next::Transport>::SendBuffer,
13039 Encoded = ::fidl_next::ServerEnd<
13040 ::fidl_next_fuchsia_unknown::Cloneable,
13041 ::fidl_next::fuchsia::WireChannel,
13042 >,
13043 >,
13044 ) -> ::fidl_next::SendFuture<'_, ___T>
13045 where
13046 <___T as ::fidl_next::Transport>::SendBuffer:
13047 ::fidl_next::encoder::InternalHandleEncoder,
13048 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13049 {
13050 self.clone_with(Clone { request })
13051 }
13052
13053 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
13054 where
13055 ___R: ::fidl_next::Encode<
13056 <___T as ::fidl_next::Transport>::SendBuffer,
13057 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
13058 >,
13059 {
13060 ::fidl_next::SendFuture::from_untyped(
13061 self.sender.send_one_way(2366825959783828089, request),
13062 )
13063 }
13064
13065 #[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"]
13066 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
13067 ::fidl_next::TwoWayFuture::from_untyped(
13068 self.sender.send_two_way(6540867515453498750, ()),
13069 )
13070 }
13071
13072 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
13073 ::fidl_next::TwoWayFuture::from_untyped(
13074 self.sender.send_two_way(2763219980499352582, ()),
13075 )
13076 }
13077
13078 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13079 pub fn deprecated_clone(
13080 &self,
13081
13082 flags: impl ::fidl_next::Encode<
13083 <___T as ::fidl_next::Transport>::SendBuffer,
13084 Encoded = crate::WireOpenFlags,
13085 >,
13086
13087 object: impl ::fidl_next::Encode<
13088 <___T as ::fidl_next::Transport>::SendBuffer,
13089 Encoded = ::fidl_next::ServerEnd<
13090 crate::Node,
13091 ::fidl_next::fuchsia::WireChannel,
13092 >,
13093 >,
13094 ) -> ::fidl_next::SendFuture<'_, ___T>
13095 where
13096 <___T as ::fidl_next::Transport>::SendBuffer:
13097 ::fidl_next::encoder::InternalHandleEncoder,
13098 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13099 {
13100 self.deprecated_clone_with(DeprecatedClone { flags, object })
13101 }
13102
13103 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13104 pub fn deprecated_clone_with<___R>(
13105 &self,
13106 request: ___R,
13107 ) -> ::fidl_next::SendFuture<'_, ___T>
13108 where
13109 ___R: ::fidl_next::Encode<
13110 <___T as ::fidl_next::Transport>::SendBuffer,
13111 Encoded = crate::WireNodeDeprecatedCloneRequest,
13112 >,
13113 {
13114 ::fidl_next::SendFuture::from_untyped(
13115 self.sender.send_one_way(6512600400724287855, request),
13116 )
13117 }
13118
13119 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
13120 pub fn deprecated_get_attr(
13121 &self,
13122 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
13123 ::fidl_next::TwoWayFuture::from_untyped(
13124 self.sender.send_two_way(8689798978500614909, ()),
13125 )
13126 }
13127
13128 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
13129 pub fn deprecated_set_attr(
13130 &self,
13131
13132 flags: impl ::fidl_next::Encode<
13133 <___T as ::fidl_next::Transport>::SendBuffer,
13134 Encoded = crate::WireNodeAttributeFlags,
13135 >,
13136
13137 attributes: impl ::fidl_next::Encode<
13138 <___T as ::fidl_next::Transport>::SendBuffer,
13139 Encoded = crate::WireNodeAttributes,
13140 >,
13141 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
13142 where
13143 <___T as ::fidl_next::Transport>::SendBuffer:
13144 ::fidl_next::encoder::InternalHandleEncoder,
13145 {
13146 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
13147 }
13148
13149 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
13150 pub fn deprecated_set_attr_with<___R>(
13151 &self,
13152 request: ___R,
13153 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
13154 where
13155 ___R: ::fidl_next::Encode<
13156 <___T as ::fidl_next::Transport>::SendBuffer,
13157 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
13158 >,
13159 {
13160 ::fidl_next::TwoWayFuture::from_untyped(
13161 self.sender.send_two_way(4721673413776871238, request),
13162 )
13163 }
13164
13165 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
13166 pub fn deprecated_get_flags(
13167 &self,
13168 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
13169 ::fidl_next::TwoWayFuture::from_untyped(
13170 self.sender.send_two_way(6595803110182632097, ()),
13171 )
13172 }
13173
13174 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13175 pub fn deprecated_set_flags(
13176 &self,
13177
13178 flags: impl ::fidl_next::Encode<
13179 <___T as ::fidl_next::Transport>::SendBuffer,
13180 Encoded = crate::WireOpenFlags,
13181 >,
13182 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
13183 where
13184 <___T as ::fidl_next::Transport>::SendBuffer:
13185 ::fidl_next::encoder::InternalHandleEncoder,
13186 {
13187 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
13188 }
13189
13190 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13191 pub fn deprecated_set_flags_with<___R>(
13192 &self,
13193 request: ___R,
13194 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
13195 where
13196 ___R: ::fidl_next::Encode<
13197 <___T as ::fidl_next::Transport>::SendBuffer,
13198 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
13199 >,
13200 {
13201 ::fidl_next::TwoWayFuture::from_untyped(
13202 self.sender.send_two_way(5950864159036794675, request),
13203 )
13204 }
13205
13206 #[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"]
13207 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
13208 ::fidl_next::TwoWayFuture::from_untyped(
13209 self.sender.send_two_way(105530239381466147, ()),
13210 )
13211 }
13212
13213 #[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"]
13214 pub fn set_flags(
13215 &self,
13216
13217 flags: impl ::fidl_next::Encode<
13218 <___T as ::fidl_next::Transport>::SendBuffer,
13219 Encoded = crate::WireFlags,
13220 >,
13221 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
13222 where
13223 <___T as ::fidl_next::Transport>::SendBuffer:
13224 ::fidl_next::encoder::InternalHandleEncoder,
13225 {
13226 self.set_flags_with(SetFlags { flags })
13227 }
13228
13229 #[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"]
13230 pub fn set_flags_with<___R>(
13231 &self,
13232 request: ___R,
13233 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
13234 where
13235 ___R: ::fidl_next::Encode<
13236 <___T as ::fidl_next::Transport>::SendBuffer,
13237 Encoded = crate::WireNodeSetFlagsRequest,
13238 >,
13239 {
13240 ::fidl_next::TwoWayFuture::from_untyped(
13241 self.sender.send_two_way(6172186066099445416, request),
13242 )
13243 }
13244
13245 #[doc = " Query the filesystem for filesystem-specific information.\n"]
13246 pub fn query_filesystem(
13247 &self,
13248 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
13249 ::fidl_next::TwoWayFuture::from_untyped(
13250 self.sender.send_two_way(8013111122914313744, ()),
13251 )
13252 }
13253
13254 #[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"]
13255 pub fn get_attributes(
13256 &self,
13257
13258 query: impl ::fidl_next::Encode<
13259 <___T as ::fidl_next::Transport>::SendBuffer,
13260 Encoded = crate::WireNodeAttributesQuery,
13261 >,
13262 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
13263 where
13264 <___T as ::fidl_next::Transport>::SendBuffer:
13265 ::fidl_next::encoder::InternalHandleEncoder,
13266 {
13267 self.get_attributes_with(GetAttributes { query })
13268 }
13269
13270 #[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"]
13271 pub fn get_attributes_with<___R>(
13272 &self,
13273 request: ___R,
13274 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
13275 where
13276 ___R: ::fidl_next::Encode<
13277 <___T as ::fidl_next::Transport>::SendBuffer,
13278 Encoded = crate::WireNodeGetAttributesRequest,
13279 >,
13280 {
13281 ::fidl_next::TwoWayFuture::from_untyped(
13282 self.sender.send_two_way(4414537700416816443, request),
13283 )
13284 }
13285
13286 #[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"]
13287 pub fn update_attributes_with<___R>(
13288 &self,
13289 request: ___R,
13290 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
13291 where
13292 ___R: ::fidl_next::Encode<
13293 <___T as ::fidl_next::Transport>::SendBuffer,
13294 Encoded = crate::WireMutableNodeAttributes<'static>,
13295 >,
13296 {
13297 ::fidl_next::TwoWayFuture::from_untyped(
13298 self.sender.send_two_way(3677402239314018056, request),
13299 )
13300 }
13301
13302 #[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"]
13303 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
13304 ::fidl_next::TwoWayFuture::from_untyped(
13305 self.sender.send_two_way(3196473584242777161, ()),
13306 )
13307 }
13308
13309 #[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"]
13310 pub fn list_extended_attributes(
13311 &self,
13312
13313 iterator: impl ::fidl_next::Encode<
13314 <___T as ::fidl_next::Transport>::SendBuffer,
13315 Encoded = ::fidl_next::ServerEnd<
13316 crate::ExtendedAttributeIterator,
13317 ::fidl_next::fuchsia::WireChannel,
13318 >,
13319 >,
13320 ) -> ::fidl_next::SendFuture<'_, ___T>
13321 where
13322 <___T as ::fidl_next::Transport>::SendBuffer:
13323 ::fidl_next::encoder::InternalHandleEncoder,
13324 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13325 {
13326 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
13327 }
13328
13329 #[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"]
13330 pub fn list_extended_attributes_with<___R>(
13331 &self,
13332 request: ___R,
13333 ) -> ::fidl_next::SendFuture<'_, ___T>
13334 where
13335 ___R: ::fidl_next::Encode<
13336 <___T as ::fidl_next::Transport>::SendBuffer,
13337 Encoded = crate::WireNodeListExtendedAttributesRequest,
13338 >,
13339 {
13340 ::fidl_next::SendFuture::from_untyped(
13341 self.sender.send_one_way(5431626189872037072, request),
13342 )
13343 }
13344
13345 #[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"]
13346 pub fn get_extended_attribute(
13347 &self,
13348
13349 name: impl ::fidl_next::Encode<
13350 <___T as ::fidl_next::Transport>::SendBuffer,
13351 Encoded = ::fidl_next::WireVector<'static, u8>,
13352 >,
13353 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
13354 where
13355 <___T as ::fidl_next::Transport>::SendBuffer:
13356 ::fidl_next::encoder::InternalHandleEncoder,
13357 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13358 {
13359 self.get_extended_attribute_with(GetExtendedAttribute { name })
13360 }
13361
13362 #[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"]
13363 pub fn get_extended_attribute_with<___R>(
13364 &self,
13365 request: ___R,
13366 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
13367 where
13368 ___R: ::fidl_next::Encode<
13369 <___T as ::fidl_next::Transport>::SendBuffer,
13370 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
13371 >,
13372 {
13373 ::fidl_next::TwoWayFuture::from_untyped(
13374 self.sender.send_two_way(5043930208506967771, request),
13375 )
13376 }
13377
13378 #[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"]
13379 pub fn set_extended_attribute(
13380 &self,
13381
13382 name: impl ::fidl_next::Encode<
13383 <___T as ::fidl_next::Transport>::SendBuffer,
13384 Encoded = ::fidl_next::WireVector<'static, u8>,
13385 >,
13386
13387 value: impl ::fidl_next::Encode<
13388 <___T as ::fidl_next::Transport>::SendBuffer,
13389 Encoded = crate::WireExtendedAttributeValue<'static>,
13390 >,
13391
13392 mode: impl ::fidl_next::Encode<
13393 <___T as ::fidl_next::Transport>::SendBuffer,
13394 Encoded = crate::WireSetExtendedAttributeMode,
13395 >,
13396 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
13397 where
13398 <___T as ::fidl_next::Transport>::SendBuffer:
13399 ::fidl_next::encoder::InternalHandleEncoder,
13400 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13401 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13402 {
13403 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
13404 }
13405
13406 #[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"]
13407 pub fn set_extended_attribute_with<___R>(
13408 &self,
13409 request: ___R,
13410 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
13411 where
13412 ___R: ::fidl_next::Encode<
13413 <___T as ::fidl_next::Transport>::SendBuffer,
13414 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
13415 >,
13416 {
13417 ::fidl_next::TwoWayFuture::from_untyped(
13418 self.sender.send_two_way(5374223046099989052, request),
13419 )
13420 }
13421
13422 #[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"]
13423 pub fn remove_extended_attribute(
13424 &self,
13425
13426 name: impl ::fidl_next::Encode<
13427 <___T as ::fidl_next::Transport>::SendBuffer,
13428 Encoded = ::fidl_next::WireVector<'static, u8>,
13429 >,
13430 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
13431 where
13432 <___T as ::fidl_next::Transport>::SendBuffer:
13433 ::fidl_next::encoder::InternalHandleEncoder,
13434 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13435 {
13436 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
13437 }
13438
13439 #[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"]
13440 pub fn remove_extended_attribute_with<___R>(
13441 &self,
13442 request: ___R,
13443 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
13444 where
13445 ___R: ::fidl_next::Encode<
13446 <___T as ::fidl_next::Transport>::SendBuffer,
13447 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
13448 >,
13449 {
13450 ::fidl_next::TwoWayFuture::from_untyped(
13451 self.sender.send_two_way(8794297771444732717, request),
13452 )
13453 }
13454 }
13455
13456 #[repr(transparent)]
13458 pub struct NodeServerSender<___T: ::fidl_next::Transport> {
13459 sender: ::fidl_next::protocol::ServerSender<___T>,
13460 }
13461
13462 impl<___T> NodeServerSender<___T>
13463 where
13464 ___T: ::fidl_next::Transport,
13465 {
13466 #[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"]
13467 pub fn on_open(
13468 &self,
13469
13470 s: impl ::fidl_next::Encode<
13471 <___T as ::fidl_next::Transport>::SendBuffer,
13472 Encoded = ::fidl_next::WireI32,
13473 >,
13474
13475 info: impl ::fidl_next::Encode<
13476 <___T as ::fidl_next::Transport>::SendBuffer,
13477 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
13478 >,
13479 ) -> ::fidl_next::SendFuture<'_, ___T>
13480 where
13481 <___T as ::fidl_next::Transport>::SendBuffer:
13482 ::fidl_next::encoder::InternalHandleEncoder,
13483 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
13484 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13485 {
13486 self.on_open_with(OnOpen { s, info })
13487 }
13488
13489 #[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"]
13490
13491 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
13492 where
13493 ___R: ::fidl_next::Encode<
13494 <___T as ::fidl_next::Transport>::SendBuffer,
13495 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
13496 >,
13497 {
13498 ::fidl_next::SendFuture::from_untyped(
13499 self.sender.send_event(9207534335756671346, request),
13500 )
13501 }
13502
13503 #[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"]
13504
13505 pub fn on_representation_with<___R>(
13506 &self,
13507 request: ___R,
13508 ) -> ::fidl_next::SendFuture<'_, ___T>
13509 where
13510 ___R: ::fidl_next::Encode<
13511 <___T as ::fidl_next::Transport>::SendBuffer,
13512 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
13513 >,
13514 {
13515 ::fidl_next::SendFuture::from_untyped(
13516 self.sender.send_event(6679970090861613324, request),
13517 )
13518 }
13519 }
13520 }
13521}
13522
13523pub trait NodeClientHandler<
13527 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
13528 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
13529>
13530{
13531 #[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"]
13532 fn on_open(
13533 &mut self,
13534 sender: &::fidl_next::ClientSender<Node, ___T>,
13535
13536 event: ::fidl_next::Response<node::OnOpen, ___T>,
13537 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13538
13539 #[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"]
13540 fn on_representation(
13541 &mut self,
13542 sender: &::fidl_next::ClientSender<Node, ___T>,
13543
13544 event: ::fidl_next::Response<node::OnRepresentation, ___T>,
13545 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13546
13547 fn on_unknown_interaction(
13548 &mut self,
13549 sender: &::fidl_next::ClientSender<Node, ___T>,
13550 ordinal: u64,
13551 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13552 sender.close();
13553 ::core::future::ready(())
13554 }
13555}
13556
13557impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Node
13558where
13559 ___H: NodeClientHandler<___T> + ::core::marker::Send,
13560 ___T: ::fidl_next::Transport,
13561 <node::Close as ::fidl_next::Method>::Response:
13562 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13563 <node::Query as ::fidl_next::Method>::Response:
13564 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13565 <node::OnOpen as ::fidl_next::Method>::Response:
13566 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13567 <node::DeprecatedGetAttr as ::fidl_next::Method>::Response:
13568 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13569 <node::DeprecatedSetAttr as ::fidl_next::Method>::Response:
13570 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13571 <node::DeprecatedGetFlags as ::fidl_next::Method>::Response:
13572 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13573 <node::DeprecatedSetFlags as ::fidl_next::Method>::Response:
13574 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13575 <node::GetFlags as ::fidl_next::Method>::Response:
13576 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13577 <node::SetFlags as ::fidl_next::Method>::Response:
13578 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13579 <node::QueryFilesystem as ::fidl_next::Method>::Response:
13580 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13581 <node::OnRepresentation as ::fidl_next::Method>::Response:
13582 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13583 <node::GetAttributes as ::fidl_next::Method>::Response:
13584 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13585 <node::UpdateAttributes as ::fidl_next::Method>::Response:
13586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13587 <node::Sync as ::fidl_next::Method>::Response:
13588 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13589 <node::GetExtendedAttribute as ::fidl_next::Method>::Response:
13590 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13591 <node::SetExtendedAttribute as ::fidl_next::Method>::Response:
13592 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13593 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
13594 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13595{
13596 async fn on_event(
13597 handler: &mut ___H,
13598 sender: &::fidl_next::ClientSender<Self, ___T>,
13599 ordinal: u64,
13600 buffer: ___T::RecvBuffer,
13601 ) {
13602 match ordinal {
13603 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
13604 Ok(decoded) => handler.on_open(sender, decoded).await,
13605 Err(e) => sender.close(),
13606 },
13607
13608 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
13609 Ok(decoded) => handler.on_representation(sender, decoded).await,
13610 Err(e) => sender.close(),
13611 },
13612
13613 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13614 }
13615 }
13616}
13617
13618pub trait NodeServerHandler<
13622 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
13623 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
13624>
13625{
13626 fn clone(
13627 &mut self,
13628 sender: &::fidl_next::ServerSender<Node, ___T>,
13629
13630 request: ::fidl_next::Request<node::Clone, ___T>,
13631 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13632
13633 #[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"]
13634 fn close(
13635 &mut self,
13636 sender: &::fidl_next::ServerSender<Node, ___T>,
13637
13638 responder: ::fidl_next::Responder<node::Close>,
13639 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13640
13641 fn query(
13642 &mut self,
13643 sender: &::fidl_next::ServerSender<Node, ___T>,
13644
13645 responder: ::fidl_next::Responder<node::Query>,
13646 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13647
13648 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13649 fn deprecated_clone(
13650 &mut self,
13651 sender: &::fidl_next::ServerSender<Node, ___T>,
13652
13653 request: ::fidl_next::Request<node::DeprecatedClone, ___T>,
13654 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13655
13656 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
13657 fn deprecated_get_attr(
13658 &mut self,
13659 sender: &::fidl_next::ServerSender<Node, ___T>,
13660
13661 responder: ::fidl_next::Responder<node::DeprecatedGetAttr>,
13662 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13663
13664 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
13665 fn deprecated_set_attr(
13666 &mut self,
13667 sender: &::fidl_next::ServerSender<Node, ___T>,
13668
13669 request: ::fidl_next::Request<node::DeprecatedSetAttr, ___T>,
13670
13671 responder: ::fidl_next::Responder<node::DeprecatedSetAttr>,
13672 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13673
13674 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
13675 fn deprecated_get_flags(
13676 &mut self,
13677 sender: &::fidl_next::ServerSender<Node, ___T>,
13678
13679 responder: ::fidl_next::Responder<node::DeprecatedGetFlags>,
13680 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13681
13682 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13683 fn deprecated_set_flags(
13684 &mut self,
13685 sender: &::fidl_next::ServerSender<Node, ___T>,
13686
13687 request: ::fidl_next::Request<node::DeprecatedSetFlags, ___T>,
13688
13689 responder: ::fidl_next::Responder<node::DeprecatedSetFlags>,
13690 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13691
13692 #[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"]
13693 fn get_flags(
13694 &mut self,
13695 sender: &::fidl_next::ServerSender<Node, ___T>,
13696
13697 responder: ::fidl_next::Responder<node::GetFlags>,
13698 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13699
13700 #[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"]
13701 fn set_flags(
13702 &mut self,
13703 sender: &::fidl_next::ServerSender<Node, ___T>,
13704
13705 request: ::fidl_next::Request<node::SetFlags, ___T>,
13706
13707 responder: ::fidl_next::Responder<node::SetFlags>,
13708 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13709
13710 #[doc = " Query the filesystem for filesystem-specific information.\n"]
13711 fn query_filesystem(
13712 &mut self,
13713 sender: &::fidl_next::ServerSender<Node, ___T>,
13714
13715 responder: ::fidl_next::Responder<node::QueryFilesystem>,
13716 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13717
13718 #[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"]
13719 fn get_attributes(
13720 &mut self,
13721 sender: &::fidl_next::ServerSender<Node, ___T>,
13722
13723 request: ::fidl_next::Request<node::GetAttributes, ___T>,
13724
13725 responder: ::fidl_next::Responder<node::GetAttributes>,
13726 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13727
13728 #[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"]
13729 fn update_attributes(
13730 &mut self,
13731 sender: &::fidl_next::ServerSender<Node, ___T>,
13732
13733 request: ::fidl_next::Request<node::UpdateAttributes, ___T>,
13734
13735 responder: ::fidl_next::Responder<node::UpdateAttributes>,
13736 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13737
13738 #[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"]
13739 fn sync(
13740 &mut self,
13741 sender: &::fidl_next::ServerSender<Node, ___T>,
13742
13743 responder: ::fidl_next::Responder<node::Sync>,
13744 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13745
13746 #[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"]
13747 fn list_extended_attributes(
13748 &mut self,
13749 sender: &::fidl_next::ServerSender<Node, ___T>,
13750
13751 request: ::fidl_next::Request<node::ListExtendedAttributes, ___T>,
13752 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13753
13754 #[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"]
13755 fn get_extended_attribute(
13756 &mut self,
13757 sender: &::fidl_next::ServerSender<Node, ___T>,
13758
13759 request: ::fidl_next::Request<node::GetExtendedAttribute, ___T>,
13760
13761 responder: ::fidl_next::Responder<node::GetExtendedAttribute>,
13762 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13763
13764 #[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"]
13765 fn set_extended_attribute(
13766 &mut self,
13767 sender: &::fidl_next::ServerSender<Node, ___T>,
13768
13769 request: ::fidl_next::Request<node::SetExtendedAttribute, ___T>,
13770
13771 responder: ::fidl_next::Responder<node::SetExtendedAttribute>,
13772 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13773
13774 #[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"]
13775 fn remove_extended_attribute(
13776 &mut self,
13777 sender: &::fidl_next::ServerSender<Node, ___T>,
13778
13779 request: ::fidl_next::Request<node::RemoveExtendedAttribute, ___T>,
13780
13781 responder: ::fidl_next::Responder<node::RemoveExtendedAttribute>,
13782 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13783
13784 fn on_unknown_interaction(
13785 &mut self,
13786 sender: &::fidl_next::ServerSender<Node, ___T>,
13787 ordinal: u64,
13788 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13789 sender.close();
13790 ::core::future::ready(())
13791 }
13792}
13793
13794impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Node
13795where
13796 ___H: NodeServerHandler<___T> + ::core::marker::Send,
13797 ___T: ::fidl_next::Transport,
13798 <node::Clone as ::fidl_next::Method>::Request:
13799 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13800 <node::DeprecatedClone as ::fidl_next::Method>::Request:
13801 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13802 <node::DeprecatedSetAttr as ::fidl_next::Method>::Request:
13803 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13804 <node::DeprecatedSetFlags as ::fidl_next::Method>::Request:
13805 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13806 <node::SetFlags as ::fidl_next::Method>::Request:
13807 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13808 <node::GetAttributes as ::fidl_next::Method>::Request:
13809 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13810 <node::UpdateAttributes as ::fidl_next::Method>::Request:
13811 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13812 <node::ListExtendedAttributes as ::fidl_next::Method>::Request:
13813 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13814 <node::GetExtendedAttribute as ::fidl_next::Method>::Request:
13815 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13816 <node::SetExtendedAttribute as ::fidl_next::Method>::Request:
13817 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13818 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
13819 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13820{
13821 async fn on_one_way(
13822 handler: &mut ___H,
13823 sender: &::fidl_next::ServerSender<Self, ___T>,
13824 ordinal: u64,
13825 buffer: ___T::RecvBuffer,
13826 ) {
13827 match ordinal {
13828 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
13829 Ok(decoded) => handler.clone(sender, decoded).await,
13830 Err(e) => sender.close(),
13831 },
13832
13833 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
13834 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
13835 Err(e) => sender.close(),
13836 },
13837
13838 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
13839 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
13840 Err(e) => sender.close(),
13841 },
13842
13843 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13844 }
13845 }
13846
13847 async fn on_two_way(
13848 handler: &mut ___H,
13849 sender: &::fidl_next::ServerSender<Self, ___T>,
13850 ordinal: u64,
13851 buffer: ___T::RecvBuffer,
13852 responder: ::fidl_next::protocol::Responder,
13853 ) {
13854 match ordinal {
13855 6540867515453498750 => {
13856 let responder = ::fidl_next::Responder::from_untyped(responder);
13857
13858 handler.close(sender, responder).await;
13859 }
13860
13861 2763219980499352582 => {
13862 let responder = ::fidl_next::Responder::from_untyped(responder);
13863
13864 handler.query(sender, responder).await;
13865 }
13866
13867 8689798978500614909 => {
13868 let responder = ::fidl_next::Responder::from_untyped(responder);
13869
13870 handler.deprecated_get_attr(sender, responder).await;
13871 }
13872
13873 4721673413776871238 => {
13874 let responder = ::fidl_next::Responder::from_untyped(responder);
13875
13876 match ::fidl_next::DecoderExt::decode(buffer) {
13877 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
13878 Err(e) => sender.close(),
13879 }
13880 }
13881
13882 6595803110182632097 => {
13883 let responder = ::fidl_next::Responder::from_untyped(responder);
13884
13885 handler.deprecated_get_flags(sender, responder).await;
13886 }
13887
13888 5950864159036794675 => {
13889 let responder = ::fidl_next::Responder::from_untyped(responder);
13890
13891 match ::fidl_next::DecoderExt::decode(buffer) {
13892 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
13893 Err(e) => sender.close(),
13894 }
13895 }
13896
13897 105530239381466147 => {
13898 let responder = ::fidl_next::Responder::from_untyped(responder);
13899
13900 handler.get_flags(sender, responder).await;
13901 }
13902
13903 6172186066099445416 => {
13904 let responder = ::fidl_next::Responder::from_untyped(responder);
13905
13906 match ::fidl_next::DecoderExt::decode(buffer) {
13907 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
13908 Err(e) => sender.close(),
13909 }
13910 }
13911
13912 8013111122914313744 => {
13913 let responder = ::fidl_next::Responder::from_untyped(responder);
13914
13915 handler.query_filesystem(sender, responder).await;
13916 }
13917
13918 4414537700416816443 => {
13919 let responder = ::fidl_next::Responder::from_untyped(responder);
13920
13921 match ::fidl_next::DecoderExt::decode(buffer) {
13922 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
13923 Err(e) => sender.close(),
13924 }
13925 }
13926
13927 3677402239314018056 => {
13928 let responder = ::fidl_next::Responder::from_untyped(responder);
13929
13930 match ::fidl_next::DecoderExt::decode(buffer) {
13931 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
13932 Err(e) => sender.close(),
13933 }
13934 }
13935
13936 3196473584242777161 => {
13937 let responder = ::fidl_next::Responder::from_untyped(responder);
13938
13939 handler.sync(sender, responder).await;
13940 }
13941
13942 5043930208506967771 => {
13943 let responder = ::fidl_next::Responder::from_untyped(responder);
13944
13945 match ::fidl_next::DecoderExt::decode(buffer) {
13946 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
13947 Err(e) => sender.close(),
13948 }
13949 }
13950
13951 5374223046099989052 => {
13952 let responder = ::fidl_next::Responder::from_untyped(responder);
13953
13954 match ::fidl_next::DecoderExt::decode(buffer) {
13955 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
13956 Err(e) => sender.close(),
13957 }
13958 }
13959
13960 8794297771444732717 => {
13961 let responder = ::fidl_next::Responder::from_untyped(responder);
13962
13963 match ::fidl_next::DecoderExt::decode(buffer) {
13964 Ok(decoded) => {
13965 handler.remove_extended_attribute(sender, decoded, responder).await
13966 }
13967 Err(e) => sender.close(),
13968 }
13969 }
13970
13971 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13972 }
13973 }
13974}
13975
13976#[derive(Debug)]
13977pub struct DirectoryDeprecatedOpenRequest {
13978 pub flags: crate::OpenFlags,
13979
13980 pub mode: crate::ModeType,
13981
13982 pub path: String,
13983
13984 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::zx::Channel>,
13985}
13986
13987impl ::fidl_next::Encodable for DirectoryDeprecatedOpenRequest {
13988 type Encoded = WireDirectoryDeprecatedOpenRequest<'static>;
13989}
13990
13991unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryDeprecatedOpenRequest
13992where
13993 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13994 ___E: ::fidl_next::Encoder,
13995 ___E: ::fidl_next::fuchsia::HandleEncoder,
13996{
13997 #[inline]
13998 fn encode(
13999 self,
14000 encoder: &mut ___E,
14001 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14002 ) -> Result<(), ::fidl_next::EncodeError> {
14003 ::fidl_next::munge! {
14004 let Self::Encoded {
14005 flags,
14006 mode,
14007 path,
14008 object,
14009
14010 } = out;
14011 }
14012
14013 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
14014
14015 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
14016
14017 ::fidl_next::Encode::encode(self.path, encoder, path)?;
14018
14019 ::fidl_next::Encode::encode(self.object, encoder, object)?;
14020
14021 Ok(())
14022 }
14023}
14024
14025impl ::fidl_next::EncodableOption for DirectoryDeprecatedOpenRequest {
14026 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryDeprecatedOpenRequest<'static>>;
14027}
14028
14029unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryDeprecatedOpenRequest
14030where
14031 ___E: ::fidl_next::Encoder + ?Sized,
14032 DirectoryDeprecatedOpenRequest: ::fidl_next::Encode<___E>,
14033{
14034 #[inline]
14035 fn encode_option(
14036 this: Option<Self>,
14037 encoder: &mut ___E,
14038 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14039 ) -> Result<(), ::fidl_next::EncodeError> {
14040 if let Some(inner) = this {
14041 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14042 ::fidl_next::WireBox::encode_present(out);
14043 } else {
14044 ::fidl_next::WireBox::encode_absent(out);
14045 }
14046
14047 Ok(())
14048 }
14049}
14050
14051impl<'de> ::fidl_next::FromWire<WireDirectoryDeprecatedOpenRequest<'de>>
14052 for DirectoryDeprecatedOpenRequest
14053{
14054 #[inline]
14055 fn from_wire(wire: WireDirectoryDeprecatedOpenRequest<'de>) -> Self {
14056 Self {
14057 flags: ::fidl_next::FromWire::from_wire(wire.flags),
14058
14059 mode: ::fidl_next::FromWire::from_wire(wire.mode),
14060
14061 path: ::fidl_next::FromWire::from_wire(wire.path),
14062
14063 object: ::fidl_next::FromWire::from_wire(wire.object),
14064 }
14065 }
14066}
14067
14068#[derive(Debug)]
14070#[repr(C)]
14071pub struct WireDirectoryDeprecatedOpenRequest<'de> {
14072 pub flags: crate::WireOpenFlags,
14073
14074 pub mode: crate::WireModeType,
14075
14076 pub path: ::fidl_next::WireString<'de>,
14077
14078 pub object: ::fidl_next::ServerEnd<crate::Node, ::fidl_next::fuchsia::WireChannel>,
14079}
14080
14081unsafe impl ::fidl_next::Wire for WireDirectoryDeprecatedOpenRequest<'static> {
14082 type Decoded<'de> = WireDirectoryDeprecatedOpenRequest<'de>;
14083
14084 #[inline]
14085 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14086 unsafe {
14087 out.as_mut_ptr().cast::<u8>().add(28).write_bytes(0, 4);
14088 }
14089 }
14090}
14091
14092unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryDeprecatedOpenRequest<'static>
14093where
14094 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14095 ___D: ::fidl_next::Decoder,
14096 ___D: ::fidl_next::fuchsia::HandleDecoder,
14097{
14098 fn decode(
14099 slot: ::fidl_next::Slot<'_, Self>,
14100 decoder: &mut ___D,
14101 ) -> Result<(), ::fidl_next::DecodeError> {
14102 ::fidl_next::munge! {
14103 let Self {
14104 mut flags,
14105 mut mode,
14106 mut path,
14107 mut object,
14108
14109 } = slot;
14110 }
14111
14112 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
14113
14114 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
14115
14116 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
14117
14118 let path = unsafe { path.deref_unchecked() };
14119
14120 if path.len() > 4095 {
14121 return Err(::fidl_next::DecodeError::VectorTooLong {
14122 size: path.len() as u64,
14123 limit: 4095,
14124 });
14125 }
14126
14127 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
14128
14129 Ok(())
14130 }
14131}
14132
14133#[derive(Debug)]
14134pub struct DirectoryCreateSymlinkRequest {
14135 pub name: String,
14136
14137 pub target: Vec<u8>,
14138
14139 pub connection:
14140 Option<::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::zx::Channel>>,
14141}
14142
14143impl ::fidl_next::Encodable for DirectoryCreateSymlinkRequest {
14144 type Encoded = WireDirectoryCreateSymlinkRequest<'static>;
14145}
14146
14147unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryCreateSymlinkRequest
14148where
14149 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14150 ___E: ::fidl_next::Encoder,
14151 ___E: ::fidl_next::fuchsia::HandleEncoder,
14152{
14153 #[inline]
14154 fn encode(
14155 self,
14156 encoder: &mut ___E,
14157 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14158 ) -> Result<(), ::fidl_next::EncodeError> {
14159 ::fidl_next::munge! {
14160 let Self::Encoded {
14161 name,
14162 target,
14163 connection,
14164
14165 } = out;
14166 }
14167
14168 ::fidl_next::Encode::encode(self.name, encoder, name)?;
14169
14170 ::fidl_next::Encode::encode(self.target, encoder, target)?;
14171
14172 ::fidl_next::Encode::encode(self.connection, encoder, connection)?;
14173
14174 Ok(())
14175 }
14176}
14177
14178impl ::fidl_next::EncodableOption for DirectoryCreateSymlinkRequest {
14179 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryCreateSymlinkRequest<'static>>;
14180}
14181
14182unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryCreateSymlinkRequest
14183where
14184 ___E: ::fidl_next::Encoder + ?Sized,
14185 DirectoryCreateSymlinkRequest: ::fidl_next::Encode<___E>,
14186{
14187 #[inline]
14188 fn encode_option(
14189 this: Option<Self>,
14190 encoder: &mut ___E,
14191 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14192 ) -> Result<(), ::fidl_next::EncodeError> {
14193 if let Some(inner) = this {
14194 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14195 ::fidl_next::WireBox::encode_present(out);
14196 } else {
14197 ::fidl_next::WireBox::encode_absent(out);
14198 }
14199
14200 Ok(())
14201 }
14202}
14203
14204impl<'de> ::fidl_next::FromWire<WireDirectoryCreateSymlinkRequest<'de>>
14205 for DirectoryCreateSymlinkRequest
14206{
14207 #[inline]
14208 fn from_wire(wire: WireDirectoryCreateSymlinkRequest<'de>) -> Self {
14209 Self {
14210 name: ::fidl_next::FromWire::from_wire(wire.name),
14211
14212 target: ::fidl_next::FromWire::from_wire(wire.target),
14213
14214 connection: ::fidl_next::FromWire::from_wire(wire.connection),
14215 }
14216 }
14217}
14218
14219#[derive(Debug)]
14221#[repr(C)]
14222pub struct WireDirectoryCreateSymlinkRequest<'de> {
14223 pub name: ::fidl_next::WireString<'de>,
14224
14225 pub target: ::fidl_next::WireVector<'de, u8>,
14226
14227 pub connection:
14228 ::fidl_next::ServerEnd<crate::Symlink, ::fidl_next::fuchsia::WireOptionalChannel>,
14229}
14230
14231unsafe impl ::fidl_next::Wire for WireDirectoryCreateSymlinkRequest<'static> {
14232 type Decoded<'de> = WireDirectoryCreateSymlinkRequest<'de>;
14233
14234 #[inline]
14235 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14236 unsafe {
14237 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
14238 }
14239 }
14240}
14241
14242unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryCreateSymlinkRequest<'static>
14243where
14244 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14245 ___D: ::fidl_next::Decoder,
14246 ___D: ::fidl_next::fuchsia::HandleDecoder,
14247{
14248 fn decode(
14249 slot: ::fidl_next::Slot<'_, Self>,
14250 decoder: &mut ___D,
14251 ) -> Result<(), ::fidl_next::DecodeError> {
14252 ::fidl_next::munge! {
14253 let Self {
14254 mut name,
14255 mut target,
14256 mut connection,
14257
14258 } = slot;
14259 }
14260
14261 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
14262
14263 let name = unsafe { name.deref_unchecked() };
14264
14265 if name.len() > 255 {
14266 return Err(::fidl_next::DecodeError::VectorTooLong {
14267 size: name.len() as u64,
14268 limit: 255,
14269 });
14270 }
14271
14272 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
14273
14274 let target = unsafe { target.deref_unchecked() };
14275
14276 if target.len() > 4095 {
14277 return Err(::fidl_next::DecodeError::VectorTooLong {
14278 size: target.len() as u64,
14279 limit: 4095,
14280 });
14281 }
14282
14283 ::fidl_next::Decode::decode(connection.as_mut(), decoder)?;
14284
14285 Ok(())
14286 }
14287}
14288
14289#[doc = " Directory defines a node which is capable of containing other Objects.\n"]
14291#[derive(Debug)]
14292pub struct Directory;
14293
14294impl ::fidl_next::Discoverable for Directory {
14295 const PROTOCOL_NAME: &'static str = "fuchsia.io.Directory";
14296}
14297
14298pub mod directory {
14299 pub mod prelude {
14300 pub use crate::{Directory, DirectoryClientHandler, DirectoryServerHandler, directory};
14301
14302 pub use crate::AdvisoryLockingAdvisoryLockRequest;
14303
14304 pub use crate::AdvisoryLockingAdvisoryLockResponse;
14305
14306 pub use crate::DirectoryCreateSymlinkRequest;
14307
14308 pub use crate::DirectoryDeprecatedOpenRequest;
14309
14310 pub use crate::DirectoryGetTokenResponse;
14311
14312 pub use crate::DirectoryLinkRequest;
14313
14314 pub use crate::DirectoryLinkResponse;
14315
14316 pub use crate::DirectoryOpenRequest;
14317
14318 pub use crate::DirectoryReadDirentsRequest;
14319
14320 pub use crate::DirectoryReadDirentsResponse;
14321
14322 pub use crate::DirectoryRenameRequest;
14323
14324 pub use crate::DirectoryRewindResponse;
14325
14326 pub use crate::DirectoryUnlinkRequest;
14327
14328 pub use crate::DirectoryWatchRequest;
14329
14330 pub use crate::DirectoryWatchResponse;
14331
14332 pub use crate::DirectoryCreateSymlinkResponse;
14333
14334 pub use crate::DirectoryRenameResponse;
14335
14336 pub use crate::DirectoryUnlinkResponse;
14337
14338 pub use crate::ExtendedAttributeValue;
14339
14340 pub use crate::MutableNodeAttributes;
14341
14342 pub use crate::NodeAttributes2;
14343
14344 pub use crate::NodeDeprecatedCloneRequest;
14345
14346 pub use crate::NodeDeprecatedGetAttrResponse;
14347
14348 pub use crate::NodeDeprecatedGetFlagsResponse;
14349
14350 pub use crate::NodeDeprecatedSetAttrRequest;
14351
14352 pub use crate::NodeDeprecatedSetAttrResponse;
14353
14354 pub use crate::NodeDeprecatedSetFlagsRequest;
14355
14356 pub use crate::NodeDeprecatedSetFlagsResponse;
14357
14358 pub use crate::NodeGetAttributesRequest;
14359
14360 pub use crate::NodeGetExtendedAttributeRequest;
14361
14362 pub use crate::NodeListExtendedAttributesRequest;
14363
14364 pub use crate::NodeOnOpenRequest;
14365
14366 pub use crate::NodeQueryFilesystemResponse;
14367
14368 pub use crate::NodeRemoveExtendedAttributeRequest;
14369
14370 pub use crate::NodeSetExtendedAttributeRequest;
14371
14372 pub use crate::NodeSetFlagsRequest;
14373
14374 pub use crate::NodeGetFlagsResponse;
14375
14376 pub use crate::NodeRemoveExtendedAttributeResponse;
14377
14378 pub use crate::NodeSetExtendedAttributeResponse;
14379
14380 pub use crate::NodeSetFlagsResponse;
14381
14382 pub use crate::NodeSyncResponse;
14383
14384 pub use crate::NodeUpdateAttributesResponse;
14385
14386 pub use crate::Representation;
14387
14388 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
14389
14390 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
14391
14392 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
14393 }
14394
14395 pub struct AdvisoryLock;
14396
14397 impl ::fidl_next::Method for AdvisoryLock {
14398 const ORDINAL: u64 = 7992130864415541162;
14399
14400 type Protocol = crate::Directory;
14401
14402 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
14403
14404 type Response = ::fidl_next::WireResult<
14405 'static,
14406 crate::WireAdvisoryLockingAdvisoryLockResponse,
14407 ::fidl_next::WireI32,
14408 >;
14409 }
14410
14411 pub struct Clone;
14412
14413 impl ::fidl_next::Method for Clone {
14414 const ORDINAL: u64 = 2366825959783828089;
14415
14416 type Protocol = crate::Directory;
14417
14418 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
14419
14420 type Response = ::fidl_next::Never;
14421 }
14422
14423 pub struct Close;
14424
14425 impl ::fidl_next::Method for Close {
14426 const ORDINAL: u64 = 6540867515453498750;
14427
14428 type Protocol = crate::Directory;
14429
14430 type Request = ();
14431
14432 type Response = ::fidl_next::WireResult<
14433 'static,
14434 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
14435 ::fidl_next::WireI32,
14436 >;
14437 }
14438
14439 pub struct Query;
14440
14441 impl ::fidl_next::Method for Query {
14442 const ORDINAL: u64 = 2763219980499352582;
14443
14444 type Protocol = crate::Directory;
14445
14446 type Request = ();
14447
14448 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
14449 }
14450
14451 pub struct DeprecatedClone;
14452
14453 impl ::fidl_next::Method for DeprecatedClone {
14454 const ORDINAL: u64 = 6512600400724287855;
14455
14456 type Protocol = crate::Directory;
14457
14458 type Request = crate::WireNodeDeprecatedCloneRequest;
14459
14460 type Response = ::fidl_next::Never;
14461 }
14462
14463 pub struct OnOpen;
14464
14465 impl ::fidl_next::Method for OnOpen {
14466 const ORDINAL: u64 = 9207534335756671346;
14467
14468 type Protocol = crate::Directory;
14469
14470 type Request = ::fidl_next::Never;
14471
14472 type Response = crate::WireNodeOnOpenRequest<'static>;
14473 }
14474
14475 pub struct DeprecatedGetAttr;
14476
14477 impl ::fidl_next::Method for DeprecatedGetAttr {
14478 const ORDINAL: u64 = 8689798978500614909;
14479
14480 type Protocol = crate::Directory;
14481
14482 type Request = ();
14483
14484 type Response = crate::WireNodeDeprecatedGetAttrResponse;
14485 }
14486
14487 pub struct DeprecatedSetAttr;
14488
14489 impl ::fidl_next::Method for DeprecatedSetAttr {
14490 const ORDINAL: u64 = 4721673413776871238;
14491
14492 type Protocol = crate::Directory;
14493
14494 type Request = crate::WireNodeDeprecatedSetAttrRequest;
14495
14496 type Response = crate::WireNodeDeprecatedSetAttrResponse;
14497 }
14498
14499 pub struct DeprecatedGetFlags;
14500
14501 impl ::fidl_next::Method for DeprecatedGetFlags {
14502 const ORDINAL: u64 = 6595803110182632097;
14503
14504 type Protocol = crate::Directory;
14505
14506 type Request = ();
14507
14508 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
14509 }
14510
14511 pub struct DeprecatedSetFlags;
14512
14513 impl ::fidl_next::Method for DeprecatedSetFlags {
14514 const ORDINAL: u64 = 5950864159036794675;
14515
14516 type Protocol = crate::Directory;
14517
14518 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
14519
14520 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
14521 }
14522
14523 pub struct GetFlags;
14524
14525 impl ::fidl_next::Method for GetFlags {
14526 const ORDINAL: u64 = 105530239381466147;
14527
14528 type Protocol = crate::Directory;
14529
14530 type Request = ();
14531
14532 type Response = ::fidl_next::WireFlexibleResult<
14533 'static,
14534 crate::WireNodeGetFlagsResponse,
14535 ::fidl_next::WireI32,
14536 >;
14537 }
14538
14539 pub struct SetFlags;
14540
14541 impl ::fidl_next::Method for SetFlags {
14542 const ORDINAL: u64 = 6172186066099445416;
14543
14544 type Protocol = crate::Directory;
14545
14546 type Request = crate::WireNodeSetFlagsRequest;
14547
14548 type Response = ::fidl_next::WireFlexibleResult<
14549 'static,
14550 crate::WireNodeSetFlagsResponse,
14551 ::fidl_next::WireI32,
14552 >;
14553 }
14554
14555 pub struct QueryFilesystem;
14556
14557 impl ::fidl_next::Method for QueryFilesystem {
14558 const ORDINAL: u64 = 8013111122914313744;
14559
14560 type Protocol = crate::Directory;
14561
14562 type Request = ();
14563
14564 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
14565 }
14566
14567 pub struct OnRepresentation;
14568
14569 impl ::fidl_next::Method for OnRepresentation {
14570 const ORDINAL: u64 = 6679970090861613324;
14571
14572 type Protocol = crate::Directory;
14573
14574 type Request = ::fidl_next::Never;
14575
14576 type Response = crate::WireRepresentation<'static>;
14577 }
14578
14579 pub struct GetAttributes;
14580
14581 impl ::fidl_next::Method for GetAttributes {
14582 const ORDINAL: u64 = 4414537700416816443;
14583
14584 type Protocol = crate::Directory;
14585
14586 type Request = crate::WireNodeGetAttributesRequest;
14587
14588 type Response = ::fidl_next::WireResult<
14589 'static,
14590 crate::WireNodeAttributes2<'static>,
14591 ::fidl_next::WireI32,
14592 >;
14593 }
14594
14595 pub struct UpdateAttributes;
14596
14597 impl ::fidl_next::Method for UpdateAttributes {
14598 const ORDINAL: u64 = 3677402239314018056;
14599
14600 type Protocol = crate::Directory;
14601
14602 type Request = crate::WireMutableNodeAttributes<'static>;
14603
14604 type Response = ::fidl_next::WireResult<
14605 'static,
14606 crate::WireNodeUpdateAttributesResponse,
14607 ::fidl_next::WireI32,
14608 >;
14609 }
14610
14611 pub struct Sync;
14612
14613 impl ::fidl_next::Method for Sync {
14614 const ORDINAL: u64 = 3196473584242777161;
14615
14616 type Protocol = crate::Directory;
14617
14618 type Request = ();
14619
14620 type Response =
14621 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
14622 }
14623
14624 pub struct ListExtendedAttributes;
14625
14626 impl ::fidl_next::Method for ListExtendedAttributes {
14627 const ORDINAL: u64 = 5431626189872037072;
14628
14629 type Protocol = crate::Directory;
14630
14631 type Request = crate::WireNodeListExtendedAttributesRequest;
14632
14633 type Response = ::fidl_next::Never;
14634 }
14635
14636 pub struct GetExtendedAttribute;
14637
14638 impl ::fidl_next::Method for GetExtendedAttribute {
14639 const ORDINAL: u64 = 5043930208506967771;
14640
14641 type Protocol = crate::Directory;
14642
14643 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
14644
14645 type Response = ::fidl_next::WireResult<
14646 'static,
14647 crate::WireExtendedAttributeValue<'static>,
14648 ::fidl_next::WireI32,
14649 >;
14650 }
14651
14652 pub struct SetExtendedAttribute;
14653
14654 impl ::fidl_next::Method for SetExtendedAttribute {
14655 const ORDINAL: u64 = 5374223046099989052;
14656
14657 type Protocol = crate::Directory;
14658
14659 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
14660
14661 type Response = ::fidl_next::WireResult<
14662 'static,
14663 crate::WireNodeSetExtendedAttributeResponse,
14664 ::fidl_next::WireI32,
14665 >;
14666 }
14667
14668 pub struct RemoveExtendedAttribute;
14669
14670 impl ::fidl_next::Method for RemoveExtendedAttribute {
14671 const ORDINAL: u64 = 8794297771444732717;
14672
14673 type Protocol = crate::Directory;
14674
14675 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
14676
14677 type Response = ::fidl_next::WireResult<
14678 'static,
14679 crate::WireNodeRemoveExtendedAttributeResponse,
14680 ::fidl_next::WireI32,
14681 >;
14682 }
14683
14684 pub struct DeprecatedOpen;
14685
14686 impl ::fidl_next::Method for DeprecatedOpen {
14687 const ORDINAL: u64 = 3193127272456937152;
14688
14689 type Protocol = crate::Directory;
14690
14691 type Request = crate::WireDirectoryDeprecatedOpenRequest<'static>;
14692
14693 type Response = ::fidl_next::Never;
14694 }
14695
14696 pub struct Open;
14697
14698 impl ::fidl_next::Method for Open {
14699 const ORDINAL: u64 = 6236883748953765593;
14700
14701 type Protocol = crate::Directory;
14702
14703 type Request = crate::WireDirectoryOpenRequest<'static>;
14704
14705 type Response = ::fidl_next::Never;
14706 }
14707
14708 pub struct ReadDirents;
14709
14710 impl ::fidl_next::Method for ReadDirents {
14711 const ORDINAL: u64 = 3855785432100874762;
14712
14713 type Protocol = crate::Directory;
14714
14715 type Request = crate::WireDirectoryReadDirentsRequest;
14716
14717 type Response = crate::WireDirectoryReadDirentsResponse<'static>;
14718 }
14719
14720 pub struct Rewind;
14721
14722 impl ::fidl_next::Method for Rewind {
14723 const ORDINAL: u64 = 1635123508515392625;
14724
14725 type Protocol = crate::Directory;
14726
14727 type Request = ();
14728
14729 type Response = crate::WireDirectoryRewindResponse;
14730 }
14731
14732 pub struct GetToken;
14733
14734 impl ::fidl_next::Method for GetToken {
14735 const ORDINAL: u64 = 2787337947777369685;
14736
14737 type Protocol = crate::Directory;
14738
14739 type Request = ();
14740
14741 type Response = crate::WireDirectoryGetTokenResponse;
14742 }
14743
14744 pub struct Link;
14745
14746 impl ::fidl_next::Method for Link {
14747 const ORDINAL: u64 = 8360374984291987687;
14748
14749 type Protocol = crate::Directory;
14750
14751 type Request = crate::WireDirectoryLinkRequest<'static>;
14752
14753 type Response = crate::WireDirectoryLinkResponse;
14754 }
14755
14756 pub struct Unlink;
14757
14758 impl ::fidl_next::Method for Unlink {
14759 const ORDINAL: u64 = 8433556716759383021;
14760
14761 type Protocol = crate::Directory;
14762
14763 type Request = crate::WireDirectoryUnlinkRequest<'static>;
14764
14765 type Response = ::fidl_next::WireResult<
14766 'static,
14767 crate::WireDirectoryUnlinkResponse,
14768 ::fidl_next::WireI32,
14769 >;
14770 }
14771
14772 pub struct Rename;
14773
14774 impl ::fidl_next::Method for Rename {
14775 const ORDINAL: u64 = 8097726607824333022;
14776
14777 type Protocol = crate::Directory;
14778
14779 type Request = crate::WireDirectoryRenameRequest<'static>;
14780
14781 type Response = ::fidl_next::WireResult<
14782 'static,
14783 crate::WireDirectoryRenameResponse,
14784 ::fidl_next::WireI32,
14785 >;
14786 }
14787
14788 pub struct CreateSymlink;
14789
14790 impl ::fidl_next::Method for CreateSymlink {
14791 const ORDINAL: u64 = 2435901052462315657;
14792
14793 type Protocol = crate::Directory;
14794
14795 type Request = crate::WireDirectoryCreateSymlinkRequest<'static>;
14796
14797 type Response = ::fidl_next::WireResult<
14798 'static,
14799 crate::WireDirectoryCreateSymlinkResponse,
14800 ::fidl_next::WireI32,
14801 >;
14802 }
14803
14804 pub struct Watch;
14805
14806 impl ::fidl_next::Method for Watch {
14807 const ORDINAL: u64 = 6275512344170098065;
14808
14809 type Protocol = crate::Directory;
14810
14811 type Request = crate::WireDirectoryWatchRequest;
14812
14813 type Response = crate::WireDirectoryWatchResponse;
14814 }
14815
14816 mod ___detail {
14817
14818 pub struct AdvisoryLock<T0> {
14819 request: T0,
14820 }
14821
14822 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
14823 where
14824 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
14825 {
14826 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
14827 }
14828
14829 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
14830 where
14831 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14832 ___E: ::fidl_next::Encoder,
14833 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
14834 {
14835 #[inline]
14836 fn encode(
14837 self,
14838 encoder: &mut ___E,
14839 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14840 ) -> Result<(), ::fidl_next::EncodeError> {
14841 ::fidl_next::munge! {
14842 let Self::Encoded {
14843 request,
14844
14845 } = out;
14846 }
14847
14848 ::fidl_next::Encode::encode(self.request, encoder, request)?;
14849
14850 Ok(())
14851 }
14852 }
14853
14854 pub struct Clone<T0> {
14855 request: T0,
14856 }
14857
14858 impl<T0> ::fidl_next::Encodable for Clone<T0>
14859 where
14860 T0: ::fidl_next::Encodable<
14861 Encoded = ::fidl_next::ServerEnd<
14862 ::fidl_next_fuchsia_unknown::Cloneable,
14863 ::fidl_next::fuchsia::WireChannel,
14864 >,
14865 >,
14866 {
14867 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
14868 }
14869
14870 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
14871 where
14872 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14873 ___E: ::fidl_next::fuchsia::HandleEncoder,
14874 T0: ::fidl_next::Encode<
14875 ___E,
14876 Encoded = ::fidl_next::ServerEnd<
14877 ::fidl_next_fuchsia_unknown::Cloneable,
14878 ::fidl_next::fuchsia::WireChannel,
14879 >,
14880 >,
14881 {
14882 #[inline]
14883 fn encode(
14884 self,
14885 encoder: &mut ___E,
14886 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14887 ) -> Result<(), ::fidl_next::EncodeError> {
14888 ::fidl_next::munge! {
14889 let Self::Encoded {
14890 request,
14891
14892 } = out;
14893 }
14894
14895 ::fidl_next::Encode::encode(self.request, encoder, request)?;
14896
14897 Ok(())
14898 }
14899 }
14900
14901 pub struct DeprecatedClone<T0, T1> {
14902 flags: T0,
14903
14904 object: T1,
14905 }
14906
14907 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
14908 where
14909 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
14910 T1: ::fidl_next::Encodable<
14911 Encoded = ::fidl_next::ServerEnd<
14912 crate::Node,
14913 ::fidl_next::fuchsia::WireChannel,
14914 >,
14915 >,
14916 {
14917 type Encoded = crate::WireNodeDeprecatedCloneRequest;
14918 }
14919
14920 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
14921 where
14922 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14923 ___E: ::fidl_next::fuchsia::HandleEncoder,
14924 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
14925 T1: ::fidl_next::Encode<
14926 ___E,
14927 Encoded = ::fidl_next::ServerEnd<
14928 crate::Node,
14929 ::fidl_next::fuchsia::WireChannel,
14930 >,
14931 >,
14932 {
14933 #[inline]
14934 fn encode(
14935 self,
14936 encoder: &mut ___E,
14937 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14938 ) -> Result<(), ::fidl_next::EncodeError> {
14939 ::fidl_next::munge! {
14940 let Self::Encoded {
14941 flags,
14942 object,
14943
14944 } = out;
14945 }
14946
14947 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
14948
14949 ::fidl_next::Encode::encode(self.object, encoder, object)?;
14950
14951 Ok(())
14952 }
14953 }
14954
14955 pub struct OnOpen<T0, T1> {
14956 s: T0,
14957
14958 info: T1,
14959 }
14960
14961 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
14962 where
14963 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
14964 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
14965 {
14966 type Encoded = crate::WireNodeOnOpenRequest<'static>;
14967 }
14968
14969 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
14970 where
14971 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14972 ___E: ::fidl_next::Encoder,
14973 ___E: ::fidl_next::fuchsia::HandleEncoder,
14974 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
14975 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
14976 {
14977 #[inline]
14978 fn encode(
14979 self,
14980 encoder: &mut ___E,
14981 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14982 ) -> Result<(), ::fidl_next::EncodeError> {
14983 ::fidl_next::munge! {
14984 let Self::Encoded {
14985 s,
14986 info,
14987
14988 } = out;
14989 }
14990
14991 ::fidl_next::Encode::encode(self.s, encoder, s)?;
14992
14993 ::fidl_next::Encode::encode(self.info, encoder, info)?;
14994
14995 Ok(())
14996 }
14997 }
14998
14999 pub struct DeprecatedSetAttr<T0, T1> {
15000 flags: T0,
15001
15002 attributes: T1,
15003 }
15004
15005 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
15006 where
15007 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
15008 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
15009 {
15010 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
15011 }
15012
15013 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
15014 where
15015 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15016 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
15017 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
15018 {
15019 #[inline]
15020 fn encode(
15021 self,
15022 encoder: &mut ___E,
15023 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15024 ) -> Result<(), ::fidl_next::EncodeError> {
15025 ::fidl_next::munge! {
15026 let Self::Encoded {
15027 flags,
15028 attributes,
15029
15030 } = out;
15031 }
15032
15033 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15034
15035 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
15036
15037 Ok(())
15038 }
15039 }
15040
15041 pub struct DeprecatedSetFlags<T0> {
15042 flags: T0,
15043 }
15044
15045 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
15046 where
15047 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
15048 {
15049 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
15050 }
15051
15052 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
15053 where
15054 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15055 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
15056 {
15057 #[inline]
15058 fn encode(
15059 self,
15060 encoder: &mut ___E,
15061 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15062 ) -> Result<(), ::fidl_next::EncodeError> {
15063 ::fidl_next::munge! {
15064 let Self::Encoded {
15065 flags,
15066
15067 } = out;
15068 }
15069
15070 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15071
15072 Ok(())
15073 }
15074 }
15075
15076 pub struct SetFlags<T0> {
15077 flags: T0,
15078 }
15079
15080 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
15081 where
15082 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
15083 {
15084 type Encoded = crate::WireNodeSetFlagsRequest;
15085 }
15086
15087 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
15088 where
15089 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15090 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
15091 {
15092 #[inline]
15093 fn encode(
15094 self,
15095 encoder: &mut ___E,
15096 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15097 ) -> Result<(), ::fidl_next::EncodeError> {
15098 ::fidl_next::munge! {
15099 let Self::Encoded {
15100 flags,
15101
15102 } = out;
15103 }
15104
15105 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15106
15107 Ok(())
15108 }
15109 }
15110
15111 pub struct GetAttributes<T0> {
15112 query: T0,
15113 }
15114
15115 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
15116 where
15117 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
15118 {
15119 type Encoded = crate::WireNodeGetAttributesRequest;
15120 }
15121
15122 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
15123 where
15124 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15125 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
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 query,
15136
15137 } = out;
15138 }
15139
15140 ::fidl_next::Encode::encode(self.query, encoder, query)?;
15141
15142 Ok(())
15143 }
15144 }
15145
15146 pub struct ListExtendedAttributes<T0> {
15147 iterator: T0,
15148 }
15149
15150 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
15151 where
15152 T0: ::fidl_next::Encodable<
15153 Encoded = ::fidl_next::ServerEnd<
15154 crate::ExtendedAttributeIterator,
15155 ::fidl_next::fuchsia::WireChannel,
15156 >,
15157 >,
15158 {
15159 type Encoded = crate::WireNodeListExtendedAttributesRequest;
15160 }
15161
15162 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
15163 where
15164 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15165 ___E: ::fidl_next::fuchsia::HandleEncoder,
15166 T0: ::fidl_next::Encode<
15167 ___E,
15168 Encoded = ::fidl_next::ServerEnd<
15169 crate::ExtendedAttributeIterator,
15170 ::fidl_next::fuchsia::WireChannel,
15171 >,
15172 >,
15173 {
15174 #[inline]
15175 fn encode(
15176 self,
15177 encoder: &mut ___E,
15178 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15179 ) -> Result<(), ::fidl_next::EncodeError> {
15180 ::fidl_next::munge! {
15181 let Self::Encoded {
15182 iterator,
15183
15184 } = out;
15185 }
15186
15187 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
15188
15189 Ok(())
15190 }
15191 }
15192
15193 pub struct GetExtendedAttribute<T0> {
15194 name: T0,
15195 }
15196
15197 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
15198 where
15199 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15200 {
15201 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
15202 }
15203
15204 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
15205 where
15206 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15207 ___E: ::fidl_next::Encoder,
15208 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15209 {
15210 #[inline]
15211 fn encode(
15212 self,
15213 encoder: &mut ___E,
15214 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15215 ) -> Result<(), ::fidl_next::EncodeError> {
15216 ::fidl_next::munge! {
15217 let Self::Encoded {
15218 name,
15219
15220 } = out;
15221 }
15222
15223 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15224
15225 Ok(())
15226 }
15227 }
15228
15229 pub struct SetExtendedAttribute<T0, T1, T2> {
15230 name: T0,
15231
15232 value: T1,
15233
15234 mode: T2,
15235 }
15236
15237 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
15238 where
15239 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15240 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
15241 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
15242 {
15243 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
15244 }
15245
15246 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
15247 where
15248 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15249 ___E: ::fidl_next::Encoder,
15250 ___E: ::fidl_next::fuchsia::HandleEncoder,
15251 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15252 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
15253 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
15254 {
15255 #[inline]
15256 fn encode(
15257 self,
15258 encoder: &mut ___E,
15259 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15260 ) -> Result<(), ::fidl_next::EncodeError> {
15261 ::fidl_next::munge! {
15262 let Self::Encoded {
15263 name,
15264 value,
15265 mode,
15266
15267 } = out;
15268 }
15269
15270 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15271
15272 ::fidl_next::Encode::encode(self.value, encoder, value)?;
15273
15274 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
15275
15276 Ok(())
15277 }
15278 }
15279
15280 pub struct RemoveExtendedAttribute<T0> {
15281 name: T0,
15282 }
15283
15284 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
15285 where
15286 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15287 {
15288 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
15289 }
15290
15291 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
15292 where
15293 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15294 ___E: ::fidl_next::Encoder,
15295 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15296 {
15297 #[inline]
15298 fn encode(
15299 self,
15300 encoder: &mut ___E,
15301 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15302 ) -> Result<(), ::fidl_next::EncodeError> {
15303 ::fidl_next::munge! {
15304 let Self::Encoded {
15305 name,
15306
15307 } = out;
15308 }
15309
15310 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15311
15312 Ok(())
15313 }
15314 }
15315
15316 pub struct DeprecatedOpen<T0, T1, T2, T3> {
15317 flags: T0,
15318
15319 mode: T1,
15320
15321 path: T2,
15322
15323 object: T3,
15324 }
15325
15326 impl<T0, T1, T2, T3> ::fidl_next::Encodable for DeprecatedOpen<T0, T1, T2, T3>
15327 where
15328 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
15329 T1: ::fidl_next::Encodable<Encoded = crate::WireModeType>,
15330 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15331 T3: ::fidl_next::Encodable<
15332 Encoded = ::fidl_next::ServerEnd<
15333 crate::Node,
15334 ::fidl_next::fuchsia::WireChannel,
15335 >,
15336 >,
15337 {
15338 type Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>;
15339 }
15340
15341 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for DeprecatedOpen<T0, T1, T2, T3>
15342 where
15343 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15344 ___E: ::fidl_next::Encoder,
15345 ___E: ::fidl_next::fuchsia::HandleEncoder,
15346 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
15347 T1: ::fidl_next::Encode<___E, Encoded = crate::WireModeType>,
15348 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15349 T3: ::fidl_next::Encode<
15350 ___E,
15351 Encoded = ::fidl_next::ServerEnd<
15352 crate::Node,
15353 ::fidl_next::fuchsia::WireChannel,
15354 >,
15355 >,
15356 {
15357 #[inline]
15358 fn encode(
15359 self,
15360 encoder: &mut ___E,
15361 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15362 ) -> Result<(), ::fidl_next::EncodeError> {
15363 ::fidl_next::munge! {
15364 let Self::Encoded {
15365 flags,
15366 mode,
15367 path,
15368 object,
15369
15370 } = out;
15371 }
15372
15373 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15374
15375 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
15376
15377 ::fidl_next::Encode::encode(self.path, encoder, path)?;
15378
15379 ::fidl_next::Encode::encode(self.object, encoder, object)?;
15380
15381 Ok(())
15382 }
15383 }
15384
15385 pub struct Open<T0, T1, T2, T3> {
15386 path: T0,
15387
15388 flags: T1,
15389
15390 options: T2,
15391
15392 object: T3,
15393 }
15394
15395 impl<T0, T1, T2, T3> ::fidl_next::Encodable for Open<T0, T1, T2, T3>
15396 where
15397 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15398 T1: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
15399 T2: ::fidl_next::Encodable<Encoded = crate::WireOptions<'static>>,
15400 T3: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireChannel>,
15401 {
15402 type Encoded = crate::WireDirectoryOpenRequest<'static>;
15403 }
15404
15405 unsafe impl<___E, T0, T1, T2, T3> ::fidl_next::Encode<___E> for Open<T0, T1, T2, T3>
15406 where
15407 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15408 ___E: ::fidl_next::Encoder,
15409 ___E: ::fidl_next::fuchsia::HandleEncoder,
15410 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15411 T1: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
15412 T2: ::fidl_next::Encode<___E, Encoded = crate::WireOptions<'static>>,
15413 T3: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireChannel>,
15414 {
15415 #[inline]
15416 fn encode(
15417 self,
15418 encoder: &mut ___E,
15419 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15420 ) -> Result<(), ::fidl_next::EncodeError> {
15421 ::fidl_next::munge! {
15422 let Self::Encoded {
15423 path,
15424 flags,
15425 options,
15426 object,
15427
15428 } = out;
15429 }
15430
15431 ::fidl_next::Encode::encode(self.path, encoder, path)?;
15432
15433 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
15434
15435 ::fidl_next::Encode::encode(self.options, encoder, options)?;
15436
15437 ::fidl_next::Encode::encode(self.object, encoder, object)?;
15438
15439 Ok(())
15440 }
15441 }
15442
15443 pub struct ReadDirents<T0> {
15444 max_bytes: T0,
15445 }
15446
15447 impl<T0> ::fidl_next::Encodable for ReadDirents<T0>
15448 where
15449 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
15450 {
15451 type Encoded = crate::WireDirectoryReadDirentsRequest;
15452 }
15453
15454 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ReadDirents<T0>
15455 where
15456 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15457 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
15458 {
15459 #[inline]
15460 fn encode(
15461 self,
15462 encoder: &mut ___E,
15463 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15464 ) -> Result<(), ::fidl_next::EncodeError> {
15465 ::fidl_next::munge! {
15466 let Self::Encoded {
15467 max_bytes,
15468
15469 } = out;
15470 }
15471
15472 ::fidl_next::Encode::encode(self.max_bytes, encoder, max_bytes)?;
15473
15474 Ok(())
15475 }
15476 }
15477
15478 pub struct Link<T0, T1, T2> {
15479 src: T0,
15480
15481 dst_parent_token: T1,
15482
15483 dst: T2,
15484 }
15485
15486 impl<T0, T1, T2> ::fidl_next::Encodable for Link<T0, T1, T2>
15487 where
15488 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15489 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
15490 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15491 {
15492 type Encoded = crate::WireDirectoryLinkRequest<'static>;
15493 }
15494
15495 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Link<T0, T1, T2>
15496 where
15497 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15498 ___E: ::fidl_next::Encoder,
15499 ___E: ::fidl_next::fuchsia::HandleEncoder,
15500 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15501 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
15502 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15503 {
15504 #[inline]
15505 fn encode(
15506 self,
15507 encoder: &mut ___E,
15508 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15509 ) -> Result<(), ::fidl_next::EncodeError> {
15510 ::fidl_next::munge! {
15511 let Self::Encoded {
15512 src,
15513 dst_parent_token,
15514 dst,
15515
15516 } = out;
15517 }
15518
15519 ::fidl_next::Encode::encode(self.src, encoder, src)?;
15520
15521 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
15522
15523 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
15524
15525 Ok(())
15526 }
15527 }
15528
15529 pub struct Unlink<T0, T1> {
15530 name: T0,
15531
15532 options: T1,
15533 }
15534
15535 impl<T0, T1> ::fidl_next::Encodable for Unlink<T0, T1>
15536 where
15537 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15538 T1: ::fidl_next::Encodable<Encoded = crate::WireUnlinkOptions<'static>>,
15539 {
15540 type Encoded = crate::WireDirectoryUnlinkRequest<'static>;
15541 }
15542
15543 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Unlink<T0, T1>
15544 where
15545 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15546 ___E: ::fidl_next::Encoder,
15547 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15548 T1: ::fidl_next::Encode<___E, Encoded = crate::WireUnlinkOptions<'static>>,
15549 {
15550 #[inline]
15551 fn encode(
15552 self,
15553 encoder: &mut ___E,
15554 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15555 ) -> Result<(), ::fidl_next::EncodeError> {
15556 ::fidl_next::munge! {
15557 let Self::Encoded {
15558 name,
15559 options,
15560
15561 } = out;
15562 }
15563
15564 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15565
15566 ::fidl_next::Encode::encode(self.options, encoder, options)?;
15567
15568 Ok(())
15569 }
15570 }
15571
15572 pub struct Rename<T0, T1, T2> {
15573 src: T0,
15574
15575 dst_parent_token: T1,
15576
15577 dst: T2,
15578 }
15579
15580 impl<T0, T1, T2> ::fidl_next::Encodable for Rename<T0, T1, T2>
15581 where
15582 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15583 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
15584 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15585 {
15586 type Encoded = crate::WireDirectoryRenameRequest<'static>;
15587 }
15588
15589 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Rename<T0, T1, T2>
15590 where
15591 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15592 ___E: ::fidl_next::Encoder,
15593 ___E: ::fidl_next::fuchsia::HandleEncoder,
15594 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15595 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
15596 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15597 {
15598 #[inline]
15599 fn encode(
15600 self,
15601 encoder: &mut ___E,
15602 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15603 ) -> Result<(), ::fidl_next::EncodeError> {
15604 ::fidl_next::munge! {
15605 let Self::Encoded {
15606 src,
15607 dst_parent_token,
15608 dst,
15609
15610 } = out;
15611 }
15612
15613 ::fidl_next::Encode::encode(self.src, encoder, src)?;
15614
15615 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
15616
15617 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
15618
15619 Ok(())
15620 }
15621 }
15622
15623 pub struct CreateSymlink<T0, T1, T2> {
15624 name: T0,
15625
15626 target: T1,
15627
15628 connection: T2,
15629 }
15630
15631 impl<T0, T1, T2> ::fidl_next::Encodable for CreateSymlink<T0, T1, T2>
15632 where
15633 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
15634 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
15635 T2: ::fidl_next::Encodable<
15636 Encoded = ::fidl_next::ServerEnd<
15637 crate::Symlink,
15638 ::fidl_next::fuchsia::WireOptionalChannel,
15639 >,
15640 >,
15641 {
15642 type Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>;
15643 }
15644
15645 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for CreateSymlink<T0, T1, T2>
15646 where
15647 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15648 ___E: ::fidl_next::Encoder,
15649 ___E: ::fidl_next::fuchsia::HandleEncoder,
15650 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
15651 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
15652 T2: ::fidl_next::Encode<
15653 ___E,
15654 Encoded = ::fidl_next::ServerEnd<
15655 crate::Symlink,
15656 ::fidl_next::fuchsia::WireOptionalChannel,
15657 >,
15658 >,
15659 {
15660 #[inline]
15661 fn encode(
15662 self,
15663 encoder: &mut ___E,
15664 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15665 ) -> Result<(), ::fidl_next::EncodeError> {
15666 ::fidl_next::munge! {
15667 let Self::Encoded {
15668 name,
15669 target,
15670 connection,
15671
15672 } = out;
15673 }
15674
15675 ::fidl_next::Encode::encode(self.name, encoder, name)?;
15676
15677 ::fidl_next::Encode::encode(self.target, encoder, target)?;
15678
15679 ::fidl_next::Encode::encode(self.connection, encoder, connection)?;
15680
15681 Ok(())
15682 }
15683 }
15684
15685 pub struct Watch<T0, T1, T2> {
15686 mask: T0,
15687
15688 options: T1,
15689
15690 watcher: T2,
15691 }
15692
15693 impl<T0, T1, T2> ::fidl_next::Encodable for Watch<T0, T1, T2>
15694 where
15695 T0: ::fidl_next::Encodable<Encoded = crate::WireWatchMask>,
15696 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
15697 T2: ::fidl_next::Encodable<
15698 Encoded = ::fidl_next::ServerEnd<
15699 crate::DirectoryWatcher,
15700 ::fidl_next::fuchsia::WireChannel,
15701 >,
15702 >,
15703 {
15704 type Encoded = crate::WireDirectoryWatchRequest;
15705 }
15706
15707 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Watch<T0, T1, T2>
15708 where
15709 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15710 ___E: ::fidl_next::fuchsia::HandleEncoder,
15711 T0: ::fidl_next::Encode<___E, Encoded = crate::WireWatchMask>,
15712 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
15713 T2: ::fidl_next::Encode<
15714 ___E,
15715 Encoded = ::fidl_next::ServerEnd<
15716 crate::DirectoryWatcher,
15717 ::fidl_next::fuchsia::WireChannel,
15718 >,
15719 >,
15720 {
15721 #[inline]
15722 fn encode(
15723 self,
15724 encoder: &mut ___E,
15725 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15726 ) -> Result<(), ::fidl_next::EncodeError> {
15727 ::fidl_next::munge! {
15728 let Self::Encoded {
15729 mask,
15730 options,
15731 watcher,
15732
15733 } = out;
15734 }
15735
15736 ::fidl_next::Encode::encode(self.mask, encoder, mask)?;
15737
15738 ::fidl_next::Encode::encode(self.options, encoder, options)?;
15739
15740 ::fidl_next::Encode::encode(self.watcher, encoder, watcher)?;
15741
15742 Ok(())
15743 }
15744 }
15745
15746 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Directory
15747 where
15748 ___T: ::fidl_next::Transport,
15749 {
15750 type ClientSender = DirectoryClientSender<___T>;
15751 type ServerSender = DirectoryServerSender<___T>;
15752 }
15753
15754 #[repr(transparent)]
15756 pub struct DirectoryClientSender<___T: ::fidl_next::Transport> {
15757 #[allow(dead_code)]
15758 sender: ::fidl_next::protocol::ClientSender<___T>,
15759 }
15760
15761 impl<___T> DirectoryClientSender<___T>
15762 where
15763 ___T: ::fidl_next::Transport,
15764 {
15765 #[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"]
15766 pub fn advisory_lock(
15767 &self,
15768
15769 request: impl ::fidl_next::Encode<
15770 <___T as ::fidl_next::Transport>::SendBuffer,
15771 Encoded = crate::WireAdvisoryLockRequest<'static>,
15772 >,
15773 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
15774 where
15775 <___T as ::fidl_next::Transport>::SendBuffer:
15776 ::fidl_next::encoder::InternalHandleEncoder,
15777 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
15778 {
15779 self.advisory_lock_with(AdvisoryLock { request })
15780 }
15781
15782 #[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"]
15783 pub fn advisory_lock_with<___R>(
15784 &self,
15785 request: ___R,
15786 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
15787 where
15788 ___R: ::fidl_next::Encode<
15789 <___T as ::fidl_next::Transport>::SendBuffer,
15790 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
15791 >,
15792 {
15793 ::fidl_next::TwoWayFuture::from_untyped(
15794 self.sender.send_two_way(7992130864415541162, request),
15795 )
15796 }
15797
15798 pub fn clone(
15799 &self,
15800
15801 request: impl ::fidl_next::Encode<
15802 <___T as ::fidl_next::Transport>::SendBuffer,
15803 Encoded = ::fidl_next::ServerEnd<
15804 ::fidl_next_fuchsia_unknown::Cloneable,
15805 ::fidl_next::fuchsia::WireChannel,
15806 >,
15807 >,
15808 ) -> ::fidl_next::SendFuture<'_, ___T>
15809 where
15810 <___T as ::fidl_next::Transport>::SendBuffer:
15811 ::fidl_next::encoder::InternalHandleEncoder,
15812 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
15813 {
15814 self.clone_with(Clone { request })
15815 }
15816
15817 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
15818 where
15819 ___R: ::fidl_next::Encode<
15820 <___T as ::fidl_next::Transport>::SendBuffer,
15821 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
15822 >,
15823 {
15824 ::fidl_next::SendFuture::from_untyped(
15825 self.sender.send_one_way(2366825959783828089, request),
15826 )
15827 }
15828
15829 #[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"]
15830 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
15831 ::fidl_next::TwoWayFuture::from_untyped(
15832 self.sender.send_two_way(6540867515453498750, ()),
15833 )
15834 }
15835
15836 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
15837 ::fidl_next::TwoWayFuture::from_untyped(
15838 self.sender.send_two_way(2763219980499352582, ()),
15839 )
15840 }
15841
15842 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
15843 pub fn deprecated_clone(
15844 &self,
15845
15846 flags: impl ::fidl_next::Encode<
15847 <___T as ::fidl_next::Transport>::SendBuffer,
15848 Encoded = crate::WireOpenFlags,
15849 >,
15850
15851 object: impl ::fidl_next::Encode<
15852 <___T as ::fidl_next::Transport>::SendBuffer,
15853 Encoded = ::fidl_next::ServerEnd<
15854 crate::Node,
15855 ::fidl_next::fuchsia::WireChannel,
15856 >,
15857 >,
15858 ) -> ::fidl_next::SendFuture<'_, ___T>
15859 where
15860 <___T as ::fidl_next::Transport>::SendBuffer:
15861 ::fidl_next::encoder::InternalHandleEncoder,
15862 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
15863 {
15864 self.deprecated_clone_with(DeprecatedClone { flags, object })
15865 }
15866
15867 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
15868 pub fn deprecated_clone_with<___R>(
15869 &self,
15870 request: ___R,
15871 ) -> ::fidl_next::SendFuture<'_, ___T>
15872 where
15873 ___R: ::fidl_next::Encode<
15874 <___T as ::fidl_next::Transport>::SendBuffer,
15875 Encoded = crate::WireNodeDeprecatedCloneRequest,
15876 >,
15877 {
15878 ::fidl_next::SendFuture::from_untyped(
15879 self.sender.send_one_way(6512600400724287855, request),
15880 )
15881 }
15882
15883 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
15884 pub fn deprecated_get_attr(
15885 &self,
15886 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
15887 ::fidl_next::TwoWayFuture::from_untyped(
15888 self.sender.send_two_way(8689798978500614909, ()),
15889 )
15890 }
15891
15892 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
15893 pub fn deprecated_set_attr(
15894 &self,
15895
15896 flags: impl ::fidl_next::Encode<
15897 <___T as ::fidl_next::Transport>::SendBuffer,
15898 Encoded = crate::WireNodeAttributeFlags,
15899 >,
15900
15901 attributes: impl ::fidl_next::Encode<
15902 <___T as ::fidl_next::Transport>::SendBuffer,
15903 Encoded = crate::WireNodeAttributes,
15904 >,
15905 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
15906 where
15907 <___T as ::fidl_next::Transport>::SendBuffer:
15908 ::fidl_next::encoder::InternalHandleEncoder,
15909 {
15910 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
15911 }
15912
15913 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
15914 pub fn deprecated_set_attr_with<___R>(
15915 &self,
15916 request: ___R,
15917 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
15918 where
15919 ___R: ::fidl_next::Encode<
15920 <___T as ::fidl_next::Transport>::SendBuffer,
15921 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
15922 >,
15923 {
15924 ::fidl_next::TwoWayFuture::from_untyped(
15925 self.sender.send_two_way(4721673413776871238, request),
15926 )
15927 }
15928
15929 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
15930 pub fn deprecated_get_flags(
15931 &self,
15932 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
15933 ::fidl_next::TwoWayFuture::from_untyped(
15934 self.sender.send_two_way(6595803110182632097, ()),
15935 )
15936 }
15937
15938 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
15939 pub fn deprecated_set_flags(
15940 &self,
15941
15942 flags: impl ::fidl_next::Encode<
15943 <___T as ::fidl_next::Transport>::SendBuffer,
15944 Encoded = crate::WireOpenFlags,
15945 >,
15946 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
15947 where
15948 <___T as ::fidl_next::Transport>::SendBuffer:
15949 ::fidl_next::encoder::InternalHandleEncoder,
15950 {
15951 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
15952 }
15953
15954 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
15955 pub fn deprecated_set_flags_with<___R>(
15956 &self,
15957 request: ___R,
15958 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
15959 where
15960 ___R: ::fidl_next::Encode<
15961 <___T as ::fidl_next::Transport>::SendBuffer,
15962 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
15963 >,
15964 {
15965 ::fidl_next::TwoWayFuture::from_untyped(
15966 self.sender.send_two_way(5950864159036794675, request),
15967 )
15968 }
15969
15970 #[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"]
15971 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
15972 ::fidl_next::TwoWayFuture::from_untyped(
15973 self.sender.send_two_way(105530239381466147, ()),
15974 )
15975 }
15976
15977 #[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"]
15978 pub fn set_flags(
15979 &self,
15980
15981 flags: impl ::fidl_next::Encode<
15982 <___T as ::fidl_next::Transport>::SendBuffer,
15983 Encoded = crate::WireFlags,
15984 >,
15985 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
15986 where
15987 <___T as ::fidl_next::Transport>::SendBuffer:
15988 ::fidl_next::encoder::InternalHandleEncoder,
15989 {
15990 self.set_flags_with(SetFlags { flags })
15991 }
15992
15993 #[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"]
15994 pub fn set_flags_with<___R>(
15995 &self,
15996 request: ___R,
15997 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
15998 where
15999 ___R: ::fidl_next::Encode<
16000 <___T as ::fidl_next::Transport>::SendBuffer,
16001 Encoded = crate::WireNodeSetFlagsRequest,
16002 >,
16003 {
16004 ::fidl_next::TwoWayFuture::from_untyped(
16005 self.sender.send_two_way(6172186066099445416, request),
16006 )
16007 }
16008
16009 #[doc = " Query the filesystem for filesystem-specific information.\n"]
16010 pub fn query_filesystem(
16011 &self,
16012 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
16013 ::fidl_next::TwoWayFuture::from_untyped(
16014 self.sender.send_two_way(8013111122914313744, ()),
16015 )
16016 }
16017
16018 #[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"]
16019 pub fn get_attributes(
16020 &self,
16021
16022 query: impl ::fidl_next::Encode<
16023 <___T as ::fidl_next::Transport>::SendBuffer,
16024 Encoded = crate::WireNodeAttributesQuery,
16025 >,
16026 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
16027 where
16028 <___T as ::fidl_next::Transport>::SendBuffer:
16029 ::fidl_next::encoder::InternalHandleEncoder,
16030 {
16031 self.get_attributes_with(GetAttributes { query })
16032 }
16033
16034 #[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"]
16035 pub fn get_attributes_with<___R>(
16036 &self,
16037 request: ___R,
16038 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
16039 where
16040 ___R: ::fidl_next::Encode<
16041 <___T as ::fidl_next::Transport>::SendBuffer,
16042 Encoded = crate::WireNodeGetAttributesRequest,
16043 >,
16044 {
16045 ::fidl_next::TwoWayFuture::from_untyped(
16046 self.sender.send_two_way(4414537700416816443, request),
16047 )
16048 }
16049
16050 #[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"]
16051 pub fn update_attributes_with<___R>(
16052 &self,
16053 request: ___R,
16054 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
16055 where
16056 ___R: ::fidl_next::Encode<
16057 <___T as ::fidl_next::Transport>::SendBuffer,
16058 Encoded = crate::WireMutableNodeAttributes<'static>,
16059 >,
16060 {
16061 ::fidl_next::TwoWayFuture::from_untyped(
16062 self.sender.send_two_way(3677402239314018056, request),
16063 )
16064 }
16065
16066 #[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"]
16067 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
16068 ::fidl_next::TwoWayFuture::from_untyped(
16069 self.sender.send_two_way(3196473584242777161, ()),
16070 )
16071 }
16072
16073 #[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"]
16074 pub fn list_extended_attributes(
16075 &self,
16076
16077 iterator: impl ::fidl_next::Encode<
16078 <___T as ::fidl_next::Transport>::SendBuffer,
16079 Encoded = ::fidl_next::ServerEnd<
16080 crate::ExtendedAttributeIterator,
16081 ::fidl_next::fuchsia::WireChannel,
16082 >,
16083 >,
16084 ) -> ::fidl_next::SendFuture<'_, ___T>
16085 where
16086 <___T as ::fidl_next::Transport>::SendBuffer:
16087 ::fidl_next::encoder::InternalHandleEncoder,
16088 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16089 {
16090 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
16091 }
16092
16093 #[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"]
16094 pub fn list_extended_attributes_with<___R>(
16095 &self,
16096 request: ___R,
16097 ) -> ::fidl_next::SendFuture<'_, ___T>
16098 where
16099 ___R: ::fidl_next::Encode<
16100 <___T as ::fidl_next::Transport>::SendBuffer,
16101 Encoded = crate::WireNodeListExtendedAttributesRequest,
16102 >,
16103 {
16104 ::fidl_next::SendFuture::from_untyped(
16105 self.sender.send_one_way(5431626189872037072, request),
16106 )
16107 }
16108
16109 #[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"]
16110 pub fn get_extended_attribute(
16111 &self,
16112
16113 name: impl ::fidl_next::Encode<
16114 <___T as ::fidl_next::Transport>::SendBuffer,
16115 Encoded = ::fidl_next::WireVector<'static, u8>,
16116 >,
16117 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
16118 where
16119 <___T as ::fidl_next::Transport>::SendBuffer:
16120 ::fidl_next::encoder::InternalHandleEncoder,
16121 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16122 {
16123 self.get_extended_attribute_with(GetExtendedAttribute { name })
16124 }
16125
16126 #[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"]
16127 pub fn get_extended_attribute_with<___R>(
16128 &self,
16129 request: ___R,
16130 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
16131 where
16132 ___R: ::fidl_next::Encode<
16133 <___T as ::fidl_next::Transport>::SendBuffer,
16134 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
16135 >,
16136 {
16137 ::fidl_next::TwoWayFuture::from_untyped(
16138 self.sender.send_two_way(5043930208506967771, request),
16139 )
16140 }
16141
16142 #[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"]
16143 pub fn set_extended_attribute(
16144 &self,
16145
16146 name: impl ::fidl_next::Encode<
16147 <___T as ::fidl_next::Transport>::SendBuffer,
16148 Encoded = ::fidl_next::WireVector<'static, u8>,
16149 >,
16150
16151 value: impl ::fidl_next::Encode<
16152 <___T as ::fidl_next::Transport>::SendBuffer,
16153 Encoded = crate::WireExtendedAttributeValue<'static>,
16154 >,
16155
16156 mode: impl ::fidl_next::Encode<
16157 <___T as ::fidl_next::Transport>::SendBuffer,
16158 Encoded = crate::WireSetExtendedAttributeMode,
16159 >,
16160 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
16161 where
16162 <___T as ::fidl_next::Transport>::SendBuffer:
16163 ::fidl_next::encoder::InternalHandleEncoder,
16164 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16165 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16166 {
16167 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
16168 }
16169
16170 #[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"]
16171 pub fn set_extended_attribute_with<___R>(
16172 &self,
16173 request: ___R,
16174 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
16175 where
16176 ___R: ::fidl_next::Encode<
16177 <___T as ::fidl_next::Transport>::SendBuffer,
16178 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
16179 >,
16180 {
16181 ::fidl_next::TwoWayFuture::from_untyped(
16182 self.sender.send_two_way(5374223046099989052, request),
16183 )
16184 }
16185
16186 #[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"]
16187 pub fn remove_extended_attribute(
16188 &self,
16189
16190 name: impl ::fidl_next::Encode<
16191 <___T as ::fidl_next::Transport>::SendBuffer,
16192 Encoded = ::fidl_next::WireVector<'static, u8>,
16193 >,
16194 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
16195 where
16196 <___T as ::fidl_next::Transport>::SendBuffer:
16197 ::fidl_next::encoder::InternalHandleEncoder,
16198 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16199 {
16200 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
16201 }
16202
16203 #[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"]
16204 pub fn remove_extended_attribute_with<___R>(
16205 &self,
16206 request: ___R,
16207 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
16208 where
16209 ___R: ::fidl_next::Encode<
16210 <___T as ::fidl_next::Transport>::SendBuffer,
16211 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
16212 >,
16213 {
16214 ::fidl_next::TwoWayFuture::from_untyped(
16215 self.sender.send_two_way(8794297771444732717, request),
16216 )
16217 }
16218
16219 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
16220 pub fn deprecated_open(
16221 &self,
16222
16223 flags: impl ::fidl_next::Encode<
16224 <___T as ::fidl_next::Transport>::SendBuffer,
16225 Encoded = crate::WireOpenFlags,
16226 >,
16227
16228 mode: impl ::fidl_next::Encode<
16229 <___T as ::fidl_next::Transport>::SendBuffer,
16230 Encoded = crate::WireModeType,
16231 >,
16232
16233 path: impl ::fidl_next::Encode<
16234 <___T as ::fidl_next::Transport>::SendBuffer,
16235 Encoded = ::fidl_next::WireString<'static>,
16236 >,
16237
16238 object: impl ::fidl_next::Encode<
16239 <___T as ::fidl_next::Transport>::SendBuffer,
16240 Encoded = ::fidl_next::ServerEnd<
16241 crate::Node,
16242 ::fidl_next::fuchsia::WireChannel,
16243 >,
16244 >,
16245 ) -> ::fidl_next::SendFuture<'_, ___T>
16246 where
16247 <___T as ::fidl_next::Transport>::SendBuffer:
16248 ::fidl_next::encoder::InternalHandleEncoder,
16249 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16250 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16251 {
16252 self.deprecated_open_with(DeprecatedOpen { flags, mode, path, object })
16253 }
16254
16255 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
16256 pub fn deprecated_open_with<___R>(
16257 &self,
16258 request: ___R,
16259 ) -> ::fidl_next::SendFuture<'_, ___T>
16260 where
16261 ___R: ::fidl_next::Encode<
16262 <___T as ::fidl_next::Transport>::SendBuffer,
16263 Encoded = crate::WireDirectoryDeprecatedOpenRequest<'static>,
16264 >,
16265 {
16266 ::fidl_next::SendFuture::from_untyped(
16267 self.sender.send_one_way(3193127272456937152, request),
16268 )
16269 }
16270
16271 #[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"]
16272 pub fn open(
16273 &self,
16274
16275 path: impl ::fidl_next::Encode<
16276 <___T as ::fidl_next::Transport>::SendBuffer,
16277 Encoded = ::fidl_next::WireString<'static>,
16278 >,
16279
16280 flags: impl ::fidl_next::Encode<
16281 <___T as ::fidl_next::Transport>::SendBuffer,
16282 Encoded = crate::WireFlags,
16283 >,
16284
16285 options: impl ::fidl_next::Encode<
16286 <___T as ::fidl_next::Transport>::SendBuffer,
16287 Encoded = crate::WireOptions<'static>,
16288 >,
16289
16290 object: impl ::fidl_next::Encode<
16291 <___T as ::fidl_next::Transport>::SendBuffer,
16292 Encoded = ::fidl_next::fuchsia::WireChannel,
16293 >,
16294 ) -> ::fidl_next::SendFuture<'_, ___T>
16295 where
16296 <___T as ::fidl_next::Transport>::SendBuffer:
16297 ::fidl_next::encoder::InternalHandleEncoder,
16298 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16299 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16300 {
16301 self.open_with(Open { path, flags, options, object })
16302 }
16303
16304 #[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"]
16305 pub fn open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
16306 where
16307 ___R: ::fidl_next::Encode<
16308 <___T as ::fidl_next::Transport>::SendBuffer,
16309 Encoded = crate::WireDirectoryOpenRequest<'static>,
16310 >,
16311 {
16312 ::fidl_next::SendFuture::from_untyped(
16313 self.sender.send_one_way(6236883748953765593, request),
16314 )
16315 }
16316
16317 #[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"]
16318 pub fn read_dirents(
16319 &self,
16320
16321 max_bytes: impl ::fidl_next::Encode<
16322 <___T as ::fidl_next::Transport>::SendBuffer,
16323 Encoded = ::fidl_next::WireU64,
16324 >,
16325 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadDirents, ___T>
16326 where
16327 <___T as ::fidl_next::Transport>::SendBuffer:
16328 ::fidl_next::encoder::InternalHandleEncoder,
16329 {
16330 self.read_dirents_with(ReadDirents { max_bytes })
16331 }
16332
16333 #[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"]
16334 pub fn read_dirents_with<___R>(
16335 &self,
16336 request: ___R,
16337 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadDirents, ___T>
16338 where
16339 ___R: ::fidl_next::Encode<
16340 <___T as ::fidl_next::Transport>::SendBuffer,
16341 Encoded = crate::WireDirectoryReadDirentsRequest,
16342 >,
16343 {
16344 ::fidl_next::TwoWayFuture::from_untyped(
16345 self.sender.send_two_way(3855785432100874762, request),
16346 )
16347 }
16348
16349 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
16350 pub fn rewind(&self) -> ::fidl_next::TwoWayFuture<'_, super::Rewind, ___T> {
16351 ::fidl_next::TwoWayFuture::from_untyped(
16352 self.sender.send_two_way(1635123508515392625, ()),
16353 )
16354 }
16355
16356 #[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"]
16357 pub fn get_token(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetToken, ___T> {
16358 ::fidl_next::TwoWayFuture::from_untyped(
16359 self.sender.send_two_way(2787337947777369685, ()),
16360 )
16361 }
16362
16363 #[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"]
16364 pub fn link(
16365 &self,
16366
16367 src: impl ::fidl_next::Encode<
16368 <___T as ::fidl_next::Transport>::SendBuffer,
16369 Encoded = ::fidl_next::WireString<'static>,
16370 >,
16371
16372 dst_parent_token: impl ::fidl_next::Encode<
16373 <___T as ::fidl_next::Transport>::SendBuffer,
16374 Encoded = ::fidl_next::fuchsia::WireHandle,
16375 >,
16376
16377 dst: impl ::fidl_next::Encode<
16378 <___T as ::fidl_next::Transport>::SendBuffer,
16379 Encoded = ::fidl_next::WireString<'static>,
16380 >,
16381 ) -> ::fidl_next::TwoWayFuture<'_, super::Link, ___T>
16382 where
16383 <___T as ::fidl_next::Transport>::SendBuffer:
16384 ::fidl_next::encoder::InternalHandleEncoder,
16385 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16386 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16387 {
16388 self.link_with(Link { src, dst_parent_token, dst })
16389 }
16390
16391 #[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"]
16392 pub fn link_with<___R>(
16393 &self,
16394 request: ___R,
16395 ) -> ::fidl_next::TwoWayFuture<'_, super::Link, ___T>
16396 where
16397 ___R: ::fidl_next::Encode<
16398 <___T as ::fidl_next::Transport>::SendBuffer,
16399 Encoded = crate::WireDirectoryLinkRequest<'static>,
16400 >,
16401 {
16402 ::fidl_next::TwoWayFuture::from_untyped(
16403 self.sender.send_two_way(8360374984291987687, request),
16404 )
16405 }
16406
16407 #[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"]
16408 pub fn unlink(
16409 &self,
16410
16411 name: impl ::fidl_next::Encode<
16412 <___T as ::fidl_next::Transport>::SendBuffer,
16413 Encoded = ::fidl_next::WireString<'static>,
16414 >,
16415
16416 options: impl ::fidl_next::Encode<
16417 <___T as ::fidl_next::Transport>::SendBuffer,
16418 Encoded = crate::WireUnlinkOptions<'static>,
16419 >,
16420 ) -> ::fidl_next::TwoWayFuture<'_, super::Unlink, ___T>
16421 where
16422 <___T as ::fidl_next::Transport>::SendBuffer:
16423 ::fidl_next::encoder::InternalHandleEncoder,
16424 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16425 {
16426 self.unlink_with(Unlink { name, options })
16427 }
16428
16429 #[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"]
16430 pub fn unlink_with<___R>(
16431 &self,
16432 request: ___R,
16433 ) -> ::fidl_next::TwoWayFuture<'_, super::Unlink, ___T>
16434 where
16435 ___R: ::fidl_next::Encode<
16436 <___T as ::fidl_next::Transport>::SendBuffer,
16437 Encoded = crate::WireDirectoryUnlinkRequest<'static>,
16438 >,
16439 {
16440 ::fidl_next::TwoWayFuture::from_untyped(
16441 self.sender.send_two_way(8433556716759383021, request),
16442 )
16443 }
16444
16445 #[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"]
16446 pub fn rename(
16447 &self,
16448
16449 src: impl ::fidl_next::Encode<
16450 <___T as ::fidl_next::Transport>::SendBuffer,
16451 Encoded = ::fidl_next::WireString<'static>,
16452 >,
16453
16454 dst_parent_token: impl ::fidl_next::Encode<
16455 <___T as ::fidl_next::Transport>::SendBuffer,
16456 Encoded = ::fidl_next::fuchsia::WireEvent,
16457 >,
16458
16459 dst: impl ::fidl_next::Encode<
16460 <___T as ::fidl_next::Transport>::SendBuffer,
16461 Encoded = ::fidl_next::WireString<'static>,
16462 >,
16463 ) -> ::fidl_next::TwoWayFuture<'_, super::Rename, ___T>
16464 where
16465 <___T as ::fidl_next::Transport>::SendBuffer:
16466 ::fidl_next::encoder::InternalHandleEncoder,
16467 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16468 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16469 {
16470 self.rename_with(Rename { src, dst_parent_token, dst })
16471 }
16472
16473 #[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"]
16474 pub fn rename_with<___R>(
16475 &self,
16476 request: ___R,
16477 ) -> ::fidl_next::TwoWayFuture<'_, super::Rename, ___T>
16478 where
16479 ___R: ::fidl_next::Encode<
16480 <___T as ::fidl_next::Transport>::SendBuffer,
16481 Encoded = crate::WireDirectoryRenameRequest<'static>,
16482 >,
16483 {
16484 ::fidl_next::TwoWayFuture::from_untyped(
16485 self.sender.send_two_way(8097726607824333022, request),
16486 )
16487 }
16488
16489 #[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"]
16490 pub fn create_symlink(
16491 &self,
16492
16493 name: impl ::fidl_next::Encode<
16494 <___T as ::fidl_next::Transport>::SendBuffer,
16495 Encoded = ::fidl_next::WireString<'static>,
16496 >,
16497
16498 target: impl ::fidl_next::Encode<
16499 <___T as ::fidl_next::Transport>::SendBuffer,
16500 Encoded = ::fidl_next::WireVector<'static, u8>,
16501 >,
16502
16503 connection: impl ::fidl_next::Encode<
16504 <___T as ::fidl_next::Transport>::SendBuffer,
16505 Encoded = ::fidl_next::ServerEnd<
16506 crate::Symlink,
16507 ::fidl_next::fuchsia::WireOptionalChannel,
16508 >,
16509 >,
16510 ) -> ::fidl_next::TwoWayFuture<'_, super::CreateSymlink, ___T>
16511 where
16512 <___T as ::fidl_next::Transport>::SendBuffer:
16513 ::fidl_next::encoder::InternalHandleEncoder,
16514 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16515 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16516 {
16517 self.create_symlink_with(CreateSymlink { name, target, connection })
16518 }
16519
16520 #[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"]
16521 pub fn create_symlink_with<___R>(
16522 &self,
16523 request: ___R,
16524 ) -> ::fidl_next::TwoWayFuture<'_, super::CreateSymlink, ___T>
16525 where
16526 ___R: ::fidl_next::Encode<
16527 <___T as ::fidl_next::Transport>::SendBuffer,
16528 Encoded = crate::WireDirectoryCreateSymlinkRequest<'static>,
16529 >,
16530 {
16531 ::fidl_next::TwoWayFuture::from_untyped(
16532 self.sender.send_two_way(2435901052462315657, request),
16533 )
16534 }
16535
16536 #[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"]
16537 pub fn watch(
16538 &self,
16539
16540 mask: impl ::fidl_next::Encode<
16541 <___T as ::fidl_next::Transport>::SendBuffer,
16542 Encoded = crate::WireWatchMask,
16543 >,
16544
16545 options: impl ::fidl_next::Encode<
16546 <___T as ::fidl_next::Transport>::SendBuffer,
16547 Encoded = ::fidl_next::WireU32,
16548 >,
16549
16550 watcher: impl ::fidl_next::Encode<
16551 <___T as ::fidl_next::Transport>::SendBuffer,
16552 Encoded = ::fidl_next::ServerEnd<
16553 crate::DirectoryWatcher,
16554 ::fidl_next::fuchsia::WireChannel,
16555 >,
16556 >,
16557 ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
16558 where
16559 <___T as ::fidl_next::Transport>::SendBuffer:
16560 ::fidl_next::encoder::InternalHandleEncoder,
16561 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16562 {
16563 self.watch_with(Watch { mask, options, watcher })
16564 }
16565
16566 #[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"]
16567 pub fn watch_with<___R>(
16568 &self,
16569 request: ___R,
16570 ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
16571 where
16572 ___R: ::fidl_next::Encode<
16573 <___T as ::fidl_next::Transport>::SendBuffer,
16574 Encoded = crate::WireDirectoryWatchRequest,
16575 >,
16576 {
16577 ::fidl_next::TwoWayFuture::from_untyped(
16578 self.sender.send_two_way(6275512344170098065, request),
16579 )
16580 }
16581 }
16582
16583 #[repr(transparent)]
16585 pub struct DirectoryServerSender<___T: ::fidl_next::Transport> {
16586 sender: ::fidl_next::protocol::ServerSender<___T>,
16587 }
16588
16589 impl<___T> DirectoryServerSender<___T>
16590 where
16591 ___T: ::fidl_next::Transport,
16592 {
16593 #[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"]
16594 pub fn on_open(
16595 &self,
16596
16597 s: impl ::fidl_next::Encode<
16598 <___T as ::fidl_next::Transport>::SendBuffer,
16599 Encoded = ::fidl_next::WireI32,
16600 >,
16601
16602 info: impl ::fidl_next::Encode<
16603 <___T as ::fidl_next::Transport>::SendBuffer,
16604 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
16605 >,
16606 ) -> ::fidl_next::SendFuture<'_, ___T>
16607 where
16608 <___T as ::fidl_next::Transport>::SendBuffer:
16609 ::fidl_next::encoder::InternalHandleEncoder,
16610 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
16611 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
16612 {
16613 self.on_open_with(OnOpen { s, info })
16614 }
16615
16616 #[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"]
16617
16618 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
16619 where
16620 ___R: ::fidl_next::Encode<
16621 <___T as ::fidl_next::Transport>::SendBuffer,
16622 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
16623 >,
16624 {
16625 ::fidl_next::SendFuture::from_untyped(
16626 self.sender.send_event(9207534335756671346, request),
16627 )
16628 }
16629
16630 #[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"]
16631
16632 pub fn on_representation_with<___R>(
16633 &self,
16634 request: ___R,
16635 ) -> ::fidl_next::SendFuture<'_, ___T>
16636 where
16637 ___R: ::fidl_next::Encode<
16638 <___T as ::fidl_next::Transport>::SendBuffer,
16639 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
16640 >,
16641 {
16642 ::fidl_next::SendFuture::from_untyped(
16643 self.sender.send_event(6679970090861613324, request),
16644 )
16645 }
16646 }
16647 }
16648}
16649
16650pub trait DirectoryClientHandler<
16654 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
16655 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
16656>
16657{
16658 #[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"]
16659 fn on_open(
16660 &mut self,
16661 sender: &::fidl_next::ClientSender<Directory, ___T>,
16662
16663 event: ::fidl_next::Response<directory::OnOpen, ___T>,
16664 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16665
16666 #[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"]
16667 fn on_representation(
16668 &mut self,
16669 sender: &::fidl_next::ClientSender<Directory, ___T>,
16670
16671 event: ::fidl_next::Response<directory::OnRepresentation, ___T>,
16672 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16673
16674 fn on_unknown_interaction(
16675 &mut self,
16676 sender: &::fidl_next::ClientSender<Directory, ___T>,
16677 ordinal: u64,
16678 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
16679 sender.close();
16680 ::core::future::ready(())
16681 }
16682}
16683
16684impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Directory
16685where
16686 ___H: DirectoryClientHandler<___T> + ::core::marker::Send,
16687 ___T: ::fidl_next::Transport,
16688 <directory::AdvisoryLock as ::fidl_next::Method>::Response:
16689 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16690 <directory::Close as ::fidl_next::Method>::Response:
16691 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16692 <directory::Query as ::fidl_next::Method>::Response:
16693 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16694 <directory::OnOpen as ::fidl_next::Method>::Response:
16695 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16696 <directory::DeprecatedGetAttr as ::fidl_next::Method>::Response:
16697 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16698 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Response:
16699 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16700 <directory::DeprecatedGetFlags as ::fidl_next::Method>::Response:
16701 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16702 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Response:
16703 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16704 <directory::GetFlags as ::fidl_next::Method>::Response:
16705 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16706 <directory::SetFlags as ::fidl_next::Method>::Response:
16707 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16708 <directory::QueryFilesystem as ::fidl_next::Method>::Response:
16709 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16710 <directory::OnRepresentation as ::fidl_next::Method>::Response:
16711 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16712 <directory::GetAttributes as ::fidl_next::Method>::Response:
16713 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16714 <directory::UpdateAttributes as ::fidl_next::Method>::Response:
16715 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16716 <directory::Sync as ::fidl_next::Method>::Response:
16717 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16718 <directory::GetExtendedAttribute as ::fidl_next::Method>::Response:
16719 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16720 <directory::SetExtendedAttribute as ::fidl_next::Method>::Response:
16721 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16722 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
16723 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16724 <directory::ReadDirents as ::fidl_next::Method>::Response:
16725 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16726 <directory::Rewind as ::fidl_next::Method>::Response:
16727 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16728 <directory::GetToken as ::fidl_next::Method>::Response:
16729 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16730 <directory::Link as ::fidl_next::Method>::Response:
16731 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16732 <directory::Unlink as ::fidl_next::Method>::Response:
16733 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16734 <directory::Rename as ::fidl_next::Method>::Response:
16735 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16736 <directory::CreateSymlink as ::fidl_next::Method>::Response:
16737 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16738 <directory::Watch as ::fidl_next::Method>::Response:
16739 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16740{
16741 async fn on_event(
16742 handler: &mut ___H,
16743 sender: &::fidl_next::ClientSender<Self, ___T>,
16744 ordinal: u64,
16745 buffer: ___T::RecvBuffer,
16746 ) {
16747 match ordinal {
16748 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
16749 Ok(decoded) => handler.on_open(sender, decoded).await,
16750 Err(e) => sender.close(),
16751 },
16752
16753 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
16754 Ok(decoded) => handler.on_representation(sender, decoded).await,
16755 Err(e) => sender.close(),
16756 },
16757
16758 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
16759 }
16760 }
16761}
16762
16763pub trait DirectoryServerHandler<
16767 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
16768 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
16769>
16770{
16771 #[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"]
16772 fn advisory_lock(
16773 &mut self,
16774 sender: &::fidl_next::ServerSender<Directory, ___T>,
16775
16776 request: ::fidl_next::Request<directory::AdvisoryLock, ___T>,
16777
16778 responder: ::fidl_next::Responder<directory::AdvisoryLock>,
16779 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16780
16781 fn clone(
16782 &mut self,
16783 sender: &::fidl_next::ServerSender<Directory, ___T>,
16784
16785 request: ::fidl_next::Request<directory::Clone, ___T>,
16786 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16787
16788 #[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"]
16789 fn close(
16790 &mut self,
16791 sender: &::fidl_next::ServerSender<Directory, ___T>,
16792
16793 responder: ::fidl_next::Responder<directory::Close>,
16794 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16795
16796 fn query(
16797 &mut self,
16798 sender: &::fidl_next::ServerSender<Directory, ___T>,
16799
16800 responder: ::fidl_next::Responder<directory::Query>,
16801 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16802
16803 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
16804 fn deprecated_clone(
16805 &mut self,
16806 sender: &::fidl_next::ServerSender<Directory, ___T>,
16807
16808 request: ::fidl_next::Request<directory::DeprecatedClone, ___T>,
16809 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16810
16811 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
16812 fn deprecated_get_attr(
16813 &mut self,
16814 sender: &::fidl_next::ServerSender<Directory, ___T>,
16815
16816 responder: ::fidl_next::Responder<directory::DeprecatedGetAttr>,
16817 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16818
16819 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
16820 fn deprecated_set_attr(
16821 &mut self,
16822 sender: &::fidl_next::ServerSender<Directory, ___T>,
16823
16824 request: ::fidl_next::Request<directory::DeprecatedSetAttr, ___T>,
16825
16826 responder: ::fidl_next::Responder<directory::DeprecatedSetAttr>,
16827 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16828
16829 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
16830 fn deprecated_get_flags(
16831 &mut self,
16832 sender: &::fidl_next::ServerSender<Directory, ___T>,
16833
16834 responder: ::fidl_next::Responder<directory::DeprecatedGetFlags>,
16835 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16836
16837 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
16838 fn deprecated_set_flags(
16839 &mut self,
16840 sender: &::fidl_next::ServerSender<Directory, ___T>,
16841
16842 request: ::fidl_next::Request<directory::DeprecatedSetFlags, ___T>,
16843
16844 responder: ::fidl_next::Responder<directory::DeprecatedSetFlags>,
16845 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16846
16847 #[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"]
16848 fn get_flags(
16849 &mut self,
16850 sender: &::fidl_next::ServerSender<Directory, ___T>,
16851
16852 responder: ::fidl_next::Responder<directory::GetFlags>,
16853 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16854
16855 #[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"]
16856 fn set_flags(
16857 &mut self,
16858 sender: &::fidl_next::ServerSender<Directory, ___T>,
16859
16860 request: ::fidl_next::Request<directory::SetFlags, ___T>,
16861
16862 responder: ::fidl_next::Responder<directory::SetFlags>,
16863 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16864
16865 #[doc = " Query the filesystem for filesystem-specific information.\n"]
16866 fn query_filesystem(
16867 &mut self,
16868 sender: &::fidl_next::ServerSender<Directory, ___T>,
16869
16870 responder: ::fidl_next::Responder<directory::QueryFilesystem>,
16871 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16872
16873 #[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"]
16874 fn get_attributes(
16875 &mut self,
16876 sender: &::fidl_next::ServerSender<Directory, ___T>,
16877
16878 request: ::fidl_next::Request<directory::GetAttributes, ___T>,
16879
16880 responder: ::fidl_next::Responder<directory::GetAttributes>,
16881 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16882
16883 #[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"]
16884 fn update_attributes(
16885 &mut self,
16886 sender: &::fidl_next::ServerSender<Directory, ___T>,
16887
16888 request: ::fidl_next::Request<directory::UpdateAttributes, ___T>,
16889
16890 responder: ::fidl_next::Responder<directory::UpdateAttributes>,
16891 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16892
16893 #[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"]
16894 fn sync(
16895 &mut self,
16896 sender: &::fidl_next::ServerSender<Directory, ___T>,
16897
16898 responder: ::fidl_next::Responder<directory::Sync>,
16899 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16900
16901 #[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"]
16902 fn list_extended_attributes(
16903 &mut self,
16904 sender: &::fidl_next::ServerSender<Directory, ___T>,
16905
16906 request: ::fidl_next::Request<directory::ListExtendedAttributes, ___T>,
16907 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16908
16909 #[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"]
16910 fn get_extended_attribute(
16911 &mut self,
16912 sender: &::fidl_next::ServerSender<Directory, ___T>,
16913
16914 request: ::fidl_next::Request<directory::GetExtendedAttribute, ___T>,
16915
16916 responder: ::fidl_next::Responder<directory::GetExtendedAttribute>,
16917 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16918
16919 #[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"]
16920 fn set_extended_attribute(
16921 &mut self,
16922 sender: &::fidl_next::ServerSender<Directory, ___T>,
16923
16924 request: ::fidl_next::Request<directory::SetExtendedAttribute, ___T>,
16925
16926 responder: ::fidl_next::Responder<directory::SetExtendedAttribute>,
16927 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16928
16929 #[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"]
16930 fn remove_extended_attribute(
16931 &mut self,
16932 sender: &::fidl_next::ServerSender<Directory, ___T>,
16933
16934 request: ::fidl_next::Request<directory::RemoveExtendedAttribute, ___T>,
16935
16936 responder: ::fidl_next::Responder<directory::RemoveExtendedAttribute>,
16937 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16938
16939 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
16940 fn deprecated_open(
16941 &mut self,
16942 sender: &::fidl_next::ServerSender<Directory, ___T>,
16943
16944 request: ::fidl_next::Request<directory::DeprecatedOpen, ___T>,
16945 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16946
16947 #[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"]
16948 fn open(
16949 &mut self,
16950 sender: &::fidl_next::ServerSender<Directory, ___T>,
16951
16952 request: ::fidl_next::Request<directory::Open, ___T>,
16953 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16954
16955 #[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"]
16956 fn read_dirents(
16957 &mut self,
16958 sender: &::fidl_next::ServerSender<Directory, ___T>,
16959
16960 request: ::fidl_next::Request<directory::ReadDirents, ___T>,
16961
16962 responder: ::fidl_next::Responder<directory::ReadDirents>,
16963 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16964
16965 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
16966 fn rewind(
16967 &mut self,
16968 sender: &::fidl_next::ServerSender<Directory, ___T>,
16969
16970 responder: ::fidl_next::Responder<directory::Rewind>,
16971 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16972
16973 #[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"]
16974 fn get_token(
16975 &mut self,
16976 sender: &::fidl_next::ServerSender<Directory, ___T>,
16977
16978 responder: ::fidl_next::Responder<directory::GetToken>,
16979 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16980
16981 #[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"]
16982 fn link(
16983 &mut self,
16984 sender: &::fidl_next::ServerSender<Directory, ___T>,
16985
16986 request: ::fidl_next::Request<directory::Link, ___T>,
16987
16988 responder: ::fidl_next::Responder<directory::Link>,
16989 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
16990
16991 #[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"]
16992 fn unlink(
16993 &mut self,
16994 sender: &::fidl_next::ServerSender<Directory, ___T>,
16995
16996 request: ::fidl_next::Request<directory::Unlink, ___T>,
16997
16998 responder: ::fidl_next::Responder<directory::Unlink>,
16999 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17000
17001 #[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"]
17002 fn rename(
17003 &mut self,
17004 sender: &::fidl_next::ServerSender<Directory, ___T>,
17005
17006 request: ::fidl_next::Request<directory::Rename, ___T>,
17007
17008 responder: ::fidl_next::Responder<directory::Rename>,
17009 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17010
17011 #[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"]
17012 fn create_symlink(
17013 &mut self,
17014 sender: &::fidl_next::ServerSender<Directory, ___T>,
17015
17016 request: ::fidl_next::Request<directory::CreateSymlink, ___T>,
17017
17018 responder: ::fidl_next::Responder<directory::CreateSymlink>,
17019 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17020
17021 #[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"]
17022 fn watch(
17023 &mut self,
17024 sender: &::fidl_next::ServerSender<Directory, ___T>,
17025
17026 request: ::fidl_next::Request<directory::Watch, ___T>,
17027
17028 responder: ::fidl_next::Responder<directory::Watch>,
17029 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
17030
17031 fn on_unknown_interaction(
17032 &mut self,
17033 sender: &::fidl_next::ServerSender<Directory, ___T>,
17034 ordinal: u64,
17035 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
17036 sender.close();
17037 ::core::future::ready(())
17038 }
17039}
17040
17041impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Directory
17042where
17043 ___H: DirectoryServerHandler<___T> + ::core::marker::Send,
17044 ___T: ::fidl_next::Transport,
17045 <directory::AdvisoryLock as ::fidl_next::Method>::Request:
17046 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17047 <directory::Clone as ::fidl_next::Method>::Request:
17048 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17049 <directory::DeprecatedClone as ::fidl_next::Method>::Request:
17050 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17051 <directory::DeprecatedSetAttr as ::fidl_next::Method>::Request:
17052 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17053 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Request:
17054 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17055 <directory::SetFlags as ::fidl_next::Method>::Request:
17056 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17057 <directory::GetAttributes as ::fidl_next::Method>::Request:
17058 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17059 <directory::UpdateAttributes as ::fidl_next::Method>::Request:
17060 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17061 <directory::ListExtendedAttributes as ::fidl_next::Method>::Request:
17062 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17063 <directory::GetExtendedAttribute as ::fidl_next::Method>::Request:
17064 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17065 <directory::SetExtendedAttribute as ::fidl_next::Method>::Request:
17066 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17067 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
17068 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17069 <directory::DeprecatedOpen as ::fidl_next::Method>::Request:
17070 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17071 <directory::Open as ::fidl_next::Method>::Request:
17072 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17073 <directory::ReadDirents as ::fidl_next::Method>::Request:
17074 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17075 <directory::Link as ::fidl_next::Method>::Request:
17076 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17077 <directory::Unlink as ::fidl_next::Method>::Request:
17078 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17079 <directory::Rename as ::fidl_next::Method>::Request:
17080 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17081 <directory::CreateSymlink as ::fidl_next::Method>::Request:
17082 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17083 <directory::Watch as ::fidl_next::Method>::Request:
17084 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
17085{
17086 async fn on_one_way(
17087 handler: &mut ___H,
17088 sender: &::fidl_next::ServerSender<Self, ___T>,
17089 ordinal: u64,
17090 buffer: ___T::RecvBuffer,
17091 ) {
17092 match ordinal {
17093 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
17094 Ok(decoded) => handler.clone(sender, decoded).await,
17095 Err(e) => sender.close(),
17096 },
17097
17098 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
17099 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
17100 Err(e) => sender.close(),
17101 },
17102
17103 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
17104 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
17105 Err(e) => sender.close(),
17106 },
17107
17108 3193127272456937152 => match ::fidl_next::DecoderExt::decode(buffer) {
17109 Ok(decoded) => handler.deprecated_open(sender, decoded).await,
17110 Err(e) => sender.close(),
17111 },
17112
17113 6236883748953765593 => match ::fidl_next::DecoderExt::decode(buffer) {
17114 Ok(decoded) => handler.open(sender, decoded).await,
17115 Err(e) => sender.close(),
17116 },
17117
17118 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
17119 }
17120 }
17121
17122 async fn on_two_way(
17123 handler: &mut ___H,
17124 sender: &::fidl_next::ServerSender<Self, ___T>,
17125 ordinal: u64,
17126 buffer: ___T::RecvBuffer,
17127 responder: ::fidl_next::protocol::Responder,
17128 ) {
17129 match ordinal {
17130 7992130864415541162 => {
17131 let responder = ::fidl_next::Responder::from_untyped(responder);
17132
17133 match ::fidl_next::DecoderExt::decode(buffer) {
17134 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
17135 Err(e) => sender.close(),
17136 }
17137 }
17138
17139 6540867515453498750 => {
17140 let responder = ::fidl_next::Responder::from_untyped(responder);
17141
17142 handler.close(sender, responder).await;
17143 }
17144
17145 2763219980499352582 => {
17146 let responder = ::fidl_next::Responder::from_untyped(responder);
17147
17148 handler.query(sender, responder).await;
17149 }
17150
17151 8689798978500614909 => {
17152 let responder = ::fidl_next::Responder::from_untyped(responder);
17153
17154 handler.deprecated_get_attr(sender, responder).await;
17155 }
17156
17157 4721673413776871238 => {
17158 let responder = ::fidl_next::Responder::from_untyped(responder);
17159
17160 match ::fidl_next::DecoderExt::decode(buffer) {
17161 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
17162 Err(e) => sender.close(),
17163 }
17164 }
17165
17166 6595803110182632097 => {
17167 let responder = ::fidl_next::Responder::from_untyped(responder);
17168
17169 handler.deprecated_get_flags(sender, responder).await;
17170 }
17171
17172 5950864159036794675 => {
17173 let responder = ::fidl_next::Responder::from_untyped(responder);
17174
17175 match ::fidl_next::DecoderExt::decode(buffer) {
17176 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
17177 Err(e) => sender.close(),
17178 }
17179 }
17180
17181 105530239381466147 => {
17182 let responder = ::fidl_next::Responder::from_untyped(responder);
17183
17184 handler.get_flags(sender, responder).await;
17185 }
17186
17187 6172186066099445416 => {
17188 let responder = ::fidl_next::Responder::from_untyped(responder);
17189
17190 match ::fidl_next::DecoderExt::decode(buffer) {
17191 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
17192 Err(e) => sender.close(),
17193 }
17194 }
17195
17196 8013111122914313744 => {
17197 let responder = ::fidl_next::Responder::from_untyped(responder);
17198
17199 handler.query_filesystem(sender, responder).await;
17200 }
17201
17202 4414537700416816443 => {
17203 let responder = ::fidl_next::Responder::from_untyped(responder);
17204
17205 match ::fidl_next::DecoderExt::decode(buffer) {
17206 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
17207 Err(e) => sender.close(),
17208 }
17209 }
17210
17211 3677402239314018056 => {
17212 let responder = ::fidl_next::Responder::from_untyped(responder);
17213
17214 match ::fidl_next::DecoderExt::decode(buffer) {
17215 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
17216 Err(e) => sender.close(),
17217 }
17218 }
17219
17220 3196473584242777161 => {
17221 let responder = ::fidl_next::Responder::from_untyped(responder);
17222
17223 handler.sync(sender, responder).await;
17224 }
17225
17226 5043930208506967771 => {
17227 let responder = ::fidl_next::Responder::from_untyped(responder);
17228
17229 match ::fidl_next::DecoderExt::decode(buffer) {
17230 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
17231 Err(e) => sender.close(),
17232 }
17233 }
17234
17235 5374223046099989052 => {
17236 let responder = ::fidl_next::Responder::from_untyped(responder);
17237
17238 match ::fidl_next::DecoderExt::decode(buffer) {
17239 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
17240 Err(e) => sender.close(),
17241 }
17242 }
17243
17244 8794297771444732717 => {
17245 let responder = ::fidl_next::Responder::from_untyped(responder);
17246
17247 match ::fidl_next::DecoderExt::decode(buffer) {
17248 Ok(decoded) => {
17249 handler.remove_extended_attribute(sender, decoded, responder).await
17250 }
17251 Err(e) => sender.close(),
17252 }
17253 }
17254
17255 3855785432100874762 => {
17256 let responder = ::fidl_next::Responder::from_untyped(responder);
17257
17258 match ::fidl_next::DecoderExt::decode(buffer) {
17259 Ok(decoded) => handler.read_dirents(sender, decoded, responder).await,
17260 Err(e) => sender.close(),
17261 }
17262 }
17263
17264 1635123508515392625 => {
17265 let responder = ::fidl_next::Responder::from_untyped(responder);
17266
17267 handler.rewind(sender, responder).await;
17268 }
17269
17270 2787337947777369685 => {
17271 let responder = ::fidl_next::Responder::from_untyped(responder);
17272
17273 handler.get_token(sender, responder).await;
17274 }
17275
17276 8360374984291987687 => {
17277 let responder = ::fidl_next::Responder::from_untyped(responder);
17278
17279 match ::fidl_next::DecoderExt::decode(buffer) {
17280 Ok(decoded) => handler.link(sender, decoded, responder).await,
17281 Err(e) => sender.close(),
17282 }
17283 }
17284
17285 8433556716759383021 => {
17286 let responder = ::fidl_next::Responder::from_untyped(responder);
17287
17288 match ::fidl_next::DecoderExt::decode(buffer) {
17289 Ok(decoded) => handler.unlink(sender, decoded, responder).await,
17290 Err(e) => sender.close(),
17291 }
17292 }
17293
17294 8097726607824333022 => {
17295 let responder = ::fidl_next::Responder::from_untyped(responder);
17296
17297 match ::fidl_next::DecoderExt::decode(buffer) {
17298 Ok(decoded) => handler.rename(sender, decoded, responder).await,
17299 Err(e) => sender.close(),
17300 }
17301 }
17302
17303 2435901052462315657 => {
17304 let responder = ::fidl_next::Responder::from_untyped(responder);
17305
17306 match ::fidl_next::DecoderExt::decode(buffer) {
17307 Ok(decoded) => handler.create_symlink(sender, decoded, responder).await,
17308 Err(e) => sender.close(),
17309 }
17310 }
17311
17312 6275512344170098065 => {
17313 let responder = ::fidl_next::Responder::from_untyped(responder);
17314
17315 match ::fidl_next::DecoderExt::decode(buffer) {
17316 Ok(decoded) => handler.watch(sender, decoded, responder).await,
17317 Err(e) => sender.close(),
17318 }
17319 }
17320
17321 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
17322 }
17323 }
17324}
17325
17326#[derive(Clone, Debug)]
17327#[repr(C)]
17328pub struct DirectoryObject {}
17329
17330impl ::fidl_next::Encodable for DirectoryObject {
17331 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirectoryObject> =
17332 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
17333
17334 type Encoded = WireDirectoryObject;
17335}
17336
17337unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryObject
17338where
17339 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17340{
17341 #[inline]
17342 fn encode(
17343 self,
17344 encoder: &mut ___E,
17345 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17346 ) -> Result<(), ::fidl_next::EncodeError> {
17347 ::fidl_next::munge! {
17348 let Self::Encoded {
17349
17350 } = out;
17351 }
17352
17353 Ok(())
17354 }
17355}
17356
17357unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryObject
17358where
17359 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17360{
17361 #[inline]
17362 fn encode_ref(
17363 &self,
17364 encoder: &mut ___E,
17365 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17366 ) -> Result<(), ::fidl_next::EncodeError> {
17367 ::fidl_next::munge! {
17368 let Self::Encoded {
17369
17370 } = out;
17371 }
17372
17373 Ok(())
17374 }
17375}
17376
17377impl ::fidl_next::EncodableOption for DirectoryObject {
17378 type EncodedOption = ::fidl_next::WireBox<'static, WireDirectoryObject>;
17379}
17380
17381unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryObject
17382where
17383 ___E: ::fidl_next::Encoder + ?Sized,
17384 DirectoryObject: ::fidl_next::Encode<___E>,
17385{
17386 #[inline]
17387 fn encode_option(
17388 this: Option<Self>,
17389 encoder: &mut ___E,
17390 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17391 ) -> Result<(), ::fidl_next::EncodeError> {
17392 if let Some(inner) = this {
17393 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17394 ::fidl_next::WireBox::encode_present(out);
17395 } else {
17396 ::fidl_next::WireBox::encode_absent(out);
17397 }
17398
17399 Ok(())
17400 }
17401}
17402
17403unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DirectoryObject
17404where
17405 ___E: ::fidl_next::Encoder + ?Sized,
17406 DirectoryObject: ::fidl_next::EncodeRef<___E>,
17407{
17408 #[inline]
17409 fn encode_option_ref(
17410 this: Option<&Self>,
17411 encoder: &mut ___E,
17412 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17413 ) -> Result<(), ::fidl_next::EncodeError> {
17414 if let Some(inner) = this {
17415 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17416 ::fidl_next::WireBox::encode_present(out);
17417 } else {
17418 ::fidl_next::WireBox::encode_absent(out);
17419 }
17420
17421 Ok(())
17422 }
17423}
17424
17425impl ::fidl_next::FromWire<WireDirectoryObject> for DirectoryObject {
17426 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirectoryObject, Self> =
17427 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
17428
17429 #[inline]
17430 fn from_wire(wire: WireDirectoryObject) -> Self {
17431 Self {}
17432 }
17433}
17434
17435impl ::fidl_next::FromWireRef<WireDirectoryObject> for DirectoryObject {
17436 #[inline]
17437 fn from_wire_ref(wire: &WireDirectoryObject) -> Self {
17438 Self {}
17439 }
17440}
17441
17442#[derive(Clone, Debug)]
17444#[repr(C)]
17445pub struct WireDirectoryObject {}
17446
17447unsafe impl ::fidl_next::Wire for WireDirectoryObject {
17448 type Decoded<'de> = WireDirectoryObject;
17449
17450 #[inline]
17451 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17452}
17453
17454unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryObject
17455where
17456 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17457{
17458 fn decode(
17459 slot: ::fidl_next::Slot<'_, Self>,
17460 decoder: &mut ___D,
17461 ) -> Result<(), ::fidl_next::DecodeError> {
17462 ::fidl_next::munge! {
17463 let Self {
17464
17465 } = slot;
17466 }
17467
17468 Ok(())
17469 }
17470}
17471
17472#[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"]
17474#[derive(Debug)]
17475pub struct DirectoryWatcher;
17476
17477pub mod directory_watcher {
17478 pub mod prelude {
17479 pub use crate::{
17480 DirectoryWatcher, DirectoryWatcherClientHandler, DirectoryWatcherServerHandler,
17481 directory_watcher,
17482 };
17483 }
17484
17485 mod ___detail {
17486
17487 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirectoryWatcher
17488 where
17489 ___T: ::fidl_next::Transport,
17490 {
17491 type ClientSender = DirectoryWatcherClientSender<___T>;
17492 type ServerSender = DirectoryWatcherServerSender<___T>;
17493 }
17494
17495 #[repr(transparent)]
17497 pub struct DirectoryWatcherClientSender<___T: ::fidl_next::Transport> {
17498 #[allow(dead_code)]
17499 sender: ::fidl_next::protocol::ClientSender<___T>,
17500 }
17501
17502 impl<___T> DirectoryWatcherClientSender<___T> where ___T: ::fidl_next::Transport {}
17503
17504 #[repr(transparent)]
17506 pub struct DirectoryWatcherServerSender<___T: ::fidl_next::Transport> {
17507 sender: ::fidl_next::protocol::ServerSender<___T>,
17508 }
17509
17510 impl<___T> DirectoryWatcherServerSender<___T> where ___T: ::fidl_next::Transport {}
17511 }
17512}
17513
17514pub trait DirectoryWatcherClientHandler<
17518 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
17519 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
17520>
17521{
17522}
17523
17524impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DirectoryWatcher
17525where
17526 ___H: DirectoryWatcherClientHandler<___T> + ::core::marker::Send,
17527 ___T: ::fidl_next::Transport,
17528{
17529 async fn on_event(
17530 handler: &mut ___H,
17531 sender: &::fidl_next::ClientSender<Self, ___T>,
17532 ordinal: u64,
17533 buffer: ___T::RecvBuffer,
17534 ) {
17535 match ordinal {
17536 ordinal => sender.close(),
17537 }
17538 }
17539}
17540
17541pub trait DirectoryWatcherServerHandler<
17545 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
17546 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
17547>
17548{
17549}
17550
17551impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DirectoryWatcher
17552where
17553 ___H: DirectoryWatcherServerHandler<___T> + ::core::marker::Send,
17554 ___T: ::fidl_next::Transport,
17555{
17556 async fn on_one_way(
17557 handler: &mut ___H,
17558 sender: &::fidl_next::ServerSender<Self, ___T>,
17559 ordinal: u64,
17560 buffer: ___T::RecvBuffer,
17561 ) {
17562 match ordinal {
17563 ordinal => sender.close(),
17564 }
17565 }
17566
17567 async fn on_two_way(
17568 handler: &mut ___H,
17569 sender: &::fidl_next::ServerSender<Self, ___T>,
17570 ordinal: u64,
17571 buffer: ___T::RecvBuffer,
17572 responder: ::fidl_next::protocol::Responder,
17573 ) {
17574 match ordinal {
17575 ordinal => sender.close(),
17576 }
17577 }
17578}
17579
17580#[derive(Clone, Copy, Debug, PartialEq, Eq)]
17581#[repr(u8)]
17582pub enum DirentType {
17583 Unknown = 0,
17584 Directory = 4,
17585 BlockDevice = 6,
17586 File = 8,
17587 Symlink = 10,
17588 Service = 16,
17589 UnknownOrdinal_(u8),
17590}
17591
17592impl ::fidl_next::Encodable for DirentType {
17593 type Encoded = WireDirentType;
17594}
17595impl ::std::convert::From<u8> for DirentType {
17596 fn from(value: u8) -> Self {
17597 match value {
17598 0 => Self::Unknown,
17599 4 => Self::Directory,
17600 6 => Self::BlockDevice,
17601 8 => Self::File,
17602 10 => Self::Symlink,
17603 16 => Self::Service,
17604
17605 _ => Self::UnknownOrdinal_(value),
17606 }
17607 }
17608}
17609
17610unsafe impl<___E> ::fidl_next::Encode<___E> for DirentType
17611where
17612 ___E: ?Sized,
17613{
17614 #[inline]
17615 fn encode(
17616 self,
17617 encoder: &mut ___E,
17618 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17619 ) -> Result<(), ::fidl_next::EncodeError> {
17620 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
17621 }
17622}
17623
17624unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirentType
17625where
17626 ___E: ?Sized,
17627{
17628 #[inline]
17629 fn encode_ref(
17630 &self,
17631 encoder: &mut ___E,
17632 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17633 ) -> Result<(), ::fidl_next::EncodeError> {
17634 ::fidl_next::munge!(let WireDirentType { value } = out);
17635 let _ = value.write(u8::from(match *self {
17636 Self::Unknown => 0,
17637
17638 Self::Directory => 4,
17639
17640 Self::BlockDevice => 6,
17641
17642 Self::File => 8,
17643
17644 Self::Symlink => 10,
17645
17646 Self::Service => 16,
17647
17648 Self::UnknownOrdinal_(value) => value,
17649 }));
17650
17651 Ok(())
17652 }
17653}
17654
17655impl ::core::convert::From<WireDirentType> for DirentType {
17656 fn from(wire: WireDirentType) -> Self {
17657 match u8::from(wire.value) {
17658 0 => Self::Unknown,
17659
17660 4 => Self::Directory,
17661
17662 6 => Self::BlockDevice,
17663
17664 8 => Self::File,
17665
17666 10 => Self::Symlink,
17667
17668 16 => Self::Service,
17669
17670 value => Self::UnknownOrdinal_(value),
17671 }
17672 }
17673}
17674
17675impl ::fidl_next::FromWire<WireDirentType> for DirentType {
17676 #[inline]
17677 fn from_wire(wire: WireDirentType) -> Self {
17678 Self::from(wire)
17679 }
17680}
17681
17682impl ::fidl_next::FromWireRef<WireDirentType> for DirentType {
17683 #[inline]
17684 fn from_wire_ref(wire: &WireDirentType) -> Self {
17685 Self::from(*wire)
17686 }
17687}
17688
17689#[derive(Clone, Copy, Debug, PartialEq, Eq)]
17691#[repr(transparent)]
17692pub struct WireDirentType {
17693 value: u8,
17694}
17695
17696unsafe impl ::fidl_next::Wire for WireDirentType {
17697 type Decoded<'de> = Self;
17698
17699 #[inline]
17700 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
17701 }
17703}
17704
17705impl WireDirentType {
17706 pub const UNKNOWN: WireDirentType = WireDirentType { value: 0 };
17707
17708 pub const DIRECTORY: WireDirentType = WireDirentType { value: 4 };
17709
17710 pub const BLOCK_DEVICE: WireDirentType = WireDirentType { value: 6 };
17711
17712 pub const FILE: WireDirentType = WireDirentType { value: 8 };
17713
17714 pub const SYMLINK: WireDirentType = WireDirentType { value: 10 };
17715
17716 pub const SERVICE: WireDirentType = WireDirentType { value: 16 };
17717}
17718
17719unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirentType
17720where
17721 ___D: ?Sized,
17722{
17723 fn decode(
17724 slot: ::fidl_next::Slot<'_, Self>,
17725 _: &mut ___D,
17726 ) -> Result<(), ::fidl_next::DecodeError> {
17727 Ok(())
17728 }
17729}
17730
17731impl ::core::convert::From<DirentType> for WireDirentType {
17732 fn from(natural: DirentType) -> Self {
17733 match natural {
17734 DirentType::Unknown => WireDirentType::UNKNOWN,
17735
17736 DirentType::Directory => WireDirentType::DIRECTORY,
17737
17738 DirentType::BlockDevice => WireDirentType::BLOCK_DEVICE,
17739
17740 DirentType::File => WireDirentType::FILE,
17741
17742 DirentType::Symlink => WireDirentType::SYMLINK,
17743
17744 DirentType::Service => WireDirentType::SERVICE,
17745
17746 DirentType::UnknownOrdinal_(value) => WireDirentType { value: u8::from(value) },
17747 }
17748 }
17749}
17750
17751#[doc = " The maximum size of a chunk in the ListExtendedAttributes iterator.\n"]
17752pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128;
17753
17754#[derive(Clone, Debug)]
17755pub struct ExtendedAttributeIteratorGetNextResponse {
17756 pub attributes: Vec<Vec<u8>>,
17757
17758 pub last: bool,
17759}
17760
17761impl ::fidl_next::Encodable for ExtendedAttributeIteratorGetNextResponse {
17762 type Encoded = WireExtendedAttributeIteratorGetNextResponse<'static>;
17763}
17764
17765unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeIteratorGetNextResponse
17766where
17767 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17768 ___E: ::fidl_next::Encoder,
17769{
17770 #[inline]
17771 fn encode(
17772 self,
17773 encoder: &mut ___E,
17774 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17775 ) -> Result<(), ::fidl_next::EncodeError> {
17776 ::fidl_next::munge! {
17777 let Self::Encoded {
17778 attributes,
17779 last,
17780
17781 } = out;
17782 }
17783
17784 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
17785
17786 ::fidl_next::Encode::encode(self.last, encoder, last)?;
17787
17788 Ok(())
17789 }
17790}
17791
17792unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExtendedAttributeIteratorGetNextResponse
17793where
17794 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17795 ___E: ::fidl_next::Encoder,
17796{
17797 #[inline]
17798 fn encode_ref(
17799 &self,
17800 encoder: &mut ___E,
17801 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17802 ) -> Result<(), ::fidl_next::EncodeError> {
17803 ::fidl_next::munge! {
17804 let Self::Encoded {
17805 attributes,
17806 last,
17807
17808 } = out;
17809 }
17810
17811 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
17812
17813 ::fidl_next::EncodeRef::encode_ref(&self.last, encoder, last)?;
17814
17815 Ok(())
17816 }
17817}
17818
17819impl ::fidl_next::EncodableOption for ExtendedAttributeIteratorGetNextResponse {
17820 type EncodedOption =
17821 ::fidl_next::WireBox<'static, WireExtendedAttributeIteratorGetNextResponse<'static>>;
17822}
17823
17824unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExtendedAttributeIteratorGetNextResponse
17825where
17826 ___E: ::fidl_next::Encoder + ?Sized,
17827 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<___E>,
17828{
17829 #[inline]
17830 fn encode_option(
17831 this: Option<Self>,
17832 encoder: &mut ___E,
17833 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17834 ) -> Result<(), ::fidl_next::EncodeError> {
17835 if let Some(inner) = this {
17836 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17837 ::fidl_next::WireBox::encode_present(out);
17838 } else {
17839 ::fidl_next::WireBox::encode_absent(out);
17840 }
17841
17842 Ok(())
17843 }
17844}
17845
17846unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ExtendedAttributeIteratorGetNextResponse
17847where
17848 ___E: ::fidl_next::Encoder + ?Sized,
17849 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::EncodeRef<___E>,
17850{
17851 #[inline]
17852 fn encode_option_ref(
17853 this: Option<&Self>,
17854 encoder: &mut ___E,
17855 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17856 ) -> Result<(), ::fidl_next::EncodeError> {
17857 if let Some(inner) = this {
17858 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17859 ::fidl_next::WireBox::encode_present(out);
17860 } else {
17861 ::fidl_next::WireBox::encode_absent(out);
17862 }
17863
17864 Ok(())
17865 }
17866}
17867
17868impl<'de> ::fidl_next::FromWire<WireExtendedAttributeIteratorGetNextResponse<'de>>
17869 for ExtendedAttributeIteratorGetNextResponse
17870{
17871 #[inline]
17872 fn from_wire(wire: WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
17873 Self {
17874 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
17875
17876 last: ::fidl_next::FromWire::from_wire(wire.last),
17877 }
17878 }
17879}
17880
17881impl<'de> ::fidl_next::FromWireRef<WireExtendedAttributeIteratorGetNextResponse<'de>>
17882 for ExtendedAttributeIteratorGetNextResponse
17883{
17884 #[inline]
17885 fn from_wire_ref(wire: &WireExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
17886 Self {
17887 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
17888
17889 last: ::fidl_next::FromWireRef::from_wire_ref(&wire.last),
17890 }
17891 }
17892}
17893
17894#[derive(Debug)]
17896#[repr(C)]
17897pub struct WireExtendedAttributeIteratorGetNextResponse<'de> {
17898 pub attributes: ::fidl_next::WireVector<'de, ::fidl_next::WireVector<'de, u8>>,
17899
17900 pub last: bool,
17901}
17902
17903unsafe impl ::fidl_next::Wire for WireExtendedAttributeIteratorGetNextResponse<'static> {
17904 type Decoded<'de> = WireExtendedAttributeIteratorGetNextResponse<'de>;
17905
17906 #[inline]
17907 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17908 unsafe {
17909 out.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
17910 }
17911 }
17912}
17913
17914unsafe impl<___D> ::fidl_next::Decode<___D>
17915 for WireExtendedAttributeIteratorGetNextResponse<'static>
17916where
17917 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17918 ___D: ::fidl_next::Decoder,
17919{
17920 fn decode(
17921 slot: ::fidl_next::Slot<'_, Self>,
17922 decoder: &mut ___D,
17923 ) -> Result<(), ::fidl_next::DecodeError> {
17924 ::fidl_next::munge! {
17925 let Self {
17926 mut attributes,
17927 mut last,
17928
17929 } = slot;
17930 }
17931
17932 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
17933
17934 let attributes = unsafe { attributes.deref_unchecked() };
17935
17936 if attributes.len() > 128 {
17937 return Err(::fidl_next::DecodeError::VectorTooLong {
17938 size: attributes.len() as u64,
17939 limit: 128,
17940 });
17941 }
17942
17943 ::fidl_next::Decode::decode(last.as_mut(), decoder)?;
17944
17945 Ok(())
17946 }
17947}
17948
17949#[derive(Debug)]
17951pub struct ExtendedAttributeIterator;
17952
17953pub mod extended_attribute_iterator {
17954 pub mod prelude {
17955 pub use crate::{
17956 ExtendedAttributeIterator, ExtendedAttributeIteratorClientHandler,
17957 ExtendedAttributeIteratorServerHandler, extended_attribute_iterator,
17958 };
17959
17960 pub use crate::ExtendedAttributeIteratorGetNextResponse;
17961 }
17962
17963 pub struct GetNext;
17964
17965 impl ::fidl_next::Method for GetNext {
17966 const ORDINAL: u64 = 268639596268373415;
17967
17968 type Protocol = crate::ExtendedAttributeIterator;
17969
17970 type Request = ();
17971
17972 type Response = ::fidl_next::WireResult<
17973 'static,
17974 crate::WireExtendedAttributeIteratorGetNextResponse<'static>,
17975 ::fidl_next::WireI32,
17976 >;
17977 }
17978
17979 mod ___detail {
17980
17981 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ExtendedAttributeIterator
17982 where
17983 ___T: ::fidl_next::Transport,
17984 {
17985 type ClientSender = ExtendedAttributeIteratorClientSender<___T>;
17986 type ServerSender = ExtendedAttributeIteratorServerSender<___T>;
17987 }
17988
17989 #[repr(transparent)]
17991 pub struct ExtendedAttributeIteratorClientSender<___T: ::fidl_next::Transport> {
17992 #[allow(dead_code)]
17993 sender: ::fidl_next::protocol::ClientSender<___T>,
17994 }
17995
17996 impl<___T> ExtendedAttributeIteratorClientSender<___T>
17997 where
17998 ___T: ::fidl_next::Transport,
17999 {
18000 #[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"]
18001 pub fn get_next(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetNext, ___T> {
18002 ::fidl_next::TwoWayFuture::from_untyped(
18003 self.sender.send_two_way(268639596268373415, ()),
18004 )
18005 }
18006 }
18007
18008 #[repr(transparent)]
18010 pub struct ExtendedAttributeIteratorServerSender<___T: ::fidl_next::Transport> {
18011 sender: ::fidl_next::protocol::ServerSender<___T>,
18012 }
18013
18014 impl<___T> ExtendedAttributeIteratorServerSender<___T> where ___T: ::fidl_next::Transport {}
18015 }
18016}
18017
18018pub trait ExtendedAttributeIteratorClientHandler<
18022 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18023 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18024>
18025{
18026}
18027
18028impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ExtendedAttributeIterator
18029where
18030 ___H: ExtendedAttributeIteratorClientHandler<___T> + ::core::marker::Send,
18031 ___T: ::fidl_next::Transport,
18032 <extended_attribute_iterator::GetNext as ::fidl_next::Method>::Response:
18033 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18034{
18035 async fn on_event(
18036 handler: &mut ___H,
18037 sender: &::fidl_next::ClientSender<Self, ___T>,
18038 ordinal: u64,
18039 buffer: ___T::RecvBuffer,
18040 ) {
18041 match ordinal {
18042 ordinal => sender.close(),
18043 }
18044 }
18045}
18046
18047pub trait ExtendedAttributeIteratorServerHandler<
18051 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18052 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18053>
18054{
18055 #[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"]
18056 fn get_next(
18057 &mut self,
18058 sender: &::fidl_next::ServerSender<ExtendedAttributeIterator, ___T>,
18059
18060 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext>,
18061 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18062}
18063
18064impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ExtendedAttributeIterator
18065where
18066 ___H: ExtendedAttributeIteratorServerHandler<___T> + ::core::marker::Send,
18067 ___T: ::fidl_next::Transport,
18068{
18069 async fn on_one_way(
18070 handler: &mut ___H,
18071 sender: &::fidl_next::ServerSender<Self, ___T>,
18072 ordinal: u64,
18073 buffer: ___T::RecvBuffer,
18074 ) {
18075 match ordinal {
18076 ordinal => sender.close(),
18077 }
18078 }
18079
18080 async fn on_two_way(
18081 handler: &mut ___H,
18082 sender: &::fidl_next::ServerSender<Self, ___T>,
18083 ordinal: u64,
18084 buffer: ___T::RecvBuffer,
18085 responder: ::fidl_next::protocol::Responder,
18086 ) {
18087 match ordinal {
18088 268639596268373415 => {
18089 let responder = ::fidl_next::Responder::from_untyped(responder);
18090
18091 handler.get_next(sender, responder).await;
18092 }
18093
18094 ordinal => sender.close(),
18095 }
18096 }
18097}
18098
18099pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
18100
18101#[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"]
18102pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: crate::Flags = crate::Flags::FLAG_MUST_CREATE;
18103
18104#[derive(Clone, Debug)]
18105#[repr(C)]
18106pub struct ReadableReadRequest {
18107 pub count: u64,
18108}
18109
18110impl ::fidl_next::Encodable for ReadableReadRequest {
18111 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireReadableReadRequest> = unsafe {
18112 ::fidl_next::CopyOptimization::enable_if(
18113 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
18114 )
18115 };
18116
18117 type Encoded = WireReadableReadRequest;
18118}
18119
18120unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadRequest
18121where
18122 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18123{
18124 #[inline]
18125 fn encode(
18126 self,
18127 encoder: &mut ___E,
18128 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18129 ) -> Result<(), ::fidl_next::EncodeError> {
18130 ::fidl_next::munge! {
18131 let Self::Encoded {
18132 count,
18133
18134 } = out;
18135 }
18136
18137 ::fidl_next::Encode::encode(self.count, encoder, count)?;
18138
18139 Ok(())
18140 }
18141}
18142
18143unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadRequest
18144where
18145 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18146{
18147 #[inline]
18148 fn encode_ref(
18149 &self,
18150 encoder: &mut ___E,
18151 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18152 ) -> Result<(), ::fidl_next::EncodeError> {
18153 ::fidl_next::munge! {
18154 let Self::Encoded {
18155 count,
18156
18157 } = out;
18158 }
18159
18160 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
18161
18162 Ok(())
18163 }
18164}
18165
18166impl ::fidl_next::EncodableOption for ReadableReadRequest {
18167 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadRequest>;
18168}
18169
18170unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadRequest
18171where
18172 ___E: ::fidl_next::Encoder + ?Sized,
18173 ReadableReadRequest: ::fidl_next::Encode<___E>,
18174{
18175 #[inline]
18176 fn encode_option(
18177 this: Option<Self>,
18178 encoder: &mut ___E,
18179 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18180 ) -> Result<(), ::fidl_next::EncodeError> {
18181 if let Some(inner) = this {
18182 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18183 ::fidl_next::WireBox::encode_present(out);
18184 } else {
18185 ::fidl_next::WireBox::encode_absent(out);
18186 }
18187
18188 Ok(())
18189 }
18190}
18191
18192unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadRequest
18193where
18194 ___E: ::fidl_next::Encoder + ?Sized,
18195 ReadableReadRequest: ::fidl_next::EncodeRef<___E>,
18196{
18197 #[inline]
18198 fn encode_option_ref(
18199 this: Option<&Self>,
18200 encoder: &mut ___E,
18201 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18202 ) -> Result<(), ::fidl_next::EncodeError> {
18203 if let Some(inner) = this {
18204 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18205 ::fidl_next::WireBox::encode_present(out);
18206 } else {
18207 ::fidl_next::WireBox::encode_absent(out);
18208 }
18209
18210 Ok(())
18211 }
18212}
18213
18214impl ::fidl_next::FromWire<WireReadableReadRequest> for ReadableReadRequest {
18215 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireReadableReadRequest, Self> = unsafe {
18216 ::fidl_next::CopyOptimization::enable_if(
18217 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
18218 .is_enabled(),
18219 )
18220 };
18221
18222 #[inline]
18223 fn from_wire(wire: WireReadableReadRequest) -> Self {
18224 Self { count: ::fidl_next::FromWire::from_wire(wire.count) }
18225 }
18226}
18227
18228impl ::fidl_next::FromWireRef<WireReadableReadRequest> for ReadableReadRequest {
18229 #[inline]
18230 fn from_wire_ref(wire: &WireReadableReadRequest) -> Self {
18231 Self { count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count) }
18232 }
18233}
18234
18235#[derive(Clone, Debug)]
18237#[repr(C)]
18238pub struct WireReadableReadRequest {
18239 pub count: ::fidl_next::WireU64,
18240}
18241
18242unsafe impl ::fidl_next::Wire for WireReadableReadRequest {
18243 type Decoded<'de> = WireReadableReadRequest;
18244
18245 #[inline]
18246 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18247}
18248
18249unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadRequest
18250where
18251 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18252{
18253 fn decode(
18254 slot: ::fidl_next::Slot<'_, Self>,
18255 decoder: &mut ___D,
18256 ) -> Result<(), ::fidl_next::DecodeError> {
18257 ::fidl_next::munge! {
18258 let Self {
18259 mut count,
18260
18261 } = slot;
18262 }
18263
18264 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
18265
18266 Ok(())
18267 }
18268}
18269
18270#[doc = " The maximum I/O size that is allowed for read/write operations using\n byte vectors.\n"]
18271pub const MAX_TRANSFER_SIZE: u64 = 8192;
18272
18273#[doc = " The byte vector type used for read/write operations.\n"]
18274pub type Transfer = Vec<u8>;
18275
18276pub type WireTransfer<'de> = ::fidl_next::WireVector<'de, u8>;
18278
18279#[derive(Clone, Debug)]
18280pub struct ReadableReadResponse {
18281 pub data: Vec<u8>,
18282}
18283
18284impl ::fidl_next::Encodable for ReadableReadResponse {
18285 type Encoded = WireReadableReadResponse<'static>;
18286}
18287
18288unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadResponse
18289where
18290 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18291 ___E: ::fidl_next::Encoder,
18292{
18293 #[inline]
18294 fn encode(
18295 self,
18296 encoder: &mut ___E,
18297 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18298 ) -> Result<(), ::fidl_next::EncodeError> {
18299 ::fidl_next::munge! {
18300 let Self::Encoded {
18301 data,
18302
18303 } = out;
18304 }
18305
18306 ::fidl_next::Encode::encode(self.data, encoder, data)?;
18307
18308 Ok(())
18309 }
18310}
18311
18312unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadResponse
18313where
18314 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18315 ___E: ::fidl_next::Encoder,
18316{
18317 #[inline]
18318 fn encode_ref(
18319 &self,
18320 encoder: &mut ___E,
18321 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18322 ) -> Result<(), ::fidl_next::EncodeError> {
18323 ::fidl_next::munge! {
18324 let Self::Encoded {
18325 data,
18326
18327 } = out;
18328 }
18329
18330 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
18331
18332 Ok(())
18333 }
18334}
18335
18336impl ::fidl_next::EncodableOption for ReadableReadResponse {
18337 type EncodedOption = ::fidl_next::WireBox<'static, WireReadableReadResponse<'static>>;
18338}
18339
18340unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ReadableReadResponse
18341where
18342 ___E: ::fidl_next::Encoder + ?Sized,
18343 ReadableReadResponse: ::fidl_next::Encode<___E>,
18344{
18345 #[inline]
18346 fn encode_option(
18347 this: Option<Self>,
18348 encoder: &mut ___E,
18349 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18350 ) -> Result<(), ::fidl_next::EncodeError> {
18351 if let Some(inner) = this {
18352 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18353 ::fidl_next::WireBox::encode_present(out);
18354 } else {
18355 ::fidl_next::WireBox::encode_absent(out);
18356 }
18357
18358 Ok(())
18359 }
18360}
18361
18362unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ReadableReadResponse
18363where
18364 ___E: ::fidl_next::Encoder + ?Sized,
18365 ReadableReadResponse: ::fidl_next::EncodeRef<___E>,
18366{
18367 #[inline]
18368 fn encode_option_ref(
18369 this: Option<&Self>,
18370 encoder: &mut ___E,
18371 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18372 ) -> Result<(), ::fidl_next::EncodeError> {
18373 if let Some(inner) = this {
18374 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18375 ::fidl_next::WireBox::encode_present(out);
18376 } else {
18377 ::fidl_next::WireBox::encode_absent(out);
18378 }
18379
18380 Ok(())
18381 }
18382}
18383
18384impl<'de> ::fidl_next::FromWire<WireReadableReadResponse<'de>> for ReadableReadResponse {
18385 #[inline]
18386 fn from_wire(wire: WireReadableReadResponse<'de>) -> Self {
18387 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
18388 }
18389}
18390
18391impl<'de> ::fidl_next::FromWireRef<WireReadableReadResponse<'de>> for ReadableReadResponse {
18392 #[inline]
18393 fn from_wire_ref(wire: &WireReadableReadResponse<'de>) -> Self {
18394 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
18395 }
18396}
18397
18398#[derive(Debug)]
18400#[repr(C)]
18401pub struct WireReadableReadResponse<'de> {
18402 pub data: ::fidl_next::WireVector<'de, u8>,
18403}
18404
18405unsafe impl ::fidl_next::Wire for WireReadableReadResponse<'static> {
18406 type Decoded<'de> = WireReadableReadResponse<'de>;
18407
18408 #[inline]
18409 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18410}
18411
18412unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadResponse<'static>
18413where
18414 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18415 ___D: ::fidl_next::Decoder,
18416{
18417 fn decode(
18418 slot: ::fidl_next::Slot<'_, Self>,
18419 decoder: &mut ___D,
18420 ) -> Result<(), ::fidl_next::DecodeError> {
18421 ::fidl_next::munge! {
18422 let Self {
18423 mut data,
18424
18425 } = slot;
18426 }
18427
18428 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
18429
18430 let data = unsafe { data.deref_unchecked() };
18431
18432 if data.len() > 8192 {
18433 return Err(::fidl_next::DecodeError::VectorTooLong {
18434 size: data.len() as u64,
18435 limit: 8192,
18436 });
18437 }
18438
18439 Ok(())
18440 }
18441}
18442
18443#[derive(Debug)]
18445pub struct Readable;
18446
18447pub mod readable {
18448 pub mod prelude {
18449 pub use crate::{Readable, ReadableClientHandler, ReadableServerHandler, readable};
18450
18451 pub use crate::ReadableReadRequest;
18452
18453 pub use crate::ReadableReadResponse;
18454 }
18455
18456 pub struct Read;
18457
18458 impl ::fidl_next::Method for Read {
18459 const ORDINAL: u64 = 395825947633028830;
18460
18461 type Protocol = crate::Readable;
18462
18463 type Request = crate::WireReadableReadRequest;
18464
18465 type Response = ::fidl_next::WireResult<
18466 'static,
18467 crate::WireReadableReadResponse<'static>,
18468 ::fidl_next::WireI32,
18469 >;
18470 }
18471
18472 mod ___detail {
18473
18474 pub struct Read<T0> {
18475 count: T0,
18476 }
18477
18478 impl<T0> ::fidl_next::Encodable for Read<T0>
18479 where
18480 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
18481 {
18482 type Encoded = crate::WireReadableReadRequest;
18483 }
18484
18485 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
18486 where
18487 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18488 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
18489 {
18490 #[inline]
18491 fn encode(
18492 self,
18493 encoder: &mut ___E,
18494 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18495 ) -> Result<(), ::fidl_next::EncodeError> {
18496 ::fidl_next::munge! {
18497 let Self::Encoded {
18498 count,
18499
18500 } = out;
18501 }
18502
18503 ::fidl_next::Encode::encode(self.count, encoder, count)?;
18504
18505 Ok(())
18506 }
18507 }
18508
18509 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Readable
18510 where
18511 ___T: ::fidl_next::Transport,
18512 {
18513 type ClientSender = ReadableClientSender<___T>;
18514 type ServerSender = ReadableServerSender<___T>;
18515 }
18516
18517 #[repr(transparent)]
18519 pub struct ReadableClientSender<___T: ::fidl_next::Transport> {
18520 #[allow(dead_code)]
18521 sender: ::fidl_next::protocol::ClientSender<___T>,
18522 }
18523
18524 impl<___T> ReadableClientSender<___T>
18525 where
18526 ___T: ::fidl_next::Transport,
18527 {
18528 #[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"]
18529 pub fn read(
18530 &self,
18531
18532 count: impl ::fidl_next::Encode<
18533 <___T as ::fidl_next::Transport>::SendBuffer,
18534 Encoded = ::fidl_next::WireU64,
18535 >,
18536 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
18537 where
18538 <___T as ::fidl_next::Transport>::SendBuffer:
18539 ::fidl_next::encoder::InternalHandleEncoder,
18540 {
18541 self.read_with(Read { count })
18542 }
18543
18544 #[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"]
18545 pub fn read_with<___R>(
18546 &self,
18547 request: ___R,
18548 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
18549 where
18550 ___R: ::fidl_next::Encode<
18551 <___T as ::fidl_next::Transport>::SendBuffer,
18552 Encoded = crate::WireReadableReadRequest,
18553 >,
18554 {
18555 ::fidl_next::TwoWayFuture::from_untyped(
18556 self.sender.send_two_way(395825947633028830, request),
18557 )
18558 }
18559 }
18560
18561 #[repr(transparent)]
18563 pub struct ReadableServerSender<___T: ::fidl_next::Transport> {
18564 sender: ::fidl_next::protocol::ServerSender<___T>,
18565 }
18566
18567 impl<___T> ReadableServerSender<___T> where ___T: ::fidl_next::Transport {}
18568 }
18569}
18570
18571pub trait ReadableClientHandler<
18575 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18576 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18577>
18578{
18579}
18580
18581impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Readable
18582where
18583 ___H: ReadableClientHandler<___T> + ::core::marker::Send,
18584 ___T: ::fidl_next::Transport,
18585 <readable::Read as ::fidl_next::Method>::Response:
18586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18587{
18588 async fn on_event(
18589 handler: &mut ___H,
18590 sender: &::fidl_next::ClientSender<Self, ___T>,
18591 ordinal: u64,
18592 buffer: ___T::RecvBuffer,
18593 ) {
18594 match ordinal {
18595 ordinal => sender.close(),
18596 }
18597 }
18598}
18599
18600pub trait ReadableServerHandler<
18604 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
18605 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18606>
18607{
18608 #[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"]
18609 fn read(
18610 &mut self,
18611 sender: &::fidl_next::ServerSender<Readable, ___T>,
18612
18613 request: ::fidl_next::Request<readable::Read, ___T>,
18614
18615 responder: ::fidl_next::Responder<readable::Read>,
18616 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18617}
18618
18619impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Readable
18620where
18621 ___H: ReadableServerHandler<___T> + ::core::marker::Send,
18622 ___T: ::fidl_next::Transport,
18623 <readable::Read as ::fidl_next::Method>::Request:
18624 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18625{
18626 async fn on_one_way(
18627 handler: &mut ___H,
18628 sender: &::fidl_next::ServerSender<Self, ___T>,
18629 ordinal: u64,
18630 buffer: ___T::RecvBuffer,
18631 ) {
18632 match ordinal {
18633 ordinal => sender.close(),
18634 }
18635 }
18636
18637 async fn on_two_way(
18638 handler: &mut ___H,
18639 sender: &::fidl_next::ServerSender<Self, ___T>,
18640 ordinal: u64,
18641 buffer: ___T::RecvBuffer,
18642 responder: ::fidl_next::protocol::Responder,
18643 ) {
18644 match ordinal {
18645 395825947633028830 => {
18646 let responder = ::fidl_next::Responder::from_untyped(responder);
18647
18648 match ::fidl_next::DecoderExt::decode(buffer) {
18649 Ok(decoded) => handler.read(sender, decoded, responder).await,
18650 Err(e) => sender.close(),
18651 }
18652 }
18653
18654 ordinal => sender.close(),
18655 }
18656 }
18657}
18658
18659#[derive(Clone, Debug)]
18660pub struct WritableWriteRequest {
18661 pub data: Vec<u8>,
18662}
18663
18664impl ::fidl_next::Encodable for WritableWriteRequest {
18665 type Encoded = WireWritableWriteRequest<'static>;
18666}
18667
18668unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteRequest
18669where
18670 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18671 ___E: ::fidl_next::Encoder,
18672{
18673 #[inline]
18674 fn encode(
18675 self,
18676 encoder: &mut ___E,
18677 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18678 ) -> Result<(), ::fidl_next::EncodeError> {
18679 ::fidl_next::munge! {
18680 let Self::Encoded {
18681 data,
18682
18683 } = out;
18684 }
18685
18686 ::fidl_next::Encode::encode(self.data, encoder, data)?;
18687
18688 Ok(())
18689 }
18690}
18691
18692unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteRequest
18693where
18694 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18695 ___E: ::fidl_next::Encoder,
18696{
18697 #[inline]
18698 fn encode_ref(
18699 &self,
18700 encoder: &mut ___E,
18701 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18702 ) -> Result<(), ::fidl_next::EncodeError> {
18703 ::fidl_next::munge! {
18704 let Self::Encoded {
18705 data,
18706
18707 } = out;
18708 }
18709
18710 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
18711
18712 Ok(())
18713 }
18714}
18715
18716impl ::fidl_next::EncodableOption for WritableWriteRequest {
18717 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteRequest<'static>>;
18718}
18719
18720unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteRequest
18721where
18722 ___E: ::fidl_next::Encoder + ?Sized,
18723 WritableWriteRequest: ::fidl_next::Encode<___E>,
18724{
18725 #[inline]
18726 fn encode_option(
18727 this: Option<Self>,
18728 encoder: &mut ___E,
18729 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18730 ) -> Result<(), ::fidl_next::EncodeError> {
18731 if let Some(inner) = this {
18732 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18733 ::fidl_next::WireBox::encode_present(out);
18734 } else {
18735 ::fidl_next::WireBox::encode_absent(out);
18736 }
18737
18738 Ok(())
18739 }
18740}
18741
18742unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteRequest
18743where
18744 ___E: ::fidl_next::Encoder + ?Sized,
18745 WritableWriteRequest: ::fidl_next::EncodeRef<___E>,
18746{
18747 #[inline]
18748 fn encode_option_ref(
18749 this: Option<&Self>,
18750 encoder: &mut ___E,
18751 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18752 ) -> Result<(), ::fidl_next::EncodeError> {
18753 if let Some(inner) = this {
18754 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18755 ::fidl_next::WireBox::encode_present(out);
18756 } else {
18757 ::fidl_next::WireBox::encode_absent(out);
18758 }
18759
18760 Ok(())
18761 }
18762}
18763
18764impl<'de> ::fidl_next::FromWire<WireWritableWriteRequest<'de>> for WritableWriteRequest {
18765 #[inline]
18766 fn from_wire(wire: WireWritableWriteRequest<'de>) -> Self {
18767 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
18768 }
18769}
18770
18771impl<'de> ::fidl_next::FromWireRef<WireWritableWriteRequest<'de>> for WritableWriteRequest {
18772 #[inline]
18773 fn from_wire_ref(wire: &WireWritableWriteRequest<'de>) -> Self {
18774 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
18775 }
18776}
18777
18778#[derive(Debug)]
18780#[repr(C)]
18781pub struct WireWritableWriteRequest<'de> {
18782 pub data: ::fidl_next::WireVector<'de, u8>,
18783}
18784
18785unsafe impl ::fidl_next::Wire for WireWritableWriteRequest<'static> {
18786 type Decoded<'de> = WireWritableWriteRequest<'de>;
18787
18788 #[inline]
18789 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18790}
18791
18792unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteRequest<'static>
18793where
18794 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18795 ___D: ::fidl_next::Decoder,
18796{
18797 fn decode(
18798 slot: ::fidl_next::Slot<'_, Self>,
18799 decoder: &mut ___D,
18800 ) -> Result<(), ::fidl_next::DecodeError> {
18801 ::fidl_next::munge! {
18802 let Self {
18803 mut data,
18804
18805 } = slot;
18806 }
18807
18808 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
18809
18810 let data = unsafe { data.deref_unchecked() };
18811
18812 if data.len() > 8192 {
18813 return Err(::fidl_next::DecodeError::VectorTooLong {
18814 size: data.len() as u64,
18815 limit: 8192,
18816 });
18817 }
18818
18819 Ok(())
18820 }
18821}
18822
18823#[derive(Clone, Debug)]
18824#[repr(C)]
18825pub struct WritableWriteResponse {
18826 pub actual_count: u64,
18827}
18828
18829impl ::fidl_next::Encodable for WritableWriteResponse {
18830 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireWritableWriteResponse> = unsafe {
18831 ::fidl_next::CopyOptimization::enable_if(
18832 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
18833 )
18834 };
18835
18836 type Encoded = WireWritableWriteResponse;
18837}
18838
18839unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteResponse
18840where
18841 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18842{
18843 #[inline]
18844 fn encode(
18845 self,
18846 encoder: &mut ___E,
18847 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18848 ) -> Result<(), ::fidl_next::EncodeError> {
18849 ::fidl_next::munge! {
18850 let Self::Encoded {
18851 actual_count,
18852
18853 } = out;
18854 }
18855
18856 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
18857
18858 Ok(())
18859 }
18860}
18861
18862unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteResponse
18863where
18864 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18865{
18866 #[inline]
18867 fn encode_ref(
18868 &self,
18869 encoder: &mut ___E,
18870 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18871 ) -> Result<(), ::fidl_next::EncodeError> {
18872 ::fidl_next::munge! {
18873 let Self::Encoded {
18874 actual_count,
18875
18876 } = out;
18877 }
18878
18879 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
18880
18881 Ok(())
18882 }
18883}
18884
18885impl ::fidl_next::EncodableOption for WritableWriteResponse {
18886 type EncodedOption = ::fidl_next::WireBox<'static, WireWritableWriteResponse>;
18887}
18888
18889unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WritableWriteResponse
18890where
18891 ___E: ::fidl_next::Encoder + ?Sized,
18892 WritableWriteResponse: ::fidl_next::Encode<___E>,
18893{
18894 #[inline]
18895 fn encode_option(
18896 this: Option<Self>,
18897 encoder: &mut ___E,
18898 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18899 ) -> Result<(), ::fidl_next::EncodeError> {
18900 if let Some(inner) = this {
18901 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18902 ::fidl_next::WireBox::encode_present(out);
18903 } else {
18904 ::fidl_next::WireBox::encode_absent(out);
18905 }
18906
18907 Ok(())
18908 }
18909}
18910
18911unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WritableWriteResponse
18912where
18913 ___E: ::fidl_next::Encoder + ?Sized,
18914 WritableWriteResponse: ::fidl_next::EncodeRef<___E>,
18915{
18916 #[inline]
18917 fn encode_option_ref(
18918 this: Option<&Self>,
18919 encoder: &mut ___E,
18920 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18921 ) -> Result<(), ::fidl_next::EncodeError> {
18922 if let Some(inner) = this {
18923 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
18924 ::fidl_next::WireBox::encode_present(out);
18925 } else {
18926 ::fidl_next::WireBox::encode_absent(out);
18927 }
18928
18929 Ok(())
18930 }
18931}
18932
18933impl ::fidl_next::FromWire<WireWritableWriteResponse> for WritableWriteResponse {
18934 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireWritableWriteResponse, Self> = unsafe {
18935 ::fidl_next::CopyOptimization::enable_if(
18936 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
18937 .is_enabled(),
18938 )
18939 };
18940
18941 #[inline]
18942 fn from_wire(wire: WireWritableWriteResponse) -> Self {
18943 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
18944 }
18945}
18946
18947impl ::fidl_next::FromWireRef<WireWritableWriteResponse> for WritableWriteResponse {
18948 #[inline]
18949 fn from_wire_ref(wire: &WireWritableWriteResponse) -> Self {
18950 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
18951 }
18952}
18953
18954#[derive(Clone, Debug)]
18956#[repr(C)]
18957pub struct WireWritableWriteResponse {
18958 pub actual_count: ::fidl_next::WireU64,
18959}
18960
18961unsafe impl ::fidl_next::Wire for WireWritableWriteResponse {
18962 type Decoded<'de> = WireWritableWriteResponse;
18963
18964 #[inline]
18965 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18966}
18967
18968unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteResponse
18969where
18970 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18971{
18972 fn decode(
18973 slot: ::fidl_next::Slot<'_, Self>,
18974 decoder: &mut ___D,
18975 ) -> Result<(), ::fidl_next::DecodeError> {
18976 ::fidl_next::munge! {
18977 let Self {
18978 mut actual_count,
18979
18980 } = slot;
18981 }
18982
18983 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
18984
18985 Ok(())
18986 }
18987}
18988
18989#[derive(Debug)]
18991pub struct Writable;
18992
18993pub mod writable {
18994 pub mod prelude {
18995 pub use crate::{Writable, WritableClientHandler, WritableServerHandler, writable};
18996
18997 pub use crate::WritableWriteRequest;
18998
18999 pub use crate::WritableWriteResponse;
19000 }
19001
19002 pub struct Write;
19003
19004 impl ::fidl_next::Method for Write {
19005 const ORDINAL: u64 = 7651971425397809026;
19006
19007 type Protocol = crate::Writable;
19008
19009 type Request = crate::WireWritableWriteRequest<'static>;
19010
19011 type Response = ::fidl_next::WireResult<
19012 'static,
19013 crate::WireWritableWriteResponse,
19014 ::fidl_next::WireI32,
19015 >;
19016 }
19017
19018 mod ___detail {
19019
19020 pub struct Write<T0> {
19021 data: T0,
19022 }
19023
19024 impl<T0> ::fidl_next::Encodable for Write<T0>
19025 where
19026 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
19027 {
19028 type Encoded = crate::WireWritableWriteRequest<'static>;
19029 }
19030
19031 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
19032 where
19033 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19034 ___E: ::fidl_next::Encoder,
19035 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
19036 {
19037 #[inline]
19038 fn encode(
19039 self,
19040 encoder: &mut ___E,
19041 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19042 ) -> Result<(), ::fidl_next::EncodeError> {
19043 ::fidl_next::munge! {
19044 let Self::Encoded {
19045 data,
19046
19047 } = out;
19048 }
19049
19050 ::fidl_next::Encode::encode(self.data, encoder, data)?;
19051
19052 Ok(())
19053 }
19054 }
19055
19056 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Writable
19057 where
19058 ___T: ::fidl_next::Transport,
19059 {
19060 type ClientSender = WritableClientSender<___T>;
19061 type ServerSender = WritableServerSender<___T>;
19062 }
19063
19064 #[repr(transparent)]
19066 pub struct WritableClientSender<___T: ::fidl_next::Transport> {
19067 #[allow(dead_code)]
19068 sender: ::fidl_next::protocol::ClientSender<___T>,
19069 }
19070
19071 impl<___T> WritableClientSender<___T>
19072 where
19073 ___T: ::fidl_next::Transport,
19074 {
19075 #[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"]
19076 pub fn write(
19077 &self,
19078
19079 data: impl ::fidl_next::Encode<
19080 <___T as ::fidl_next::Transport>::SendBuffer,
19081 Encoded = ::fidl_next::WireVector<'static, u8>,
19082 >,
19083 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
19084 where
19085 <___T as ::fidl_next::Transport>::SendBuffer:
19086 ::fidl_next::encoder::InternalHandleEncoder,
19087 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
19088 {
19089 self.write_with(Write { data })
19090 }
19091
19092 #[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"]
19093 pub fn write_with<___R>(
19094 &self,
19095 request: ___R,
19096 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
19097 where
19098 ___R: ::fidl_next::Encode<
19099 <___T as ::fidl_next::Transport>::SendBuffer,
19100 Encoded = crate::WireWritableWriteRequest<'static>,
19101 >,
19102 {
19103 ::fidl_next::TwoWayFuture::from_untyped(
19104 self.sender.send_two_way(7651971425397809026, request),
19105 )
19106 }
19107 }
19108
19109 #[repr(transparent)]
19111 pub struct WritableServerSender<___T: ::fidl_next::Transport> {
19112 sender: ::fidl_next::protocol::ServerSender<___T>,
19113 }
19114
19115 impl<___T> WritableServerSender<___T> where ___T: ::fidl_next::Transport {}
19116 }
19117}
19118
19119pub trait WritableClientHandler<
19123 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
19124 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19125>
19126{
19127}
19128
19129impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Writable
19130where
19131 ___H: WritableClientHandler<___T> + ::core::marker::Send,
19132 ___T: ::fidl_next::Transport,
19133 <writable::Write as ::fidl_next::Method>::Response:
19134 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19135{
19136 async fn on_event(
19137 handler: &mut ___H,
19138 sender: &::fidl_next::ClientSender<Self, ___T>,
19139 ordinal: u64,
19140 buffer: ___T::RecvBuffer,
19141 ) {
19142 match ordinal {
19143 ordinal => sender.close(),
19144 }
19145 }
19146}
19147
19148pub trait WritableServerHandler<
19152 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
19153 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19154>
19155{
19156 #[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"]
19157 fn write(
19158 &mut self,
19159 sender: &::fidl_next::ServerSender<Writable, ___T>,
19160
19161 request: ::fidl_next::Request<writable::Write, ___T>,
19162
19163 responder: ::fidl_next::Responder<writable::Write>,
19164 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19165}
19166
19167impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Writable
19168where
19169 ___H: WritableServerHandler<___T> + ::core::marker::Send,
19170 ___T: ::fidl_next::Transport,
19171 <writable::Write as ::fidl_next::Method>::Request:
19172 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
19173{
19174 async fn on_one_way(
19175 handler: &mut ___H,
19176 sender: &::fidl_next::ServerSender<Self, ___T>,
19177 ordinal: u64,
19178 buffer: ___T::RecvBuffer,
19179 ) {
19180 match ordinal {
19181 ordinal => sender.close(),
19182 }
19183 }
19184
19185 async fn on_two_way(
19186 handler: &mut ___H,
19187 sender: &::fidl_next::ServerSender<Self, ___T>,
19188 ordinal: u64,
19189 buffer: ___T::RecvBuffer,
19190 responder: ::fidl_next::protocol::Responder,
19191 ) {
19192 match ordinal {
19193 7651971425397809026 => {
19194 let responder = ::fidl_next::Responder::from_untyped(responder);
19195
19196 match ::fidl_next::DecoderExt::decode(buffer) {
19197 Ok(decoded) => handler.write(sender, decoded, responder).await,
19198 Err(e) => sender.close(),
19199 }
19200 }
19201
19202 ordinal => sender.close(),
19203 }
19204 }
19205}
19206
19207#[derive(Clone, Debug)]
19208pub struct FileSeekRequest {
19209 pub origin: crate::SeekOrigin,
19210
19211 pub offset: i64,
19212}
19213
19214impl ::fidl_next::Encodable for FileSeekRequest {
19215 type Encoded = WireFileSeekRequest;
19216}
19217
19218unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekRequest
19219where
19220 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19221{
19222 #[inline]
19223 fn encode(
19224 self,
19225 encoder: &mut ___E,
19226 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19227 ) -> Result<(), ::fidl_next::EncodeError> {
19228 ::fidl_next::munge! {
19229 let Self::Encoded {
19230 origin,
19231 offset,
19232
19233 } = out;
19234 }
19235
19236 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
19237
19238 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
19239
19240 Ok(())
19241 }
19242}
19243
19244unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekRequest
19245where
19246 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19247{
19248 #[inline]
19249 fn encode_ref(
19250 &self,
19251 encoder: &mut ___E,
19252 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19253 ) -> Result<(), ::fidl_next::EncodeError> {
19254 ::fidl_next::munge! {
19255 let Self::Encoded {
19256 origin,
19257 offset,
19258
19259 } = out;
19260 }
19261
19262 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder, origin)?;
19263
19264 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
19265
19266 Ok(())
19267 }
19268}
19269
19270impl ::fidl_next::EncodableOption for FileSeekRequest {
19271 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekRequest>;
19272}
19273
19274unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekRequest
19275where
19276 ___E: ::fidl_next::Encoder + ?Sized,
19277 FileSeekRequest: ::fidl_next::Encode<___E>,
19278{
19279 #[inline]
19280 fn encode_option(
19281 this: Option<Self>,
19282 encoder: &mut ___E,
19283 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19284 ) -> Result<(), ::fidl_next::EncodeError> {
19285 if let Some(inner) = this {
19286 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19287 ::fidl_next::WireBox::encode_present(out);
19288 } else {
19289 ::fidl_next::WireBox::encode_absent(out);
19290 }
19291
19292 Ok(())
19293 }
19294}
19295
19296unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekRequest
19297where
19298 ___E: ::fidl_next::Encoder + ?Sized,
19299 FileSeekRequest: ::fidl_next::EncodeRef<___E>,
19300{
19301 #[inline]
19302 fn encode_option_ref(
19303 this: Option<&Self>,
19304 encoder: &mut ___E,
19305 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19306 ) -> Result<(), ::fidl_next::EncodeError> {
19307 if let Some(inner) = this {
19308 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19309 ::fidl_next::WireBox::encode_present(out);
19310 } else {
19311 ::fidl_next::WireBox::encode_absent(out);
19312 }
19313
19314 Ok(())
19315 }
19316}
19317
19318impl ::fidl_next::FromWire<WireFileSeekRequest> for FileSeekRequest {
19319 #[inline]
19320 fn from_wire(wire: WireFileSeekRequest) -> Self {
19321 Self {
19322 origin: ::fidl_next::FromWire::from_wire(wire.origin),
19323
19324 offset: ::fidl_next::FromWire::from_wire(wire.offset),
19325 }
19326 }
19327}
19328
19329impl ::fidl_next::FromWireRef<WireFileSeekRequest> for FileSeekRequest {
19330 #[inline]
19331 fn from_wire_ref(wire: &WireFileSeekRequest) -> Self {
19332 Self {
19333 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
19334
19335 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
19336 }
19337 }
19338}
19339
19340#[derive(Clone, Debug)]
19342#[repr(C)]
19343pub struct WireFileSeekRequest {
19344 pub origin: crate::WireSeekOrigin,
19345
19346 pub offset: ::fidl_next::WireI64,
19347}
19348
19349unsafe impl ::fidl_next::Wire for WireFileSeekRequest {
19350 type Decoded<'de> = WireFileSeekRequest;
19351
19352 #[inline]
19353 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19354 unsafe {
19355 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
19356 }
19357 }
19358}
19359
19360unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekRequest
19361where
19362 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19363{
19364 fn decode(
19365 slot: ::fidl_next::Slot<'_, Self>,
19366 decoder: &mut ___D,
19367 ) -> Result<(), ::fidl_next::DecodeError> {
19368 ::fidl_next::munge! {
19369 let Self {
19370 mut origin,
19371 mut offset,
19372
19373 } = slot;
19374 }
19375
19376 ::fidl_next::Decode::decode(origin.as_mut(), decoder)?;
19377
19378 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
19379
19380 Ok(())
19381 }
19382}
19383
19384#[derive(Clone, Debug)]
19385#[repr(C)]
19386pub struct FileSeekResponse {
19387 pub offset_from_start: u64,
19388}
19389
19390impl ::fidl_next::Encodable for FileSeekResponse {
19391 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileSeekResponse> = unsafe {
19392 ::fidl_next::CopyOptimization::enable_if(
19393 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
19394 )
19395 };
19396
19397 type Encoded = WireFileSeekResponse;
19398}
19399
19400unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekResponse
19401where
19402 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19403{
19404 #[inline]
19405 fn encode(
19406 self,
19407 encoder: &mut ___E,
19408 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19409 ) -> Result<(), ::fidl_next::EncodeError> {
19410 ::fidl_next::munge! {
19411 let Self::Encoded {
19412 offset_from_start,
19413
19414 } = out;
19415 }
19416
19417 ::fidl_next::Encode::encode(self.offset_from_start, encoder, offset_from_start)?;
19418
19419 Ok(())
19420 }
19421}
19422
19423unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekResponse
19424where
19425 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19426{
19427 #[inline]
19428 fn encode_ref(
19429 &self,
19430 encoder: &mut ___E,
19431 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19432 ) -> Result<(), ::fidl_next::EncodeError> {
19433 ::fidl_next::munge! {
19434 let Self::Encoded {
19435 offset_from_start,
19436
19437 } = out;
19438 }
19439
19440 ::fidl_next::EncodeRef::encode_ref(&self.offset_from_start, encoder, offset_from_start)?;
19441
19442 Ok(())
19443 }
19444}
19445
19446impl ::fidl_next::EncodableOption for FileSeekResponse {
19447 type EncodedOption = ::fidl_next::WireBox<'static, WireFileSeekResponse>;
19448}
19449
19450unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileSeekResponse
19451where
19452 ___E: ::fidl_next::Encoder + ?Sized,
19453 FileSeekResponse: ::fidl_next::Encode<___E>,
19454{
19455 #[inline]
19456 fn encode_option(
19457 this: Option<Self>,
19458 encoder: &mut ___E,
19459 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19460 ) -> Result<(), ::fidl_next::EncodeError> {
19461 if let Some(inner) = this {
19462 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19463 ::fidl_next::WireBox::encode_present(out);
19464 } else {
19465 ::fidl_next::WireBox::encode_absent(out);
19466 }
19467
19468 Ok(())
19469 }
19470}
19471
19472unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileSeekResponse
19473where
19474 ___E: ::fidl_next::Encoder + ?Sized,
19475 FileSeekResponse: ::fidl_next::EncodeRef<___E>,
19476{
19477 #[inline]
19478 fn encode_option_ref(
19479 this: Option<&Self>,
19480 encoder: &mut ___E,
19481 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19482 ) -> Result<(), ::fidl_next::EncodeError> {
19483 if let Some(inner) = this {
19484 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19485 ::fidl_next::WireBox::encode_present(out);
19486 } else {
19487 ::fidl_next::WireBox::encode_absent(out);
19488 }
19489
19490 Ok(())
19491 }
19492}
19493
19494impl ::fidl_next::FromWire<WireFileSeekResponse> for FileSeekResponse {
19495 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileSeekResponse, Self> = unsafe {
19496 ::fidl_next::CopyOptimization::enable_if(
19497 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
19498 .is_enabled(),
19499 )
19500 };
19501
19502 #[inline]
19503 fn from_wire(wire: WireFileSeekResponse) -> Self {
19504 Self { offset_from_start: ::fidl_next::FromWire::from_wire(wire.offset_from_start) }
19505 }
19506}
19507
19508impl ::fidl_next::FromWireRef<WireFileSeekResponse> for FileSeekResponse {
19509 #[inline]
19510 fn from_wire_ref(wire: &WireFileSeekResponse) -> Self {
19511 Self { offset_from_start: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset_from_start) }
19512 }
19513}
19514
19515#[derive(Clone, Debug)]
19517#[repr(C)]
19518pub struct WireFileSeekResponse {
19519 pub offset_from_start: ::fidl_next::WireU64,
19520}
19521
19522unsafe impl ::fidl_next::Wire for WireFileSeekResponse {
19523 type Decoded<'de> = WireFileSeekResponse;
19524
19525 #[inline]
19526 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19527}
19528
19529unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekResponse
19530where
19531 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19532{
19533 fn decode(
19534 slot: ::fidl_next::Slot<'_, Self>,
19535 decoder: &mut ___D,
19536 ) -> Result<(), ::fidl_next::DecodeError> {
19537 ::fidl_next::munge! {
19538 let Self {
19539 mut offset_from_start,
19540
19541 } = slot;
19542 }
19543
19544 ::fidl_next::Decode::decode(offset_from_start.as_mut(), decoder)?;
19545
19546 Ok(())
19547 }
19548}
19549
19550#[derive(Clone, Debug)]
19551#[repr(C)]
19552pub struct FileReadAtRequest {
19553 pub count: u64,
19554
19555 pub offset: u64,
19556}
19557
19558impl ::fidl_next::Encodable for FileReadAtRequest {
19559 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileReadAtRequest> = unsafe {
19560 ::fidl_next::CopyOptimization::enable_if(
19561 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
19562 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
19563 )
19564 };
19565
19566 type Encoded = WireFileReadAtRequest;
19567}
19568
19569unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtRequest
19570where
19571 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19572{
19573 #[inline]
19574 fn encode(
19575 self,
19576 encoder: &mut ___E,
19577 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19578 ) -> Result<(), ::fidl_next::EncodeError> {
19579 ::fidl_next::munge! {
19580 let Self::Encoded {
19581 count,
19582 offset,
19583
19584 } = out;
19585 }
19586
19587 ::fidl_next::Encode::encode(self.count, encoder, count)?;
19588
19589 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
19590
19591 Ok(())
19592 }
19593}
19594
19595unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtRequest
19596where
19597 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19598{
19599 #[inline]
19600 fn encode_ref(
19601 &self,
19602 encoder: &mut ___E,
19603 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19604 ) -> Result<(), ::fidl_next::EncodeError> {
19605 ::fidl_next::munge! {
19606 let Self::Encoded {
19607 count,
19608 offset,
19609
19610 } = out;
19611 }
19612
19613 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
19614
19615 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
19616
19617 Ok(())
19618 }
19619}
19620
19621impl ::fidl_next::EncodableOption for FileReadAtRequest {
19622 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtRequest>;
19623}
19624
19625unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtRequest
19626where
19627 ___E: ::fidl_next::Encoder + ?Sized,
19628 FileReadAtRequest: ::fidl_next::Encode<___E>,
19629{
19630 #[inline]
19631 fn encode_option(
19632 this: Option<Self>,
19633 encoder: &mut ___E,
19634 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19635 ) -> Result<(), ::fidl_next::EncodeError> {
19636 if let Some(inner) = this {
19637 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19638 ::fidl_next::WireBox::encode_present(out);
19639 } else {
19640 ::fidl_next::WireBox::encode_absent(out);
19641 }
19642
19643 Ok(())
19644 }
19645}
19646
19647unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileReadAtRequest
19648where
19649 ___E: ::fidl_next::Encoder + ?Sized,
19650 FileReadAtRequest: ::fidl_next::EncodeRef<___E>,
19651{
19652 #[inline]
19653 fn encode_option_ref(
19654 this: Option<&Self>,
19655 encoder: &mut ___E,
19656 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19657 ) -> Result<(), ::fidl_next::EncodeError> {
19658 if let Some(inner) = this {
19659 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19660 ::fidl_next::WireBox::encode_present(out);
19661 } else {
19662 ::fidl_next::WireBox::encode_absent(out);
19663 }
19664
19665 Ok(())
19666 }
19667}
19668
19669impl ::fidl_next::FromWire<WireFileReadAtRequest> for FileReadAtRequest {
19670 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileReadAtRequest, Self> = unsafe {
19671 ::fidl_next::CopyOptimization::enable_if(
19672 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
19673 .is_enabled()
19674 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
19675 .is_enabled(),
19676 )
19677 };
19678
19679 #[inline]
19680 fn from_wire(wire: WireFileReadAtRequest) -> Self {
19681 Self {
19682 count: ::fidl_next::FromWire::from_wire(wire.count),
19683
19684 offset: ::fidl_next::FromWire::from_wire(wire.offset),
19685 }
19686 }
19687}
19688
19689impl ::fidl_next::FromWireRef<WireFileReadAtRequest> for FileReadAtRequest {
19690 #[inline]
19691 fn from_wire_ref(wire: &WireFileReadAtRequest) -> Self {
19692 Self {
19693 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
19694
19695 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
19696 }
19697 }
19698}
19699
19700#[derive(Clone, Debug)]
19702#[repr(C)]
19703pub struct WireFileReadAtRequest {
19704 pub count: ::fidl_next::WireU64,
19705
19706 pub offset: ::fidl_next::WireU64,
19707}
19708
19709unsafe impl ::fidl_next::Wire for WireFileReadAtRequest {
19710 type Decoded<'de> = WireFileReadAtRequest;
19711
19712 #[inline]
19713 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19714}
19715
19716unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtRequest
19717where
19718 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19719{
19720 fn decode(
19721 slot: ::fidl_next::Slot<'_, Self>,
19722 decoder: &mut ___D,
19723 ) -> Result<(), ::fidl_next::DecodeError> {
19724 ::fidl_next::munge! {
19725 let Self {
19726 mut count,
19727 mut offset,
19728
19729 } = slot;
19730 }
19731
19732 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
19733
19734 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
19735
19736 Ok(())
19737 }
19738}
19739
19740#[derive(Clone, Debug)]
19741pub struct FileReadAtResponse {
19742 pub data: Vec<u8>,
19743}
19744
19745impl ::fidl_next::Encodable for FileReadAtResponse {
19746 type Encoded = WireFileReadAtResponse<'static>;
19747}
19748
19749unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtResponse
19750where
19751 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19752 ___E: ::fidl_next::Encoder,
19753{
19754 #[inline]
19755 fn encode(
19756 self,
19757 encoder: &mut ___E,
19758 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19759 ) -> Result<(), ::fidl_next::EncodeError> {
19760 ::fidl_next::munge! {
19761 let Self::Encoded {
19762 data,
19763
19764 } = out;
19765 }
19766
19767 ::fidl_next::Encode::encode(self.data, encoder, data)?;
19768
19769 Ok(())
19770 }
19771}
19772
19773unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtResponse
19774where
19775 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19776 ___E: ::fidl_next::Encoder,
19777{
19778 #[inline]
19779 fn encode_ref(
19780 &self,
19781 encoder: &mut ___E,
19782 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19783 ) -> Result<(), ::fidl_next::EncodeError> {
19784 ::fidl_next::munge! {
19785 let Self::Encoded {
19786 data,
19787
19788 } = out;
19789 }
19790
19791 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
19792
19793 Ok(())
19794 }
19795}
19796
19797impl ::fidl_next::EncodableOption for FileReadAtResponse {
19798 type EncodedOption = ::fidl_next::WireBox<'static, WireFileReadAtResponse<'static>>;
19799}
19800
19801unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileReadAtResponse
19802where
19803 ___E: ::fidl_next::Encoder + ?Sized,
19804 FileReadAtResponse: ::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 FileReadAtResponse
19824where
19825 ___E: ::fidl_next::Encoder + ?Sized,
19826 FileReadAtResponse: ::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<'de> ::fidl_next::FromWire<WireFileReadAtResponse<'de>> for FileReadAtResponse {
19846 #[inline]
19847 fn from_wire(wire: WireFileReadAtResponse<'de>) -> Self {
19848 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
19849 }
19850}
19851
19852impl<'de> ::fidl_next::FromWireRef<WireFileReadAtResponse<'de>> for FileReadAtResponse {
19853 #[inline]
19854 fn from_wire_ref(wire: &WireFileReadAtResponse<'de>) -> Self {
19855 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
19856 }
19857}
19858
19859#[derive(Debug)]
19861#[repr(C)]
19862pub struct WireFileReadAtResponse<'de> {
19863 pub data: ::fidl_next::WireVector<'de, u8>,
19864}
19865
19866unsafe impl ::fidl_next::Wire for WireFileReadAtResponse<'static> {
19867 type Decoded<'de> = WireFileReadAtResponse<'de>;
19868
19869 #[inline]
19870 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19871}
19872
19873unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtResponse<'static>
19874where
19875 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19876 ___D: ::fidl_next::Decoder,
19877{
19878 fn decode(
19879 slot: ::fidl_next::Slot<'_, Self>,
19880 decoder: &mut ___D,
19881 ) -> Result<(), ::fidl_next::DecodeError> {
19882 ::fidl_next::munge! {
19883 let Self {
19884 mut data,
19885
19886 } = slot;
19887 }
19888
19889 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
19890
19891 let data = unsafe { data.deref_unchecked() };
19892
19893 if data.len() > 8192 {
19894 return Err(::fidl_next::DecodeError::VectorTooLong {
19895 size: data.len() as u64,
19896 limit: 8192,
19897 });
19898 }
19899
19900 Ok(())
19901 }
19902}
19903
19904#[derive(Clone, Debug)]
19905pub struct FileWriteAtRequest {
19906 pub data: Vec<u8>,
19907
19908 pub offset: u64,
19909}
19910
19911impl ::fidl_next::Encodable for FileWriteAtRequest {
19912 type Encoded = WireFileWriteAtRequest<'static>;
19913}
19914
19915unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtRequest
19916where
19917 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19918 ___E: ::fidl_next::Encoder,
19919{
19920 #[inline]
19921 fn encode(
19922 self,
19923 encoder: &mut ___E,
19924 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19925 ) -> Result<(), ::fidl_next::EncodeError> {
19926 ::fidl_next::munge! {
19927 let Self::Encoded {
19928 data,
19929 offset,
19930
19931 } = out;
19932 }
19933
19934 ::fidl_next::Encode::encode(self.data, encoder, data)?;
19935
19936 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
19937
19938 Ok(())
19939 }
19940}
19941
19942unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtRequest
19943where
19944 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19945 ___E: ::fidl_next::Encoder,
19946{
19947 #[inline]
19948 fn encode_ref(
19949 &self,
19950 encoder: &mut ___E,
19951 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19952 ) -> Result<(), ::fidl_next::EncodeError> {
19953 ::fidl_next::munge! {
19954 let Self::Encoded {
19955 data,
19956 offset,
19957
19958 } = out;
19959 }
19960
19961 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
19962
19963 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
19964
19965 Ok(())
19966 }
19967}
19968
19969impl ::fidl_next::EncodableOption for FileWriteAtRequest {
19970 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtRequest<'static>>;
19971}
19972
19973unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtRequest
19974where
19975 ___E: ::fidl_next::Encoder + ?Sized,
19976 FileWriteAtRequest: ::fidl_next::Encode<___E>,
19977{
19978 #[inline]
19979 fn encode_option(
19980 this: Option<Self>,
19981 encoder: &mut ___E,
19982 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19983 ) -> Result<(), ::fidl_next::EncodeError> {
19984 if let Some(inner) = this {
19985 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19986 ::fidl_next::WireBox::encode_present(out);
19987 } else {
19988 ::fidl_next::WireBox::encode_absent(out);
19989 }
19990
19991 Ok(())
19992 }
19993}
19994
19995unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtRequest
19996where
19997 ___E: ::fidl_next::Encoder + ?Sized,
19998 FileWriteAtRequest: ::fidl_next::EncodeRef<___E>,
19999{
20000 #[inline]
20001 fn encode_option_ref(
20002 this: Option<&Self>,
20003 encoder: &mut ___E,
20004 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20005 ) -> Result<(), ::fidl_next::EncodeError> {
20006 if let Some(inner) = this {
20007 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20008 ::fidl_next::WireBox::encode_present(out);
20009 } else {
20010 ::fidl_next::WireBox::encode_absent(out);
20011 }
20012
20013 Ok(())
20014 }
20015}
20016
20017impl<'de> ::fidl_next::FromWire<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
20018 #[inline]
20019 fn from_wire(wire: WireFileWriteAtRequest<'de>) -> Self {
20020 Self {
20021 data: ::fidl_next::FromWire::from_wire(wire.data),
20022
20023 offset: ::fidl_next::FromWire::from_wire(wire.offset),
20024 }
20025 }
20026}
20027
20028impl<'de> ::fidl_next::FromWireRef<WireFileWriteAtRequest<'de>> for FileWriteAtRequest {
20029 #[inline]
20030 fn from_wire_ref(wire: &WireFileWriteAtRequest<'de>) -> Self {
20031 Self {
20032 data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
20033
20034 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
20035 }
20036 }
20037}
20038
20039#[derive(Debug)]
20041#[repr(C)]
20042pub struct WireFileWriteAtRequest<'de> {
20043 pub data: ::fidl_next::WireVector<'de, u8>,
20044
20045 pub offset: ::fidl_next::WireU64,
20046}
20047
20048unsafe impl ::fidl_next::Wire for WireFileWriteAtRequest<'static> {
20049 type Decoded<'de> = WireFileWriteAtRequest<'de>;
20050
20051 #[inline]
20052 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20053}
20054
20055unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtRequest<'static>
20056where
20057 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20058 ___D: ::fidl_next::Decoder,
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 data,
20067 mut offset,
20068
20069 } = slot;
20070 }
20071
20072 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
20073
20074 let data = unsafe { data.deref_unchecked() };
20075
20076 if data.len() > 8192 {
20077 return Err(::fidl_next::DecodeError::VectorTooLong {
20078 size: data.len() as u64,
20079 limit: 8192,
20080 });
20081 }
20082
20083 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
20084
20085 Ok(())
20086 }
20087}
20088
20089#[derive(Clone, Debug)]
20090#[repr(C)]
20091pub struct FileWriteAtResponse {
20092 pub actual_count: u64,
20093}
20094
20095impl ::fidl_next::Encodable for FileWriteAtResponse {
20096 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileWriteAtResponse> = unsafe {
20097 ::fidl_next::CopyOptimization::enable_if(
20098 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20099 )
20100 };
20101
20102 type Encoded = WireFileWriteAtResponse;
20103}
20104
20105unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtResponse
20106where
20107 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20108{
20109 #[inline]
20110 fn encode(
20111 self,
20112 encoder: &mut ___E,
20113 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20114 ) -> Result<(), ::fidl_next::EncodeError> {
20115 ::fidl_next::munge! {
20116 let Self::Encoded {
20117 actual_count,
20118
20119 } = out;
20120 }
20121
20122 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
20123
20124 Ok(())
20125 }
20126}
20127
20128unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtResponse
20129where
20130 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20131{
20132 #[inline]
20133 fn encode_ref(
20134 &self,
20135 encoder: &mut ___E,
20136 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20137 ) -> Result<(), ::fidl_next::EncodeError> {
20138 ::fidl_next::munge! {
20139 let Self::Encoded {
20140 actual_count,
20141
20142 } = out;
20143 }
20144
20145 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
20146
20147 Ok(())
20148 }
20149}
20150
20151impl ::fidl_next::EncodableOption for FileWriteAtResponse {
20152 type EncodedOption = ::fidl_next::WireBox<'static, WireFileWriteAtResponse>;
20153}
20154
20155unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileWriteAtResponse
20156where
20157 ___E: ::fidl_next::Encoder + ?Sized,
20158 FileWriteAtResponse: ::fidl_next::Encode<___E>,
20159{
20160 #[inline]
20161 fn encode_option(
20162 this: Option<Self>,
20163 encoder: &mut ___E,
20164 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20165 ) -> Result<(), ::fidl_next::EncodeError> {
20166 if let Some(inner) = this {
20167 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20168 ::fidl_next::WireBox::encode_present(out);
20169 } else {
20170 ::fidl_next::WireBox::encode_absent(out);
20171 }
20172
20173 Ok(())
20174 }
20175}
20176
20177unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileWriteAtResponse
20178where
20179 ___E: ::fidl_next::Encoder + ?Sized,
20180 FileWriteAtResponse: ::fidl_next::EncodeRef<___E>,
20181{
20182 #[inline]
20183 fn encode_option_ref(
20184 this: Option<&Self>,
20185 encoder: &mut ___E,
20186 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20187 ) -> Result<(), ::fidl_next::EncodeError> {
20188 if let Some(inner) = this {
20189 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20190 ::fidl_next::WireBox::encode_present(out);
20191 } else {
20192 ::fidl_next::WireBox::encode_absent(out);
20193 }
20194
20195 Ok(())
20196 }
20197}
20198
20199impl ::fidl_next::FromWire<WireFileWriteAtResponse> for FileWriteAtResponse {
20200 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileWriteAtResponse, Self> = unsafe {
20201 ::fidl_next::CopyOptimization::enable_if(
20202 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20203 .is_enabled(),
20204 )
20205 };
20206
20207 #[inline]
20208 fn from_wire(wire: WireFileWriteAtResponse) -> Self {
20209 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
20210 }
20211}
20212
20213impl ::fidl_next::FromWireRef<WireFileWriteAtResponse> for FileWriteAtResponse {
20214 #[inline]
20215 fn from_wire_ref(wire: &WireFileWriteAtResponse) -> Self {
20216 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
20217 }
20218}
20219
20220#[derive(Clone, Debug)]
20222#[repr(C)]
20223pub struct WireFileWriteAtResponse {
20224 pub actual_count: ::fidl_next::WireU64,
20225}
20226
20227unsafe impl ::fidl_next::Wire for WireFileWriteAtResponse {
20228 type Decoded<'de> = WireFileWriteAtResponse;
20229
20230 #[inline]
20231 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20232}
20233
20234unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtResponse
20235where
20236 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20237{
20238 fn decode(
20239 slot: ::fidl_next::Slot<'_, Self>,
20240 decoder: &mut ___D,
20241 ) -> Result<(), ::fidl_next::DecodeError> {
20242 ::fidl_next::munge! {
20243 let Self {
20244 mut actual_count,
20245
20246 } = slot;
20247 }
20248
20249 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
20250
20251 Ok(())
20252 }
20253}
20254
20255#[derive(Clone, Debug)]
20256#[repr(C)]
20257pub struct FileResizeRequest {
20258 pub length: u64,
20259}
20260
20261impl ::fidl_next::Encodable for FileResizeRequest {
20262 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileResizeRequest> = unsafe {
20263 ::fidl_next::CopyOptimization::enable_if(
20264 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20265 )
20266 };
20267
20268 type Encoded = WireFileResizeRequest;
20269}
20270
20271unsafe impl<___E> ::fidl_next::Encode<___E> for FileResizeRequest
20272where
20273 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20274{
20275 #[inline]
20276 fn encode(
20277 self,
20278 encoder: &mut ___E,
20279 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20280 ) -> Result<(), ::fidl_next::EncodeError> {
20281 ::fidl_next::munge! {
20282 let Self::Encoded {
20283 length,
20284
20285 } = out;
20286 }
20287
20288 ::fidl_next::Encode::encode(self.length, encoder, length)?;
20289
20290 Ok(())
20291 }
20292}
20293
20294unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileResizeRequest
20295where
20296 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20297{
20298 #[inline]
20299 fn encode_ref(
20300 &self,
20301 encoder: &mut ___E,
20302 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20303 ) -> Result<(), ::fidl_next::EncodeError> {
20304 ::fidl_next::munge! {
20305 let Self::Encoded {
20306 length,
20307
20308 } = out;
20309 }
20310
20311 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder, length)?;
20312
20313 Ok(())
20314 }
20315}
20316
20317impl ::fidl_next::EncodableOption for FileResizeRequest {
20318 type EncodedOption = ::fidl_next::WireBox<'static, WireFileResizeRequest>;
20319}
20320
20321unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileResizeRequest
20322where
20323 ___E: ::fidl_next::Encoder + ?Sized,
20324 FileResizeRequest: ::fidl_next::Encode<___E>,
20325{
20326 #[inline]
20327 fn encode_option(
20328 this: Option<Self>,
20329 encoder: &mut ___E,
20330 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20331 ) -> Result<(), ::fidl_next::EncodeError> {
20332 if let Some(inner) = this {
20333 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20334 ::fidl_next::WireBox::encode_present(out);
20335 } else {
20336 ::fidl_next::WireBox::encode_absent(out);
20337 }
20338
20339 Ok(())
20340 }
20341}
20342
20343unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileResizeRequest
20344where
20345 ___E: ::fidl_next::Encoder + ?Sized,
20346 FileResizeRequest: ::fidl_next::EncodeRef<___E>,
20347{
20348 #[inline]
20349 fn encode_option_ref(
20350 this: Option<&Self>,
20351 encoder: &mut ___E,
20352 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20353 ) -> Result<(), ::fidl_next::EncodeError> {
20354 if let Some(inner) = this {
20355 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20356 ::fidl_next::WireBox::encode_present(out);
20357 } else {
20358 ::fidl_next::WireBox::encode_absent(out);
20359 }
20360
20361 Ok(())
20362 }
20363}
20364
20365impl ::fidl_next::FromWire<WireFileResizeRequest> for FileResizeRequest {
20366 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileResizeRequest, Self> = unsafe {
20367 ::fidl_next::CopyOptimization::enable_if(
20368 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
20369 .is_enabled(),
20370 )
20371 };
20372
20373 #[inline]
20374 fn from_wire(wire: WireFileResizeRequest) -> Self {
20375 Self { length: ::fidl_next::FromWire::from_wire(wire.length) }
20376 }
20377}
20378
20379impl ::fidl_next::FromWireRef<WireFileResizeRequest> for FileResizeRequest {
20380 #[inline]
20381 fn from_wire_ref(wire: &WireFileResizeRequest) -> Self {
20382 Self { length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length) }
20383 }
20384}
20385
20386#[derive(Clone, Debug)]
20388#[repr(C)]
20389pub struct WireFileResizeRequest {
20390 pub length: ::fidl_next::WireU64,
20391}
20392
20393unsafe impl ::fidl_next::Wire for WireFileResizeRequest {
20394 type Decoded<'de> = WireFileResizeRequest;
20395
20396 #[inline]
20397 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20398}
20399
20400unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileResizeRequest
20401where
20402 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20403{
20404 fn decode(
20405 slot: ::fidl_next::Slot<'_, Self>,
20406 decoder: &mut ___D,
20407 ) -> Result<(), ::fidl_next::DecodeError> {
20408 ::fidl_next::munge! {
20409 let Self {
20410 mut length,
20411
20412 } = slot;
20413 }
20414
20415 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
20416
20417 Ok(())
20418 }
20419}
20420
20421pub type FileResizeResponse = ();
20422
20423pub type WireFileResizeResponse = ();
20425
20426::fidl_next::bitflags! {
20427 #[derive(
20428 Clone,
20429 Copy,
20430 Debug,
20431 PartialEq,
20432 Eq,
20433 Hash,
20434 )]
20435 pub struct VmoFlags: u32 {
20436 #[doc = " Requests that the VMO be readable.\n"]const READ = 1;
20437 #[doc = " Requests that the VMO be writable.\n"]const WRITE = 2;
20438 #[doc = " Request that the VMO be executable.\n"]const EXECUTE = 4;
20439 #[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;
20440 #[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;
20441
20442 }
20443}
20444
20445impl ::fidl_next::Encodable for VmoFlags {
20446 type Encoded = WireVmoFlags;
20447}
20448
20449unsafe impl<___E> ::fidl_next::Encode<___E> for VmoFlags
20450where
20451 ___E: ?Sized,
20452{
20453 #[inline]
20454 fn encode(
20455 self,
20456 encoder: &mut ___E,
20457 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20458 ) -> Result<(), ::fidl_next::EncodeError> {
20459 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
20460 }
20461}
20462
20463unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VmoFlags
20464where
20465 ___E: ?Sized,
20466{
20467 #[inline]
20468 fn encode_ref(
20469 &self,
20470 _: &mut ___E,
20471 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20472 ) -> Result<(), ::fidl_next::EncodeError> {
20473 ::fidl_next::munge!(let WireVmoFlags { value } = out);
20474 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
20475 Ok(())
20476 }
20477}
20478
20479impl ::core::convert::From<WireVmoFlags> for VmoFlags {
20480 fn from(wire: WireVmoFlags) -> Self {
20481 Self::from_bits_retain(u32::from(wire.value))
20482 }
20483}
20484
20485impl ::fidl_next::FromWire<WireVmoFlags> for VmoFlags {
20486 #[inline]
20487 fn from_wire(wire: WireVmoFlags) -> Self {
20488 Self::from(wire)
20489 }
20490}
20491
20492impl ::fidl_next::FromWireRef<WireVmoFlags> for VmoFlags {
20493 #[inline]
20494 fn from_wire_ref(wire: &WireVmoFlags) -> Self {
20495 Self::from(*wire)
20496 }
20497}
20498
20499#[derive(Clone, Copy, Debug)]
20501#[repr(transparent)]
20502pub struct WireVmoFlags {
20503 value: ::fidl_next::WireU32,
20504}
20505
20506unsafe impl ::fidl_next::Wire for WireVmoFlags {
20507 type Decoded<'de> = Self;
20508
20509 #[inline]
20510 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
20511 }
20513}
20514
20515unsafe impl<___D> ::fidl_next::Decode<___D> for WireVmoFlags
20516where
20517 ___D: ?Sized,
20518{
20519 fn decode(
20520 slot: ::fidl_next::Slot<'_, Self>,
20521 _: &mut ___D,
20522 ) -> Result<(), ::fidl_next::DecodeError> {
20523 ::fidl_next::munge!(let Self { value } = slot);
20524 let set = u32::from(*value);
20525 if set & !VmoFlags::all().bits() != 0 {
20526 return Err(::fidl_next::DecodeError::InvalidBits {
20527 expected: VmoFlags::all().bits() as usize,
20528 actual: set as usize,
20529 });
20530 }
20531
20532 Ok(())
20533 }
20534}
20535
20536impl ::core::convert::From<VmoFlags> for WireVmoFlags {
20537 fn from(natural: VmoFlags) -> Self {
20538 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
20539 }
20540}
20541
20542#[derive(Clone, Debug)]
20543#[repr(C)]
20544pub struct FileGetBackingMemoryRequest {
20545 pub flags: crate::VmoFlags,
20546}
20547
20548impl ::fidl_next::Encodable for FileGetBackingMemoryRequest {
20549 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryRequest> = unsafe {
20550 ::fidl_next::CopyOptimization::enable_if(
20551 true && <crate::VmoFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20552 )
20553 };
20554
20555 type Encoded = WireFileGetBackingMemoryRequest;
20556}
20557
20558unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryRequest
20559where
20560 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20561{
20562 #[inline]
20563 fn encode(
20564 self,
20565 encoder: &mut ___E,
20566 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20567 ) -> Result<(), ::fidl_next::EncodeError> {
20568 ::fidl_next::munge! {
20569 let Self::Encoded {
20570 flags,
20571
20572 } = out;
20573 }
20574
20575 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
20576
20577 Ok(())
20578 }
20579}
20580
20581unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileGetBackingMemoryRequest
20582where
20583 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20584{
20585 #[inline]
20586 fn encode_ref(
20587 &self,
20588 encoder: &mut ___E,
20589 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20590 ) -> Result<(), ::fidl_next::EncodeError> {
20591 ::fidl_next::munge! {
20592 let Self::Encoded {
20593 flags,
20594
20595 } = out;
20596 }
20597
20598 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
20599
20600 Ok(())
20601 }
20602}
20603
20604impl ::fidl_next::EncodableOption for FileGetBackingMemoryRequest {
20605 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryRequest>;
20606}
20607
20608unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryRequest
20609where
20610 ___E: ::fidl_next::Encoder + ?Sized,
20611 FileGetBackingMemoryRequest: ::fidl_next::Encode<___E>,
20612{
20613 #[inline]
20614 fn encode_option(
20615 this: Option<Self>,
20616 encoder: &mut ___E,
20617 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20618 ) -> Result<(), ::fidl_next::EncodeError> {
20619 if let Some(inner) = this {
20620 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20621 ::fidl_next::WireBox::encode_present(out);
20622 } else {
20623 ::fidl_next::WireBox::encode_absent(out);
20624 }
20625
20626 Ok(())
20627 }
20628}
20629
20630unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FileGetBackingMemoryRequest
20631where
20632 ___E: ::fidl_next::Encoder + ?Sized,
20633 FileGetBackingMemoryRequest: ::fidl_next::EncodeRef<___E>,
20634{
20635 #[inline]
20636 fn encode_option_ref(
20637 this: Option<&Self>,
20638 encoder: &mut ___E,
20639 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20640 ) -> Result<(), ::fidl_next::EncodeError> {
20641 if let Some(inner) = this {
20642 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20643 ::fidl_next::WireBox::encode_present(out);
20644 } else {
20645 ::fidl_next::WireBox::encode_absent(out);
20646 }
20647
20648 Ok(())
20649 }
20650}
20651
20652impl ::fidl_next::FromWire<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
20653 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryRequest, Self> = unsafe {
20654 ::fidl_next::CopyOptimization::enable_if(
20655 true
20656
20657 && <
20658 crate::VmoFlags as ::fidl_next::FromWire<crate::WireVmoFlags>
20659 >::COPY_OPTIMIZATION.is_enabled()
20660
20661 )
20662 };
20663
20664 #[inline]
20665 fn from_wire(wire: WireFileGetBackingMemoryRequest) -> Self {
20666 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
20667 }
20668}
20669
20670impl ::fidl_next::FromWireRef<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
20671 #[inline]
20672 fn from_wire_ref(wire: &WireFileGetBackingMemoryRequest) -> Self {
20673 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
20674 }
20675}
20676
20677#[derive(Clone, Debug)]
20679#[repr(C)]
20680pub struct WireFileGetBackingMemoryRequest {
20681 pub flags: crate::WireVmoFlags,
20682}
20683
20684unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryRequest {
20685 type Decoded<'de> = WireFileGetBackingMemoryRequest;
20686
20687 #[inline]
20688 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20689}
20690
20691unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryRequest
20692where
20693 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20694{
20695 fn decode(
20696 slot: ::fidl_next::Slot<'_, Self>,
20697 decoder: &mut ___D,
20698 ) -> Result<(), ::fidl_next::DecodeError> {
20699 ::fidl_next::munge! {
20700 let Self {
20701 mut flags,
20702
20703 } = slot;
20704 }
20705
20706 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
20707
20708 Ok(())
20709 }
20710}
20711
20712#[derive(Debug)]
20713#[repr(C)]
20714pub struct FileGetBackingMemoryResponse {
20715 pub vmo: ::fidl_next::fuchsia::zx::Vmo,
20716}
20717
20718impl ::fidl_next::Encodable for FileGetBackingMemoryResponse {
20719 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileGetBackingMemoryResponse> = unsafe {
20720 ::fidl_next::CopyOptimization::enable_if(
20721 true && <::fidl_next::fuchsia::zx::Vmo as ::fidl_next::Encodable>::COPY_OPTIMIZATION
20722 .is_enabled(),
20723 )
20724 };
20725
20726 type Encoded = WireFileGetBackingMemoryResponse;
20727}
20728
20729unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryResponse
20730where
20731 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20732 ___E: ::fidl_next::fuchsia::HandleEncoder,
20733{
20734 #[inline]
20735 fn encode(
20736 self,
20737 encoder: &mut ___E,
20738 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20739 ) -> Result<(), ::fidl_next::EncodeError> {
20740 ::fidl_next::munge! {
20741 let Self::Encoded {
20742 vmo,
20743
20744 } = out;
20745 }
20746
20747 ::fidl_next::Encode::encode(self.vmo, encoder, vmo)?;
20748
20749 Ok(())
20750 }
20751}
20752
20753impl ::fidl_next::EncodableOption for FileGetBackingMemoryResponse {
20754 type EncodedOption = ::fidl_next::WireBox<'static, WireFileGetBackingMemoryResponse>;
20755}
20756
20757unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileGetBackingMemoryResponse
20758where
20759 ___E: ::fidl_next::Encoder + ?Sized,
20760 FileGetBackingMemoryResponse: ::fidl_next::Encode<___E>,
20761{
20762 #[inline]
20763 fn encode_option(
20764 this: Option<Self>,
20765 encoder: &mut ___E,
20766 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20767 ) -> Result<(), ::fidl_next::EncodeError> {
20768 if let Some(inner) = this {
20769 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20770 ::fidl_next::WireBox::encode_present(out);
20771 } else {
20772 ::fidl_next::WireBox::encode_absent(out);
20773 }
20774
20775 Ok(())
20776 }
20777}
20778
20779impl ::fidl_next::FromWire<WireFileGetBackingMemoryResponse> for FileGetBackingMemoryResponse {
20780 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileGetBackingMemoryResponse, Self> = unsafe {
20781 ::fidl_next::CopyOptimization::enable_if(
20782 true && <::fidl_next::fuchsia::zx::Vmo as ::fidl_next::FromWire<
20783 ::fidl_next::fuchsia::WireVmo,
20784 >>::COPY_OPTIMIZATION
20785 .is_enabled(),
20786 )
20787 };
20788
20789 #[inline]
20790 fn from_wire(wire: WireFileGetBackingMemoryResponse) -> Self {
20791 Self { vmo: ::fidl_next::FromWire::from_wire(wire.vmo) }
20792 }
20793}
20794
20795#[derive(Debug)]
20797#[repr(C)]
20798pub struct WireFileGetBackingMemoryResponse {
20799 pub vmo: ::fidl_next::fuchsia::WireVmo,
20800}
20801
20802unsafe impl ::fidl_next::Wire for WireFileGetBackingMemoryResponse {
20803 type Decoded<'de> = WireFileGetBackingMemoryResponse;
20804
20805 #[inline]
20806 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
20807}
20808
20809unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryResponse
20810where
20811 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20812 ___D: ::fidl_next::fuchsia::HandleDecoder,
20813{
20814 fn decode(
20815 slot: ::fidl_next::Slot<'_, Self>,
20816 decoder: &mut ___D,
20817 ) -> Result<(), ::fidl_next::DecodeError> {
20818 ::fidl_next::munge! {
20819 let Self {
20820 mut vmo,
20821
20822 } = slot;
20823 }
20824
20825 ::fidl_next::Decode::decode(vmo.as_mut(), decoder)?;
20826
20827 Ok(())
20828 }
20829}
20830
20831#[derive(Debug)]
20832pub struct LinkableLinkIntoRequest {
20833 pub dst_parent_token: ::fidl_next::fuchsia::zx::Event,
20834
20835 pub dst: String,
20836}
20837
20838impl ::fidl_next::Encodable for LinkableLinkIntoRequest {
20839 type Encoded = WireLinkableLinkIntoRequest<'static>;
20840}
20841
20842unsafe impl<___E> ::fidl_next::Encode<___E> for LinkableLinkIntoRequest
20843where
20844 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20845 ___E: ::fidl_next::Encoder,
20846 ___E: ::fidl_next::fuchsia::HandleEncoder,
20847{
20848 #[inline]
20849 fn encode(
20850 self,
20851 encoder: &mut ___E,
20852 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20853 ) -> Result<(), ::fidl_next::EncodeError> {
20854 ::fidl_next::munge! {
20855 let Self::Encoded {
20856 dst_parent_token,
20857 dst,
20858
20859 } = out;
20860 }
20861
20862 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
20863
20864 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
20865
20866 Ok(())
20867 }
20868}
20869
20870impl ::fidl_next::EncodableOption for LinkableLinkIntoRequest {
20871 type EncodedOption = ::fidl_next::WireBox<'static, WireLinkableLinkIntoRequest<'static>>;
20872}
20873
20874unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LinkableLinkIntoRequest
20875where
20876 ___E: ::fidl_next::Encoder + ?Sized,
20877 LinkableLinkIntoRequest: ::fidl_next::Encode<___E>,
20878{
20879 #[inline]
20880 fn encode_option(
20881 this: Option<Self>,
20882 encoder: &mut ___E,
20883 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20884 ) -> Result<(), ::fidl_next::EncodeError> {
20885 if let Some(inner) = this {
20886 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20887 ::fidl_next::WireBox::encode_present(out);
20888 } else {
20889 ::fidl_next::WireBox::encode_absent(out);
20890 }
20891
20892 Ok(())
20893 }
20894}
20895
20896impl<'de> ::fidl_next::FromWire<WireLinkableLinkIntoRequest<'de>> for LinkableLinkIntoRequest {
20897 #[inline]
20898 fn from_wire(wire: WireLinkableLinkIntoRequest<'de>) -> Self {
20899 Self {
20900 dst_parent_token: ::fidl_next::FromWire::from_wire(wire.dst_parent_token),
20901
20902 dst: ::fidl_next::FromWire::from_wire(wire.dst),
20903 }
20904 }
20905}
20906
20907#[derive(Debug)]
20909#[repr(C)]
20910pub struct WireLinkableLinkIntoRequest<'de> {
20911 pub dst_parent_token: ::fidl_next::fuchsia::WireEvent,
20912
20913 pub dst: ::fidl_next::WireString<'de>,
20914}
20915
20916unsafe impl ::fidl_next::Wire for WireLinkableLinkIntoRequest<'static> {
20917 type Decoded<'de> = WireLinkableLinkIntoRequest<'de>;
20918
20919 #[inline]
20920 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20921 unsafe {
20922 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
20923 }
20924 }
20925}
20926
20927unsafe impl<___D> ::fidl_next::Decode<___D> for WireLinkableLinkIntoRequest<'static>
20928where
20929 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20930 ___D: ::fidl_next::Decoder,
20931 ___D: ::fidl_next::fuchsia::HandleDecoder,
20932{
20933 fn decode(
20934 slot: ::fidl_next::Slot<'_, Self>,
20935 decoder: &mut ___D,
20936 ) -> Result<(), ::fidl_next::DecodeError> {
20937 ::fidl_next::munge! {
20938 let Self {
20939 mut dst_parent_token,
20940 mut dst,
20941
20942 } = slot;
20943 }
20944
20945 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
20946
20947 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
20948
20949 let dst = unsafe { dst.deref_unchecked() };
20950
20951 if dst.len() > 255 {
20952 return Err(::fidl_next::DecodeError::VectorTooLong {
20953 size: dst.len() as u64,
20954 limit: 255,
20955 });
20956 }
20957
20958 Ok(())
20959 }
20960}
20961
20962pub type LinkableLinkIntoResponse = ();
20963
20964pub type WireLinkableLinkIntoResponse = ();
20966
20967#[derive(Debug)]
20969pub struct Linkable;
20970
20971pub mod linkable {
20972 pub mod prelude {
20973 pub use crate::{Linkable, LinkableClientHandler, LinkableServerHandler, linkable};
20974
20975 pub use crate::LinkableLinkIntoRequest;
20976
20977 pub use crate::LinkableLinkIntoResponse;
20978 }
20979
20980 pub struct LinkInto;
20981
20982 impl ::fidl_next::Method for LinkInto {
20983 const ORDINAL: u64 = 6121399674497678964;
20984
20985 type Protocol = crate::Linkable;
20986
20987 type Request = crate::WireLinkableLinkIntoRequest<'static>;
20988
20989 type Response = ::fidl_next::WireResult<
20990 'static,
20991 crate::WireLinkableLinkIntoResponse,
20992 ::fidl_next::WireI32,
20993 >;
20994 }
20995
20996 mod ___detail {
20997
20998 pub struct LinkInto<T0, T1> {
20999 dst_parent_token: T0,
21000
21001 dst: T1,
21002 }
21003
21004 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
21005 where
21006 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
21007 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
21008 {
21009 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
21010 }
21011
21012 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
21013 where
21014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21015 ___E: ::fidl_next::Encoder,
21016 ___E: ::fidl_next::fuchsia::HandleEncoder,
21017 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
21018 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
21019 {
21020 #[inline]
21021 fn encode(
21022 self,
21023 encoder: &mut ___E,
21024 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21025 ) -> Result<(), ::fidl_next::EncodeError> {
21026 ::fidl_next::munge! {
21027 let Self::Encoded {
21028 dst_parent_token,
21029 dst,
21030
21031 } = out;
21032 }
21033
21034 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
21035
21036 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
21037
21038 Ok(())
21039 }
21040 }
21041
21042 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Linkable
21043 where
21044 ___T: ::fidl_next::Transport,
21045 {
21046 type ClientSender = LinkableClientSender<___T>;
21047 type ServerSender = LinkableServerSender<___T>;
21048 }
21049
21050 #[repr(transparent)]
21052 pub struct LinkableClientSender<___T: ::fidl_next::Transport> {
21053 #[allow(dead_code)]
21054 sender: ::fidl_next::protocol::ClientSender<___T>,
21055 }
21056
21057 impl<___T> LinkableClientSender<___T>
21058 where
21059 ___T: ::fidl_next::Transport,
21060 {
21061 #[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"]
21062 pub fn link_into(
21063 &self,
21064
21065 dst_parent_token: impl ::fidl_next::Encode<
21066 <___T as ::fidl_next::Transport>::SendBuffer,
21067 Encoded = ::fidl_next::fuchsia::WireEvent,
21068 >,
21069
21070 dst: impl ::fidl_next::Encode<
21071 <___T as ::fidl_next::Transport>::SendBuffer,
21072 Encoded = ::fidl_next::WireString<'static>,
21073 >,
21074 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
21075 where
21076 <___T as ::fidl_next::Transport>::SendBuffer:
21077 ::fidl_next::encoder::InternalHandleEncoder,
21078 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
21079 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
21080 {
21081 self.link_into_with(LinkInto { dst_parent_token, dst })
21082 }
21083
21084 #[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"]
21085 pub fn link_into_with<___R>(
21086 &self,
21087 request: ___R,
21088 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
21089 where
21090 ___R: ::fidl_next::Encode<
21091 <___T as ::fidl_next::Transport>::SendBuffer,
21092 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
21093 >,
21094 {
21095 ::fidl_next::TwoWayFuture::from_untyped(
21096 self.sender.send_two_way(6121399674497678964, request),
21097 )
21098 }
21099 }
21100
21101 #[repr(transparent)]
21103 pub struct LinkableServerSender<___T: ::fidl_next::Transport> {
21104 sender: ::fidl_next::protocol::ServerSender<___T>,
21105 }
21106
21107 impl<___T> LinkableServerSender<___T> where ___T: ::fidl_next::Transport {}
21108 }
21109}
21110
21111pub trait LinkableClientHandler<
21115 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
21116 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
21117>
21118{
21119}
21120
21121impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Linkable
21122where
21123 ___H: LinkableClientHandler<___T> + ::core::marker::Send,
21124 ___T: ::fidl_next::Transport,
21125 <linkable::LinkInto as ::fidl_next::Method>::Response:
21126 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
21127{
21128 async fn on_event(
21129 handler: &mut ___H,
21130 sender: &::fidl_next::ClientSender<Self, ___T>,
21131 ordinal: u64,
21132 buffer: ___T::RecvBuffer,
21133 ) {
21134 match ordinal {
21135 ordinal => sender.close(),
21136 }
21137 }
21138}
21139
21140pub trait LinkableServerHandler<
21144 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
21145 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
21146>
21147{
21148 #[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"]
21149 fn link_into(
21150 &mut self,
21151 sender: &::fidl_next::ServerSender<Linkable, ___T>,
21152
21153 request: ::fidl_next::Request<linkable::LinkInto, ___T>,
21154
21155 responder: ::fidl_next::Responder<linkable::LinkInto>,
21156 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
21157}
21158
21159impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Linkable
21160where
21161 ___H: LinkableServerHandler<___T> + ::core::marker::Send,
21162 ___T: ::fidl_next::Transport,
21163 <linkable::LinkInto as ::fidl_next::Method>::Request:
21164 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
21165{
21166 async fn on_one_way(
21167 handler: &mut ___H,
21168 sender: &::fidl_next::ServerSender<Self, ___T>,
21169 ordinal: u64,
21170 buffer: ___T::RecvBuffer,
21171 ) {
21172 match ordinal {
21173 ordinal => sender.close(),
21174 }
21175 }
21176
21177 async fn on_two_way(
21178 handler: &mut ___H,
21179 sender: &::fidl_next::ServerSender<Self, ___T>,
21180 ordinal: u64,
21181 buffer: ___T::RecvBuffer,
21182 responder: ::fidl_next::protocol::Responder,
21183 ) {
21184 match ordinal {
21185 6121399674497678964 => {
21186 let responder = ::fidl_next::Responder::from_untyped(responder);
21187
21188 match ::fidl_next::DecoderExt::decode(buffer) {
21189 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
21190 Err(e) => sender.close(),
21191 }
21192 }
21193
21194 ordinal => sender.close(),
21195 }
21196 }
21197}
21198
21199#[derive(Debug)]
21200pub struct FileAllocateRequest {
21201 pub offset: u64,
21202
21203 pub length: u64,
21204
21205 pub mode: crate::AllocateMode,
21206}
21207
21208impl ::fidl_next::Encodable for FileAllocateRequest {
21209 type Encoded = WireFileAllocateRequest;
21210}
21211
21212unsafe impl<___E> ::fidl_next::Encode<___E> for FileAllocateRequest
21213where
21214 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21215 ___E: ::fidl_next::fuchsia::HandleEncoder,
21216{
21217 #[inline]
21218 fn encode(
21219 self,
21220 encoder: &mut ___E,
21221 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21222 ) -> Result<(), ::fidl_next::EncodeError> {
21223 ::fidl_next::munge! {
21224 let Self::Encoded {
21225 offset,
21226 length,
21227 mode,
21228
21229 } = out;
21230 }
21231
21232 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
21233
21234 ::fidl_next::Encode::encode(self.length, encoder, length)?;
21235
21236 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
21237
21238 Ok(())
21239 }
21240}
21241
21242impl ::fidl_next::EncodableOption for FileAllocateRequest {
21243 type EncodedOption = ::fidl_next::WireBox<'static, WireFileAllocateRequest>;
21244}
21245
21246unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileAllocateRequest
21247where
21248 ___E: ::fidl_next::Encoder + ?Sized,
21249 FileAllocateRequest: ::fidl_next::Encode<___E>,
21250{
21251 #[inline]
21252 fn encode_option(
21253 this: Option<Self>,
21254 encoder: &mut ___E,
21255 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21256 ) -> Result<(), ::fidl_next::EncodeError> {
21257 if let Some(inner) = this {
21258 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21259 ::fidl_next::WireBox::encode_present(out);
21260 } else {
21261 ::fidl_next::WireBox::encode_absent(out);
21262 }
21263
21264 Ok(())
21265 }
21266}
21267
21268impl ::fidl_next::FromWire<WireFileAllocateRequest> for FileAllocateRequest {
21269 #[inline]
21270 fn from_wire(wire: WireFileAllocateRequest) -> Self {
21271 Self {
21272 offset: ::fidl_next::FromWire::from_wire(wire.offset),
21273
21274 length: ::fidl_next::FromWire::from_wire(wire.length),
21275
21276 mode: ::fidl_next::FromWire::from_wire(wire.mode),
21277 }
21278 }
21279}
21280
21281#[derive(Debug)]
21283#[repr(C)]
21284pub struct WireFileAllocateRequest {
21285 pub offset: ::fidl_next::WireU64,
21286
21287 pub length: ::fidl_next::WireU64,
21288
21289 pub mode: crate::WireAllocateMode,
21290}
21291
21292unsafe impl ::fidl_next::Wire for WireFileAllocateRequest {
21293 type Decoded<'de> = WireFileAllocateRequest;
21294
21295 #[inline]
21296 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21297 unsafe {
21298 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
21299 }
21300 }
21301}
21302
21303unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileAllocateRequest
21304where
21305 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21306 ___D: ::fidl_next::fuchsia::HandleDecoder,
21307{
21308 fn decode(
21309 slot: ::fidl_next::Slot<'_, Self>,
21310 decoder: &mut ___D,
21311 ) -> Result<(), ::fidl_next::DecodeError> {
21312 ::fidl_next::munge! {
21313 let Self {
21314 mut offset,
21315 mut length,
21316 mut mode,
21317
21318 } = slot;
21319 }
21320
21321 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
21322
21323 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
21324
21325 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
21326
21327 Ok(())
21328 }
21329}
21330
21331pub type FileAllocateResponse = ();
21332
21333pub type WireFileAllocateResponse = ();
21335
21336#[derive(Debug)]
21337pub struct FileEnableVerityRequest {
21338 pub options: crate::VerificationOptions,
21339}
21340
21341impl ::fidl_next::Encodable for FileEnableVerityRequest {
21342 type Encoded = WireFileEnableVerityRequest<'static>;
21343}
21344
21345unsafe impl<___E> ::fidl_next::Encode<___E> for FileEnableVerityRequest
21346where
21347 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21348 ___E: ::fidl_next::Encoder,
21349 ___E: ::fidl_next::fuchsia::HandleEncoder,
21350{
21351 #[inline]
21352 fn encode(
21353 self,
21354 encoder: &mut ___E,
21355 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21356 ) -> Result<(), ::fidl_next::EncodeError> {
21357 ::fidl_next::munge! {
21358 let Self::Encoded {
21359 options,
21360
21361 } = out;
21362 }
21363
21364 ::fidl_next::Encode::encode(self.options, encoder, options)?;
21365
21366 Ok(())
21367 }
21368}
21369
21370impl ::fidl_next::EncodableOption for FileEnableVerityRequest {
21371 type EncodedOption = ::fidl_next::WireBox<'static, WireFileEnableVerityRequest<'static>>;
21372}
21373
21374unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileEnableVerityRequest
21375where
21376 ___E: ::fidl_next::Encoder + ?Sized,
21377 FileEnableVerityRequest: ::fidl_next::Encode<___E>,
21378{
21379 #[inline]
21380 fn encode_option(
21381 this: Option<Self>,
21382 encoder: &mut ___E,
21383 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21384 ) -> Result<(), ::fidl_next::EncodeError> {
21385 if let Some(inner) = this {
21386 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21387 ::fidl_next::WireBox::encode_present(out);
21388 } else {
21389 ::fidl_next::WireBox::encode_absent(out);
21390 }
21391
21392 Ok(())
21393 }
21394}
21395
21396impl<'de> ::fidl_next::FromWire<WireFileEnableVerityRequest<'de>> for FileEnableVerityRequest {
21397 #[inline]
21398 fn from_wire(wire: WireFileEnableVerityRequest<'de>) -> Self {
21399 Self { options: ::fidl_next::FromWire::from_wire(wire.options) }
21400 }
21401}
21402
21403#[derive(Debug)]
21405#[repr(C)]
21406pub struct WireFileEnableVerityRequest<'de> {
21407 pub options: crate::WireVerificationOptions<'de>,
21408}
21409
21410unsafe impl ::fidl_next::Wire for WireFileEnableVerityRequest<'static> {
21411 type Decoded<'de> = WireFileEnableVerityRequest<'de>;
21412
21413 #[inline]
21414 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21415}
21416
21417unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileEnableVerityRequest<'static>
21418where
21419 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21420 ___D: ::fidl_next::Decoder,
21421 ___D: ::fidl_next::fuchsia::HandleDecoder,
21422{
21423 fn decode(
21424 slot: ::fidl_next::Slot<'_, Self>,
21425 decoder: &mut ___D,
21426 ) -> Result<(), ::fidl_next::DecodeError> {
21427 ::fidl_next::munge! {
21428 let Self {
21429 mut options,
21430
21431 } = slot;
21432 }
21433
21434 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
21435
21436 Ok(())
21437 }
21438}
21439
21440pub type FileEnableVerityResponse = ();
21441
21442pub type WireFileEnableVerityResponse = ();
21444
21445#[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"]
21447#[derive(Debug)]
21448pub struct File;
21449
21450impl ::fidl_next::Discoverable for File {
21451 const PROTOCOL_NAME: &'static str = "fuchsia.io.File";
21452}
21453
21454pub mod file {
21455 pub mod prelude {
21456 pub use crate::{File, FileClientHandler, FileServerHandler, file};
21457
21458 pub use crate::AdvisoryLockingAdvisoryLockRequest;
21459
21460 pub use crate::AdvisoryLockingAdvisoryLockResponse;
21461
21462 pub use crate::ExtendedAttributeValue;
21463
21464 pub use crate::FileAllocateRequest;
21465
21466 pub use crate::FileEnableVerityRequest;
21467
21468 pub use crate::FileGetBackingMemoryRequest;
21469
21470 pub use crate::FileInfo;
21471
21472 pub use crate::FileReadAtRequest;
21473
21474 pub use crate::FileResizeRequest;
21475
21476 pub use crate::FileSeekRequest;
21477
21478 pub use crate::FileWriteAtRequest;
21479
21480 pub use crate::FileAllocateResponse;
21481
21482 pub use crate::FileEnableVerityResponse;
21483
21484 pub use crate::FileGetBackingMemoryResponse;
21485
21486 pub use crate::FileReadAtResponse;
21487
21488 pub use crate::FileResizeResponse;
21489
21490 pub use crate::FileSeekResponse;
21491
21492 pub use crate::FileWriteAtResponse;
21493
21494 pub use crate::LinkableLinkIntoRequest;
21495
21496 pub use crate::LinkableLinkIntoResponse;
21497
21498 pub use crate::MutableNodeAttributes;
21499
21500 pub use crate::NodeAttributes2;
21501
21502 pub use crate::NodeDeprecatedCloneRequest;
21503
21504 pub use crate::NodeDeprecatedGetAttrResponse;
21505
21506 pub use crate::NodeDeprecatedGetFlagsResponse;
21507
21508 pub use crate::NodeDeprecatedSetAttrRequest;
21509
21510 pub use crate::NodeDeprecatedSetAttrResponse;
21511
21512 pub use crate::NodeDeprecatedSetFlagsRequest;
21513
21514 pub use crate::NodeDeprecatedSetFlagsResponse;
21515
21516 pub use crate::NodeGetAttributesRequest;
21517
21518 pub use crate::NodeGetExtendedAttributeRequest;
21519
21520 pub use crate::NodeListExtendedAttributesRequest;
21521
21522 pub use crate::NodeOnOpenRequest;
21523
21524 pub use crate::NodeQueryFilesystemResponse;
21525
21526 pub use crate::NodeRemoveExtendedAttributeRequest;
21527
21528 pub use crate::NodeSetExtendedAttributeRequest;
21529
21530 pub use crate::NodeSetFlagsRequest;
21531
21532 pub use crate::NodeGetFlagsResponse;
21533
21534 pub use crate::NodeRemoveExtendedAttributeResponse;
21535
21536 pub use crate::NodeSetExtendedAttributeResponse;
21537
21538 pub use crate::NodeSetFlagsResponse;
21539
21540 pub use crate::NodeSyncResponse;
21541
21542 pub use crate::NodeUpdateAttributesResponse;
21543
21544 pub use crate::ReadableReadRequest;
21545
21546 pub use crate::ReadableReadResponse;
21547
21548 pub use crate::Representation;
21549
21550 pub use crate::WritableWriteRequest;
21551
21552 pub use crate::WritableWriteResponse;
21553
21554 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
21555
21556 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
21557
21558 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
21559 }
21560
21561 pub struct AdvisoryLock;
21562
21563 impl ::fidl_next::Method for AdvisoryLock {
21564 const ORDINAL: u64 = 7992130864415541162;
21565
21566 type Protocol = crate::File;
21567
21568 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
21569
21570 type Response = ::fidl_next::WireResult<
21571 'static,
21572 crate::WireAdvisoryLockingAdvisoryLockResponse,
21573 ::fidl_next::WireI32,
21574 >;
21575 }
21576
21577 pub struct LinkInto;
21578
21579 impl ::fidl_next::Method for LinkInto {
21580 const ORDINAL: u64 = 6121399674497678964;
21581
21582 type Protocol = crate::File;
21583
21584 type Request = crate::WireLinkableLinkIntoRequest<'static>;
21585
21586 type Response = ::fidl_next::WireResult<
21587 'static,
21588 crate::WireLinkableLinkIntoResponse,
21589 ::fidl_next::WireI32,
21590 >;
21591 }
21592
21593 pub struct Clone;
21594
21595 impl ::fidl_next::Method for Clone {
21596 const ORDINAL: u64 = 2366825959783828089;
21597
21598 type Protocol = crate::File;
21599
21600 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
21601
21602 type Response = ::fidl_next::Never;
21603 }
21604
21605 pub struct Close;
21606
21607 impl ::fidl_next::Method for Close {
21608 const ORDINAL: u64 = 6540867515453498750;
21609
21610 type Protocol = crate::File;
21611
21612 type Request = ();
21613
21614 type Response = ::fidl_next::WireResult<
21615 'static,
21616 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
21617 ::fidl_next::WireI32,
21618 >;
21619 }
21620
21621 pub struct Query;
21622
21623 impl ::fidl_next::Method for Query {
21624 const ORDINAL: u64 = 2763219980499352582;
21625
21626 type Protocol = crate::File;
21627
21628 type Request = ();
21629
21630 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
21631 }
21632
21633 pub struct DeprecatedClone;
21634
21635 impl ::fidl_next::Method for DeprecatedClone {
21636 const ORDINAL: u64 = 6512600400724287855;
21637
21638 type Protocol = crate::File;
21639
21640 type Request = crate::WireNodeDeprecatedCloneRequest;
21641
21642 type Response = ::fidl_next::Never;
21643 }
21644
21645 pub struct OnOpen;
21646
21647 impl ::fidl_next::Method for OnOpen {
21648 const ORDINAL: u64 = 9207534335756671346;
21649
21650 type Protocol = crate::File;
21651
21652 type Request = ::fidl_next::Never;
21653
21654 type Response = crate::WireNodeOnOpenRequest<'static>;
21655 }
21656
21657 pub struct DeprecatedGetAttr;
21658
21659 impl ::fidl_next::Method for DeprecatedGetAttr {
21660 const ORDINAL: u64 = 8689798978500614909;
21661
21662 type Protocol = crate::File;
21663
21664 type Request = ();
21665
21666 type Response = crate::WireNodeDeprecatedGetAttrResponse;
21667 }
21668
21669 pub struct DeprecatedSetAttr;
21670
21671 impl ::fidl_next::Method for DeprecatedSetAttr {
21672 const ORDINAL: u64 = 4721673413776871238;
21673
21674 type Protocol = crate::File;
21675
21676 type Request = crate::WireNodeDeprecatedSetAttrRequest;
21677
21678 type Response = crate::WireNodeDeprecatedSetAttrResponse;
21679 }
21680
21681 pub struct DeprecatedGetFlags;
21682
21683 impl ::fidl_next::Method for DeprecatedGetFlags {
21684 const ORDINAL: u64 = 6595803110182632097;
21685
21686 type Protocol = crate::File;
21687
21688 type Request = ();
21689
21690 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
21691 }
21692
21693 pub struct DeprecatedSetFlags;
21694
21695 impl ::fidl_next::Method for DeprecatedSetFlags {
21696 const ORDINAL: u64 = 5950864159036794675;
21697
21698 type Protocol = crate::File;
21699
21700 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
21701
21702 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
21703 }
21704
21705 pub struct GetFlags;
21706
21707 impl ::fidl_next::Method for GetFlags {
21708 const ORDINAL: u64 = 105530239381466147;
21709
21710 type Protocol = crate::File;
21711
21712 type Request = ();
21713
21714 type Response = ::fidl_next::WireFlexibleResult<
21715 'static,
21716 crate::WireNodeGetFlagsResponse,
21717 ::fidl_next::WireI32,
21718 >;
21719 }
21720
21721 pub struct SetFlags;
21722
21723 impl ::fidl_next::Method for SetFlags {
21724 const ORDINAL: u64 = 6172186066099445416;
21725
21726 type Protocol = crate::File;
21727
21728 type Request = crate::WireNodeSetFlagsRequest;
21729
21730 type Response = ::fidl_next::WireFlexibleResult<
21731 'static,
21732 crate::WireNodeSetFlagsResponse,
21733 ::fidl_next::WireI32,
21734 >;
21735 }
21736
21737 pub struct QueryFilesystem;
21738
21739 impl ::fidl_next::Method for QueryFilesystem {
21740 const ORDINAL: u64 = 8013111122914313744;
21741
21742 type Protocol = crate::File;
21743
21744 type Request = ();
21745
21746 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
21747 }
21748
21749 pub struct OnRepresentation;
21750
21751 impl ::fidl_next::Method for OnRepresentation {
21752 const ORDINAL: u64 = 6679970090861613324;
21753
21754 type Protocol = crate::File;
21755
21756 type Request = ::fidl_next::Never;
21757
21758 type Response = crate::WireRepresentation<'static>;
21759 }
21760
21761 pub struct GetAttributes;
21762
21763 impl ::fidl_next::Method for GetAttributes {
21764 const ORDINAL: u64 = 4414537700416816443;
21765
21766 type Protocol = crate::File;
21767
21768 type Request = crate::WireNodeGetAttributesRequest;
21769
21770 type Response = ::fidl_next::WireResult<
21771 'static,
21772 crate::WireNodeAttributes2<'static>,
21773 ::fidl_next::WireI32,
21774 >;
21775 }
21776
21777 pub struct UpdateAttributes;
21778
21779 impl ::fidl_next::Method for UpdateAttributes {
21780 const ORDINAL: u64 = 3677402239314018056;
21781
21782 type Protocol = crate::File;
21783
21784 type Request = crate::WireMutableNodeAttributes<'static>;
21785
21786 type Response = ::fidl_next::WireResult<
21787 'static,
21788 crate::WireNodeUpdateAttributesResponse,
21789 ::fidl_next::WireI32,
21790 >;
21791 }
21792
21793 pub struct Sync;
21794
21795 impl ::fidl_next::Method for Sync {
21796 const ORDINAL: u64 = 3196473584242777161;
21797
21798 type Protocol = crate::File;
21799
21800 type Request = ();
21801
21802 type Response =
21803 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
21804 }
21805
21806 pub struct ListExtendedAttributes;
21807
21808 impl ::fidl_next::Method for ListExtendedAttributes {
21809 const ORDINAL: u64 = 5431626189872037072;
21810
21811 type Protocol = crate::File;
21812
21813 type Request = crate::WireNodeListExtendedAttributesRequest;
21814
21815 type Response = ::fidl_next::Never;
21816 }
21817
21818 pub struct GetExtendedAttribute;
21819
21820 impl ::fidl_next::Method for GetExtendedAttribute {
21821 const ORDINAL: u64 = 5043930208506967771;
21822
21823 type Protocol = crate::File;
21824
21825 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
21826
21827 type Response = ::fidl_next::WireResult<
21828 'static,
21829 crate::WireExtendedAttributeValue<'static>,
21830 ::fidl_next::WireI32,
21831 >;
21832 }
21833
21834 pub struct SetExtendedAttribute;
21835
21836 impl ::fidl_next::Method for SetExtendedAttribute {
21837 const ORDINAL: u64 = 5374223046099989052;
21838
21839 type Protocol = crate::File;
21840
21841 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
21842
21843 type Response = ::fidl_next::WireResult<
21844 'static,
21845 crate::WireNodeSetExtendedAttributeResponse,
21846 ::fidl_next::WireI32,
21847 >;
21848 }
21849
21850 pub struct RemoveExtendedAttribute;
21851
21852 impl ::fidl_next::Method for RemoveExtendedAttribute {
21853 const ORDINAL: u64 = 8794297771444732717;
21854
21855 type Protocol = crate::File;
21856
21857 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
21858
21859 type Response = ::fidl_next::WireResult<
21860 'static,
21861 crate::WireNodeRemoveExtendedAttributeResponse,
21862 ::fidl_next::WireI32,
21863 >;
21864 }
21865
21866 pub struct Read;
21867
21868 impl ::fidl_next::Method for Read {
21869 const ORDINAL: u64 = 395825947633028830;
21870
21871 type Protocol = crate::File;
21872
21873 type Request = crate::WireReadableReadRequest;
21874
21875 type Response = ::fidl_next::WireResult<
21876 'static,
21877 crate::WireReadableReadResponse<'static>,
21878 ::fidl_next::WireI32,
21879 >;
21880 }
21881
21882 pub struct Write;
21883
21884 impl ::fidl_next::Method for Write {
21885 const ORDINAL: u64 = 7651971425397809026;
21886
21887 type Protocol = crate::File;
21888
21889 type Request = crate::WireWritableWriteRequest<'static>;
21890
21891 type Response = ::fidl_next::WireResult<
21892 'static,
21893 crate::WireWritableWriteResponse,
21894 ::fidl_next::WireI32,
21895 >;
21896 }
21897
21898 pub struct Describe;
21899
21900 impl ::fidl_next::Method for Describe {
21901 const ORDINAL: u64 = 7545125870053689020;
21902
21903 type Protocol = crate::File;
21904
21905 type Request = ();
21906
21907 type Response = crate::WireFileInfo<'static>;
21908 }
21909
21910 pub struct Seek;
21911
21912 impl ::fidl_next::Method for Seek {
21913 const ORDINAL: u64 = 8649041485622956551;
21914
21915 type Protocol = crate::File;
21916
21917 type Request = crate::WireFileSeekRequest;
21918
21919 type Response =
21920 ::fidl_next::WireResult<'static, crate::WireFileSeekResponse, ::fidl_next::WireI32>;
21921 }
21922
21923 pub struct ReadAt;
21924
21925 impl ::fidl_next::Method for ReadAt {
21926 const ORDINAL: u64 = 1587416148701180478;
21927
21928 type Protocol = crate::File;
21929
21930 type Request = crate::WireFileReadAtRequest;
21931
21932 type Response = ::fidl_next::WireResult<
21933 'static,
21934 crate::WireFileReadAtResponse<'static>,
21935 ::fidl_next::WireI32,
21936 >;
21937 }
21938
21939 pub struct WriteAt;
21940
21941 impl ::fidl_next::Method for WriteAt {
21942 const ORDINAL: u64 = 8736683935131400491;
21943
21944 type Protocol = crate::File;
21945
21946 type Request = crate::WireFileWriteAtRequest<'static>;
21947
21948 type Response =
21949 ::fidl_next::WireResult<'static, crate::WireFileWriteAtResponse, ::fidl_next::WireI32>;
21950 }
21951
21952 pub struct Resize;
21953
21954 impl ::fidl_next::Method for Resize {
21955 const ORDINAL: u64 = 3134648685270758458;
21956
21957 type Protocol = crate::File;
21958
21959 type Request = crate::WireFileResizeRequest;
21960
21961 type Response =
21962 ::fidl_next::WireResult<'static, crate::WireFileResizeResponse, ::fidl_next::WireI32>;
21963 }
21964
21965 pub struct GetBackingMemory;
21966
21967 impl ::fidl_next::Method for GetBackingMemory {
21968 const ORDINAL: u64 = 46911652864194091;
21969
21970 type Protocol = crate::File;
21971
21972 type Request = crate::WireFileGetBackingMemoryRequest;
21973
21974 type Response = ::fidl_next::WireResult<
21975 'static,
21976 crate::WireFileGetBackingMemoryResponse,
21977 ::fidl_next::WireI32,
21978 >;
21979 }
21980
21981 pub struct Allocate;
21982
21983 impl ::fidl_next::Method for Allocate {
21984 const ORDINAL: u64 = 8645235848064269614;
21985
21986 type Protocol = crate::File;
21987
21988 type Request = crate::WireFileAllocateRequest;
21989
21990 type Response = ::fidl_next::WireFlexibleResult<
21991 'static,
21992 crate::WireFileAllocateResponse,
21993 ::fidl_next::WireI32,
21994 >;
21995 }
21996
21997 pub struct EnableVerity;
21998
21999 impl ::fidl_next::Method for EnableVerity {
22000 const ORDINAL: u64 = 3189145313204943035;
22001
22002 type Protocol = crate::File;
22003
22004 type Request = crate::WireFileEnableVerityRequest<'static>;
22005
22006 type Response = ::fidl_next::WireFlexibleResult<
22007 'static,
22008 crate::WireFileEnableVerityResponse,
22009 ::fidl_next::WireI32,
22010 >;
22011 }
22012
22013 mod ___detail {
22014
22015 pub struct AdvisoryLock<T0> {
22016 request: T0,
22017 }
22018
22019 impl<T0> ::fidl_next::Encodable for AdvisoryLock<T0>
22020 where
22021 T0: ::fidl_next::Encodable<Encoded = crate::WireAdvisoryLockRequest<'static>>,
22022 {
22023 type Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>;
22024 }
22025
22026 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AdvisoryLock<T0>
22027 where
22028 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22029 ___E: ::fidl_next::Encoder,
22030 T0: ::fidl_next::Encode<___E, Encoded = crate::WireAdvisoryLockRequest<'static>>,
22031 {
22032 #[inline]
22033 fn encode(
22034 self,
22035 encoder: &mut ___E,
22036 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22037 ) -> Result<(), ::fidl_next::EncodeError> {
22038 ::fidl_next::munge! {
22039 let Self::Encoded {
22040 request,
22041
22042 } = out;
22043 }
22044
22045 ::fidl_next::Encode::encode(self.request, encoder, request)?;
22046
22047 Ok(())
22048 }
22049 }
22050
22051 pub struct LinkInto<T0, T1> {
22052 dst_parent_token: T0,
22053
22054 dst: T1,
22055 }
22056
22057 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
22058 where
22059 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
22060 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
22061 {
22062 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
22063 }
22064
22065 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
22066 where
22067 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22068 ___E: ::fidl_next::Encoder,
22069 ___E: ::fidl_next::fuchsia::HandleEncoder,
22070 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
22071 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
22072 {
22073 #[inline]
22074 fn encode(
22075 self,
22076 encoder: &mut ___E,
22077 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22078 ) -> Result<(), ::fidl_next::EncodeError> {
22079 ::fidl_next::munge! {
22080 let Self::Encoded {
22081 dst_parent_token,
22082 dst,
22083
22084 } = out;
22085 }
22086
22087 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
22088
22089 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
22090
22091 Ok(())
22092 }
22093 }
22094
22095 pub struct Clone<T0> {
22096 request: T0,
22097 }
22098
22099 impl<T0> ::fidl_next::Encodable for Clone<T0>
22100 where
22101 T0: ::fidl_next::Encodable<
22102 Encoded = ::fidl_next::ServerEnd<
22103 ::fidl_next_fuchsia_unknown::Cloneable,
22104 ::fidl_next::fuchsia::WireChannel,
22105 >,
22106 >,
22107 {
22108 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
22109 }
22110
22111 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
22112 where
22113 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22114 ___E: ::fidl_next::fuchsia::HandleEncoder,
22115 T0: ::fidl_next::Encode<
22116 ___E,
22117 Encoded = ::fidl_next::ServerEnd<
22118 ::fidl_next_fuchsia_unknown::Cloneable,
22119 ::fidl_next::fuchsia::WireChannel,
22120 >,
22121 >,
22122 {
22123 #[inline]
22124 fn encode(
22125 self,
22126 encoder: &mut ___E,
22127 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22128 ) -> Result<(), ::fidl_next::EncodeError> {
22129 ::fidl_next::munge! {
22130 let Self::Encoded {
22131 request,
22132
22133 } = out;
22134 }
22135
22136 ::fidl_next::Encode::encode(self.request, encoder, request)?;
22137
22138 Ok(())
22139 }
22140 }
22141
22142 pub struct DeprecatedClone<T0, T1> {
22143 flags: T0,
22144
22145 object: T1,
22146 }
22147
22148 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
22149 where
22150 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
22151 T1: ::fidl_next::Encodable<
22152 Encoded = ::fidl_next::ServerEnd<
22153 crate::Node,
22154 ::fidl_next::fuchsia::WireChannel,
22155 >,
22156 >,
22157 {
22158 type Encoded = crate::WireNodeDeprecatedCloneRequest;
22159 }
22160
22161 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
22162 where
22163 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22164 ___E: ::fidl_next::fuchsia::HandleEncoder,
22165 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
22166 T1: ::fidl_next::Encode<
22167 ___E,
22168 Encoded = ::fidl_next::ServerEnd<
22169 crate::Node,
22170 ::fidl_next::fuchsia::WireChannel,
22171 >,
22172 >,
22173 {
22174 #[inline]
22175 fn encode(
22176 self,
22177 encoder: &mut ___E,
22178 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22179 ) -> Result<(), ::fidl_next::EncodeError> {
22180 ::fidl_next::munge! {
22181 let Self::Encoded {
22182 flags,
22183 object,
22184
22185 } = out;
22186 }
22187
22188 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22189
22190 ::fidl_next::Encode::encode(self.object, encoder, object)?;
22191
22192 Ok(())
22193 }
22194 }
22195
22196 pub struct OnOpen<T0, T1> {
22197 s: T0,
22198
22199 info: T1,
22200 }
22201
22202 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
22203 where
22204 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
22205 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
22206 {
22207 type Encoded = crate::WireNodeOnOpenRequest<'static>;
22208 }
22209
22210 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
22211 where
22212 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22213 ___E: ::fidl_next::Encoder,
22214 ___E: ::fidl_next::fuchsia::HandleEncoder,
22215 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
22216 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
22217 {
22218 #[inline]
22219 fn encode(
22220 self,
22221 encoder: &mut ___E,
22222 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22223 ) -> Result<(), ::fidl_next::EncodeError> {
22224 ::fidl_next::munge! {
22225 let Self::Encoded {
22226 s,
22227 info,
22228
22229 } = out;
22230 }
22231
22232 ::fidl_next::Encode::encode(self.s, encoder, s)?;
22233
22234 ::fidl_next::Encode::encode(self.info, encoder, info)?;
22235
22236 Ok(())
22237 }
22238 }
22239
22240 pub struct DeprecatedSetAttr<T0, T1> {
22241 flags: T0,
22242
22243 attributes: T1,
22244 }
22245
22246 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
22247 where
22248 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
22249 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
22250 {
22251 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
22252 }
22253
22254 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
22255 where
22256 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22257 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
22258 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
22259 {
22260 #[inline]
22261 fn encode(
22262 self,
22263 encoder: &mut ___E,
22264 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22265 ) -> Result<(), ::fidl_next::EncodeError> {
22266 ::fidl_next::munge! {
22267 let Self::Encoded {
22268 flags,
22269 attributes,
22270
22271 } = out;
22272 }
22273
22274 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22275
22276 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
22277
22278 Ok(())
22279 }
22280 }
22281
22282 pub struct DeprecatedSetFlags<T0> {
22283 flags: T0,
22284 }
22285
22286 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
22287 where
22288 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
22289 {
22290 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
22291 }
22292
22293 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
22294 where
22295 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22296 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
22297 {
22298 #[inline]
22299 fn encode(
22300 self,
22301 encoder: &mut ___E,
22302 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22303 ) -> Result<(), ::fidl_next::EncodeError> {
22304 ::fidl_next::munge! {
22305 let Self::Encoded {
22306 flags,
22307
22308 } = out;
22309 }
22310
22311 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22312
22313 Ok(())
22314 }
22315 }
22316
22317 pub struct SetFlags<T0> {
22318 flags: T0,
22319 }
22320
22321 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
22322 where
22323 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
22324 {
22325 type Encoded = crate::WireNodeSetFlagsRequest;
22326 }
22327
22328 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
22329 where
22330 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22331 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
22332 {
22333 #[inline]
22334 fn encode(
22335 self,
22336 encoder: &mut ___E,
22337 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22338 ) -> Result<(), ::fidl_next::EncodeError> {
22339 ::fidl_next::munge! {
22340 let Self::Encoded {
22341 flags,
22342
22343 } = out;
22344 }
22345
22346 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22347
22348 Ok(())
22349 }
22350 }
22351
22352 pub struct GetAttributes<T0> {
22353 query: T0,
22354 }
22355
22356 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
22357 where
22358 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
22359 {
22360 type Encoded = crate::WireNodeGetAttributesRequest;
22361 }
22362
22363 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
22364 where
22365 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22366 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
22367 {
22368 #[inline]
22369 fn encode(
22370 self,
22371 encoder: &mut ___E,
22372 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22373 ) -> Result<(), ::fidl_next::EncodeError> {
22374 ::fidl_next::munge! {
22375 let Self::Encoded {
22376 query,
22377
22378 } = out;
22379 }
22380
22381 ::fidl_next::Encode::encode(self.query, encoder, query)?;
22382
22383 Ok(())
22384 }
22385 }
22386
22387 pub struct ListExtendedAttributes<T0> {
22388 iterator: T0,
22389 }
22390
22391 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
22392 where
22393 T0: ::fidl_next::Encodable<
22394 Encoded = ::fidl_next::ServerEnd<
22395 crate::ExtendedAttributeIterator,
22396 ::fidl_next::fuchsia::WireChannel,
22397 >,
22398 >,
22399 {
22400 type Encoded = crate::WireNodeListExtendedAttributesRequest;
22401 }
22402
22403 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
22404 where
22405 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22406 ___E: ::fidl_next::fuchsia::HandleEncoder,
22407 T0: ::fidl_next::Encode<
22408 ___E,
22409 Encoded = ::fidl_next::ServerEnd<
22410 crate::ExtendedAttributeIterator,
22411 ::fidl_next::fuchsia::WireChannel,
22412 >,
22413 >,
22414 {
22415 #[inline]
22416 fn encode(
22417 self,
22418 encoder: &mut ___E,
22419 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22420 ) -> Result<(), ::fidl_next::EncodeError> {
22421 ::fidl_next::munge! {
22422 let Self::Encoded {
22423 iterator,
22424
22425 } = out;
22426 }
22427
22428 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
22429
22430 Ok(())
22431 }
22432 }
22433
22434 pub struct GetExtendedAttribute<T0> {
22435 name: T0,
22436 }
22437
22438 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
22439 where
22440 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
22441 {
22442 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
22443 }
22444
22445 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
22446 where
22447 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22448 ___E: ::fidl_next::Encoder,
22449 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
22450 {
22451 #[inline]
22452 fn encode(
22453 self,
22454 encoder: &mut ___E,
22455 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22456 ) -> Result<(), ::fidl_next::EncodeError> {
22457 ::fidl_next::munge! {
22458 let Self::Encoded {
22459 name,
22460
22461 } = out;
22462 }
22463
22464 ::fidl_next::Encode::encode(self.name, encoder, name)?;
22465
22466 Ok(())
22467 }
22468 }
22469
22470 pub struct SetExtendedAttribute<T0, T1, T2> {
22471 name: T0,
22472
22473 value: T1,
22474
22475 mode: T2,
22476 }
22477
22478 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
22479 where
22480 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
22481 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
22482 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
22483 {
22484 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
22485 }
22486
22487 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
22488 where
22489 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22490 ___E: ::fidl_next::Encoder,
22491 ___E: ::fidl_next::fuchsia::HandleEncoder,
22492 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
22493 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
22494 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
22495 {
22496 #[inline]
22497 fn encode(
22498 self,
22499 encoder: &mut ___E,
22500 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22501 ) -> Result<(), ::fidl_next::EncodeError> {
22502 ::fidl_next::munge! {
22503 let Self::Encoded {
22504 name,
22505 value,
22506 mode,
22507
22508 } = out;
22509 }
22510
22511 ::fidl_next::Encode::encode(self.name, encoder, name)?;
22512
22513 ::fidl_next::Encode::encode(self.value, encoder, value)?;
22514
22515 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
22516
22517 Ok(())
22518 }
22519 }
22520
22521 pub struct RemoveExtendedAttribute<T0> {
22522 name: T0,
22523 }
22524
22525 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
22526 where
22527 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
22528 {
22529 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
22530 }
22531
22532 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
22533 where
22534 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22535 ___E: ::fidl_next::Encoder,
22536 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
22537 {
22538 #[inline]
22539 fn encode(
22540 self,
22541 encoder: &mut ___E,
22542 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22543 ) -> Result<(), ::fidl_next::EncodeError> {
22544 ::fidl_next::munge! {
22545 let Self::Encoded {
22546 name,
22547
22548 } = out;
22549 }
22550
22551 ::fidl_next::Encode::encode(self.name, encoder, name)?;
22552
22553 Ok(())
22554 }
22555 }
22556
22557 pub struct Read<T0> {
22558 count: T0,
22559 }
22560
22561 impl<T0> ::fidl_next::Encodable for Read<T0>
22562 where
22563 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22564 {
22565 type Encoded = crate::WireReadableReadRequest;
22566 }
22567
22568 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Read<T0>
22569 where
22570 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22571 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22572 {
22573 #[inline]
22574 fn encode(
22575 self,
22576 encoder: &mut ___E,
22577 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22578 ) -> Result<(), ::fidl_next::EncodeError> {
22579 ::fidl_next::munge! {
22580 let Self::Encoded {
22581 count,
22582
22583 } = out;
22584 }
22585
22586 ::fidl_next::Encode::encode(self.count, encoder, count)?;
22587
22588 Ok(())
22589 }
22590 }
22591
22592 pub struct Write<T0> {
22593 data: T0,
22594 }
22595
22596 impl<T0> ::fidl_next::Encodable for Write<T0>
22597 where
22598 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
22599 {
22600 type Encoded = crate::WireWritableWriteRequest<'static>;
22601 }
22602
22603 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Write<T0>
22604 where
22605 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22606 ___E: ::fidl_next::Encoder,
22607 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
22608 {
22609 #[inline]
22610 fn encode(
22611 self,
22612 encoder: &mut ___E,
22613 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22614 ) -> Result<(), ::fidl_next::EncodeError> {
22615 ::fidl_next::munge! {
22616 let Self::Encoded {
22617 data,
22618
22619 } = out;
22620 }
22621
22622 ::fidl_next::Encode::encode(self.data, encoder, data)?;
22623
22624 Ok(())
22625 }
22626 }
22627
22628 pub struct Seek<T0, T1> {
22629 origin: T0,
22630
22631 offset: T1,
22632 }
22633
22634 impl<T0, T1> ::fidl_next::Encodable for Seek<T0, T1>
22635 where
22636 T0: ::fidl_next::Encodable<Encoded = crate::WireSeekOrigin>,
22637 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI64>,
22638 {
22639 type Encoded = crate::WireFileSeekRequest;
22640 }
22641
22642 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Seek<T0, T1>
22643 where
22644 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22645 T0: ::fidl_next::Encode<___E, Encoded = crate::WireSeekOrigin>,
22646 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI64>,
22647 {
22648 #[inline]
22649 fn encode(
22650 self,
22651 encoder: &mut ___E,
22652 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22653 ) -> Result<(), ::fidl_next::EncodeError> {
22654 ::fidl_next::munge! {
22655 let Self::Encoded {
22656 origin,
22657 offset,
22658
22659 } = out;
22660 }
22661
22662 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
22663
22664 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
22665
22666 Ok(())
22667 }
22668 }
22669
22670 pub struct ReadAt<T0, T1> {
22671 count: T0,
22672
22673 offset: T1,
22674 }
22675
22676 impl<T0, T1> ::fidl_next::Encodable for ReadAt<T0, T1>
22677 where
22678 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22679 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22680 {
22681 type Encoded = crate::WireFileReadAtRequest;
22682 }
22683
22684 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ReadAt<T0, T1>
22685 where
22686 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22687 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22688 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
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 count,
22699 offset,
22700
22701 } = out;
22702 }
22703
22704 ::fidl_next::Encode::encode(self.count, encoder, count)?;
22705
22706 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
22707
22708 Ok(())
22709 }
22710 }
22711
22712 pub struct WriteAt<T0, T1> {
22713 data: T0,
22714
22715 offset: T1,
22716 }
22717
22718 impl<T0, T1> ::fidl_next::Encodable for WriteAt<T0, T1>
22719 where
22720 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
22721 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22722 {
22723 type Encoded = crate::WireFileWriteAtRequest<'static>;
22724 }
22725
22726 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for WriteAt<T0, T1>
22727 where
22728 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22729 ___E: ::fidl_next::Encoder,
22730 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
22731 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22732 {
22733 #[inline]
22734 fn encode(
22735 self,
22736 encoder: &mut ___E,
22737 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22738 ) -> Result<(), ::fidl_next::EncodeError> {
22739 ::fidl_next::munge! {
22740 let Self::Encoded {
22741 data,
22742 offset,
22743
22744 } = out;
22745 }
22746
22747 ::fidl_next::Encode::encode(self.data, encoder, data)?;
22748
22749 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
22750
22751 Ok(())
22752 }
22753 }
22754
22755 pub struct Resize<T0> {
22756 length: T0,
22757 }
22758
22759 impl<T0> ::fidl_next::Encodable for Resize<T0>
22760 where
22761 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22762 {
22763 type Encoded = crate::WireFileResizeRequest;
22764 }
22765
22766 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Resize<T0>
22767 where
22768 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22769 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22770 {
22771 #[inline]
22772 fn encode(
22773 self,
22774 encoder: &mut ___E,
22775 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22776 ) -> Result<(), ::fidl_next::EncodeError> {
22777 ::fidl_next::munge! {
22778 let Self::Encoded {
22779 length,
22780
22781 } = out;
22782 }
22783
22784 ::fidl_next::Encode::encode(self.length, encoder, length)?;
22785
22786 Ok(())
22787 }
22788 }
22789
22790 pub struct GetBackingMemory<T0> {
22791 flags: T0,
22792 }
22793
22794 impl<T0> ::fidl_next::Encodable for GetBackingMemory<T0>
22795 where
22796 T0: ::fidl_next::Encodable<Encoded = crate::WireVmoFlags>,
22797 {
22798 type Encoded = crate::WireFileGetBackingMemoryRequest;
22799 }
22800
22801 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetBackingMemory<T0>
22802 where
22803 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22804 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVmoFlags>,
22805 {
22806 #[inline]
22807 fn encode(
22808 self,
22809 encoder: &mut ___E,
22810 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22811 ) -> Result<(), ::fidl_next::EncodeError> {
22812 ::fidl_next::munge! {
22813 let Self::Encoded {
22814 flags,
22815
22816 } = out;
22817 }
22818
22819 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
22820
22821 Ok(())
22822 }
22823 }
22824
22825 pub struct Allocate<T0, T1, T2> {
22826 offset: T0,
22827
22828 length: T1,
22829
22830 mode: T2,
22831 }
22832
22833 impl<T0, T1, T2> ::fidl_next::Encodable for Allocate<T0, T1, T2>
22834 where
22835 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22836 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
22837 T2: ::fidl_next::Encodable<Encoded = crate::WireAllocateMode>,
22838 {
22839 type Encoded = crate::WireFileAllocateRequest;
22840 }
22841
22842 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for Allocate<T0, T1, T2>
22843 where
22844 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22845 ___E: ::fidl_next::fuchsia::HandleEncoder,
22846 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22847 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
22848 T2: ::fidl_next::Encode<___E, Encoded = crate::WireAllocateMode>,
22849 {
22850 #[inline]
22851 fn encode(
22852 self,
22853 encoder: &mut ___E,
22854 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22855 ) -> Result<(), ::fidl_next::EncodeError> {
22856 ::fidl_next::munge! {
22857 let Self::Encoded {
22858 offset,
22859 length,
22860 mode,
22861
22862 } = out;
22863 }
22864
22865 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
22866
22867 ::fidl_next::Encode::encode(self.length, encoder, length)?;
22868
22869 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
22870
22871 Ok(())
22872 }
22873 }
22874
22875 pub struct EnableVerity<T0> {
22876 options: T0,
22877 }
22878
22879 impl<T0> ::fidl_next::Encodable for EnableVerity<T0>
22880 where
22881 T0: ::fidl_next::Encodable<Encoded = crate::WireVerificationOptions<'static>>,
22882 {
22883 type Encoded = crate::WireFileEnableVerityRequest<'static>;
22884 }
22885
22886 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for EnableVerity<T0>
22887 where
22888 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22889 ___E: ::fidl_next::Encoder,
22890 ___E: ::fidl_next::fuchsia::HandleEncoder,
22891 T0: ::fidl_next::Encode<___E, Encoded = crate::WireVerificationOptions<'static>>,
22892 {
22893 #[inline]
22894 fn encode(
22895 self,
22896 encoder: &mut ___E,
22897 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22898 ) -> Result<(), ::fidl_next::EncodeError> {
22899 ::fidl_next::munge! {
22900 let Self::Encoded {
22901 options,
22902
22903 } = out;
22904 }
22905
22906 ::fidl_next::Encode::encode(self.options, encoder, options)?;
22907
22908 Ok(())
22909 }
22910 }
22911
22912 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::File
22913 where
22914 ___T: ::fidl_next::Transport,
22915 {
22916 type ClientSender = FileClientSender<___T>;
22917 type ServerSender = FileServerSender<___T>;
22918 }
22919
22920 #[repr(transparent)]
22922 pub struct FileClientSender<___T: ::fidl_next::Transport> {
22923 #[allow(dead_code)]
22924 sender: ::fidl_next::protocol::ClientSender<___T>,
22925 }
22926
22927 impl<___T> FileClientSender<___T>
22928 where
22929 ___T: ::fidl_next::Transport,
22930 {
22931 #[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"]
22932 pub fn advisory_lock(
22933 &self,
22934
22935 request: impl ::fidl_next::Encode<
22936 <___T as ::fidl_next::Transport>::SendBuffer,
22937 Encoded = crate::WireAdvisoryLockRequest<'static>,
22938 >,
22939 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
22940 where
22941 <___T as ::fidl_next::Transport>::SendBuffer:
22942 ::fidl_next::encoder::InternalHandleEncoder,
22943 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
22944 {
22945 self.advisory_lock_with(AdvisoryLock { request })
22946 }
22947
22948 #[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"]
22949 pub fn advisory_lock_with<___R>(
22950 &self,
22951 request: ___R,
22952 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
22953 where
22954 ___R: ::fidl_next::Encode<
22955 <___T as ::fidl_next::Transport>::SendBuffer,
22956 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest<'static>,
22957 >,
22958 {
22959 ::fidl_next::TwoWayFuture::from_untyped(
22960 self.sender.send_two_way(7992130864415541162, request),
22961 )
22962 }
22963
22964 #[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"]
22965 pub fn link_into(
22966 &self,
22967
22968 dst_parent_token: impl ::fidl_next::Encode<
22969 <___T as ::fidl_next::Transport>::SendBuffer,
22970 Encoded = ::fidl_next::fuchsia::WireEvent,
22971 >,
22972
22973 dst: impl ::fidl_next::Encode<
22974 <___T as ::fidl_next::Transport>::SendBuffer,
22975 Encoded = ::fidl_next::WireString<'static>,
22976 >,
22977 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
22978 where
22979 <___T as ::fidl_next::Transport>::SendBuffer:
22980 ::fidl_next::encoder::InternalHandleEncoder,
22981 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
22982 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
22983 {
22984 self.link_into_with(LinkInto { dst_parent_token, dst })
22985 }
22986
22987 #[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"]
22988 pub fn link_into_with<___R>(
22989 &self,
22990 request: ___R,
22991 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
22992 where
22993 ___R: ::fidl_next::Encode<
22994 <___T as ::fidl_next::Transport>::SendBuffer,
22995 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
22996 >,
22997 {
22998 ::fidl_next::TwoWayFuture::from_untyped(
22999 self.sender.send_two_way(6121399674497678964, request),
23000 )
23001 }
23002
23003 pub fn clone(
23004 &self,
23005
23006 request: impl ::fidl_next::Encode<
23007 <___T as ::fidl_next::Transport>::SendBuffer,
23008 Encoded = ::fidl_next::ServerEnd<
23009 ::fidl_next_fuchsia_unknown::Cloneable,
23010 ::fidl_next::fuchsia::WireChannel,
23011 >,
23012 >,
23013 ) -> ::fidl_next::SendFuture<'_, ___T>
23014 where
23015 <___T as ::fidl_next::Transport>::SendBuffer:
23016 ::fidl_next::encoder::InternalHandleEncoder,
23017 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23018 {
23019 self.clone_with(Clone { request })
23020 }
23021
23022 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
23023 where
23024 ___R: ::fidl_next::Encode<
23025 <___T as ::fidl_next::Transport>::SendBuffer,
23026 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
23027 >,
23028 {
23029 ::fidl_next::SendFuture::from_untyped(
23030 self.sender.send_one_way(2366825959783828089, request),
23031 )
23032 }
23033
23034 #[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"]
23035 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
23036 ::fidl_next::TwoWayFuture::from_untyped(
23037 self.sender.send_two_way(6540867515453498750, ()),
23038 )
23039 }
23040
23041 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
23042 ::fidl_next::TwoWayFuture::from_untyped(
23043 self.sender.send_two_way(2763219980499352582, ()),
23044 )
23045 }
23046
23047 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23048 pub fn deprecated_clone(
23049 &self,
23050
23051 flags: impl ::fidl_next::Encode<
23052 <___T as ::fidl_next::Transport>::SendBuffer,
23053 Encoded = crate::WireOpenFlags,
23054 >,
23055
23056 object: impl ::fidl_next::Encode<
23057 <___T as ::fidl_next::Transport>::SendBuffer,
23058 Encoded = ::fidl_next::ServerEnd<
23059 crate::Node,
23060 ::fidl_next::fuchsia::WireChannel,
23061 >,
23062 >,
23063 ) -> ::fidl_next::SendFuture<'_, ___T>
23064 where
23065 <___T as ::fidl_next::Transport>::SendBuffer:
23066 ::fidl_next::encoder::InternalHandleEncoder,
23067 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23068 {
23069 self.deprecated_clone_with(DeprecatedClone { flags, object })
23070 }
23071
23072 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23073 pub fn deprecated_clone_with<___R>(
23074 &self,
23075 request: ___R,
23076 ) -> ::fidl_next::SendFuture<'_, ___T>
23077 where
23078 ___R: ::fidl_next::Encode<
23079 <___T as ::fidl_next::Transport>::SendBuffer,
23080 Encoded = crate::WireNodeDeprecatedCloneRequest,
23081 >,
23082 {
23083 ::fidl_next::SendFuture::from_untyped(
23084 self.sender.send_one_way(6512600400724287855, request),
23085 )
23086 }
23087
23088 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
23089 pub fn deprecated_get_attr(
23090 &self,
23091 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
23092 ::fidl_next::TwoWayFuture::from_untyped(
23093 self.sender.send_two_way(8689798978500614909, ()),
23094 )
23095 }
23096
23097 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
23098 pub fn deprecated_set_attr(
23099 &self,
23100
23101 flags: impl ::fidl_next::Encode<
23102 <___T as ::fidl_next::Transport>::SendBuffer,
23103 Encoded = crate::WireNodeAttributeFlags,
23104 >,
23105
23106 attributes: impl ::fidl_next::Encode<
23107 <___T as ::fidl_next::Transport>::SendBuffer,
23108 Encoded = crate::WireNodeAttributes,
23109 >,
23110 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
23111 where
23112 <___T as ::fidl_next::Transport>::SendBuffer:
23113 ::fidl_next::encoder::InternalHandleEncoder,
23114 {
23115 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
23116 }
23117
23118 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
23119 pub fn deprecated_set_attr_with<___R>(
23120 &self,
23121 request: ___R,
23122 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
23123 where
23124 ___R: ::fidl_next::Encode<
23125 <___T as ::fidl_next::Transport>::SendBuffer,
23126 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
23127 >,
23128 {
23129 ::fidl_next::TwoWayFuture::from_untyped(
23130 self.sender.send_two_way(4721673413776871238, request),
23131 )
23132 }
23133
23134 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
23135 pub fn deprecated_get_flags(
23136 &self,
23137 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
23138 ::fidl_next::TwoWayFuture::from_untyped(
23139 self.sender.send_two_way(6595803110182632097, ()),
23140 )
23141 }
23142
23143 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
23144 pub fn deprecated_set_flags(
23145 &self,
23146
23147 flags: impl ::fidl_next::Encode<
23148 <___T as ::fidl_next::Transport>::SendBuffer,
23149 Encoded = crate::WireOpenFlags,
23150 >,
23151 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
23152 where
23153 <___T as ::fidl_next::Transport>::SendBuffer:
23154 ::fidl_next::encoder::InternalHandleEncoder,
23155 {
23156 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
23157 }
23158
23159 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
23160 pub fn deprecated_set_flags_with<___R>(
23161 &self,
23162 request: ___R,
23163 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
23164 where
23165 ___R: ::fidl_next::Encode<
23166 <___T as ::fidl_next::Transport>::SendBuffer,
23167 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
23168 >,
23169 {
23170 ::fidl_next::TwoWayFuture::from_untyped(
23171 self.sender.send_two_way(5950864159036794675, request),
23172 )
23173 }
23174
23175 #[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"]
23176 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
23177 ::fidl_next::TwoWayFuture::from_untyped(
23178 self.sender.send_two_way(105530239381466147, ()),
23179 )
23180 }
23181
23182 #[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"]
23183 pub fn set_flags(
23184 &self,
23185
23186 flags: impl ::fidl_next::Encode<
23187 <___T as ::fidl_next::Transport>::SendBuffer,
23188 Encoded = crate::WireFlags,
23189 >,
23190 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
23191 where
23192 <___T as ::fidl_next::Transport>::SendBuffer:
23193 ::fidl_next::encoder::InternalHandleEncoder,
23194 {
23195 self.set_flags_with(SetFlags { flags })
23196 }
23197
23198 #[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"]
23199 pub fn set_flags_with<___R>(
23200 &self,
23201 request: ___R,
23202 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
23203 where
23204 ___R: ::fidl_next::Encode<
23205 <___T as ::fidl_next::Transport>::SendBuffer,
23206 Encoded = crate::WireNodeSetFlagsRequest,
23207 >,
23208 {
23209 ::fidl_next::TwoWayFuture::from_untyped(
23210 self.sender.send_two_way(6172186066099445416, request),
23211 )
23212 }
23213
23214 #[doc = " Query the filesystem for filesystem-specific information.\n"]
23215 pub fn query_filesystem(
23216 &self,
23217 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
23218 ::fidl_next::TwoWayFuture::from_untyped(
23219 self.sender.send_two_way(8013111122914313744, ()),
23220 )
23221 }
23222
23223 #[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"]
23224 pub fn get_attributes(
23225 &self,
23226
23227 query: impl ::fidl_next::Encode<
23228 <___T as ::fidl_next::Transport>::SendBuffer,
23229 Encoded = crate::WireNodeAttributesQuery,
23230 >,
23231 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
23232 where
23233 <___T as ::fidl_next::Transport>::SendBuffer:
23234 ::fidl_next::encoder::InternalHandleEncoder,
23235 {
23236 self.get_attributes_with(GetAttributes { query })
23237 }
23238
23239 #[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"]
23240 pub fn get_attributes_with<___R>(
23241 &self,
23242 request: ___R,
23243 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
23244 where
23245 ___R: ::fidl_next::Encode<
23246 <___T as ::fidl_next::Transport>::SendBuffer,
23247 Encoded = crate::WireNodeGetAttributesRequest,
23248 >,
23249 {
23250 ::fidl_next::TwoWayFuture::from_untyped(
23251 self.sender.send_two_way(4414537700416816443, request),
23252 )
23253 }
23254
23255 #[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"]
23256 pub fn update_attributes_with<___R>(
23257 &self,
23258 request: ___R,
23259 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
23260 where
23261 ___R: ::fidl_next::Encode<
23262 <___T as ::fidl_next::Transport>::SendBuffer,
23263 Encoded = crate::WireMutableNodeAttributes<'static>,
23264 >,
23265 {
23266 ::fidl_next::TwoWayFuture::from_untyped(
23267 self.sender.send_two_way(3677402239314018056, request),
23268 )
23269 }
23270
23271 #[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"]
23272 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
23273 ::fidl_next::TwoWayFuture::from_untyped(
23274 self.sender.send_two_way(3196473584242777161, ()),
23275 )
23276 }
23277
23278 #[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"]
23279 pub fn list_extended_attributes(
23280 &self,
23281
23282 iterator: impl ::fidl_next::Encode<
23283 <___T as ::fidl_next::Transport>::SendBuffer,
23284 Encoded = ::fidl_next::ServerEnd<
23285 crate::ExtendedAttributeIterator,
23286 ::fidl_next::fuchsia::WireChannel,
23287 >,
23288 >,
23289 ) -> ::fidl_next::SendFuture<'_, ___T>
23290 where
23291 <___T as ::fidl_next::Transport>::SendBuffer:
23292 ::fidl_next::encoder::InternalHandleEncoder,
23293 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23294 {
23295 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
23296 }
23297
23298 #[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"]
23299 pub fn list_extended_attributes_with<___R>(
23300 &self,
23301 request: ___R,
23302 ) -> ::fidl_next::SendFuture<'_, ___T>
23303 where
23304 ___R: ::fidl_next::Encode<
23305 <___T as ::fidl_next::Transport>::SendBuffer,
23306 Encoded = crate::WireNodeListExtendedAttributesRequest,
23307 >,
23308 {
23309 ::fidl_next::SendFuture::from_untyped(
23310 self.sender.send_one_way(5431626189872037072, request),
23311 )
23312 }
23313
23314 #[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"]
23315 pub fn get_extended_attribute(
23316 &self,
23317
23318 name: impl ::fidl_next::Encode<
23319 <___T as ::fidl_next::Transport>::SendBuffer,
23320 Encoded = ::fidl_next::WireVector<'static, u8>,
23321 >,
23322 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
23323 where
23324 <___T as ::fidl_next::Transport>::SendBuffer:
23325 ::fidl_next::encoder::InternalHandleEncoder,
23326 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23327 {
23328 self.get_extended_attribute_with(GetExtendedAttribute { name })
23329 }
23330
23331 #[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"]
23332 pub fn get_extended_attribute_with<___R>(
23333 &self,
23334 request: ___R,
23335 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
23336 where
23337 ___R: ::fidl_next::Encode<
23338 <___T as ::fidl_next::Transport>::SendBuffer,
23339 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
23340 >,
23341 {
23342 ::fidl_next::TwoWayFuture::from_untyped(
23343 self.sender.send_two_way(5043930208506967771, request),
23344 )
23345 }
23346
23347 #[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"]
23348 pub fn set_extended_attribute(
23349 &self,
23350
23351 name: impl ::fidl_next::Encode<
23352 <___T as ::fidl_next::Transport>::SendBuffer,
23353 Encoded = ::fidl_next::WireVector<'static, u8>,
23354 >,
23355
23356 value: impl ::fidl_next::Encode<
23357 <___T as ::fidl_next::Transport>::SendBuffer,
23358 Encoded = crate::WireExtendedAttributeValue<'static>,
23359 >,
23360
23361 mode: impl ::fidl_next::Encode<
23362 <___T as ::fidl_next::Transport>::SendBuffer,
23363 Encoded = crate::WireSetExtendedAttributeMode,
23364 >,
23365 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
23366 where
23367 <___T as ::fidl_next::Transport>::SendBuffer:
23368 ::fidl_next::encoder::InternalHandleEncoder,
23369 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23370 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23371 {
23372 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
23373 }
23374
23375 #[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"]
23376 pub fn set_extended_attribute_with<___R>(
23377 &self,
23378 request: ___R,
23379 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
23380 where
23381 ___R: ::fidl_next::Encode<
23382 <___T as ::fidl_next::Transport>::SendBuffer,
23383 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
23384 >,
23385 {
23386 ::fidl_next::TwoWayFuture::from_untyped(
23387 self.sender.send_two_way(5374223046099989052, request),
23388 )
23389 }
23390
23391 #[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"]
23392 pub fn remove_extended_attribute(
23393 &self,
23394
23395 name: impl ::fidl_next::Encode<
23396 <___T as ::fidl_next::Transport>::SendBuffer,
23397 Encoded = ::fidl_next::WireVector<'static, u8>,
23398 >,
23399 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
23400 where
23401 <___T as ::fidl_next::Transport>::SendBuffer:
23402 ::fidl_next::encoder::InternalHandleEncoder,
23403 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23404 {
23405 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
23406 }
23407
23408 #[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"]
23409 pub fn remove_extended_attribute_with<___R>(
23410 &self,
23411 request: ___R,
23412 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
23413 where
23414 ___R: ::fidl_next::Encode<
23415 <___T as ::fidl_next::Transport>::SendBuffer,
23416 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
23417 >,
23418 {
23419 ::fidl_next::TwoWayFuture::from_untyped(
23420 self.sender.send_two_way(8794297771444732717, request),
23421 )
23422 }
23423
23424 #[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"]
23425 pub fn read(
23426 &self,
23427
23428 count: impl ::fidl_next::Encode<
23429 <___T as ::fidl_next::Transport>::SendBuffer,
23430 Encoded = ::fidl_next::WireU64,
23431 >,
23432 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
23433 where
23434 <___T as ::fidl_next::Transport>::SendBuffer:
23435 ::fidl_next::encoder::InternalHandleEncoder,
23436 {
23437 self.read_with(Read { count })
23438 }
23439
23440 #[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"]
23441 pub fn read_with<___R>(
23442 &self,
23443 request: ___R,
23444 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
23445 where
23446 ___R: ::fidl_next::Encode<
23447 <___T as ::fidl_next::Transport>::SendBuffer,
23448 Encoded = crate::WireReadableReadRequest,
23449 >,
23450 {
23451 ::fidl_next::TwoWayFuture::from_untyped(
23452 self.sender.send_two_way(395825947633028830, request),
23453 )
23454 }
23455
23456 #[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"]
23457 pub fn write(
23458 &self,
23459
23460 data: impl ::fidl_next::Encode<
23461 <___T as ::fidl_next::Transport>::SendBuffer,
23462 Encoded = ::fidl_next::WireVector<'static, u8>,
23463 >,
23464 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
23465 where
23466 <___T as ::fidl_next::Transport>::SendBuffer:
23467 ::fidl_next::encoder::InternalHandleEncoder,
23468 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23469 {
23470 self.write_with(Write { data })
23471 }
23472
23473 #[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"]
23474 pub fn write_with<___R>(
23475 &self,
23476 request: ___R,
23477 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
23478 where
23479 ___R: ::fidl_next::Encode<
23480 <___T as ::fidl_next::Transport>::SendBuffer,
23481 Encoded = crate::WireWritableWriteRequest<'static>,
23482 >,
23483 {
23484 ::fidl_next::TwoWayFuture::from_untyped(
23485 self.sender.send_two_way(7651971425397809026, request),
23486 )
23487 }
23488
23489 pub fn describe(&self) -> ::fidl_next::TwoWayFuture<'_, super::Describe, ___T> {
23490 ::fidl_next::TwoWayFuture::from_untyped(
23491 self.sender.send_two_way(7545125870053689020, ()),
23492 )
23493 }
23494
23495 #[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"]
23496 pub fn seek(
23497 &self,
23498
23499 origin: impl ::fidl_next::Encode<
23500 <___T as ::fidl_next::Transport>::SendBuffer,
23501 Encoded = crate::WireSeekOrigin,
23502 >,
23503
23504 offset: impl ::fidl_next::Encode<
23505 <___T as ::fidl_next::Transport>::SendBuffer,
23506 Encoded = ::fidl_next::WireI64,
23507 >,
23508 ) -> ::fidl_next::TwoWayFuture<'_, super::Seek, ___T>
23509 where
23510 <___T as ::fidl_next::Transport>::SendBuffer:
23511 ::fidl_next::encoder::InternalHandleEncoder,
23512 {
23513 self.seek_with(Seek { origin, offset })
23514 }
23515
23516 #[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"]
23517 pub fn seek_with<___R>(
23518 &self,
23519 request: ___R,
23520 ) -> ::fidl_next::TwoWayFuture<'_, super::Seek, ___T>
23521 where
23522 ___R: ::fidl_next::Encode<
23523 <___T as ::fidl_next::Transport>::SendBuffer,
23524 Encoded = crate::WireFileSeekRequest,
23525 >,
23526 {
23527 ::fidl_next::TwoWayFuture::from_untyped(
23528 self.sender.send_two_way(8649041485622956551, request),
23529 )
23530 }
23531
23532 #[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"]
23533 pub fn read_at(
23534 &self,
23535
23536 count: impl ::fidl_next::Encode<
23537 <___T as ::fidl_next::Transport>::SendBuffer,
23538 Encoded = ::fidl_next::WireU64,
23539 >,
23540
23541 offset: impl ::fidl_next::Encode<
23542 <___T as ::fidl_next::Transport>::SendBuffer,
23543 Encoded = ::fidl_next::WireU64,
23544 >,
23545 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadAt, ___T>
23546 where
23547 <___T as ::fidl_next::Transport>::SendBuffer:
23548 ::fidl_next::encoder::InternalHandleEncoder,
23549 {
23550 self.read_at_with(ReadAt { count, offset })
23551 }
23552
23553 #[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"]
23554 pub fn read_at_with<___R>(
23555 &self,
23556 request: ___R,
23557 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadAt, ___T>
23558 where
23559 ___R: ::fidl_next::Encode<
23560 <___T as ::fidl_next::Transport>::SendBuffer,
23561 Encoded = crate::WireFileReadAtRequest,
23562 >,
23563 {
23564 ::fidl_next::TwoWayFuture::from_untyped(
23565 self.sender.send_two_way(1587416148701180478, request),
23566 )
23567 }
23568
23569 #[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"]
23570 pub fn write_at(
23571 &self,
23572
23573 data: impl ::fidl_next::Encode<
23574 <___T as ::fidl_next::Transport>::SendBuffer,
23575 Encoded = ::fidl_next::WireVector<'static, u8>,
23576 >,
23577
23578 offset: impl ::fidl_next::Encode<
23579 <___T as ::fidl_next::Transport>::SendBuffer,
23580 Encoded = ::fidl_next::WireU64,
23581 >,
23582 ) -> ::fidl_next::TwoWayFuture<'_, super::WriteAt, ___T>
23583 where
23584 <___T as ::fidl_next::Transport>::SendBuffer:
23585 ::fidl_next::encoder::InternalHandleEncoder,
23586 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23587 {
23588 self.write_at_with(WriteAt { data, offset })
23589 }
23590
23591 #[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"]
23592 pub fn write_at_with<___R>(
23593 &self,
23594 request: ___R,
23595 ) -> ::fidl_next::TwoWayFuture<'_, super::WriteAt, ___T>
23596 where
23597 ___R: ::fidl_next::Encode<
23598 <___T as ::fidl_next::Transport>::SendBuffer,
23599 Encoded = crate::WireFileWriteAtRequest<'static>,
23600 >,
23601 {
23602 ::fidl_next::TwoWayFuture::from_untyped(
23603 self.sender.send_two_way(8736683935131400491, request),
23604 )
23605 }
23606
23607 #[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"]
23608 pub fn resize(
23609 &self,
23610
23611 length: impl ::fidl_next::Encode<
23612 <___T as ::fidl_next::Transport>::SendBuffer,
23613 Encoded = ::fidl_next::WireU64,
23614 >,
23615 ) -> ::fidl_next::TwoWayFuture<'_, super::Resize, ___T>
23616 where
23617 <___T as ::fidl_next::Transport>::SendBuffer:
23618 ::fidl_next::encoder::InternalHandleEncoder,
23619 {
23620 self.resize_with(Resize { length })
23621 }
23622
23623 #[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"]
23624 pub fn resize_with<___R>(
23625 &self,
23626 request: ___R,
23627 ) -> ::fidl_next::TwoWayFuture<'_, super::Resize, ___T>
23628 where
23629 ___R: ::fidl_next::Encode<
23630 <___T as ::fidl_next::Transport>::SendBuffer,
23631 Encoded = crate::WireFileResizeRequest,
23632 >,
23633 {
23634 ::fidl_next::TwoWayFuture::from_untyped(
23635 self.sender.send_two_way(3134648685270758458, request),
23636 )
23637 }
23638
23639 #[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"]
23640 pub fn get_backing_memory(
23641 &self,
23642
23643 flags: impl ::fidl_next::Encode<
23644 <___T as ::fidl_next::Transport>::SendBuffer,
23645 Encoded = crate::WireVmoFlags,
23646 >,
23647 ) -> ::fidl_next::TwoWayFuture<'_, super::GetBackingMemory, ___T>
23648 where
23649 <___T as ::fidl_next::Transport>::SendBuffer:
23650 ::fidl_next::encoder::InternalHandleEncoder,
23651 {
23652 self.get_backing_memory_with(GetBackingMemory { flags })
23653 }
23654
23655 #[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"]
23656 pub fn get_backing_memory_with<___R>(
23657 &self,
23658 request: ___R,
23659 ) -> ::fidl_next::TwoWayFuture<'_, super::GetBackingMemory, ___T>
23660 where
23661 ___R: ::fidl_next::Encode<
23662 <___T as ::fidl_next::Transport>::SendBuffer,
23663 Encoded = crate::WireFileGetBackingMemoryRequest,
23664 >,
23665 {
23666 ::fidl_next::TwoWayFuture::from_untyped(
23667 self.sender.send_two_way(46911652864194091, request),
23668 )
23669 }
23670
23671 #[doc = " Pre-allocate on-disk space for this file.\n"]
23672 pub fn allocate(
23673 &self,
23674
23675 offset: impl ::fidl_next::Encode<
23676 <___T as ::fidl_next::Transport>::SendBuffer,
23677 Encoded = ::fidl_next::WireU64,
23678 >,
23679
23680 length: impl ::fidl_next::Encode<
23681 <___T as ::fidl_next::Transport>::SendBuffer,
23682 Encoded = ::fidl_next::WireU64,
23683 >,
23684
23685 mode: impl ::fidl_next::Encode<
23686 <___T as ::fidl_next::Transport>::SendBuffer,
23687 Encoded = crate::WireAllocateMode,
23688 >,
23689 ) -> ::fidl_next::TwoWayFuture<'_, super::Allocate, ___T>
23690 where
23691 <___T as ::fidl_next::Transport>::SendBuffer:
23692 ::fidl_next::encoder::InternalHandleEncoder,
23693 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23694 {
23695 self.allocate_with(Allocate { offset, length, mode })
23696 }
23697
23698 #[doc = " Pre-allocate on-disk space for this file.\n"]
23699 pub fn allocate_with<___R>(
23700 &self,
23701 request: ___R,
23702 ) -> ::fidl_next::TwoWayFuture<'_, super::Allocate, ___T>
23703 where
23704 ___R: ::fidl_next::Encode<
23705 <___T as ::fidl_next::Transport>::SendBuffer,
23706 Encoded = crate::WireFileAllocateRequest,
23707 >,
23708 {
23709 ::fidl_next::TwoWayFuture::from_untyped(
23710 self.sender.send_two_way(8645235848064269614, request),
23711 )
23712 }
23713
23714 #[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"]
23715 pub fn enable_verity(
23716 &self,
23717
23718 options: impl ::fidl_next::Encode<
23719 <___T as ::fidl_next::Transport>::SendBuffer,
23720 Encoded = crate::WireVerificationOptions<'static>,
23721 >,
23722 ) -> ::fidl_next::TwoWayFuture<'_, super::EnableVerity, ___T>
23723 where
23724 <___T as ::fidl_next::Transport>::SendBuffer:
23725 ::fidl_next::encoder::InternalHandleEncoder,
23726 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23727 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23728 {
23729 self.enable_verity_with(EnableVerity { options })
23730 }
23731
23732 #[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"]
23733 pub fn enable_verity_with<___R>(
23734 &self,
23735 request: ___R,
23736 ) -> ::fidl_next::TwoWayFuture<'_, super::EnableVerity, ___T>
23737 where
23738 ___R: ::fidl_next::Encode<
23739 <___T as ::fidl_next::Transport>::SendBuffer,
23740 Encoded = crate::WireFileEnableVerityRequest<'static>,
23741 >,
23742 {
23743 ::fidl_next::TwoWayFuture::from_untyped(
23744 self.sender.send_two_way(3189145313204943035, request),
23745 )
23746 }
23747 }
23748
23749 #[repr(transparent)]
23751 pub struct FileServerSender<___T: ::fidl_next::Transport> {
23752 sender: ::fidl_next::protocol::ServerSender<___T>,
23753 }
23754
23755 impl<___T> FileServerSender<___T>
23756 where
23757 ___T: ::fidl_next::Transport,
23758 {
23759 #[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"]
23760 pub fn on_open(
23761 &self,
23762
23763 s: impl ::fidl_next::Encode<
23764 <___T as ::fidl_next::Transport>::SendBuffer,
23765 Encoded = ::fidl_next::WireI32,
23766 >,
23767
23768 info: impl ::fidl_next::Encode<
23769 <___T as ::fidl_next::Transport>::SendBuffer,
23770 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
23771 >,
23772 ) -> ::fidl_next::SendFuture<'_, ___T>
23773 where
23774 <___T as ::fidl_next::Transport>::SendBuffer:
23775 ::fidl_next::encoder::InternalHandleEncoder,
23776 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
23777 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
23778 {
23779 self.on_open_with(OnOpen { s, info })
23780 }
23781
23782 #[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"]
23783
23784 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
23785 where
23786 ___R: ::fidl_next::Encode<
23787 <___T as ::fidl_next::Transport>::SendBuffer,
23788 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
23789 >,
23790 {
23791 ::fidl_next::SendFuture::from_untyped(
23792 self.sender.send_event(9207534335756671346, request),
23793 )
23794 }
23795
23796 #[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"]
23797
23798 pub fn on_representation_with<___R>(
23799 &self,
23800 request: ___R,
23801 ) -> ::fidl_next::SendFuture<'_, ___T>
23802 where
23803 ___R: ::fidl_next::Encode<
23804 <___T as ::fidl_next::Transport>::SendBuffer,
23805 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
23806 >,
23807 {
23808 ::fidl_next::SendFuture::from_untyped(
23809 self.sender.send_event(6679970090861613324, request),
23810 )
23811 }
23812 }
23813 }
23814}
23815
23816pub trait FileClientHandler<
23820 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
23821 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
23822>
23823{
23824 #[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"]
23825 fn on_open(
23826 &mut self,
23827 sender: &::fidl_next::ClientSender<File, ___T>,
23828
23829 event: ::fidl_next::Response<file::OnOpen, ___T>,
23830 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23831
23832 #[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"]
23833 fn on_representation(
23834 &mut self,
23835 sender: &::fidl_next::ClientSender<File, ___T>,
23836
23837 event: ::fidl_next::Response<file::OnRepresentation, ___T>,
23838 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23839
23840 fn on_unknown_interaction(
23841 &mut self,
23842 sender: &::fidl_next::ClientSender<File, ___T>,
23843 ordinal: u64,
23844 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
23845 sender.close();
23846 ::core::future::ready(())
23847 }
23848}
23849
23850impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for File
23851where
23852 ___H: FileClientHandler<___T> + ::core::marker::Send,
23853 ___T: ::fidl_next::Transport,
23854 <file::AdvisoryLock as ::fidl_next::Method>::Response:
23855 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23856 <file::LinkInto as ::fidl_next::Method>::Response:
23857 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23858 <file::Close as ::fidl_next::Method>::Response:
23859 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23860 <file::Query as ::fidl_next::Method>::Response:
23861 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23862 <file::OnOpen as ::fidl_next::Method>::Response:
23863 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23864 <file::DeprecatedGetAttr as ::fidl_next::Method>::Response:
23865 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23866 <file::DeprecatedSetAttr as ::fidl_next::Method>::Response:
23867 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23868 <file::DeprecatedGetFlags as ::fidl_next::Method>::Response:
23869 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23870 <file::DeprecatedSetFlags as ::fidl_next::Method>::Response:
23871 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23872 <file::GetFlags as ::fidl_next::Method>::Response:
23873 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23874 <file::SetFlags as ::fidl_next::Method>::Response:
23875 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23876 <file::QueryFilesystem as ::fidl_next::Method>::Response:
23877 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23878 <file::OnRepresentation as ::fidl_next::Method>::Response:
23879 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23880 <file::GetAttributes as ::fidl_next::Method>::Response:
23881 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23882 <file::UpdateAttributes as ::fidl_next::Method>::Response:
23883 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23884 <file::Sync as ::fidl_next::Method>::Response:
23885 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23886 <file::GetExtendedAttribute as ::fidl_next::Method>::Response:
23887 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23888 <file::SetExtendedAttribute as ::fidl_next::Method>::Response:
23889 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23890 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
23891 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23892 <file::Read as ::fidl_next::Method>::Response:
23893 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23894 <file::Write as ::fidl_next::Method>::Response:
23895 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23896 <file::Describe as ::fidl_next::Method>::Response:
23897 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23898 <file::Seek as ::fidl_next::Method>::Response:
23899 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23900 <file::ReadAt as ::fidl_next::Method>::Response:
23901 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23902 <file::WriteAt as ::fidl_next::Method>::Response:
23903 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23904 <file::Resize as ::fidl_next::Method>::Response:
23905 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23906 <file::GetBackingMemory as ::fidl_next::Method>::Response:
23907 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23908 <file::Allocate as ::fidl_next::Method>::Response:
23909 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23910 <file::EnableVerity as ::fidl_next::Method>::Response:
23911 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23912{
23913 async fn on_event(
23914 handler: &mut ___H,
23915 sender: &::fidl_next::ClientSender<Self, ___T>,
23916 ordinal: u64,
23917 buffer: ___T::RecvBuffer,
23918 ) {
23919 match ordinal {
23920 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
23921 Ok(decoded) => handler.on_open(sender, decoded).await,
23922 Err(e) => sender.close(),
23923 },
23924
23925 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
23926 Ok(decoded) => handler.on_representation(sender, decoded).await,
23927 Err(e) => sender.close(),
23928 },
23929
23930 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
23931 }
23932 }
23933}
23934
23935pub trait FileServerHandler<
23939 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
23940 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
23941>
23942{
23943 #[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"]
23944 fn advisory_lock(
23945 &mut self,
23946 sender: &::fidl_next::ServerSender<File, ___T>,
23947
23948 request: ::fidl_next::Request<file::AdvisoryLock, ___T>,
23949
23950 responder: ::fidl_next::Responder<file::AdvisoryLock>,
23951 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23952
23953 #[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"]
23954 fn link_into(
23955 &mut self,
23956 sender: &::fidl_next::ServerSender<File, ___T>,
23957
23958 request: ::fidl_next::Request<file::LinkInto, ___T>,
23959
23960 responder: ::fidl_next::Responder<file::LinkInto>,
23961 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23962
23963 fn clone(
23964 &mut self,
23965 sender: &::fidl_next::ServerSender<File, ___T>,
23966
23967 request: ::fidl_next::Request<file::Clone, ___T>,
23968 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23969
23970 #[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"]
23971 fn close(
23972 &mut self,
23973 sender: &::fidl_next::ServerSender<File, ___T>,
23974
23975 responder: ::fidl_next::Responder<file::Close>,
23976 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23977
23978 fn query(
23979 &mut self,
23980 sender: &::fidl_next::ServerSender<File, ___T>,
23981
23982 responder: ::fidl_next::Responder<file::Query>,
23983 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23984
23985 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23986 fn deprecated_clone(
23987 &mut self,
23988 sender: &::fidl_next::ServerSender<File, ___T>,
23989
23990 request: ::fidl_next::Request<file::DeprecatedClone, ___T>,
23991 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
23992
23993 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
23994 fn deprecated_get_attr(
23995 &mut self,
23996 sender: &::fidl_next::ServerSender<File, ___T>,
23997
23998 responder: ::fidl_next::Responder<file::DeprecatedGetAttr>,
23999 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24000
24001 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
24002 fn deprecated_set_attr(
24003 &mut self,
24004 sender: &::fidl_next::ServerSender<File, ___T>,
24005
24006 request: ::fidl_next::Request<file::DeprecatedSetAttr, ___T>,
24007
24008 responder: ::fidl_next::Responder<file::DeprecatedSetAttr>,
24009 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24010
24011 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
24012 fn deprecated_get_flags(
24013 &mut self,
24014 sender: &::fidl_next::ServerSender<File, ___T>,
24015
24016 responder: ::fidl_next::Responder<file::DeprecatedGetFlags>,
24017 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24018
24019 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
24020 fn deprecated_set_flags(
24021 &mut self,
24022 sender: &::fidl_next::ServerSender<File, ___T>,
24023
24024 request: ::fidl_next::Request<file::DeprecatedSetFlags, ___T>,
24025
24026 responder: ::fidl_next::Responder<file::DeprecatedSetFlags>,
24027 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24028
24029 #[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"]
24030 fn get_flags(
24031 &mut self,
24032 sender: &::fidl_next::ServerSender<File, ___T>,
24033
24034 responder: ::fidl_next::Responder<file::GetFlags>,
24035 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24036
24037 #[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"]
24038 fn set_flags(
24039 &mut self,
24040 sender: &::fidl_next::ServerSender<File, ___T>,
24041
24042 request: ::fidl_next::Request<file::SetFlags, ___T>,
24043
24044 responder: ::fidl_next::Responder<file::SetFlags>,
24045 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24046
24047 #[doc = " Query the filesystem for filesystem-specific information.\n"]
24048 fn query_filesystem(
24049 &mut self,
24050 sender: &::fidl_next::ServerSender<File, ___T>,
24051
24052 responder: ::fidl_next::Responder<file::QueryFilesystem>,
24053 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24054
24055 #[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"]
24056 fn get_attributes(
24057 &mut self,
24058 sender: &::fidl_next::ServerSender<File, ___T>,
24059
24060 request: ::fidl_next::Request<file::GetAttributes, ___T>,
24061
24062 responder: ::fidl_next::Responder<file::GetAttributes>,
24063 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24064
24065 #[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"]
24066 fn update_attributes(
24067 &mut self,
24068 sender: &::fidl_next::ServerSender<File, ___T>,
24069
24070 request: ::fidl_next::Request<file::UpdateAttributes, ___T>,
24071
24072 responder: ::fidl_next::Responder<file::UpdateAttributes>,
24073 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24074
24075 #[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"]
24076 fn sync(
24077 &mut self,
24078 sender: &::fidl_next::ServerSender<File, ___T>,
24079
24080 responder: ::fidl_next::Responder<file::Sync>,
24081 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24082
24083 #[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"]
24084 fn list_extended_attributes(
24085 &mut self,
24086 sender: &::fidl_next::ServerSender<File, ___T>,
24087
24088 request: ::fidl_next::Request<file::ListExtendedAttributes, ___T>,
24089 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24090
24091 #[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"]
24092 fn get_extended_attribute(
24093 &mut self,
24094 sender: &::fidl_next::ServerSender<File, ___T>,
24095
24096 request: ::fidl_next::Request<file::GetExtendedAttribute, ___T>,
24097
24098 responder: ::fidl_next::Responder<file::GetExtendedAttribute>,
24099 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24100
24101 #[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"]
24102 fn set_extended_attribute(
24103 &mut self,
24104 sender: &::fidl_next::ServerSender<File, ___T>,
24105
24106 request: ::fidl_next::Request<file::SetExtendedAttribute, ___T>,
24107
24108 responder: ::fidl_next::Responder<file::SetExtendedAttribute>,
24109 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24110
24111 #[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"]
24112 fn remove_extended_attribute(
24113 &mut self,
24114 sender: &::fidl_next::ServerSender<File, ___T>,
24115
24116 request: ::fidl_next::Request<file::RemoveExtendedAttribute, ___T>,
24117
24118 responder: ::fidl_next::Responder<file::RemoveExtendedAttribute>,
24119 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24120
24121 #[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"]
24122 fn read(
24123 &mut self,
24124 sender: &::fidl_next::ServerSender<File, ___T>,
24125
24126 request: ::fidl_next::Request<file::Read, ___T>,
24127
24128 responder: ::fidl_next::Responder<file::Read>,
24129 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24130
24131 #[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"]
24132 fn write(
24133 &mut self,
24134 sender: &::fidl_next::ServerSender<File, ___T>,
24135
24136 request: ::fidl_next::Request<file::Write, ___T>,
24137
24138 responder: ::fidl_next::Responder<file::Write>,
24139 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24140
24141 fn describe(
24142 &mut self,
24143 sender: &::fidl_next::ServerSender<File, ___T>,
24144
24145 responder: ::fidl_next::Responder<file::Describe>,
24146 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24147
24148 #[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"]
24149 fn seek(
24150 &mut self,
24151 sender: &::fidl_next::ServerSender<File, ___T>,
24152
24153 request: ::fidl_next::Request<file::Seek, ___T>,
24154
24155 responder: ::fidl_next::Responder<file::Seek>,
24156 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24157
24158 #[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"]
24159 fn read_at(
24160 &mut self,
24161 sender: &::fidl_next::ServerSender<File, ___T>,
24162
24163 request: ::fidl_next::Request<file::ReadAt, ___T>,
24164
24165 responder: ::fidl_next::Responder<file::ReadAt>,
24166 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24167
24168 #[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"]
24169 fn write_at(
24170 &mut self,
24171 sender: &::fidl_next::ServerSender<File, ___T>,
24172
24173 request: ::fidl_next::Request<file::WriteAt, ___T>,
24174
24175 responder: ::fidl_next::Responder<file::WriteAt>,
24176 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24177
24178 #[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"]
24179 fn resize(
24180 &mut self,
24181 sender: &::fidl_next::ServerSender<File, ___T>,
24182
24183 request: ::fidl_next::Request<file::Resize, ___T>,
24184
24185 responder: ::fidl_next::Responder<file::Resize>,
24186 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24187
24188 #[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"]
24189 fn get_backing_memory(
24190 &mut self,
24191 sender: &::fidl_next::ServerSender<File, ___T>,
24192
24193 request: ::fidl_next::Request<file::GetBackingMemory, ___T>,
24194
24195 responder: ::fidl_next::Responder<file::GetBackingMemory>,
24196 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24197
24198 #[doc = " Pre-allocate on-disk space for this file.\n"]
24199 fn allocate(
24200 &mut self,
24201 sender: &::fidl_next::ServerSender<File, ___T>,
24202
24203 request: ::fidl_next::Request<file::Allocate, ___T>,
24204
24205 responder: ::fidl_next::Responder<file::Allocate>,
24206 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24207
24208 #[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"]
24209 fn enable_verity(
24210 &mut self,
24211 sender: &::fidl_next::ServerSender<File, ___T>,
24212
24213 request: ::fidl_next::Request<file::EnableVerity, ___T>,
24214
24215 responder: ::fidl_next::Responder<file::EnableVerity>,
24216 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
24217
24218 fn on_unknown_interaction(
24219 &mut self,
24220 sender: &::fidl_next::ServerSender<File, ___T>,
24221 ordinal: u64,
24222 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
24223 sender.close();
24224 ::core::future::ready(())
24225 }
24226}
24227
24228impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for File
24229where
24230 ___H: FileServerHandler<___T> + ::core::marker::Send,
24231 ___T: ::fidl_next::Transport,
24232 <file::AdvisoryLock as ::fidl_next::Method>::Request:
24233 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24234 <file::LinkInto as ::fidl_next::Method>::Request:
24235 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24236 <file::Clone as ::fidl_next::Method>::Request:
24237 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24238 <file::DeprecatedClone as ::fidl_next::Method>::Request:
24239 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24240 <file::DeprecatedSetAttr as ::fidl_next::Method>::Request:
24241 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24242 <file::DeprecatedSetFlags as ::fidl_next::Method>::Request:
24243 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24244 <file::SetFlags as ::fidl_next::Method>::Request:
24245 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24246 <file::GetAttributes as ::fidl_next::Method>::Request:
24247 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24248 <file::UpdateAttributes as ::fidl_next::Method>::Request:
24249 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24250 <file::ListExtendedAttributes as ::fidl_next::Method>::Request:
24251 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24252 <file::GetExtendedAttribute as ::fidl_next::Method>::Request:
24253 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24254 <file::SetExtendedAttribute as ::fidl_next::Method>::Request:
24255 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24256 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
24257 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24258 <file::Read as ::fidl_next::Method>::Request:
24259 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24260 <file::Write as ::fidl_next::Method>::Request:
24261 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24262 <file::Seek as ::fidl_next::Method>::Request:
24263 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24264 <file::ReadAt as ::fidl_next::Method>::Request:
24265 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24266 <file::WriteAt as ::fidl_next::Method>::Request:
24267 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24268 <file::Resize as ::fidl_next::Method>::Request:
24269 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24270 <file::GetBackingMemory as ::fidl_next::Method>::Request:
24271 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24272 <file::Allocate as ::fidl_next::Method>::Request:
24273 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24274 <file::EnableVerity as ::fidl_next::Method>::Request:
24275 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
24276{
24277 async fn on_one_way(
24278 handler: &mut ___H,
24279 sender: &::fidl_next::ServerSender<Self, ___T>,
24280 ordinal: u64,
24281 buffer: ___T::RecvBuffer,
24282 ) {
24283 match ordinal {
24284 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
24285 Ok(decoded) => handler.clone(sender, decoded).await,
24286 Err(e) => sender.close(),
24287 },
24288
24289 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
24290 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
24291 Err(e) => sender.close(),
24292 },
24293
24294 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
24295 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
24296 Err(e) => sender.close(),
24297 },
24298
24299 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
24300 }
24301 }
24302
24303 async fn on_two_way(
24304 handler: &mut ___H,
24305 sender: &::fidl_next::ServerSender<Self, ___T>,
24306 ordinal: u64,
24307 buffer: ___T::RecvBuffer,
24308 responder: ::fidl_next::protocol::Responder,
24309 ) {
24310 match ordinal {
24311 7992130864415541162 => {
24312 let responder = ::fidl_next::Responder::from_untyped(responder);
24313
24314 match ::fidl_next::DecoderExt::decode(buffer) {
24315 Ok(decoded) => handler.advisory_lock(sender, decoded, responder).await,
24316 Err(e) => sender.close(),
24317 }
24318 }
24319
24320 6121399674497678964 => {
24321 let responder = ::fidl_next::Responder::from_untyped(responder);
24322
24323 match ::fidl_next::DecoderExt::decode(buffer) {
24324 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
24325 Err(e) => sender.close(),
24326 }
24327 }
24328
24329 6540867515453498750 => {
24330 let responder = ::fidl_next::Responder::from_untyped(responder);
24331
24332 handler.close(sender, responder).await;
24333 }
24334
24335 2763219980499352582 => {
24336 let responder = ::fidl_next::Responder::from_untyped(responder);
24337
24338 handler.query(sender, responder).await;
24339 }
24340
24341 8689798978500614909 => {
24342 let responder = ::fidl_next::Responder::from_untyped(responder);
24343
24344 handler.deprecated_get_attr(sender, responder).await;
24345 }
24346
24347 4721673413776871238 => {
24348 let responder = ::fidl_next::Responder::from_untyped(responder);
24349
24350 match ::fidl_next::DecoderExt::decode(buffer) {
24351 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
24352 Err(e) => sender.close(),
24353 }
24354 }
24355
24356 6595803110182632097 => {
24357 let responder = ::fidl_next::Responder::from_untyped(responder);
24358
24359 handler.deprecated_get_flags(sender, responder).await;
24360 }
24361
24362 5950864159036794675 => {
24363 let responder = ::fidl_next::Responder::from_untyped(responder);
24364
24365 match ::fidl_next::DecoderExt::decode(buffer) {
24366 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
24367 Err(e) => sender.close(),
24368 }
24369 }
24370
24371 105530239381466147 => {
24372 let responder = ::fidl_next::Responder::from_untyped(responder);
24373
24374 handler.get_flags(sender, responder).await;
24375 }
24376
24377 6172186066099445416 => {
24378 let responder = ::fidl_next::Responder::from_untyped(responder);
24379
24380 match ::fidl_next::DecoderExt::decode(buffer) {
24381 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
24382 Err(e) => sender.close(),
24383 }
24384 }
24385
24386 8013111122914313744 => {
24387 let responder = ::fidl_next::Responder::from_untyped(responder);
24388
24389 handler.query_filesystem(sender, responder).await;
24390 }
24391
24392 4414537700416816443 => {
24393 let responder = ::fidl_next::Responder::from_untyped(responder);
24394
24395 match ::fidl_next::DecoderExt::decode(buffer) {
24396 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
24397 Err(e) => sender.close(),
24398 }
24399 }
24400
24401 3677402239314018056 => {
24402 let responder = ::fidl_next::Responder::from_untyped(responder);
24403
24404 match ::fidl_next::DecoderExt::decode(buffer) {
24405 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
24406 Err(e) => sender.close(),
24407 }
24408 }
24409
24410 3196473584242777161 => {
24411 let responder = ::fidl_next::Responder::from_untyped(responder);
24412
24413 handler.sync(sender, responder).await;
24414 }
24415
24416 5043930208506967771 => {
24417 let responder = ::fidl_next::Responder::from_untyped(responder);
24418
24419 match ::fidl_next::DecoderExt::decode(buffer) {
24420 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
24421 Err(e) => sender.close(),
24422 }
24423 }
24424
24425 5374223046099989052 => {
24426 let responder = ::fidl_next::Responder::from_untyped(responder);
24427
24428 match ::fidl_next::DecoderExt::decode(buffer) {
24429 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
24430 Err(e) => sender.close(),
24431 }
24432 }
24433
24434 8794297771444732717 => {
24435 let responder = ::fidl_next::Responder::from_untyped(responder);
24436
24437 match ::fidl_next::DecoderExt::decode(buffer) {
24438 Ok(decoded) => {
24439 handler.remove_extended_attribute(sender, decoded, responder).await
24440 }
24441 Err(e) => sender.close(),
24442 }
24443 }
24444
24445 395825947633028830 => {
24446 let responder = ::fidl_next::Responder::from_untyped(responder);
24447
24448 match ::fidl_next::DecoderExt::decode(buffer) {
24449 Ok(decoded) => handler.read(sender, decoded, responder).await,
24450 Err(e) => sender.close(),
24451 }
24452 }
24453
24454 7651971425397809026 => {
24455 let responder = ::fidl_next::Responder::from_untyped(responder);
24456
24457 match ::fidl_next::DecoderExt::decode(buffer) {
24458 Ok(decoded) => handler.write(sender, decoded, responder).await,
24459 Err(e) => sender.close(),
24460 }
24461 }
24462
24463 7545125870053689020 => {
24464 let responder = ::fidl_next::Responder::from_untyped(responder);
24465
24466 handler.describe(sender, responder).await;
24467 }
24468
24469 8649041485622956551 => {
24470 let responder = ::fidl_next::Responder::from_untyped(responder);
24471
24472 match ::fidl_next::DecoderExt::decode(buffer) {
24473 Ok(decoded) => handler.seek(sender, decoded, responder).await,
24474 Err(e) => sender.close(),
24475 }
24476 }
24477
24478 1587416148701180478 => {
24479 let responder = ::fidl_next::Responder::from_untyped(responder);
24480
24481 match ::fidl_next::DecoderExt::decode(buffer) {
24482 Ok(decoded) => handler.read_at(sender, decoded, responder).await,
24483 Err(e) => sender.close(),
24484 }
24485 }
24486
24487 8736683935131400491 => {
24488 let responder = ::fidl_next::Responder::from_untyped(responder);
24489
24490 match ::fidl_next::DecoderExt::decode(buffer) {
24491 Ok(decoded) => handler.write_at(sender, decoded, responder).await,
24492 Err(e) => sender.close(),
24493 }
24494 }
24495
24496 3134648685270758458 => {
24497 let responder = ::fidl_next::Responder::from_untyped(responder);
24498
24499 match ::fidl_next::DecoderExt::decode(buffer) {
24500 Ok(decoded) => handler.resize(sender, decoded, responder).await,
24501 Err(e) => sender.close(),
24502 }
24503 }
24504
24505 46911652864194091 => {
24506 let responder = ::fidl_next::Responder::from_untyped(responder);
24507
24508 match ::fidl_next::DecoderExt::decode(buffer) {
24509 Ok(decoded) => handler.get_backing_memory(sender, decoded, responder).await,
24510 Err(e) => sender.close(),
24511 }
24512 }
24513
24514 8645235848064269614 => {
24515 let responder = ::fidl_next::Responder::from_untyped(responder);
24516
24517 match ::fidl_next::DecoderExt::decode(buffer) {
24518 Ok(decoded) => handler.allocate(sender, decoded, responder).await,
24519 Err(e) => sender.close(),
24520 }
24521 }
24522
24523 3189145313204943035 => {
24524 let responder = ::fidl_next::Responder::from_untyped(responder);
24525
24526 match ::fidl_next::DecoderExt::decode(buffer) {
24527 Ok(decoded) => handler.enable_verity(sender, decoded, responder).await,
24528 Err(e) => sender.close(),
24529 }
24530 }
24531
24532 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
24533 }
24534 }
24535}
24536
24537#[derive(Debug)]
24538#[repr(C)]
24539pub struct FileObject {
24540 pub event: Option<::fidl_next::fuchsia::zx::Event>,
24541
24542 pub stream: Option<::fidl_next::fuchsia::zx::Stream>,
24543}
24544
24545impl ::fidl_next::Encodable for FileObject {
24546 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFileObject> = unsafe {
24547 ::fidl_next::CopyOptimization::enable_if(
24548 true
24549
24550 && <
24551 Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::Encodable
24552 >::COPY_OPTIMIZATION.is_enabled()
24553
24554 && <
24555 Option<::fidl_next::fuchsia::zx::Stream> as ::fidl_next::Encodable
24556 >::COPY_OPTIMIZATION.is_enabled()
24557
24558 )
24559 };
24560
24561 type Encoded = WireFileObject;
24562}
24563
24564unsafe impl<___E> ::fidl_next::Encode<___E> for FileObject
24565where
24566 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24567 ___E: ::fidl_next::fuchsia::HandleEncoder,
24568{
24569 #[inline]
24570 fn encode(
24571 self,
24572 encoder: &mut ___E,
24573 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24574 ) -> Result<(), ::fidl_next::EncodeError> {
24575 ::fidl_next::munge! {
24576 let Self::Encoded {
24577 event,
24578 stream,
24579
24580 } = out;
24581 }
24582
24583 ::fidl_next::Encode::encode(self.event, encoder, event)?;
24584
24585 ::fidl_next::Encode::encode(self.stream, encoder, stream)?;
24586
24587 Ok(())
24588 }
24589}
24590
24591impl ::fidl_next::EncodableOption for FileObject {
24592 type EncodedOption = ::fidl_next::WireBox<'static, WireFileObject>;
24593}
24594
24595unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FileObject
24596where
24597 ___E: ::fidl_next::Encoder + ?Sized,
24598 FileObject: ::fidl_next::Encode<___E>,
24599{
24600 #[inline]
24601 fn encode_option(
24602 this: Option<Self>,
24603 encoder: &mut ___E,
24604 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
24605 ) -> Result<(), ::fidl_next::EncodeError> {
24606 if let Some(inner) = this {
24607 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
24608 ::fidl_next::WireBox::encode_present(out);
24609 } else {
24610 ::fidl_next::WireBox::encode_absent(out);
24611 }
24612
24613 Ok(())
24614 }
24615}
24616
24617impl ::fidl_next::FromWire<WireFileObject> for FileObject {
24618 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFileObject, Self> = unsafe {
24619 ::fidl_next::CopyOptimization::enable_if(
24620 true && <Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::FromWire<
24621 ::fidl_next::fuchsia::WireOptionalEvent,
24622 >>::COPY_OPTIMIZATION
24623 .is_enabled()
24624 && <Option<::fidl_next::fuchsia::zx::Stream> as ::fidl_next::FromWire<
24625 ::fidl_next::fuchsia::WireOptionalStream,
24626 >>::COPY_OPTIMIZATION
24627 .is_enabled(),
24628 )
24629 };
24630
24631 #[inline]
24632 fn from_wire(wire: WireFileObject) -> Self {
24633 Self {
24634 event: ::fidl_next::FromWire::from_wire(wire.event),
24635
24636 stream: ::fidl_next::FromWire::from_wire(wire.stream),
24637 }
24638 }
24639}
24640
24641#[derive(Debug)]
24643#[repr(C)]
24644pub struct WireFileObject {
24645 pub event: ::fidl_next::fuchsia::WireOptionalEvent,
24646
24647 pub stream: ::fidl_next::fuchsia::WireOptionalStream,
24648}
24649
24650unsafe impl ::fidl_next::Wire for WireFileObject {
24651 type Decoded<'de> = WireFileObject;
24652
24653 #[inline]
24654 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
24655}
24656
24657unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileObject
24658where
24659 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
24660 ___D: ::fidl_next::fuchsia::HandleDecoder,
24661{
24662 fn decode(
24663 slot: ::fidl_next::Slot<'_, Self>,
24664 decoder: &mut ___D,
24665 ) -> Result<(), ::fidl_next::DecodeError> {
24666 ::fidl_next::munge! {
24667 let Self {
24668 mut event,
24669 mut stream,
24670
24671 } = slot;
24672 }
24673
24674 ::fidl_next::Decode::decode(event.as_mut(), decoder)?;
24675
24676 ::fidl_next::Decode::decode(stream.as_mut(), decoder)?;
24677
24678 Ok(())
24679 }
24680}
24681
24682::fidl_next::bitflags! {
24683 #[derive(
24684 Clone,
24685 Copy,
24686 Debug,
24687 PartialEq,
24688 Eq,
24689 Hash,
24690 )]
24691 pub struct FileSignal: u32 {
24692 #[doc = " Indicates the file is ready for reading.\n"]const READABLE = 16777216;
24693 #[doc = " Indicates the file is ready for writing.\n"]const WRITABLE = 33554432;
24694
24695 }
24696}
24697
24698impl ::fidl_next::Encodable for FileSignal {
24699 type Encoded = WireFileSignal;
24700}
24701
24702unsafe impl<___E> ::fidl_next::Encode<___E> for FileSignal
24703where
24704 ___E: ?Sized,
24705{
24706 #[inline]
24707 fn encode(
24708 self,
24709 encoder: &mut ___E,
24710 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24711 ) -> Result<(), ::fidl_next::EncodeError> {
24712 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
24713 }
24714}
24715
24716unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSignal
24717where
24718 ___E: ?Sized,
24719{
24720 #[inline]
24721 fn encode_ref(
24722 &self,
24723 _: &mut ___E,
24724 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24725 ) -> Result<(), ::fidl_next::EncodeError> {
24726 ::fidl_next::munge!(let WireFileSignal { value } = out);
24727 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
24728 Ok(())
24729 }
24730}
24731
24732impl ::core::convert::From<WireFileSignal> for FileSignal {
24733 fn from(wire: WireFileSignal) -> Self {
24734 Self::from_bits_retain(u32::from(wire.value))
24735 }
24736}
24737
24738impl ::fidl_next::FromWire<WireFileSignal> for FileSignal {
24739 #[inline]
24740 fn from_wire(wire: WireFileSignal) -> Self {
24741 Self::from(wire)
24742 }
24743}
24744
24745impl ::fidl_next::FromWireRef<WireFileSignal> for FileSignal {
24746 #[inline]
24747 fn from_wire_ref(wire: &WireFileSignal) -> Self {
24748 Self::from(*wire)
24749 }
24750}
24751
24752#[derive(Clone, Copy, Debug)]
24754#[repr(transparent)]
24755pub struct WireFileSignal {
24756 value: ::fidl_next::WireU32,
24757}
24758
24759unsafe impl ::fidl_next::Wire for WireFileSignal {
24760 type Decoded<'de> = Self;
24761
24762 #[inline]
24763 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24764 }
24766}
24767
24768unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSignal
24769where
24770 ___D: ?Sized,
24771{
24772 fn decode(
24773 slot: ::fidl_next::Slot<'_, Self>,
24774 _: &mut ___D,
24775 ) -> Result<(), ::fidl_next::DecodeError> {
24776 ::fidl_next::munge!(let Self { value } = slot);
24777 let set = u32::from(*value);
24778 if set & !FileSignal::all().bits() != 0 {
24779 return Err(::fidl_next::DecodeError::InvalidBits {
24780 expected: FileSignal::all().bits() as usize,
24781 actual: set as usize,
24782 });
24783 }
24784
24785 Ok(())
24786 }
24787}
24788
24789impl ::core::convert::From<FileSignal> for WireFileSignal {
24790 fn from(natural: FileSignal) -> Self {
24791 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
24792 }
24793}
24794
24795pub const MAX_FS_NAME_BUFFER: u64 = 32;
24796
24797#[derive(Clone, Debug)]
24798#[repr(C)]
24799pub struct FilesystemInfo {
24800 pub total_bytes: u64,
24801
24802 pub used_bytes: u64,
24803
24804 pub total_nodes: u64,
24805
24806 pub used_nodes: u64,
24807
24808 pub free_shared_pool_bytes: u64,
24809
24810 pub fs_id: u64,
24811
24812 pub block_size: u32,
24813
24814 pub max_filename_size: u32,
24815
24816 pub fs_type: u32,
24817
24818 pub padding: u32,
24819
24820 pub name: [i8; 32],
24821}
24822
24823impl ::fidl_next::Encodable for FilesystemInfo {
24824 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFilesystemInfo> = unsafe {
24825 ::fidl_next::CopyOptimization::enable_if(
24826 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24827 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24828 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24829 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24830 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24831 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24832 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24833 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24834 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24835 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
24836 && <[i8; 32] as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
24837 )
24838 };
24839
24840 type Encoded = WireFilesystemInfo;
24841}
24842
24843unsafe impl<___E> ::fidl_next::Encode<___E> for FilesystemInfo
24844where
24845 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24846{
24847 #[inline]
24848 fn encode(
24849 self,
24850 encoder: &mut ___E,
24851 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24852 ) -> Result<(), ::fidl_next::EncodeError> {
24853 ::fidl_next::munge! {
24854 let Self::Encoded {
24855 total_bytes,
24856 used_bytes,
24857 total_nodes,
24858 used_nodes,
24859 free_shared_pool_bytes,
24860 fs_id,
24861 block_size,
24862 max_filename_size,
24863 fs_type,
24864 padding,
24865 name,
24866
24867 } = out;
24868 }
24869
24870 ::fidl_next::Encode::encode(self.total_bytes, encoder, total_bytes)?;
24871
24872 ::fidl_next::Encode::encode(self.used_bytes, encoder, used_bytes)?;
24873
24874 ::fidl_next::Encode::encode(self.total_nodes, encoder, total_nodes)?;
24875
24876 ::fidl_next::Encode::encode(self.used_nodes, encoder, used_nodes)?;
24877
24878 ::fidl_next::Encode::encode(self.free_shared_pool_bytes, encoder, free_shared_pool_bytes)?;
24879
24880 ::fidl_next::Encode::encode(self.fs_id, encoder, fs_id)?;
24881
24882 ::fidl_next::Encode::encode(self.block_size, encoder, block_size)?;
24883
24884 ::fidl_next::Encode::encode(self.max_filename_size, encoder, max_filename_size)?;
24885
24886 ::fidl_next::Encode::encode(self.fs_type, encoder, fs_type)?;
24887
24888 ::fidl_next::Encode::encode(self.padding, encoder, padding)?;
24889
24890 ::fidl_next::Encode::encode(self.name, encoder, name)?;
24891
24892 Ok(())
24893 }
24894}
24895
24896unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FilesystemInfo
24897where
24898 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
24899{
24900 #[inline]
24901 fn encode_ref(
24902 &self,
24903 encoder: &mut ___E,
24904 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24905 ) -> Result<(), ::fidl_next::EncodeError> {
24906 ::fidl_next::munge! {
24907 let Self::Encoded {
24908 total_bytes,
24909 used_bytes,
24910 total_nodes,
24911 used_nodes,
24912 free_shared_pool_bytes,
24913 fs_id,
24914 block_size,
24915 max_filename_size,
24916 fs_type,
24917 padding,
24918 name,
24919
24920 } = out;
24921 }
24922
24923 ::fidl_next::EncodeRef::encode_ref(&self.total_bytes, encoder, total_bytes)?;
24924
24925 ::fidl_next::EncodeRef::encode_ref(&self.used_bytes, encoder, used_bytes)?;
24926
24927 ::fidl_next::EncodeRef::encode_ref(&self.total_nodes, encoder, total_nodes)?;
24928
24929 ::fidl_next::EncodeRef::encode_ref(&self.used_nodes, encoder, used_nodes)?;
24930
24931 ::fidl_next::EncodeRef::encode_ref(
24932 &self.free_shared_pool_bytes,
24933 encoder,
24934 free_shared_pool_bytes,
24935 )?;
24936
24937 ::fidl_next::EncodeRef::encode_ref(&self.fs_id, encoder, fs_id)?;
24938
24939 ::fidl_next::EncodeRef::encode_ref(&self.block_size, encoder, block_size)?;
24940
24941 ::fidl_next::EncodeRef::encode_ref(&self.max_filename_size, encoder, max_filename_size)?;
24942
24943 ::fidl_next::EncodeRef::encode_ref(&self.fs_type, encoder, fs_type)?;
24944
24945 ::fidl_next::EncodeRef::encode_ref(&self.padding, encoder, padding)?;
24946
24947 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
24948
24949 Ok(())
24950 }
24951}
24952
24953impl ::fidl_next::EncodableOption for FilesystemInfo {
24954 type EncodedOption = ::fidl_next::WireBox<'static, WireFilesystemInfo>;
24955}
24956
24957unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FilesystemInfo
24958where
24959 ___E: ::fidl_next::Encoder + ?Sized,
24960 FilesystemInfo: ::fidl_next::Encode<___E>,
24961{
24962 #[inline]
24963 fn encode_option(
24964 this: Option<Self>,
24965 encoder: &mut ___E,
24966 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
24967 ) -> Result<(), ::fidl_next::EncodeError> {
24968 if let Some(inner) = this {
24969 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
24970 ::fidl_next::WireBox::encode_present(out);
24971 } else {
24972 ::fidl_next::WireBox::encode_absent(out);
24973 }
24974
24975 Ok(())
24976 }
24977}
24978
24979unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FilesystemInfo
24980where
24981 ___E: ::fidl_next::Encoder + ?Sized,
24982 FilesystemInfo: ::fidl_next::EncodeRef<___E>,
24983{
24984 #[inline]
24985 fn encode_option_ref(
24986 this: Option<&Self>,
24987 encoder: &mut ___E,
24988 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
24989 ) -> Result<(), ::fidl_next::EncodeError> {
24990 if let Some(inner) = this {
24991 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
24992 ::fidl_next::WireBox::encode_present(out);
24993 } else {
24994 ::fidl_next::WireBox::encode_absent(out);
24995 }
24996
24997 Ok(())
24998 }
24999}
25000
25001impl ::fidl_next::FromWire<WireFilesystemInfo> for FilesystemInfo {
25002 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFilesystemInfo, Self> = unsafe {
25003 ::fidl_next::CopyOptimization::enable_if(
25004 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25005 .is_enabled()
25006 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25007 .is_enabled()
25008 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25009 .is_enabled()
25010 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25011 .is_enabled()
25012 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25013 .is_enabled()
25014 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
25015 .is_enabled()
25016 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25017 .is_enabled()
25018 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25019 .is_enabled()
25020 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25021 .is_enabled()
25022 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
25023 .is_enabled()
25024 && <[i8; 32] as ::fidl_next::FromWire<[i8; 32]>>::COPY_OPTIMIZATION.is_enabled(),
25025 )
25026 };
25027
25028 #[inline]
25029 fn from_wire(wire: WireFilesystemInfo) -> Self {
25030 Self {
25031 total_bytes: ::fidl_next::FromWire::from_wire(wire.total_bytes),
25032
25033 used_bytes: ::fidl_next::FromWire::from_wire(wire.used_bytes),
25034
25035 total_nodes: ::fidl_next::FromWire::from_wire(wire.total_nodes),
25036
25037 used_nodes: ::fidl_next::FromWire::from_wire(wire.used_nodes),
25038
25039 free_shared_pool_bytes: ::fidl_next::FromWire::from_wire(wire.free_shared_pool_bytes),
25040
25041 fs_id: ::fidl_next::FromWire::from_wire(wire.fs_id),
25042
25043 block_size: ::fidl_next::FromWire::from_wire(wire.block_size),
25044
25045 max_filename_size: ::fidl_next::FromWire::from_wire(wire.max_filename_size),
25046
25047 fs_type: ::fidl_next::FromWire::from_wire(wire.fs_type),
25048
25049 padding: ::fidl_next::FromWire::from_wire(wire.padding),
25050
25051 name: ::fidl_next::FromWire::from_wire(wire.name),
25052 }
25053 }
25054}
25055
25056impl ::fidl_next::FromWireRef<WireFilesystemInfo> for FilesystemInfo {
25057 #[inline]
25058 fn from_wire_ref(wire: &WireFilesystemInfo) -> Self {
25059 Self {
25060 total_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_bytes),
25061
25062 used_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_bytes),
25063
25064 total_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_nodes),
25065
25066 used_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_nodes),
25067
25068 free_shared_pool_bytes: ::fidl_next::FromWireRef::from_wire_ref(
25069 &wire.free_shared_pool_bytes,
25070 ),
25071
25072 fs_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_id),
25073
25074 block_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.block_size),
25075
25076 max_filename_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_filename_size),
25077
25078 fs_type: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_type),
25079
25080 padding: ::fidl_next::FromWireRef::from_wire_ref(&wire.padding),
25081
25082 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
25083 }
25084 }
25085}
25086
25087#[derive(Clone, Debug)]
25089#[repr(C)]
25090pub struct WireFilesystemInfo {
25091 pub total_bytes: ::fidl_next::WireU64,
25092
25093 pub used_bytes: ::fidl_next::WireU64,
25094
25095 pub total_nodes: ::fidl_next::WireU64,
25096
25097 pub used_nodes: ::fidl_next::WireU64,
25098
25099 pub free_shared_pool_bytes: ::fidl_next::WireU64,
25100
25101 pub fs_id: ::fidl_next::WireU64,
25102
25103 pub block_size: ::fidl_next::WireU32,
25104
25105 pub max_filename_size: ::fidl_next::WireU32,
25106
25107 pub fs_type: ::fidl_next::WireU32,
25108
25109 pub padding: ::fidl_next::WireU32,
25110
25111 pub name: [i8; 32],
25112}
25113
25114unsafe impl ::fidl_next::Wire for WireFilesystemInfo {
25115 type Decoded<'de> = WireFilesystemInfo;
25116
25117 #[inline]
25118 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
25119}
25120
25121unsafe impl<___D> ::fidl_next::Decode<___D> for WireFilesystemInfo
25122where
25123 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25124{
25125 fn decode(
25126 slot: ::fidl_next::Slot<'_, Self>,
25127 decoder: &mut ___D,
25128 ) -> Result<(), ::fidl_next::DecodeError> {
25129 ::fidl_next::munge! {
25130 let Self {
25131 mut total_bytes,
25132 mut used_bytes,
25133 mut total_nodes,
25134 mut used_nodes,
25135 mut free_shared_pool_bytes,
25136 mut fs_id,
25137 mut block_size,
25138 mut max_filename_size,
25139 mut fs_type,
25140 mut padding,
25141 mut name,
25142
25143 } = slot;
25144 }
25145
25146 ::fidl_next::Decode::decode(total_bytes.as_mut(), decoder)?;
25147
25148 ::fidl_next::Decode::decode(used_bytes.as_mut(), decoder)?;
25149
25150 ::fidl_next::Decode::decode(total_nodes.as_mut(), decoder)?;
25151
25152 ::fidl_next::Decode::decode(used_nodes.as_mut(), decoder)?;
25153
25154 ::fidl_next::Decode::decode(free_shared_pool_bytes.as_mut(), decoder)?;
25155
25156 ::fidl_next::Decode::decode(fs_id.as_mut(), decoder)?;
25157
25158 ::fidl_next::Decode::decode(block_size.as_mut(), decoder)?;
25159
25160 ::fidl_next::Decode::decode(max_filename_size.as_mut(), decoder)?;
25161
25162 ::fidl_next::Decode::decode(fs_type.as_mut(), decoder)?;
25163
25164 ::fidl_next::Decode::decode(padding.as_mut(), decoder)?;
25165
25166 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
25167
25168 Ok(())
25169 }
25170}
25171
25172#[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"]
25173pub const INHERITED_WRITE_PERMISSIONS: crate::Operations = crate::Operations::from_bits_retain(356);
25174
25175#[doc = " Nodes which do not have ino values should return this value\n from Readdir and GetAttr.\n"]
25176pub const INO_UNKNOWN: u64 = 18446744073709551615;
25177
25178pub const MASK_KNOWN_PERMISSIONS: crate::Flags = crate::Flags::from_bits_retain(25087);
25179
25180pub const MASK_KNOWN_PROTOCOLS: crate::Flags = crate::Flags::from_bits_retain(30069489664);
25181
25182pub const MASK_PERMISSION_FLAGS: u64 = 65535;
25183
25184pub const MASK_POSIX_FLAGS: u64 = 4294967295;
25185
25186#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
25187pub const MAX_FILENAME: u64 = 255;
25188
25189pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
25190
25191#[derive(Clone, Debug)]
25192#[repr(C)]
25193pub struct Service {}
25194
25195impl ::fidl_next::Encodable for Service {
25196 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireService> =
25197 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
25198
25199 type Encoded = WireService;
25200}
25201
25202unsafe impl<___E> ::fidl_next::Encode<___E> for Service
25203where
25204 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25205{
25206 #[inline]
25207 fn encode(
25208 self,
25209 encoder: &mut ___E,
25210 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25211 ) -> Result<(), ::fidl_next::EncodeError> {
25212 ::fidl_next::munge! {
25213 let Self::Encoded {
25214
25215 } = out;
25216 }
25217
25218 Ok(())
25219 }
25220}
25221
25222unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
25223where
25224 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25225{
25226 #[inline]
25227 fn encode_ref(
25228 &self,
25229 encoder: &mut ___E,
25230 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25231 ) -> Result<(), ::fidl_next::EncodeError> {
25232 ::fidl_next::munge! {
25233 let Self::Encoded {
25234
25235 } = out;
25236 }
25237
25238 Ok(())
25239 }
25240}
25241
25242impl ::fidl_next::EncodableOption for Service {
25243 type EncodedOption = ::fidl_next::WireBox<'static, WireService>;
25244}
25245
25246unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Service
25247where
25248 ___E: ::fidl_next::Encoder + ?Sized,
25249 Service: ::fidl_next::Encode<___E>,
25250{
25251 #[inline]
25252 fn encode_option(
25253 this: Option<Self>,
25254 encoder: &mut ___E,
25255 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25256 ) -> Result<(), ::fidl_next::EncodeError> {
25257 if let Some(inner) = this {
25258 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25259 ::fidl_next::WireBox::encode_present(out);
25260 } else {
25261 ::fidl_next::WireBox::encode_absent(out);
25262 }
25263
25264 Ok(())
25265 }
25266}
25267
25268unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Service
25269where
25270 ___E: ::fidl_next::Encoder + ?Sized,
25271 Service: ::fidl_next::EncodeRef<___E>,
25272{
25273 #[inline]
25274 fn encode_option_ref(
25275 this: Option<&Self>,
25276 encoder: &mut ___E,
25277 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25278 ) -> Result<(), ::fidl_next::EncodeError> {
25279 if let Some(inner) = this {
25280 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25281 ::fidl_next::WireBox::encode_present(out);
25282 } else {
25283 ::fidl_next::WireBox::encode_absent(out);
25284 }
25285
25286 Ok(())
25287 }
25288}
25289
25290impl ::fidl_next::FromWire<WireService> for Service {
25291 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireService, Self> =
25292 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
25293
25294 #[inline]
25295 fn from_wire(wire: WireService) -> Self {
25296 Self {}
25297 }
25298}
25299
25300impl ::fidl_next::FromWireRef<WireService> for Service {
25301 #[inline]
25302 fn from_wire_ref(wire: &WireService) -> Self {
25303 Self {}
25304 }
25305}
25306
25307#[derive(Clone, Debug)]
25309#[repr(C)]
25310pub struct WireService {}
25311
25312unsafe impl ::fidl_next::Wire for WireService {
25313 type Decoded<'de> = WireService;
25314
25315 #[inline]
25316 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
25317}
25318
25319unsafe impl<___D> ::fidl_next::Decode<___D> for WireService
25320where
25321 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25322{
25323 fn decode(
25324 slot: ::fidl_next::Slot<'_, Self>,
25325 decoder: &mut ___D,
25326 ) -> Result<(), ::fidl_next::DecodeError> {
25327 ::fidl_next::munge! {
25328 let Self {
25329
25330 } = slot;
25331 }
25332
25333 Ok(())
25334 }
25335}
25336
25337#[derive(Clone, Debug)]
25338pub struct SymlinkObject {
25339 pub target: Vec<u8>,
25340}
25341
25342impl ::fidl_next::Encodable for SymlinkObject {
25343 type Encoded = WireSymlinkObject<'static>;
25344}
25345
25346unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkObject
25347where
25348 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25349 ___E: ::fidl_next::Encoder,
25350{
25351 #[inline]
25352 fn encode(
25353 self,
25354 encoder: &mut ___E,
25355 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25356 ) -> Result<(), ::fidl_next::EncodeError> {
25357 ::fidl_next::munge! {
25358 let Self::Encoded {
25359 target,
25360
25361 } = out;
25362 }
25363
25364 ::fidl_next::Encode::encode(self.target, encoder, target)?;
25365
25366 Ok(())
25367 }
25368}
25369
25370unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkObject
25371where
25372 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25373 ___E: ::fidl_next::Encoder,
25374{
25375 #[inline]
25376 fn encode_ref(
25377 &self,
25378 encoder: &mut ___E,
25379 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25380 ) -> Result<(), ::fidl_next::EncodeError> {
25381 ::fidl_next::munge! {
25382 let Self::Encoded {
25383 target,
25384
25385 } = out;
25386 }
25387
25388 ::fidl_next::EncodeRef::encode_ref(&self.target, encoder, target)?;
25389
25390 Ok(())
25391 }
25392}
25393
25394impl ::fidl_next::EncodableOption for SymlinkObject {
25395 type EncodedOption = ::fidl_next::WireBox<'static, WireSymlinkObject<'static>>;
25396}
25397
25398unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SymlinkObject
25399where
25400 ___E: ::fidl_next::Encoder + ?Sized,
25401 SymlinkObject: ::fidl_next::Encode<___E>,
25402{
25403 #[inline]
25404 fn encode_option(
25405 this: Option<Self>,
25406 encoder: &mut ___E,
25407 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25408 ) -> Result<(), ::fidl_next::EncodeError> {
25409 if let Some(inner) = this {
25410 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25411 ::fidl_next::WireBox::encode_present(out);
25412 } else {
25413 ::fidl_next::WireBox::encode_absent(out);
25414 }
25415
25416 Ok(())
25417 }
25418}
25419
25420unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SymlinkObject
25421where
25422 ___E: ::fidl_next::Encoder + ?Sized,
25423 SymlinkObject: ::fidl_next::EncodeRef<___E>,
25424{
25425 #[inline]
25426 fn encode_option_ref(
25427 this: Option<&Self>,
25428 encoder: &mut ___E,
25429 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25430 ) -> Result<(), ::fidl_next::EncodeError> {
25431 if let Some(inner) = this {
25432 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
25433 ::fidl_next::WireBox::encode_present(out);
25434 } else {
25435 ::fidl_next::WireBox::encode_absent(out);
25436 }
25437
25438 Ok(())
25439 }
25440}
25441
25442impl<'de> ::fidl_next::FromWire<WireSymlinkObject<'de>> for SymlinkObject {
25443 #[inline]
25444 fn from_wire(wire: WireSymlinkObject<'de>) -> Self {
25445 Self { target: ::fidl_next::FromWire::from_wire(wire.target) }
25446 }
25447}
25448
25449impl<'de> ::fidl_next::FromWireRef<WireSymlinkObject<'de>> for SymlinkObject {
25450 #[inline]
25451 fn from_wire_ref(wire: &WireSymlinkObject<'de>) -> Self {
25452 Self { target: ::fidl_next::FromWireRef::from_wire_ref(&wire.target) }
25453 }
25454}
25455
25456#[derive(Debug)]
25458#[repr(C)]
25459pub struct WireSymlinkObject<'de> {
25460 pub target: ::fidl_next::WireVector<'de, u8>,
25461}
25462
25463unsafe impl ::fidl_next::Wire for WireSymlinkObject<'static> {
25464 type Decoded<'de> = WireSymlinkObject<'de>;
25465
25466 #[inline]
25467 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
25468}
25469
25470unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkObject<'static>
25471where
25472 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25473 ___D: ::fidl_next::Decoder,
25474{
25475 fn decode(
25476 slot: ::fidl_next::Slot<'_, Self>,
25477 decoder: &mut ___D,
25478 ) -> Result<(), ::fidl_next::DecodeError> {
25479 ::fidl_next::munge! {
25480 let Self {
25481 mut target,
25482
25483 } = slot;
25484 }
25485
25486 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
25487
25488 let target = unsafe { target.deref_unchecked() };
25489
25490 if target.len() > 4095 {
25491 return Err(::fidl_next::DecodeError::VectorTooLong {
25492 size: target.len() as u64,
25493 limit: 4095,
25494 });
25495 }
25496
25497 Ok(())
25498 }
25499}
25500
25501#[derive(Debug)]
25502pub enum NodeInfoDeprecated {
25503 Service(crate::Service),
25504
25505 File(crate::FileObject),
25506
25507 Directory(crate::DirectoryObject),
25508
25509 Symlink(crate::SymlinkObject),
25510}
25511
25512impl ::fidl_next::Encodable for NodeInfoDeprecated {
25513 type Encoded = WireNodeInfoDeprecated<'static>;
25514}
25515
25516unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfoDeprecated
25517where
25518 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25519 ___E: ::fidl_next::Encoder,
25520 ___E: ::fidl_next::fuchsia::HandleEncoder,
25521{
25522 #[inline]
25523 fn encode(
25524 self,
25525 encoder: &mut ___E,
25526 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25527 ) -> Result<(), ::fidl_next::EncodeError> {
25528 ::fidl_next::munge!(let WireNodeInfoDeprecated { raw, _phantom: _ } = out);
25529
25530 match self {
25531 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
25532 value, 1, encoder, raw,
25533 )?,
25534
25535 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileObject>(
25536 value, 2, encoder, raw,
25537 )?,
25538
25539 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
25540 ___E,
25541 crate::DirectoryObject,
25542 >(value, 3, encoder, raw)?,
25543
25544 Self::Symlink(value) => ::fidl_next::RawWireUnion::encode_as::<
25545 ___E,
25546 crate::SymlinkObject,
25547 >(value, 4, encoder, raw)?,
25548 }
25549
25550 Ok(())
25551 }
25552}
25553
25554impl ::fidl_next::EncodableOption for NodeInfoDeprecated {
25555 type EncodedOption = WireOptionalNodeInfoDeprecated<'static>;
25556}
25557
25558unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NodeInfoDeprecated
25559where
25560 ___E: ?Sized,
25561 NodeInfoDeprecated: ::fidl_next::Encode<___E>,
25562{
25563 #[inline]
25564 fn encode_option(
25565 this: Option<Self>,
25566 encoder: &mut ___E,
25567 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
25568 ) -> Result<(), ::fidl_next::EncodeError> {
25569 ::fidl_next::munge!(let WireOptionalNodeInfoDeprecated { raw, _phantom: _ } = &mut *out);
25570
25571 if let Some(inner) = this {
25572 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
25573 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
25574 } else {
25575 ::fidl_next::RawWireUnion::encode_absent(raw);
25576 }
25577
25578 Ok(())
25579 }
25580}
25581
25582impl<'de> ::fidl_next::FromWire<WireNodeInfoDeprecated<'de>> for NodeInfoDeprecated {
25583 #[inline]
25584 fn from_wire(wire: WireNodeInfoDeprecated<'de>) -> Self {
25585 let wire = ::core::mem::ManuallyDrop::new(wire);
25586 match wire.raw.ordinal() {
25587 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
25588 wire.raw.get().read_unchecked::<crate::WireService>()
25589 })),
25590
25591 2 => Self::File(::fidl_next::FromWire::from_wire(unsafe {
25592 wire.raw.get().read_unchecked::<crate::WireFileObject>()
25593 })),
25594
25595 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
25596 wire.raw.get().read_unchecked::<crate::WireDirectoryObject>()
25597 })),
25598
25599 4 => Self::Symlink(::fidl_next::FromWire::from_wire(unsafe {
25600 wire.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>()
25601 })),
25602
25603 _ => unsafe { ::core::hint::unreachable_unchecked() },
25604 }
25605 }
25606}
25607
25608impl<'de> ::fidl_next::FromWireOption<WireOptionalNodeInfoDeprecated<'de>>
25609 for Box<NodeInfoDeprecated>
25610{
25611 #[inline]
25612 fn from_wire_option(wire: WireOptionalNodeInfoDeprecated<'de>) -> Option<Self> {
25613 if let Some(inner) = wire.into_option() {
25614 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
25615 } else {
25616 None
25617 }
25618 }
25619}
25620
25621#[repr(transparent)]
25623pub struct WireNodeInfoDeprecated<'de> {
25624 raw: ::fidl_next::RawWireUnion,
25625 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25626}
25627
25628impl<'de> Drop for WireNodeInfoDeprecated<'de> {
25629 fn drop(&mut self) {
25630 match self.raw.ordinal() {
25631 1 => {
25632 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireService>() };
25633 }
25634
25635 2 => {
25636 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFileObject>() };
25637 }
25638
25639 3 => {
25640 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectoryObject>() };
25641 }
25642
25643 4 => {
25644 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSymlinkObject<'de>>() };
25645 }
25646
25647 _ => unsafe { ::core::hint::unreachable_unchecked() },
25648 }
25649 }
25650}
25651
25652unsafe impl ::fidl_next::Wire for WireNodeInfoDeprecated<'static> {
25653 type Decoded<'de> = WireNodeInfoDeprecated<'de>;
25654
25655 #[inline]
25656 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25657 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25658 ::fidl_next::RawWireUnion::zero_padding(raw);
25659 }
25660}
25661
25662pub mod node_info_deprecated {
25663 pub enum Ref<'de> {
25664 Service(&'de crate::WireService),
25665
25666 File(&'de crate::WireFileObject),
25667
25668 Directory(&'de crate::WireDirectoryObject),
25669
25670 Symlink(&'de crate::WireSymlinkObject<'de>),
25671 }
25672}
25673
25674impl<'de> WireNodeInfoDeprecated<'de> {
25675 pub fn as_ref(&self) -> crate::node_info_deprecated::Ref<'_> {
25676 match self.raw.ordinal() {
25677 1 => crate::node_info_deprecated::Ref::Service(unsafe {
25678 self.raw.get().deref_unchecked::<crate::WireService>()
25679 }),
25680
25681 2 => crate::node_info_deprecated::Ref::File(unsafe {
25682 self.raw.get().deref_unchecked::<crate::WireFileObject>()
25683 }),
25684
25685 3 => crate::node_info_deprecated::Ref::Directory(unsafe {
25686 self.raw.get().deref_unchecked::<crate::WireDirectoryObject>()
25687 }),
25688
25689 4 => crate::node_info_deprecated::Ref::Symlink(unsafe {
25690 self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>()
25691 }),
25692
25693 _ => unsafe { ::core::hint::unreachable_unchecked() },
25694 }
25695 }
25696}
25697
25698unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfoDeprecated<'static>
25699where
25700 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25701 ___D: ::fidl_next::Decoder,
25702 ___D: ::fidl_next::fuchsia::HandleDecoder,
25703{
25704 fn decode(
25705 mut slot: ::fidl_next::Slot<'_, Self>,
25706 decoder: &mut ___D,
25707 ) -> Result<(), ::fidl_next::DecodeError> {
25708 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25709 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
25710 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
25711
25712 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
25713
25714 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
25715 raw, decoder,
25716 )?,
25717
25718 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
25719 raw, decoder,
25720 )?,
25721
25722 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
25723 }
25724
25725 Ok(())
25726 }
25727}
25728
25729impl<'de> ::core::fmt::Debug for WireNodeInfoDeprecated<'de> {
25730 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25731 match self.raw.ordinal() {
25732 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService>().fmt(f) },
25733 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileObject>().fmt(f) },
25734 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryObject>().fmt(f) },
25735 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkObject<'_>>().fmt(f) },
25736 _ => unsafe { ::core::hint::unreachable_unchecked() },
25737 }
25738 }
25739}
25740
25741#[repr(transparent)]
25742pub struct WireOptionalNodeInfoDeprecated<'de> {
25743 raw: ::fidl_next::RawWireUnion,
25744 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25745}
25746
25747unsafe impl ::fidl_next::Wire for WireOptionalNodeInfoDeprecated<'static> {
25748 type Decoded<'de> = WireOptionalNodeInfoDeprecated<'de>;
25749
25750 #[inline]
25751 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25752 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25753 ::fidl_next::RawWireUnion::zero_padding(raw);
25754 }
25755}
25756
25757impl<'de> WireOptionalNodeInfoDeprecated<'de> {
25758 pub fn is_some(&self) -> bool {
25759 self.raw.is_some()
25760 }
25761
25762 pub fn is_none(&self) -> bool {
25763 self.raw.is_none()
25764 }
25765
25766 pub fn as_ref(&self) -> Option<&WireNodeInfoDeprecated<'de>> {
25767 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
25768 }
25769
25770 pub fn into_option(self) -> Option<WireNodeInfoDeprecated<'de>> {
25771 if self.is_some() {
25772 Some(WireNodeInfoDeprecated { raw: self.raw, _phantom: ::core::marker::PhantomData })
25773 } else {
25774 None
25775 }
25776 }
25777}
25778
25779unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodeInfoDeprecated<'static>
25780where
25781 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25782 ___D: ::fidl_next::Decoder,
25783 ___D: ::fidl_next::fuchsia::HandleDecoder,
25784{
25785 fn decode(
25786 mut slot: ::fidl_next::Slot<'_, Self>,
25787 decoder: &mut ___D,
25788 ) -> Result<(), ::fidl_next::DecodeError> {
25789 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25790 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
25791 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
25792
25793 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
25794
25795 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
25796 raw, decoder,
25797 )?,
25798
25799 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject<'static>>(
25800 raw, decoder,
25801 )?,
25802
25803 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
25804 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
25805 }
25806
25807 Ok(())
25808 }
25809}
25810
25811impl<'de> ::core::fmt::Debug for WireOptionalNodeInfoDeprecated<'de> {
25812 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25813 self.as_ref().fmt(f)
25814 }
25815}
25816
25817#[doc = " Flags used when opening a node reference must fall within this mask.\n"]
25818pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: crate::OpenFlags =
25819 crate::OpenFlags::from_bits_retain(46661632);
25820
25821#[doc = " All known rights.\n"]
25822pub const OPEN_RIGHTS: crate::OpenFlags = crate::OpenFlags::from_bits_retain(11);
25823
25824#[doc = " Set of permissions that are expected when opening a node as executable.\n"]
25825pub const PERM_EXECUTABLE: crate::Flags = crate::Flags::from_bits_retain(201);
25826
25827#[doc = " Set of permissions that are expected when opening a node as readable.\n"]
25828pub const PERM_READABLE: crate::Flags = crate::Flags::from_bits_retain(211);
25829
25830#[doc = " Set of permissions that are expected when opening a node as writable.\n"]
25831pub const PERM_WRITABLE: crate::Flags = crate::Flags::from_bits_retain(485);
25832
25833#[doc = " Alias for directory permission alias rw*\n"]
25834pub const RW_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(503);
25835
25836#[doc = " Alias for directory permission alias rx*\n"]
25837pub const RX_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(219);
25838
25839#[doc = " Alias for directory permission alias r*\n"]
25840pub const R_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(211);
25841
25842#[doc = " The name of the extended attribute accessible via the SELinux context attribute.\n"]
25843pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
25844
25845pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
25846
25847#[doc = " A [\'Node\'] which contains a symbolic link.\n"]
25849#[derive(Debug)]
25850pub struct Symlink;
25851
25852impl ::fidl_next::Discoverable for Symlink {
25853 const PROTOCOL_NAME: &'static str = "fuchsia.io.Symlink";
25854}
25855
25856pub mod symlink {
25857 pub mod prelude {
25858 pub use crate::{Symlink, SymlinkClientHandler, SymlinkServerHandler, symlink};
25859
25860 pub use crate::ExtendedAttributeValue;
25861
25862 pub use crate::LinkableLinkIntoRequest;
25863
25864 pub use crate::LinkableLinkIntoResponse;
25865
25866 pub use crate::MutableNodeAttributes;
25867
25868 pub use crate::NodeAttributes2;
25869
25870 pub use crate::NodeDeprecatedCloneRequest;
25871
25872 pub use crate::NodeDeprecatedGetAttrResponse;
25873
25874 pub use crate::NodeDeprecatedGetFlagsResponse;
25875
25876 pub use crate::NodeDeprecatedSetAttrRequest;
25877
25878 pub use crate::NodeDeprecatedSetAttrResponse;
25879
25880 pub use crate::NodeDeprecatedSetFlagsRequest;
25881
25882 pub use crate::NodeDeprecatedSetFlagsResponse;
25883
25884 pub use crate::NodeGetAttributesRequest;
25885
25886 pub use crate::NodeGetExtendedAttributeRequest;
25887
25888 pub use crate::NodeListExtendedAttributesRequest;
25889
25890 pub use crate::NodeOnOpenRequest;
25891
25892 pub use crate::NodeQueryFilesystemResponse;
25893
25894 pub use crate::NodeRemoveExtendedAttributeRequest;
25895
25896 pub use crate::NodeSetExtendedAttributeRequest;
25897
25898 pub use crate::NodeSetFlagsRequest;
25899
25900 pub use crate::NodeGetFlagsResponse;
25901
25902 pub use crate::NodeRemoveExtendedAttributeResponse;
25903
25904 pub use crate::NodeSetExtendedAttributeResponse;
25905
25906 pub use crate::NodeSetFlagsResponse;
25907
25908 pub use crate::NodeSyncResponse;
25909
25910 pub use crate::NodeUpdateAttributesResponse;
25911
25912 pub use crate::Representation;
25913
25914 pub use crate::SymlinkInfo;
25915
25916 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
25917
25918 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
25919
25920 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
25921 }
25922
25923 pub struct LinkInto;
25924
25925 impl ::fidl_next::Method for LinkInto {
25926 const ORDINAL: u64 = 6121399674497678964;
25927
25928 type Protocol = crate::Symlink;
25929
25930 type Request = crate::WireLinkableLinkIntoRequest<'static>;
25931
25932 type Response = ::fidl_next::WireResult<
25933 'static,
25934 crate::WireLinkableLinkIntoResponse,
25935 ::fidl_next::WireI32,
25936 >;
25937 }
25938
25939 pub struct Clone;
25940
25941 impl ::fidl_next::Method for Clone {
25942 const ORDINAL: u64 = 2366825959783828089;
25943
25944 type Protocol = crate::Symlink;
25945
25946 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
25947
25948 type Response = ::fidl_next::Never;
25949 }
25950
25951 pub struct Close;
25952
25953 impl ::fidl_next::Method for Close {
25954 const ORDINAL: u64 = 6540867515453498750;
25955
25956 type Protocol = crate::Symlink;
25957
25958 type Request = ();
25959
25960 type Response = ::fidl_next::WireResult<
25961 'static,
25962 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
25963 ::fidl_next::WireI32,
25964 >;
25965 }
25966
25967 pub struct Query;
25968
25969 impl ::fidl_next::Method for Query {
25970 const ORDINAL: u64 = 2763219980499352582;
25971
25972 type Protocol = crate::Symlink;
25973
25974 type Request = ();
25975
25976 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse<'static>;
25977 }
25978
25979 pub struct DeprecatedClone;
25980
25981 impl ::fidl_next::Method for DeprecatedClone {
25982 const ORDINAL: u64 = 6512600400724287855;
25983
25984 type Protocol = crate::Symlink;
25985
25986 type Request = crate::WireNodeDeprecatedCloneRequest;
25987
25988 type Response = ::fidl_next::Never;
25989 }
25990
25991 pub struct OnOpen;
25992
25993 impl ::fidl_next::Method for OnOpen {
25994 const ORDINAL: u64 = 9207534335756671346;
25995
25996 type Protocol = crate::Symlink;
25997
25998 type Request = ::fidl_next::Never;
25999
26000 type Response = crate::WireNodeOnOpenRequest<'static>;
26001 }
26002
26003 pub struct DeprecatedGetAttr;
26004
26005 impl ::fidl_next::Method for DeprecatedGetAttr {
26006 const ORDINAL: u64 = 8689798978500614909;
26007
26008 type Protocol = crate::Symlink;
26009
26010 type Request = ();
26011
26012 type Response = crate::WireNodeDeprecatedGetAttrResponse;
26013 }
26014
26015 pub struct DeprecatedSetAttr;
26016
26017 impl ::fidl_next::Method for DeprecatedSetAttr {
26018 const ORDINAL: u64 = 4721673413776871238;
26019
26020 type Protocol = crate::Symlink;
26021
26022 type Request = crate::WireNodeDeprecatedSetAttrRequest;
26023
26024 type Response = crate::WireNodeDeprecatedSetAttrResponse;
26025 }
26026
26027 pub struct DeprecatedGetFlags;
26028
26029 impl ::fidl_next::Method for DeprecatedGetFlags {
26030 const ORDINAL: u64 = 6595803110182632097;
26031
26032 type Protocol = crate::Symlink;
26033
26034 type Request = ();
26035
26036 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
26037 }
26038
26039 pub struct DeprecatedSetFlags;
26040
26041 impl ::fidl_next::Method for DeprecatedSetFlags {
26042 const ORDINAL: u64 = 5950864159036794675;
26043
26044 type Protocol = crate::Symlink;
26045
26046 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
26047
26048 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
26049 }
26050
26051 pub struct GetFlags;
26052
26053 impl ::fidl_next::Method for GetFlags {
26054 const ORDINAL: u64 = 105530239381466147;
26055
26056 type Protocol = crate::Symlink;
26057
26058 type Request = ();
26059
26060 type Response = ::fidl_next::WireFlexibleResult<
26061 'static,
26062 crate::WireNodeGetFlagsResponse,
26063 ::fidl_next::WireI32,
26064 >;
26065 }
26066
26067 pub struct SetFlags;
26068
26069 impl ::fidl_next::Method for SetFlags {
26070 const ORDINAL: u64 = 6172186066099445416;
26071
26072 type Protocol = crate::Symlink;
26073
26074 type Request = crate::WireNodeSetFlagsRequest;
26075
26076 type Response = ::fidl_next::WireFlexibleResult<
26077 'static,
26078 crate::WireNodeSetFlagsResponse,
26079 ::fidl_next::WireI32,
26080 >;
26081 }
26082
26083 pub struct QueryFilesystem;
26084
26085 impl ::fidl_next::Method for QueryFilesystem {
26086 const ORDINAL: u64 = 8013111122914313744;
26087
26088 type Protocol = crate::Symlink;
26089
26090 type Request = ();
26091
26092 type Response = crate::WireNodeQueryFilesystemResponse<'static>;
26093 }
26094
26095 pub struct OnRepresentation;
26096
26097 impl ::fidl_next::Method for OnRepresentation {
26098 const ORDINAL: u64 = 6679970090861613324;
26099
26100 type Protocol = crate::Symlink;
26101
26102 type Request = ::fidl_next::Never;
26103
26104 type Response = crate::WireRepresentation<'static>;
26105 }
26106
26107 pub struct GetAttributes;
26108
26109 impl ::fidl_next::Method for GetAttributes {
26110 const ORDINAL: u64 = 4414537700416816443;
26111
26112 type Protocol = crate::Symlink;
26113
26114 type Request = crate::WireNodeGetAttributesRequest;
26115
26116 type Response = ::fidl_next::WireResult<
26117 'static,
26118 crate::WireNodeAttributes2<'static>,
26119 ::fidl_next::WireI32,
26120 >;
26121 }
26122
26123 pub struct UpdateAttributes;
26124
26125 impl ::fidl_next::Method for UpdateAttributes {
26126 const ORDINAL: u64 = 3677402239314018056;
26127
26128 type Protocol = crate::Symlink;
26129
26130 type Request = crate::WireMutableNodeAttributes<'static>;
26131
26132 type Response = ::fidl_next::WireResult<
26133 'static,
26134 crate::WireNodeUpdateAttributesResponse,
26135 ::fidl_next::WireI32,
26136 >;
26137 }
26138
26139 pub struct Sync;
26140
26141 impl ::fidl_next::Method for Sync {
26142 const ORDINAL: u64 = 3196473584242777161;
26143
26144 type Protocol = crate::Symlink;
26145
26146 type Request = ();
26147
26148 type Response =
26149 ::fidl_next::WireResult<'static, crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
26150 }
26151
26152 pub struct ListExtendedAttributes;
26153
26154 impl ::fidl_next::Method for ListExtendedAttributes {
26155 const ORDINAL: u64 = 5431626189872037072;
26156
26157 type Protocol = crate::Symlink;
26158
26159 type Request = crate::WireNodeListExtendedAttributesRequest;
26160
26161 type Response = ::fidl_next::Never;
26162 }
26163
26164 pub struct GetExtendedAttribute;
26165
26166 impl ::fidl_next::Method for GetExtendedAttribute {
26167 const ORDINAL: u64 = 5043930208506967771;
26168
26169 type Protocol = crate::Symlink;
26170
26171 type Request = crate::WireNodeGetExtendedAttributeRequest<'static>;
26172
26173 type Response = ::fidl_next::WireResult<
26174 'static,
26175 crate::WireExtendedAttributeValue<'static>,
26176 ::fidl_next::WireI32,
26177 >;
26178 }
26179
26180 pub struct SetExtendedAttribute;
26181
26182 impl ::fidl_next::Method for SetExtendedAttribute {
26183 const ORDINAL: u64 = 5374223046099989052;
26184
26185 type Protocol = crate::Symlink;
26186
26187 type Request = crate::WireNodeSetExtendedAttributeRequest<'static>;
26188
26189 type Response = ::fidl_next::WireResult<
26190 'static,
26191 crate::WireNodeSetExtendedAttributeResponse,
26192 ::fidl_next::WireI32,
26193 >;
26194 }
26195
26196 pub struct RemoveExtendedAttribute;
26197
26198 impl ::fidl_next::Method for RemoveExtendedAttribute {
26199 const ORDINAL: u64 = 8794297771444732717;
26200
26201 type Protocol = crate::Symlink;
26202
26203 type Request = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
26204
26205 type Response = ::fidl_next::WireResult<
26206 'static,
26207 crate::WireNodeRemoveExtendedAttributeResponse,
26208 ::fidl_next::WireI32,
26209 >;
26210 }
26211
26212 pub struct Describe;
26213
26214 impl ::fidl_next::Method for Describe {
26215 const ORDINAL: u64 = 8371117097481679347;
26216
26217 type Protocol = crate::Symlink;
26218
26219 type Request = ();
26220
26221 type Response = ::fidl_next::WireFlexible<'static, crate::WireSymlinkInfo<'static>>;
26222 }
26223
26224 mod ___detail {
26225
26226 pub struct LinkInto<T0, T1> {
26227 dst_parent_token: T0,
26228
26229 dst: T1,
26230 }
26231
26232 impl<T0, T1> ::fidl_next::Encodable for LinkInto<T0, T1>
26233 where
26234 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireEvent>,
26235 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
26236 {
26237 type Encoded = crate::WireLinkableLinkIntoRequest<'static>;
26238 }
26239
26240 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for LinkInto<T0, T1>
26241 where
26242 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26243 ___E: ::fidl_next::Encoder,
26244 ___E: ::fidl_next::fuchsia::HandleEncoder,
26245 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireEvent>,
26246 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
26247 {
26248 #[inline]
26249 fn encode(
26250 self,
26251 encoder: &mut ___E,
26252 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26253 ) -> Result<(), ::fidl_next::EncodeError> {
26254 ::fidl_next::munge! {
26255 let Self::Encoded {
26256 dst_parent_token,
26257 dst,
26258
26259 } = out;
26260 }
26261
26262 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
26263
26264 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
26265
26266 Ok(())
26267 }
26268 }
26269
26270 pub struct Clone<T0> {
26271 request: T0,
26272 }
26273
26274 impl<T0> ::fidl_next::Encodable for Clone<T0>
26275 where
26276 T0: ::fidl_next::Encodable<
26277 Encoded = ::fidl_next::ServerEnd<
26278 ::fidl_next_fuchsia_unknown::Cloneable,
26279 ::fidl_next::fuchsia::WireChannel,
26280 >,
26281 >,
26282 {
26283 type Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
26284 }
26285
26286 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
26287 where
26288 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26289 ___E: ::fidl_next::fuchsia::HandleEncoder,
26290 T0: ::fidl_next::Encode<
26291 ___E,
26292 Encoded = ::fidl_next::ServerEnd<
26293 ::fidl_next_fuchsia_unknown::Cloneable,
26294 ::fidl_next::fuchsia::WireChannel,
26295 >,
26296 >,
26297 {
26298 #[inline]
26299 fn encode(
26300 self,
26301 encoder: &mut ___E,
26302 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26303 ) -> Result<(), ::fidl_next::EncodeError> {
26304 ::fidl_next::munge! {
26305 let Self::Encoded {
26306 request,
26307
26308 } = out;
26309 }
26310
26311 ::fidl_next::Encode::encode(self.request, encoder, request)?;
26312
26313 Ok(())
26314 }
26315 }
26316
26317 pub struct DeprecatedClone<T0, T1> {
26318 flags: T0,
26319
26320 object: T1,
26321 }
26322
26323 impl<T0, T1> ::fidl_next::Encodable for DeprecatedClone<T0, T1>
26324 where
26325 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
26326 T1: ::fidl_next::Encodable<
26327 Encoded = ::fidl_next::ServerEnd<
26328 crate::Node,
26329 ::fidl_next::fuchsia::WireChannel,
26330 >,
26331 >,
26332 {
26333 type Encoded = crate::WireNodeDeprecatedCloneRequest;
26334 }
26335
26336 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedClone<T0, T1>
26337 where
26338 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26339 ___E: ::fidl_next::fuchsia::HandleEncoder,
26340 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
26341 T1: ::fidl_next::Encode<
26342 ___E,
26343 Encoded = ::fidl_next::ServerEnd<
26344 crate::Node,
26345 ::fidl_next::fuchsia::WireChannel,
26346 >,
26347 >,
26348 {
26349 #[inline]
26350 fn encode(
26351 self,
26352 encoder: &mut ___E,
26353 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26354 ) -> Result<(), ::fidl_next::EncodeError> {
26355 ::fidl_next::munge! {
26356 let Self::Encoded {
26357 flags,
26358 object,
26359
26360 } = out;
26361 }
26362
26363 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
26364
26365 ::fidl_next::Encode::encode(self.object, encoder, object)?;
26366
26367 Ok(())
26368 }
26369 }
26370
26371 pub struct OnOpen<T0, T1> {
26372 s: T0,
26373
26374 info: T1,
26375 }
26376
26377 impl<T0, T1> ::fidl_next::Encodable for OnOpen<T0, T1>
26378 where
26379 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireI32>,
26380 T1: ::fidl_next::Encodable<Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
26381 {
26382 type Encoded = crate::WireNodeOnOpenRequest<'static>;
26383 }
26384
26385 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for OnOpen<T0, T1>
26386 where
26387 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26388 ___E: ::fidl_next::Encoder,
26389 ___E: ::fidl_next::fuchsia::HandleEncoder,
26390 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireI32>,
26391 T1: ::fidl_next::Encode<___E, Encoded = crate::WireOptionalNodeInfoDeprecated<'static>>,
26392 {
26393 #[inline]
26394 fn encode(
26395 self,
26396 encoder: &mut ___E,
26397 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26398 ) -> Result<(), ::fidl_next::EncodeError> {
26399 ::fidl_next::munge! {
26400 let Self::Encoded {
26401 s,
26402 info,
26403
26404 } = out;
26405 }
26406
26407 ::fidl_next::Encode::encode(self.s, encoder, s)?;
26408
26409 ::fidl_next::Encode::encode(self.info, encoder, info)?;
26410
26411 Ok(())
26412 }
26413 }
26414
26415 pub struct DeprecatedSetAttr<T0, T1> {
26416 flags: T0,
26417
26418 attributes: T1,
26419 }
26420
26421 impl<T0, T1> ::fidl_next::Encodable for DeprecatedSetAttr<T0, T1>
26422 where
26423 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributeFlags>,
26424 T1: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributes>,
26425 {
26426 type Encoded = crate::WireNodeDeprecatedSetAttrRequest;
26427 }
26428
26429 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DeprecatedSetAttr<T0, T1>
26430 where
26431 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26432 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributeFlags>,
26433 T1: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributes>,
26434 {
26435 #[inline]
26436 fn encode(
26437 self,
26438 encoder: &mut ___E,
26439 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26440 ) -> Result<(), ::fidl_next::EncodeError> {
26441 ::fidl_next::munge! {
26442 let Self::Encoded {
26443 flags,
26444 attributes,
26445
26446 } = out;
26447 }
26448
26449 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
26450
26451 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
26452
26453 Ok(())
26454 }
26455 }
26456
26457 pub struct DeprecatedSetFlags<T0> {
26458 flags: T0,
26459 }
26460
26461 impl<T0> ::fidl_next::Encodable for DeprecatedSetFlags<T0>
26462 where
26463 T0: ::fidl_next::Encodable<Encoded = crate::WireOpenFlags>,
26464 {
26465 type Encoded = crate::WireNodeDeprecatedSetFlagsRequest;
26466 }
26467
26468 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DeprecatedSetFlags<T0>
26469 where
26470 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26471 T0: ::fidl_next::Encode<___E, Encoded = crate::WireOpenFlags>,
26472 {
26473 #[inline]
26474 fn encode(
26475 self,
26476 encoder: &mut ___E,
26477 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26478 ) -> Result<(), ::fidl_next::EncodeError> {
26479 ::fidl_next::munge! {
26480 let Self::Encoded {
26481 flags,
26482
26483 } = out;
26484 }
26485
26486 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
26487
26488 Ok(())
26489 }
26490 }
26491
26492 pub struct SetFlags<T0> {
26493 flags: T0,
26494 }
26495
26496 impl<T0> ::fidl_next::Encodable for SetFlags<T0>
26497 where
26498 T0: ::fidl_next::Encodable<Encoded = crate::WireFlags>,
26499 {
26500 type Encoded = crate::WireNodeSetFlagsRequest;
26501 }
26502
26503 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetFlags<T0>
26504 where
26505 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26506 T0: ::fidl_next::Encode<___E, Encoded = crate::WireFlags>,
26507 {
26508 #[inline]
26509 fn encode(
26510 self,
26511 encoder: &mut ___E,
26512 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26513 ) -> Result<(), ::fidl_next::EncodeError> {
26514 ::fidl_next::munge! {
26515 let Self::Encoded {
26516 flags,
26517
26518 } = out;
26519 }
26520
26521 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
26522
26523 Ok(())
26524 }
26525 }
26526
26527 pub struct GetAttributes<T0> {
26528 query: T0,
26529 }
26530
26531 impl<T0> ::fidl_next::Encodable for GetAttributes<T0>
26532 where
26533 T0: ::fidl_next::Encodable<Encoded = crate::WireNodeAttributesQuery>,
26534 {
26535 type Encoded = crate::WireNodeGetAttributesRequest;
26536 }
26537
26538 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetAttributes<T0>
26539 where
26540 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26541 T0: ::fidl_next::Encode<___E, Encoded = crate::WireNodeAttributesQuery>,
26542 {
26543 #[inline]
26544 fn encode(
26545 self,
26546 encoder: &mut ___E,
26547 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26548 ) -> Result<(), ::fidl_next::EncodeError> {
26549 ::fidl_next::munge! {
26550 let Self::Encoded {
26551 query,
26552
26553 } = out;
26554 }
26555
26556 ::fidl_next::Encode::encode(self.query, encoder, query)?;
26557
26558 Ok(())
26559 }
26560 }
26561
26562 pub struct ListExtendedAttributes<T0> {
26563 iterator: T0,
26564 }
26565
26566 impl<T0> ::fidl_next::Encodable for ListExtendedAttributes<T0>
26567 where
26568 T0: ::fidl_next::Encodable<
26569 Encoded = ::fidl_next::ServerEnd<
26570 crate::ExtendedAttributeIterator,
26571 ::fidl_next::fuchsia::WireChannel,
26572 >,
26573 >,
26574 {
26575 type Encoded = crate::WireNodeListExtendedAttributesRequest;
26576 }
26577
26578 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ListExtendedAttributes<T0>
26579 where
26580 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26581 ___E: ::fidl_next::fuchsia::HandleEncoder,
26582 T0: ::fidl_next::Encode<
26583 ___E,
26584 Encoded = ::fidl_next::ServerEnd<
26585 crate::ExtendedAttributeIterator,
26586 ::fidl_next::fuchsia::WireChannel,
26587 >,
26588 >,
26589 {
26590 #[inline]
26591 fn encode(
26592 self,
26593 encoder: &mut ___E,
26594 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26595 ) -> Result<(), ::fidl_next::EncodeError> {
26596 ::fidl_next::munge! {
26597 let Self::Encoded {
26598 iterator,
26599
26600 } = out;
26601 }
26602
26603 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
26604
26605 Ok(())
26606 }
26607 }
26608
26609 pub struct GetExtendedAttribute<T0> {
26610 name: T0,
26611 }
26612
26613 impl<T0> ::fidl_next::Encodable for GetExtendedAttribute<T0>
26614 where
26615 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
26616 {
26617 type Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>;
26618 }
26619
26620 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for GetExtendedAttribute<T0>
26621 where
26622 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26623 ___E: ::fidl_next::Encoder,
26624 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
26625 {
26626 #[inline]
26627 fn encode(
26628 self,
26629 encoder: &mut ___E,
26630 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26631 ) -> Result<(), ::fidl_next::EncodeError> {
26632 ::fidl_next::munge! {
26633 let Self::Encoded {
26634 name,
26635
26636 } = out;
26637 }
26638
26639 ::fidl_next::Encode::encode(self.name, encoder, name)?;
26640
26641 Ok(())
26642 }
26643 }
26644
26645 pub struct SetExtendedAttribute<T0, T1, T2> {
26646 name: T0,
26647
26648 value: T1,
26649
26650 mode: T2,
26651 }
26652
26653 impl<T0, T1, T2> ::fidl_next::Encodable for SetExtendedAttribute<T0, T1, T2>
26654 where
26655 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
26656 T1: ::fidl_next::Encodable<Encoded = crate::WireExtendedAttributeValue<'static>>,
26657 T2: ::fidl_next::Encodable<Encoded = crate::WireSetExtendedAttributeMode>,
26658 {
26659 type Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>;
26660 }
26661
26662 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for SetExtendedAttribute<T0, T1, T2>
26663 where
26664 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26665 ___E: ::fidl_next::Encoder,
26666 ___E: ::fidl_next::fuchsia::HandleEncoder,
26667 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
26668 T1: ::fidl_next::Encode<___E, Encoded = crate::WireExtendedAttributeValue<'static>>,
26669 T2: ::fidl_next::Encode<___E, Encoded = crate::WireSetExtendedAttributeMode>,
26670 {
26671 #[inline]
26672 fn encode(
26673 self,
26674 encoder: &mut ___E,
26675 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26676 ) -> Result<(), ::fidl_next::EncodeError> {
26677 ::fidl_next::munge! {
26678 let Self::Encoded {
26679 name,
26680 value,
26681 mode,
26682
26683 } = out;
26684 }
26685
26686 ::fidl_next::Encode::encode(self.name, encoder, name)?;
26687
26688 ::fidl_next::Encode::encode(self.value, encoder, value)?;
26689
26690 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
26691
26692 Ok(())
26693 }
26694 }
26695
26696 pub struct RemoveExtendedAttribute<T0> {
26697 name: T0,
26698 }
26699
26700 impl<T0> ::fidl_next::Encodable for RemoveExtendedAttribute<T0>
26701 where
26702 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
26703 {
26704 type Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>;
26705 }
26706
26707 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for RemoveExtendedAttribute<T0>
26708 where
26709 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26710 ___E: ::fidl_next::Encoder,
26711 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
26712 {
26713 #[inline]
26714 fn encode(
26715 self,
26716 encoder: &mut ___E,
26717 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26718 ) -> Result<(), ::fidl_next::EncodeError> {
26719 ::fidl_next::munge! {
26720 let Self::Encoded {
26721 name,
26722
26723 } = out;
26724 }
26725
26726 ::fidl_next::Encode::encode(self.name, encoder, name)?;
26727
26728 Ok(())
26729 }
26730 }
26731
26732 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Symlink
26733 where
26734 ___T: ::fidl_next::Transport,
26735 {
26736 type ClientSender = SymlinkClientSender<___T>;
26737 type ServerSender = SymlinkServerSender<___T>;
26738 }
26739
26740 #[repr(transparent)]
26742 pub struct SymlinkClientSender<___T: ::fidl_next::Transport> {
26743 #[allow(dead_code)]
26744 sender: ::fidl_next::protocol::ClientSender<___T>,
26745 }
26746
26747 impl<___T> SymlinkClientSender<___T>
26748 where
26749 ___T: ::fidl_next::Transport,
26750 {
26751 #[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"]
26752 pub fn link_into(
26753 &self,
26754
26755 dst_parent_token: impl ::fidl_next::Encode<
26756 <___T as ::fidl_next::Transport>::SendBuffer,
26757 Encoded = ::fidl_next::fuchsia::WireEvent,
26758 >,
26759
26760 dst: impl ::fidl_next::Encode<
26761 <___T as ::fidl_next::Transport>::SendBuffer,
26762 Encoded = ::fidl_next::WireString<'static>,
26763 >,
26764 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
26765 where
26766 <___T as ::fidl_next::Transport>::SendBuffer:
26767 ::fidl_next::encoder::InternalHandleEncoder,
26768 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
26769 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
26770 {
26771 self.link_into_with(LinkInto { dst_parent_token, dst })
26772 }
26773
26774 #[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"]
26775 pub fn link_into_with<___R>(
26776 &self,
26777 request: ___R,
26778 ) -> ::fidl_next::TwoWayFuture<'_, super::LinkInto, ___T>
26779 where
26780 ___R: ::fidl_next::Encode<
26781 <___T as ::fidl_next::Transport>::SendBuffer,
26782 Encoded = crate::WireLinkableLinkIntoRequest<'static>,
26783 >,
26784 {
26785 ::fidl_next::TwoWayFuture::from_untyped(
26786 self.sender.send_two_way(6121399674497678964, request),
26787 )
26788 }
26789
26790 pub fn clone(
26791 &self,
26792
26793 request: impl ::fidl_next::Encode<
26794 <___T as ::fidl_next::Transport>::SendBuffer,
26795 Encoded = ::fidl_next::ServerEnd<
26796 ::fidl_next_fuchsia_unknown::Cloneable,
26797 ::fidl_next::fuchsia::WireChannel,
26798 >,
26799 >,
26800 ) -> ::fidl_next::SendFuture<'_, ___T>
26801 where
26802 <___T as ::fidl_next::Transport>::SendBuffer:
26803 ::fidl_next::encoder::InternalHandleEncoder,
26804 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
26805 {
26806 self.clone_with(Clone { request })
26807 }
26808
26809 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
26810 where
26811 ___R: ::fidl_next::Encode<
26812 <___T as ::fidl_next::Transport>::SendBuffer,
26813 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
26814 >,
26815 {
26816 ::fidl_next::SendFuture::from_untyped(
26817 self.sender.send_one_way(2366825959783828089, request),
26818 )
26819 }
26820
26821 #[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"]
26822 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
26823 ::fidl_next::TwoWayFuture::from_untyped(
26824 self.sender.send_two_way(6540867515453498750, ()),
26825 )
26826 }
26827
26828 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
26829 ::fidl_next::TwoWayFuture::from_untyped(
26830 self.sender.send_two_way(2763219980499352582, ()),
26831 )
26832 }
26833
26834 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
26835 pub fn deprecated_clone(
26836 &self,
26837
26838 flags: impl ::fidl_next::Encode<
26839 <___T as ::fidl_next::Transport>::SendBuffer,
26840 Encoded = crate::WireOpenFlags,
26841 >,
26842
26843 object: impl ::fidl_next::Encode<
26844 <___T as ::fidl_next::Transport>::SendBuffer,
26845 Encoded = ::fidl_next::ServerEnd<
26846 crate::Node,
26847 ::fidl_next::fuchsia::WireChannel,
26848 >,
26849 >,
26850 ) -> ::fidl_next::SendFuture<'_, ___T>
26851 where
26852 <___T as ::fidl_next::Transport>::SendBuffer:
26853 ::fidl_next::encoder::InternalHandleEncoder,
26854 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
26855 {
26856 self.deprecated_clone_with(DeprecatedClone { flags, object })
26857 }
26858
26859 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
26860 pub fn deprecated_clone_with<___R>(
26861 &self,
26862 request: ___R,
26863 ) -> ::fidl_next::SendFuture<'_, ___T>
26864 where
26865 ___R: ::fidl_next::Encode<
26866 <___T as ::fidl_next::Transport>::SendBuffer,
26867 Encoded = crate::WireNodeDeprecatedCloneRequest,
26868 >,
26869 {
26870 ::fidl_next::SendFuture::from_untyped(
26871 self.sender.send_one_way(6512600400724287855, request),
26872 )
26873 }
26874
26875 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
26876 pub fn deprecated_get_attr(
26877 &self,
26878 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetAttr, ___T> {
26879 ::fidl_next::TwoWayFuture::from_untyped(
26880 self.sender.send_two_way(8689798978500614909, ()),
26881 )
26882 }
26883
26884 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
26885 pub fn deprecated_set_attr(
26886 &self,
26887
26888 flags: impl ::fidl_next::Encode<
26889 <___T as ::fidl_next::Transport>::SendBuffer,
26890 Encoded = crate::WireNodeAttributeFlags,
26891 >,
26892
26893 attributes: impl ::fidl_next::Encode<
26894 <___T as ::fidl_next::Transport>::SendBuffer,
26895 Encoded = crate::WireNodeAttributes,
26896 >,
26897 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
26898 where
26899 <___T as ::fidl_next::Transport>::SendBuffer:
26900 ::fidl_next::encoder::InternalHandleEncoder,
26901 {
26902 self.deprecated_set_attr_with(DeprecatedSetAttr { flags, attributes })
26903 }
26904
26905 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
26906 pub fn deprecated_set_attr_with<___R>(
26907 &self,
26908 request: ___R,
26909 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetAttr, ___T>
26910 where
26911 ___R: ::fidl_next::Encode<
26912 <___T as ::fidl_next::Transport>::SendBuffer,
26913 Encoded = crate::WireNodeDeprecatedSetAttrRequest,
26914 >,
26915 {
26916 ::fidl_next::TwoWayFuture::from_untyped(
26917 self.sender.send_two_way(4721673413776871238, request),
26918 )
26919 }
26920
26921 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
26922 pub fn deprecated_get_flags(
26923 &self,
26924 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedGetFlags, ___T> {
26925 ::fidl_next::TwoWayFuture::from_untyped(
26926 self.sender.send_two_way(6595803110182632097, ()),
26927 )
26928 }
26929
26930 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
26931 pub fn deprecated_set_flags(
26932 &self,
26933
26934 flags: impl ::fidl_next::Encode<
26935 <___T as ::fidl_next::Transport>::SendBuffer,
26936 Encoded = crate::WireOpenFlags,
26937 >,
26938 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
26939 where
26940 <___T as ::fidl_next::Transport>::SendBuffer:
26941 ::fidl_next::encoder::InternalHandleEncoder,
26942 {
26943 self.deprecated_set_flags_with(DeprecatedSetFlags { flags })
26944 }
26945
26946 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
26947 pub fn deprecated_set_flags_with<___R>(
26948 &self,
26949 request: ___R,
26950 ) -> ::fidl_next::TwoWayFuture<'_, super::DeprecatedSetFlags, ___T>
26951 where
26952 ___R: ::fidl_next::Encode<
26953 <___T as ::fidl_next::Transport>::SendBuffer,
26954 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
26955 >,
26956 {
26957 ::fidl_next::TwoWayFuture::from_untyped(
26958 self.sender.send_two_way(5950864159036794675, request),
26959 )
26960 }
26961
26962 #[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"]
26963 pub fn get_flags(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFlags, ___T> {
26964 ::fidl_next::TwoWayFuture::from_untyped(
26965 self.sender.send_two_way(105530239381466147, ()),
26966 )
26967 }
26968
26969 #[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"]
26970 pub fn set_flags(
26971 &self,
26972
26973 flags: impl ::fidl_next::Encode<
26974 <___T as ::fidl_next::Transport>::SendBuffer,
26975 Encoded = crate::WireFlags,
26976 >,
26977 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
26978 where
26979 <___T as ::fidl_next::Transport>::SendBuffer:
26980 ::fidl_next::encoder::InternalHandleEncoder,
26981 {
26982 self.set_flags_with(SetFlags { flags })
26983 }
26984
26985 #[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"]
26986 pub fn set_flags_with<___R>(
26987 &self,
26988 request: ___R,
26989 ) -> ::fidl_next::TwoWayFuture<'_, super::SetFlags, ___T>
26990 where
26991 ___R: ::fidl_next::Encode<
26992 <___T as ::fidl_next::Transport>::SendBuffer,
26993 Encoded = crate::WireNodeSetFlagsRequest,
26994 >,
26995 {
26996 ::fidl_next::TwoWayFuture::from_untyped(
26997 self.sender.send_two_way(6172186066099445416, request),
26998 )
26999 }
27000
27001 #[doc = " Query the filesystem for filesystem-specific information.\n"]
27002 pub fn query_filesystem(
27003 &self,
27004 ) -> ::fidl_next::TwoWayFuture<'_, super::QueryFilesystem, ___T> {
27005 ::fidl_next::TwoWayFuture::from_untyped(
27006 self.sender.send_two_way(8013111122914313744, ()),
27007 )
27008 }
27009
27010 #[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"]
27011 pub fn get_attributes(
27012 &self,
27013
27014 query: impl ::fidl_next::Encode<
27015 <___T as ::fidl_next::Transport>::SendBuffer,
27016 Encoded = crate::WireNodeAttributesQuery,
27017 >,
27018 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
27019 where
27020 <___T as ::fidl_next::Transport>::SendBuffer:
27021 ::fidl_next::encoder::InternalHandleEncoder,
27022 {
27023 self.get_attributes_with(GetAttributes { query })
27024 }
27025
27026 #[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"]
27027 pub fn get_attributes_with<___R>(
27028 &self,
27029 request: ___R,
27030 ) -> ::fidl_next::TwoWayFuture<'_, super::GetAttributes, ___T>
27031 where
27032 ___R: ::fidl_next::Encode<
27033 <___T as ::fidl_next::Transport>::SendBuffer,
27034 Encoded = crate::WireNodeGetAttributesRequest,
27035 >,
27036 {
27037 ::fidl_next::TwoWayFuture::from_untyped(
27038 self.sender.send_two_way(4414537700416816443, request),
27039 )
27040 }
27041
27042 #[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"]
27043 pub fn update_attributes_with<___R>(
27044 &self,
27045 request: ___R,
27046 ) -> ::fidl_next::TwoWayFuture<'_, super::UpdateAttributes, ___T>
27047 where
27048 ___R: ::fidl_next::Encode<
27049 <___T as ::fidl_next::Transport>::SendBuffer,
27050 Encoded = crate::WireMutableNodeAttributes<'static>,
27051 >,
27052 {
27053 ::fidl_next::TwoWayFuture::from_untyped(
27054 self.sender.send_two_way(3677402239314018056, request),
27055 )
27056 }
27057
27058 #[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"]
27059 pub fn sync(&self) -> ::fidl_next::TwoWayFuture<'_, super::Sync, ___T> {
27060 ::fidl_next::TwoWayFuture::from_untyped(
27061 self.sender.send_two_way(3196473584242777161, ()),
27062 )
27063 }
27064
27065 #[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"]
27066 pub fn list_extended_attributes(
27067 &self,
27068
27069 iterator: impl ::fidl_next::Encode<
27070 <___T as ::fidl_next::Transport>::SendBuffer,
27071 Encoded = ::fidl_next::ServerEnd<
27072 crate::ExtendedAttributeIterator,
27073 ::fidl_next::fuchsia::WireChannel,
27074 >,
27075 >,
27076 ) -> ::fidl_next::SendFuture<'_, ___T>
27077 where
27078 <___T as ::fidl_next::Transport>::SendBuffer:
27079 ::fidl_next::encoder::InternalHandleEncoder,
27080 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27081 {
27082 self.list_extended_attributes_with(ListExtendedAttributes { iterator })
27083 }
27084
27085 #[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"]
27086 pub fn list_extended_attributes_with<___R>(
27087 &self,
27088 request: ___R,
27089 ) -> ::fidl_next::SendFuture<'_, ___T>
27090 where
27091 ___R: ::fidl_next::Encode<
27092 <___T as ::fidl_next::Transport>::SendBuffer,
27093 Encoded = crate::WireNodeListExtendedAttributesRequest,
27094 >,
27095 {
27096 ::fidl_next::SendFuture::from_untyped(
27097 self.sender.send_one_way(5431626189872037072, request),
27098 )
27099 }
27100
27101 #[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"]
27102 pub fn get_extended_attribute(
27103 &self,
27104
27105 name: impl ::fidl_next::Encode<
27106 <___T as ::fidl_next::Transport>::SendBuffer,
27107 Encoded = ::fidl_next::WireVector<'static, u8>,
27108 >,
27109 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
27110 where
27111 <___T as ::fidl_next::Transport>::SendBuffer:
27112 ::fidl_next::encoder::InternalHandleEncoder,
27113 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
27114 {
27115 self.get_extended_attribute_with(GetExtendedAttribute { name })
27116 }
27117
27118 #[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"]
27119 pub fn get_extended_attribute_with<___R>(
27120 &self,
27121 request: ___R,
27122 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExtendedAttribute, ___T>
27123 where
27124 ___R: ::fidl_next::Encode<
27125 <___T as ::fidl_next::Transport>::SendBuffer,
27126 Encoded = crate::WireNodeGetExtendedAttributeRequest<'static>,
27127 >,
27128 {
27129 ::fidl_next::TwoWayFuture::from_untyped(
27130 self.sender.send_two_way(5043930208506967771, request),
27131 )
27132 }
27133
27134 #[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"]
27135 pub fn set_extended_attribute(
27136 &self,
27137
27138 name: impl ::fidl_next::Encode<
27139 <___T as ::fidl_next::Transport>::SendBuffer,
27140 Encoded = ::fidl_next::WireVector<'static, u8>,
27141 >,
27142
27143 value: impl ::fidl_next::Encode<
27144 <___T as ::fidl_next::Transport>::SendBuffer,
27145 Encoded = crate::WireExtendedAttributeValue<'static>,
27146 >,
27147
27148 mode: impl ::fidl_next::Encode<
27149 <___T as ::fidl_next::Transport>::SendBuffer,
27150 Encoded = crate::WireSetExtendedAttributeMode,
27151 >,
27152 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
27153 where
27154 <___T as ::fidl_next::Transport>::SendBuffer:
27155 ::fidl_next::encoder::InternalHandleEncoder,
27156 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
27157 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27158 {
27159 self.set_extended_attribute_with(SetExtendedAttribute { name, value, mode })
27160 }
27161
27162 #[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"]
27163 pub fn set_extended_attribute_with<___R>(
27164 &self,
27165 request: ___R,
27166 ) -> ::fidl_next::TwoWayFuture<'_, super::SetExtendedAttribute, ___T>
27167 where
27168 ___R: ::fidl_next::Encode<
27169 <___T as ::fidl_next::Transport>::SendBuffer,
27170 Encoded = crate::WireNodeSetExtendedAttributeRequest<'static>,
27171 >,
27172 {
27173 ::fidl_next::TwoWayFuture::from_untyped(
27174 self.sender.send_two_way(5374223046099989052, request),
27175 )
27176 }
27177
27178 #[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"]
27179 pub fn remove_extended_attribute(
27180 &self,
27181
27182 name: impl ::fidl_next::Encode<
27183 <___T as ::fidl_next::Transport>::SendBuffer,
27184 Encoded = ::fidl_next::WireVector<'static, u8>,
27185 >,
27186 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
27187 where
27188 <___T as ::fidl_next::Transport>::SendBuffer:
27189 ::fidl_next::encoder::InternalHandleEncoder,
27190 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
27191 {
27192 self.remove_extended_attribute_with(RemoveExtendedAttribute { name })
27193 }
27194
27195 #[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"]
27196 pub fn remove_extended_attribute_with<___R>(
27197 &self,
27198 request: ___R,
27199 ) -> ::fidl_next::TwoWayFuture<'_, super::RemoveExtendedAttribute, ___T>
27200 where
27201 ___R: ::fidl_next::Encode<
27202 <___T as ::fidl_next::Transport>::SendBuffer,
27203 Encoded = crate::WireNodeRemoveExtendedAttributeRequest<'static>,
27204 >,
27205 {
27206 ::fidl_next::TwoWayFuture::from_untyped(
27207 self.sender.send_two_way(8794297771444732717, request),
27208 )
27209 }
27210
27211 pub fn describe(&self) -> ::fidl_next::TwoWayFuture<'_, super::Describe, ___T> {
27212 ::fidl_next::TwoWayFuture::from_untyped(
27213 self.sender.send_two_way(8371117097481679347, ()),
27214 )
27215 }
27216 }
27217
27218 #[repr(transparent)]
27220 pub struct SymlinkServerSender<___T: ::fidl_next::Transport> {
27221 sender: ::fidl_next::protocol::ServerSender<___T>,
27222 }
27223
27224 impl<___T> SymlinkServerSender<___T>
27225 where
27226 ___T: ::fidl_next::Transport,
27227 {
27228 #[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"]
27229 pub fn on_open(
27230 &self,
27231
27232 s: impl ::fidl_next::Encode<
27233 <___T as ::fidl_next::Transport>::SendBuffer,
27234 Encoded = ::fidl_next::WireI32,
27235 >,
27236
27237 info: impl ::fidl_next::Encode<
27238 <___T as ::fidl_next::Transport>::SendBuffer,
27239 Encoded = crate::WireOptionalNodeInfoDeprecated<'static>,
27240 >,
27241 ) -> ::fidl_next::SendFuture<'_, ___T>
27242 where
27243 <___T as ::fidl_next::Transport>::SendBuffer:
27244 ::fidl_next::encoder::InternalHandleEncoder,
27245 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
27246 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
27247 {
27248 self.on_open_with(OnOpen { s, info })
27249 }
27250
27251 #[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"]
27252
27253 pub fn on_open_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
27254 where
27255 ___R: ::fidl_next::Encode<
27256 <___T as ::fidl_next::Transport>::SendBuffer,
27257 Encoded = <super::OnOpen as ::fidl_next::Method>::Response,
27258 >,
27259 {
27260 ::fidl_next::SendFuture::from_untyped(
27261 self.sender.send_event(9207534335756671346, request),
27262 )
27263 }
27264
27265 #[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"]
27266
27267 pub fn on_representation_with<___R>(
27268 &self,
27269 request: ___R,
27270 ) -> ::fidl_next::SendFuture<'_, ___T>
27271 where
27272 ___R: ::fidl_next::Encode<
27273 <___T as ::fidl_next::Transport>::SendBuffer,
27274 Encoded = <super::OnRepresentation as ::fidl_next::Method>::Response,
27275 >,
27276 {
27277 ::fidl_next::SendFuture::from_untyped(
27278 self.sender.send_event(6679970090861613324, request),
27279 )
27280 }
27281 }
27282 }
27283}
27284
27285pub trait SymlinkClientHandler<
27289 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
27290 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
27291>
27292{
27293 #[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"]
27294 fn on_open(
27295 &mut self,
27296 sender: &::fidl_next::ClientSender<Symlink, ___T>,
27297
27298 event: ::fidl_next::Response<symlink::OnOpen, ___T>,
27299 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27300
27301 #[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"]
27302 fn on_representation(
27303 &mut self,
27304 sender: &::fidl_next::ClientSender<Symlink, ___T>,
27305
27306 event: ::fidl_next::Response<symlink::OnRepresentation, ___T>,
27307 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27308
27309 fn on_unknown_interaction(
27310 &mut self,
27311 sender: &::fidl_next::ClientSender<Symlink, ___T>,
27312 ordinal: u64,
27313 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
27314 sender.close();
27315 ::core::future::ready(())
27316 }
27317}
27318
27319impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Symlink
27320where
27321 ___H: SymlinkClientHandler<___T> + ::core::marker::Send,
27322 ___T: ::fidl_next::Transport,
27323 <symlink::LinkInto as ::fidl_next::Method>::Response:
27324 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27325 <symlink::Close as ::fidl_next::Method>::Response:
27326 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27327 <symlink::Query as ::fidl_next::Method>::Response:
27328 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27329 <symlink::OnOpen as ::fidl_next::Method>::Response:
27330 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27331 <symlink::DeprecatedGetAttr as ::fidl_next::Method>::Response:
27332 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27333 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Response:
27334 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27335 <symlink::DeprecatedGetFlags as ::fidl_next::Method>::Response:
27336 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27337 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Response:
27338 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27339 <symlink::GetFlags as ::fidl_next::Method>::Response:
27340 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27341 <symlink::SetFlags as ::fidl_next::Method>::Response:
27342 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27343 <symlink::QueryFilesystem as ::fidl_next::Method>::Response:
27344 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27345 <symlink::OnRepresentation as ::fidl_next::Method>::Response:
27346 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27347 <symlink::GetAttributes as ::fidl_next::Method>::Response:
27348 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27349 <symlink::UpdateAttributes as ::fidl_next::Method>::Response:
27350 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27351 <symlink::Sync as ::fidl_next::Method>::Response:
27352 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27353 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Response:
27354 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27355 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Response:
27356 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27357 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
27358 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27359 <symlink::Describe as ::fidl_next::Method>::Response:
27360 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27361{
27362 async fn on_event(
27363 handler: &mut ___H,
27364 sender: &::fidl_next::ClientSender<Self, ___T>,
27365 ordinal: u64,
27366 buffer: ___T::RecvBuffer,
27367 ) {
27368 match ordinal {
27369 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
27370 Ok(decoded) => handler.on_open(sender, decoded).await,
27371 Err(e) => sender.close(),
27372 },
27373
27374 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
27375 Ok(decoded) => handler.on_representation(sender, decoded).await,
27376 Err(e) => sender.close(),
27377 },
27378
27379 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
27380 }
27381 }
27382}
27383
27384pub trait SymlinkServerHandler<
27388 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
27389 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
27390>
27391{
27392 #[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"]
27393 fn link_into(
27394 &mut self,
27395 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27396
27397 request: ::fidl_next::Request<symlink::LinkInto, ___T>,
27398
27399 responder: ::fidl_next::Responder<symlink::LinkInto>,
27400 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27401
27402 fn clone(
27403 &mut self,
27404 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27405
27406 request: ::fidl_next::Request<symlink::Clone, ___T>,
27407 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27408
27409 #[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"]
27410 fn close(
27411 &mut self,
27412 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27413
27414 responder: ::fidl_next::Responder<symlink::Close>,
27415 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27416
27417 fn query(
27418 &mut self,
27419 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27420
27421 responder: ::fidl_next::Responder<symlink::Query>,
27422 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27423
27424 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
27425 fn deprecated_clone(
27426 &mut self,
27427 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27428
27429 request: ::fidl_next::Request<symlink::DeprecatedClone, ___T>,
27430 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27431
27432 #[doc = " DEPRECATED - Use `Node.GetAttributes` instead.\n"]
27433 fn deprecated_get_attr(
27434 &mut self,
27435 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27436
27437 responder: ::fidl_next::Responder<symlink::DeprecatedGetAttr>,
27438 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27439
27440 #[doc = " DEPRECATED - Use `Node.UpdateAttributes` instead.\n"]
27441 fn deprecated_set_attr(
27442 &mut self,
27443 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27444
27445 request: ::fidl_next::Request<symlink::DeprecatedSetAttr, ___T>,
27446
27447 responder: ::fidl_next::Responder<symlink::DeprecatedSetAttr>,
27448 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27449
27450 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
27451 fn deprecated_get_flags(
27452 &mut self,
27453 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27454
27455 responder: ::fidl_next::Responder<symlink::DeprecatedGetFlags>,
27456 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27457
27458 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
27459 fn deprecated_set_flags(
27460 &mut self,
27461 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27462
27463 request: ::fidl_next::Request<symlink::DeprecatedSetFlags, ___T>,
27464
27465 responder: ::fidl_next::Responder<symlink::DeprecatedSetFlags>,
27466 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27467
27468 #[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"]
27469 fn get_flags(
27470 &mut self,
27471 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27472
27473 responder: ::fidl_next::Responder<symlink::GetFlags>,
27474 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27475
27476 #[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"]
27477 fn set_flags(
27478 &mut self,
27479 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27480
27481 request: ::fidl_next::Request<symlink::SetFlags, ___T>,
27482
27483 responder: ::fidl_next::Responder<symlink::SetFlags>,
27484 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27485
27486 #[doc = " Query the filesystem for filesystem-specific information.\n"]
27487 fn query_filesystem(
27488 &mut self,
27489 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27490
27491 responder: ::fidl_next::Responder<symlink::QueryFilesystem>,
27492 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27493
27494 #[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"]
27495 fn get_attributes(
27496 &mut self,
27497 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27498
27499 request: ::fidl_next::Request<symlink::GetAttributes, ___T>,
27500
27501 responder: ::fidl_next::Responder<symlink::GetAttributes>,
27502 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27503
27504 #[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"]
27505 fn update_attributes(
27506 &mut self,
27507 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27508
27509 request: ::fidl_next::Request<symlink::UpdateAttributes, ___T>,
27510
27511 responder: ::fidl_next::Responder<symlink::UpdateAttributes>,
27512 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27513
27514 #[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"]
27515 fn sync(
27516 &mut self,
27517 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27518
27519 responder: ::fidl_next::Responder<symlink::Sync>,
27520 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27521
27522 #[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"]
27523 fn list_extended_attributes(
27524 &mut self,
27525 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27526
27527 request: ::fidl_next::Request<symlink::ListExtendedAttributes, ___T>,
27528 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27529
27530 #[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"]
27531 fn get_extended_attribute(
27532 &mut self,
27533 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27534
27535 request: ::fidl_next::Request<symlink::GetExtendedAttribute, ___T>,
27536
27537 responder: ::fidl_next::Responder<symlink::GetExtendedAttribute>,
27538 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27539
27540 #[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"]
27541 fn set_extended_attribute(
27542 &mut self,
27543 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27544
27545 request: ::fidl_next::Request<symlink::SetExtendedAttribute, ___T>,
27546
27547 responder: ::fidl_next::Responder<symlink::SetExtendedAttribute>,
27548 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27549
27550 #[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"]
27551 fn remove_extended_attribute(
27552 &mut self,
27553 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27554
27555 request: ::fidl_next::Request<symlink::RemoveExtendedAttribute, ___T>,
27556
27557 responder: ::fidl_next::Responder<symlink::RemoveExtendedAttribute>,
27558 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27559
27560 fn describe(
27561 &mut self,
27562 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27563
27564 responder: ::fidl_next::Responder<symlink::Describe>,
27565 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
27566
27567 fn on_unknown_interaction(
27568 &mut self,
27569 sender: &::fidl_next::ServerSender<Symlink, ___T>,
27570 ordinal: u64,
27571 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
27572 sender.close();
27573 ::core::future::ready(())
27574 }
27575}
27576
27577impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Symlink
27578where
27579 ___H: SymlinkServerHandler<___T> + ::core::marker::Send,
27580 ___T: ::fidl_next::Transport,
27581 <symlink::LinkInto as ::fidl_next::Method>::Request:
27582 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27583 <symlink::Clone as ::fidl_next::Method>::Request:
27584 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27585 <symlink::DeprecatedClone as ::fidl_next::Method>::Request:
27586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27587 <symlink::DeprecatedSetAttr as ::fidl_next::Method>::Request:
27588 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27589 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Request:
27590 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27591 <symlink::SetFlags as ::fidl_next::Method>::Request:
27592 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27593 <symlink::GetAttributes as ::fidl_next::Method>::Request:
27594 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27595 <symlink::UpdateAttributes as ::fidl_next::Method>::Request:
27596 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27597 <symlink::ListExtendedAttributes as ::fidl_next::Method>::Request:
27598 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27599 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Request:
27600 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27601 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Request:
27602 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27603 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Request:
27604 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
27605{
27606 async fn on_one_way(
27607 handler: &mut ___H,
27608 sender: &::fidl_next::ServerSender<Self, ___T>,
27609 ordinal: u64,
27610 buffer: ___T::RecvBuffer,
27611 ) {
27612 match ordinal {
27613 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
27614 Ok(decoded) => handler.clone(sender, decoded).await,
27615 Err(e) => sender.close(),
27616 },
27617
27618 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
27619 Ok(decoded) => handler.deprecated_clone(sender, decoded).await,
27620 Err(e) => sender.close(),
27621 },
27622
27623 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
27624 Ok(decoded) => handler.list_extended_attributes(sender, decoded).await,
27625 Err(e) => sender.close(),
27626 },
27627
27628 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
27629 }
27630 }
27631
27632 async fn on_two_way(
27633 handler: &mut ___H,
27634 sender: &::fidl_next::ServerSender<Self, ___T>,
27635 ordinal: u64,
27636 buffer: ___T::RecvBuffer,
27637 responder: ::fidl_next::protocol::Responder,
27638 ) {
27639 match ordinal {
27640 6121399674497678964 => {
27641 let responder = ::fidl_next::Responder::from_untyped(responder);
27642
27643 match ::fidl_next::DecoderExt::decode(buffer) {
27644 Ok(decoded) => handler.link_into(sender, decoded, responder).await,
27645 Err(e) => sender.close(),
27646 }
27647 }
27648
27649 6540867515453498750 => {
27650 let responder = ::fidl_next::Responder::from_untyped(responder);
27651
27652 handler.close(sender, responder).await;
27653 }
27654
27655 2763219980499352582 => {
27656 let responder = ::fidl_next::Responder::from_untyped(responder);
27657
27658 handler.query(sender, responder).await;
27659 }
27660
27661 8689798978500614909 => {
27662 let responder = ::fidl_next::Responder::from_untyped(responder);
27663
27664 handler.deprecated_get_attr(sender, responder).await;
27665 }
27666
27667 4721673413776871238 => {
27668 let responder = ::fidl_next::Responder::from_untyped(responder);
27669
27670 match ::fidl_next::DecoderExt::decode(buffer) {
27671 Ok(decoded) => handler.deprecated_set_attr(sender, decoded, responder).await,
27672 Err(e) => sender.close(),
27673 }
27674 }
27675
27676 6595803110182632097 => {
27677 let responder = ::fidl_next::Responder::from_untyped(responder);
27678
27679 handler.deprecated_get_flags(sender, responder).await;
27680 }
27681
27682 5950864159036794675 => {
27683 let responder = ::fidl_next::Responder::from_untyped(responder);
27684
27685 match ::fidl_next::DecoderExt::decode(buffer) {
27686 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder).await,
27687 Err(e) => sender.close(),
27688 }
27689 }
27690
27691 105530239381466147 => {
27692 let responder = ::fidl_next::Responder::from_untyped(responder);
27693
27694 handler.get_flags(sender, responder).await;
27695 }
27696
27697 6172186066099445416 => {
27698 let responder = ::fidl_next::Responder::from_untyped(responder);
27699
27700 match ::fidl_next::DecoderExt::decode(buffer) {
27701 Ok(decoded) => handler.set_flags(sender, decoded, responder).await,
27702 Err(e) => sender.close(),
27703 }
27704 }
27705
27706 8013111122914313744 => {
27707 let responder = ::fidl_next::Responder::from_untyped(responder);
27708
27709 handler.query_filesystem(sender, responder).await;
27710 }
27711
27712 4414537700416816443 => {
27713 let responder = ::fidl_next::Responder::from_untyped(responder);
27714
27715 match ::fidl_next::DecoderExt::decode(buffer) {
27716 Ok(decoded) => handler.get_attributes(sender, decoded, responder).await,
27717 Err(e) => sender.close(),
27718 }
27719 }
27720
27721 3677402239314018056 => {
27722 let responder = ::fidl_next::Responder::from_untyped(responder);
27723
27724 match ::fidl_next::DecoderExt::decode(buffer) {
27725 Ok(decoded) => handler.update_attributes(sender, decoded, responder).await,
27726 Err(e) => sender.close(),
27727 }
27728 }
27729
27730 3196473584242777161 => {
27731 let responder = ::fidl_next::Responder::from_untyped(responder);
27732
27733 handler.sync(sender, responder).await;
27734 }
27735
27736 5043930208506967771 => {
27737 let responder = ::fidl_next::Responder::from_untyped(responder);
27738
27739 match ::fidl_next::DecoderExt::decode(buffer) {
27740 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder).await,
27741 Err(e) => sender.close(),
27742 }
27743 }
27744
27745 5374223046099989052 => {
27746 let responder = ::fidl_next::Responder::from_untyped(responder);
27747
27748 match ::fidl_next::DecoderExt::decode(buffer) {
27749 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder).await,
27750 Err(e) => sender.close(),
27751 }
27752 }
27753
27754 8794297771444732717 => {
27755 let responder = ::fidl_next::Responder::from_untyped(responder);
27756
27757 match ::fidl_next::DecoderExt::decode(buffer) {
27758 Ok(decoded) => {
27759 handler.remove_extended_attribute(sender, decoded, responder).await
27760 }
27761 Err(e) => sender.close(),
27762 }
27763 }
27764
27765 8371117097481679347 => {
27766 let responder = ::fidl_next::Responder::from_untyped(responder);
27767
27768 handler.describe(sender, responder).await;
27769 }
27770
27771 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
27772 }
27773 }
27774}
27775
27776#[doc = " Alias for directory permission alias w*\n"]
27777pub const W_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(485);
27778
27779#[derive(Clone, Copy, Debug, PartialEq, Eq)]
27780#[repr(u8)]
27781pub enum WatchEvent {
27782 Deleted = 0,
27783 Added = 1,
27784 Removed = 2,
27785 Existing = 3,
27786 Idle = 4,
27787}
27788
27789impl ::fidl_next::Encodable for WatchEvent {
27790 type Encoded = WireWatchEvent;
27791}
27792impl ::std::convert::TryFrom<u8> for WatchEvent {
27793 type Error = ::fidl_next::UnknownStrictEnumMemberError;
27794 fn try_from(value: u8) -> Result<Self, Self::Error> {
27795 match value {
27796 0 => Ok(Self::Deleted),
27797 1 => Ok(Self::Added),
27798 2 => Ok(Self::Removed),
27799 3 => Ok(Self::Existing),
27800 4 => Ok(Self::Idle),
27801
27802 _ => Err(Self::Error::new(value.into())),
27803 }
27804 }
27805}
27806
27807unsafe impl<___E> ::fidl_next::Encode<___E> for WatchEvent
27808where
27809 ___E: ?Sized,
27810{
27811 #[inline]
27812 fn encode(
27813 self,
27814 encoder: &mut ___E,
27815 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27816 ) -> Result<(), ::fidl_next::EncodeError> {
27817 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
27818 }
27819}
27820
27821unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchEvent
27822where
27823 ___E: ?Sized,
27824{
27825 #[inline]
27826 fn encode_ref(
27827 &self,
27828 encoder: &mut ___E,
27829 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27830 ) -> Result<(), ::fidl_next::EncodeError> {
27831 ::fidl_next::munge!(let WireWatchEvent { value } = out);
27832 let _ = value.write(u8::from(match *self {
27833 Self::Deleted => 0,
27834
27835 Self::Added => 1,
27836
27837 Self::Removed => 2,
27838
27839 Self::Existing => 3,
27840
27841 Self::Idle => 4,
27842 }));
27843
27844 Ok(())
27845 }
27846}
27847
27848impl ::core::convert::From<WireWatchEvent> for WatchEvent {
27849 fn from(wire: WireWatchEvent) -> Self {
27850 match u8::from(wire.value) {
27851 0 => Self::Deleted,
27852
27853 1 => Self::Added,
27854
27855 2 => Self::Removed,
27856
27857 3 => Self::Existing,
27858
27859 4 => Self::Idle,
27860
27861 _ => unsafe { ::core::hint::unreachable_unchecked() },
27862 }
27863 }
27864}
27865
27866impl ::fidl_next::FromWire<WireWatchEvent> for WatchEvent {
27867 #[inline]
27868 fn from_wire(wire: WireWatchEvent) -> Self {
27869 Self::from(wire)
27870 }
27871}
27872
27873impl ::fidl_next::FromWireRef<WireWatchEvent> for WatchEvent {
27874 #[inline]
27875 fn from_wire_ref(wire: &WireWatchEvent) -> Self {
27876 Self::from(*wire)
27877 }
27878}
27879
27880#[derive(Clone, Copy, Debug, PartialEq, Eq)]
27882#[repr(transparent)]
27883pub struct WireWatchEvent {
27884 value: u8,
27885}
27886
27887unsafe impl ::fidl_next::Wire for WireWatchEvent {
27888 type Decoded<'de> = Self;
27889
27890 #[inline]
27891 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
27892 }
27894}
27895
27896impl WireWatchEvent {
27897 pub const DELETED: WireWatchEvent = WireWatchEvent { value: 0 };
27898
27899 pub const ADDED: WireWatchEvent = WireWatchEvent { value: 1 };
27900
27901 pub const REMOVED: WireWatchEvent = WireWatchEvent { value: 2 };
27902
27903 pub const EXISTING: WireWatchEvent = WireWatchEvent { value: 3 };
27904
27905 pub const IDLE: WireWatchEvent = WireWatchEvent { value: 4 };
27906}
27907
27908unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchEvent
27909where
27910 ___D: ?Sized,
27911{
27912 fn decode(
27913 slot: ::fidl_next::Slot<'_, Self>,
27914 _: &mut ___D,
27915 ) -> Result<(), ::fidl_next::DecodeError> {
27916 ::fidl_next::munge!(let Self { value } = slot);
27917
27918 match u8::from(*value) {
27919 0 | 1 | 2 | 3 | 4 => (),
27920 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
27921 }
27922
27923 Ok(())
27924 }
27925}
27926
27927impl ::core::convert::From<WatchEvent> for WireWatchEvent {
27928 fn from(natural: WatchEvent) -> Self {
27929 match natural {
27930 WatchEvent::Deleted => WireWatchEvent::DELETED,
27931
27932 WatchEvent::Added => WireWatchEvent::ADDED,
27933
27934 WatchEvent::Removed => WireWatchEvent::REMOVED,
27935
27936 WatchEvent::Existing => WireWatchEvent::EXISTING,
27937
27938 WatchEvent::Idle => WireWatchEvent::IDLE,
27939 }
27940 }
27941}
27942
27943#[doc = " Alias for directory permission alias x*\n"]
27944pub const X_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(201);
27945
27946pub mod compat {
27948
27949 impl ::fidl_next::CompatFrom<crate::Operations> for ::fidl_fuchsia_io::Operations {
27950 fn compat_from(value: crate::Operations) -> Self {
27951 Self::from_bits_retain(value.bits())
27952 }
27953 }
27954
27955 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Operations> for crate::Operations {
27956 fn compat_from(value: ::fidl_fuchsia_io::Operations) -> Self {
27957 Self::from_bits_retain(value.bits())
27958 }
27959 }
27960
27961 impl ::fidl_next::CompatFrom<crate::SeekOrigin> for ::fidl_fuchsia_io::SeekOrigin {
27962 fn compat_from(value: crate::SeekOrigin) -> Self {
27963 match value {
27964 crate::SeekOrigin::Start => Self::Start,
27965
27966 crate::SeekOrigin::Current => Self::Current,
27967
27968 crate::SeekOrigin::End => Self::End,
27969 }
27970 }
27971 }
27972
27973 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SeekOrigin> for crate::SeekOrigin {
27974 fn compat_from(value: ::fidl_fuchsia_io::SeekOrigin) -> Self {
27975 match value {
27976 ::fidl_fuchsia_io::SeekOrigin::Start => Self::Start,
27977
27978 ::fidl_fuchsia_io::SeekOrigin::Current => Self::Current,
27979
27980 ::fidl_fuchsia_io::SeekOrigin::End => Self::End,
27981 }
27982 }
27983 }
27984
27985 impl ::fidl_next::CompatFrom<crate::AdvisoryLockRange> for ::fidl_fuchsia_io::AdvisoryLockRange {
27986 #[inline]
27987 fn compat_from(value: crate::AdvisoryLockRange) -> Self {
27988 Self {
27989 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
27990
27991 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
27992
27993 length: ::fidl_next::CompatFrom::compat_from(value.length),
27994 }
27995 }
27996 }
27997
27998 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockRange> for crate::AdvisoryLockRange {
27999 #[inline]
28000 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockRange) -> Self {
28001 Self {
28002 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
28003
28004 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
28005
28006 length: ::fidl_next::CompatFrom::compat_from(value.length),
28007 }
28008 }
28009 }
28010
28011 impl ::fidl_next::CompatFrom<crate::AdvisoryLockType> for ::fidl_fuchsia_io::AdvisoryLockType {
28012 fn compat_from(value: crate::AdvisoryLockType) -> Self {
28013 match value {
28014 crate::AdvisoryLockType::Read => Self::Read,
28015
28016 crate::AdvisoryLockType::Write => Self::Write,
28017
28018 crate::AdvisoryLockType::Unlock => Self::Unlock,
28019 }
28020 }
28021 }
28022
28023 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockType> for crate::AdvisoryLockType {
28024 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockType) -> Self {
28025 match value {
28026 ::fidl_fuchsia_io::AdvisoryLockType::Read => Self::Read,
28027
28028 ::fidl_fuchsia_io::AdvisoryLockType::Write => Self::Write,
28029
28030 ::fidl_fuchsia_io::AdvisoryLockType::Unlock => Self::Unlock,
28031 }
28032 }
28033 }
28034
28035 impl ::fidl_next::CompatFrom<crate::AdvisoryLockRequest>
28036 for ::fidl_fuchsia_io::AdvisoryLockRequest
28037 {
28038 fn compat_from(value: crate::AdvisoryLockRequest) -> Self {
28039 Self {
28040 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
28041
28042 range: ::fidl_next::CompatFrom::compat_from(value.range),
28043
28044 wait: ::fidl_next::CompatFrom::compat_from(value.wait),
28045
28046 __source_breaking: ::fidl::marker::SourceBreaking,
28047 }
28048 }
28049 }
28050
28051 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockRequest>
28052 for crate::AdvisoryLockRequest
28053 {
28054 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockRequest) -> Self {
28055 Self {
28056 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
28057
28058 range: ::fidl_next::CompatFrom::compat_from(value.range),
28059
28060 wait: ::fidl_next::CompatFrom::compat_from(value.wait),
28061 }
28062 }
28063 }
28064
28065 impl ::fidl_next::CompatFrom<crate::AdvisoryLockingAdvisoryLockRequest>
28066 for ::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest
28067 {
28068 #[inline]
28069 fn compat_from(value: crate::AdvisoryLockingAdvisoryLockRequest) -> Self {
28070 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
28071 }
28072 }
28073
28074 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest>
28075 for crate::AdvisoryLockingAdvisoryLockRequest
28076 {
28077 #[inline]
28078 fn compat_from(value: ::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest) -> Self {
28079 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
28080 }
28081 }
28082
28083 #[cfg(target_os = "fuchsia")]
28084 pub type AdvisoryLockingProxy = ::fidl_next::ClientSender<crate::AdvisoryLocking>;
28087
28088 impl ::fidl_next::CompatFrom<crate::AdvisoryLocking> for ::fidl_fuchsia_io::AdvisoryLockingMarker {
28089 fn compat_from(_: crate::AdvisoryLocking) -> Self {
28090 Self
28091 }
28092 }
28093
28094 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AdvisoryLockingMarker> for crate::AdvisoryLocking {
28095 fn compat_from(_: ::fidl_fuchsia_io::AdvisoryLockingMarker) -> Self {
28096 Self
28097 }
28098 }
28099
28100 #[cfg(target_os = "fuchsia")]
28101
28102 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::AdvisoryLockingProxy>
28103 for crate::AdvisoryLocking
28104 {
28105 fn client_compat_from(
28106 proxy: ::fidl_fuchsia_io::AdvisoryLockingProxy,
28107 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
28108 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
28109 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
28110 ::fidl_next::Client::new(client_end)
28111 }
28112 }
28113
28114 impl ::fidl_next::CompatFrom<crate::AllocateMode> for ::fidl_fuchsia_io::AllocateMode {
28115 fn compat_from(value: crate::AllocateMode) -> Self {
28116 Self::from_bits_retain(value.bits())
28117 }
28118 }
28119
28120 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::AllocateMode> for crate::AllocateMode {
28121 fn compat_from(value: ::fidl_fuchsia_io::AllocateMode) -> Self {
28122 Self::from_bits_retain(value.bits())
28123 }
28124 }
28125
28126 impl ::fidl_next::CompatFrom<crate::ConnectionInfo> for ::fidl_fuchsia_io::ConnectionInfo {
28127 fn compat_from(value: crate::ConnectionInfo) -> Self {
28128 Self {
28129 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
28130
28131 __source_breaking: ::fidl::marker::SourceBreaking,
28132 }
28133 }
28134 }
28135
28136 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ConnectionInfo> for crate::ConnectionInfo {
28137 fn compat_from(value: ::fidl_fuchsia_io::ConnectionInfo) -> Self {
28138 Self { rights: ::fidl_next::CompatFrom::compat_from(value.rights) }
28139 }
28140 }
28141
28142 impl ::fidl_next::CompatFrom<crate::OpenFlags> for ::fidl_fuchsia_io::OpenFlags {
28143 fn compat_from(value: crate::OpenFlags) -> Self {
28144 Self::from_bits_retain(value.bits())
28145 }
28146 }
28147
28148 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::OpenFlags> for crate::OpenFlags {
28149 fn compat_from(value: ::fidl_fuchsia_io::OpenFlags) -> Self {
28150 Self::from_bits_retain(value.bits())
28151 }
28152 }
28153
28154 impl ::fidl_next::CompatFrom<crate::NodeAttributes> for ::fidl_fuchsia_io::NodeAttributes {
28155 #[inline]
28156 fn compat_from(value: crate::NodeAttributes) -> Self {
28157 Self {
28158 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28159
28160 id: ::fidl_next::CompatFrom::compat_from(value.id),
28161
28162 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
28163
28164 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
28165
28166 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
28167
28168 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
28169
28170 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
28171 }
28172 }
28173 }
28174
28175 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributes> for crate::NodeAttributes {
28176 #[inline]
28177 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributes) -> Self {
28178 Self {
28179 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28180
28181 id: ::fidl_next::CompatFrom::compat_from(value.id),
28182
28183 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
28184
28185 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
28186
28187 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
28188
28189 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
28190
28191 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
28192 }
28193 }
28194 }
28195
28196 impl ::fidl_next::CompatFrom<crate::NodeAttributeFlags> for ::fidl_fuchsia_io::NodeAttributeFlags {
28197 fn compat_from(value: crate::NodeAttributeFlags) -> Self {
28198 Self::from_bits_retain(value.bits())
28199 }
28200 }
28201
28202 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributeFlags> for crate::NodeAttributeFlags {
28203 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributeFlags) -> Self {
28204 Self::from_bits_retain(value.bits())
28205 }
28206 }
28207
28208 impl ::fidl_next::CompatFrom<crate::NodeQueryFilesystemResponse>
28209 for ::fidl_fuchsia_io::NodeQueryFilesystemResponse
28210 {
28211 #[inline]
28212 fn compat_from(value: crate::NodeQueryFilesystemResponse) -> Self {
28213 Self {
28214 s: ::fidl_next::CompatFrom::compat_from(value.s),
28215
28216 info: ::fidl_next::CompatFrom::compat_from(value.info),
28217 }
28218 }
28219 }
28220
28221 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeQueryFilesystemResponse>
28222 for crate::NodeQueryFilesystemResponse
28223 {
28224 #[inline]
28225 fn compat_from(value: ::fidl_fuchsia_io::NodeQueryFilesystemResponse) -> Self {
28226 Self {
28227 s: ::fidl_next::CompatFrom::compat_from(value.s),
28228
28229 info: ::fidl_next::CompatFrom::compat_from(value.info),
28230 }
28231 }
28232 }
28233
28234 impl ::fidl_next::CompatFrom<crate::ModeType> for ::fidl_fuchsia_io::ModeType {
28235 fn compat_from(value: crate::ModeType) -> Self {
28236 Self::from_bits_retain(value.bits())
28237 }
28238 }
28239
28240 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ModeType> for crate::ModeType {
28241 fn compat_from(value: ::fidl_fuchsia_io::ModeType) -> Self {
28242 Self::from_bits_retain(value.bits())
28243 }
28244 }
28245
28246 impl ::fidl_next::CompatFrom<crate::DirectoryReadDirentsRequest>
28247 for ::fidl_fuchsia_io::DirectoryReadDirentsRequest
28248 {
28249 #[inline]
28250 fn compat_from(value: crate::DirectoryReadDirentsRequest) -> Self {
28251 Self { max_bytes: ::fidl_next::CompatFrom::compat_from(value.max_bytes) }
28252 }
28253 }
28254
28255 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryReadDirentsRequest>
28256 for crate::DirectoryReadDirentsRequest
28257 {
28258 #[inline]
28259 fn compat_from(value: ::fidl_fuchsia_io::DirectoryReadDirentsRequest) -> Self {
28260 Self { max_bytes: ::fidl_next::CompatFrom::compat_from(value.max_bytes) }
28261 }
28262 }
28263
28264 impl ::fidl_next::CompatFrom<crate::DirectoryReadDirentsResponse>
28265 for ::fidl_fuchsia_io::DirectoryReadDirentsResponse
28266 {
28267 #[inline]
28268 fn compat_from(value: crate::DirectoryReadDirentsResponse) -> Self {
28269 Self {
28270 s: ::fidl_next::CompatFrom::compat_from(value.s),
28271
28272 dirents: ::fidl_next::CompatFrom::compat_from(value.dirents),
28273 }
28274 }
28275 }
28276
28277 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryReadDirentsResponse>
28278 for crate::DirectoryReadDirentsResponse
28279 {
28280 #[inline]
28281 fn compat_from(value: ::fidl_fuchsia_io::DirectoryReadDirentsResponse) -> Self {
28282 Self {
28283 s: ::fidl_next::CompatFrom::compat_from(value.s),
28284
28285 dirents: ::fidl_next::CompatFrom::compat_from(value.dirents),
28286 }
28287 }
28288 }
28289
28290 impl ::fidl_next::CompatFrom<crate::DirectoryRewindResponse>
28291 for ::fidl_fuchsia_io::DirectoryRewindResponse
28292 {
28293 #[inline]
28294 fn compat_from(value: crate::DirectoryRewindResponse) -> Self {
28295 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28296 }
28297 }
28298
28299 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryRewindResponse>
28300 for crate::DirectoryRewindResponse
28301 {
28302 #[inline]
28303 fn compat_from(value: ::fidl_fuchsia_io::DirectoryRewindResponse) -> Self {
28304 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28305 }
28306 }
28307
28308 impl ::fidl_next::CompatFrom<crate::DirectoryGetTokenResponse>
28309 for ::fidl_fuchsia_io::DirectoryGetTokenResponse
28310 {
28311 #[inline]
28312 fn compat_from(value: crate::DirectoryGetTokenResponse) -> Self {
28313 Self {
28314 s: ::fidl_next::CompatFrom::compat_from(value.s),
28315
28316 token: ::fidl_next::CompatFrom::compat_from(value.token),
28317 }
28318 }
28319 }
28320
28321 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryGetTokenResponse>
28322 for crate::DirectoryGetTokenResponse
28323 {
28324 #[inline]
28325 fn compat_from(value: ::fidl_fuchsia_io::DirectoryGetTokenResponse) -> Self {
28326 Self {
28327 s: ::fidl_next::CompatFrom::compat_from(value.s),
28328
28329 token: ::fidl_next::CompatFrom::compat_from(value.token),
28330 }
28331 }
28332 }
28333
28334 impl ::fidl_next::CompatFrom<crate::DirectoryLinkRequest>
28335 for ::fidl_fuchsia_io::DirectoryLinkRequest
28336 {
28337 #[inline]
28338 fn compat_from(value: crate::DirectoryLinkRequest) -> Self {
28339 Self {
28340 src: ::fidl_next::CompatFrom::compat_from(value.src),
28341
28342 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
28343
28344 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
28345 }
28346 }
28347 }
28348
28349 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryLinkRequest>
28350 for crate::DirectoryLinkRequest
28351 {
28352 #[inline]
28353 fn compat_from(value: ::fidl_fuchsia_io::DirectoryLinkRequest) -> Self {
28354 Self {
28355 src: ::fidl_next::CompatFrom::compat_from(value.src),
28356
28357 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
28358
28359 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
28360 }
28361 }
28362 }
28363
28364 impl ::fidl_next::CompatFrom<crate::DirectoryLinkResponse>
28365 for ::fidl_fuchsia_io::DirectoryLinkResponse
28366 {
28367 #[inline]
28368 fn compat_from(value: crate::DirectoryLinkResponse) -> Self {
28369 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28370 }
28371 }
28372
28373 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryLinkResponse>
28374 for crate::DirectoryLinkResponse
28375 {
28376 #[inline]
28377 fn compat_from(value: ::fidl_fuchsia_io::DirectoryLinkResponse) -> Self {
28378 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28379 }
28380 }
28381
28382 impl ::fidl_next::CompatFrom<crate::UnlinkFlags> for ::fidl_fuchsia_io::UnlinkFlags {
28383 fn compat_from(value: crate::UnlinkFlags) -> Self {
28384 Self::from_bits_retain(value.bits())
28385 }
28386 }
28387
28388 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::UnlinkFlags> for crate::UnlinkFlags {
28389 fn compat_from(value: ::fidl_fuchsia_io::UnlinkFlags) -> Self {
28390 Self::from_bits_retain(value.bits())
28391 }
28392 }
28393
28394 impl ::fidl_next::CompatFrom<crate::UnlinkOptions> for ::fidl_fuchsia_io::UnlinkOptions {
28395 fn compat_from(value: crate::UnlinkOptions) -> Self {
28396 Self {
28397 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
28398
28399 __source_breaking: ::fidl::marker::SourceBreaking,
28400 }
28401 }
28402 }
28403
28404 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::UnlinkOptions> for crate::UnlinkOptions {
28405 fn compat_from(value: ::fidl_fuchsia_io::UnlinkOptions) -> Self {
28406 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28407 }
28408 }
28409
28410 impl ::fidl_next::CompatFrom<crate::DirectoryUnlinkRequest>
28411 for ::fidl_fuchsia_io::DirectoryUnlinkRequest
28412 {
28413 #[inline]
28414 fn compat_from(value: crate::DirectoryUnlinkRequest) -> Self {
28415 Self {
28416 name: ::fidl_next::CompatFrom::compat_from(value.name),
28417
28418 options: ::fidl_next::CompatFrom::compat_from(value.options),
28419 }
28420 }
28421 }
28422
28423 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryUnlinkRequest>
28424 for crate::DirectoryUnlinkRequest
28425 {
28426 #[inline]
28427 fn compat_from(value: ::fidl_fuchsia_io::DirectoryUnlinkRequest) -> Self {
28428 Self {
28429 name: ::fidl_next::CompatFrom::compat_from(value.name),
28430
28431 options: ::fidl_next::CompatFrom::compat_from(value.options),
28432 }
28433 }
28434 }
28435
28436 impl ::fidl_next::CompatFrom<crate::DirectoryRenameRequest>
28437 for ::fidl_fuchsia_io::DirectoryRenameRequest
28438 {
28439 #[inline]
28440 fn compat_from(value: crate::DirectoryRenameRequest) -> Self {
28441 Self {
28442 src: ::fidl_next::CompatFrom::compat_from(value.src),
28443
28444 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
28445
28446 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
28447 }
28448 }
28449 }
28450
28451 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryRenameRequest>
28452 for crate::DirectoryRenameRequest
28453 {
28454 #[inline]
28455 fn compat_from(value: ::fidl_fuchsia_io::DirectoryRenameRequest) -> Self {
28456 Self {
28457 src: ::fidl_next::CompatFrom::compat_from(value.src),
28458
28459 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
28460
28461 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
28462 }
28463 }
28464 }
28465
28466 impl ::fidl_next::CompatFrom<crate::WatchMask> for ::fidl_fuchsia_io::WatchMask {
28467 fn compat_from(value: crate::WatchMask) -> Self {
28468 Self::from_bits_retain(value.bits())
28469 }
28470 }
28471
28472 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WatchMask> for crate::WatchMask {
28473 fn compat_from(value: ::fidl_fuchsia_io::WatchMask) -> Self {
28474 Self::from_bits_retain(value.bits())
28475 }
28476 }
28477
28478 impl ::fidl_next::CompatFrom<crate::DirectoryWatchRequest>
28479 for ::fidl_fuchsia_io::DirectoryWatchRequest
28480 {
28481 #[inline]
28482 fn compat_from(value: crate::DirectoryWatchRequest) -> Self {
28483 Self {
28484 mask: ::fidl_next::CompatFrom::compat_from(value.mask),
28485
28486 options: ::fidl_next::CompatFrom::compat_from(value.options),
28487
28488 watcher: ::fidl_next::CompatFrom::compat_from(value.watcher),
28489 }
28490 }
28491 }
28492
28493 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatchRequest>
28494 for crate::DirectoryWatchRequest
28495 {
28496 #[inline]
28497 fn compat_from(value: ::fidl_fuchsia_io::DirectoryWatchRequest) -> Self {
28498 Self {
28499 mask: ::fidl_next::CompatFrom::compat_from(value.mask),
28500
28501 options: ::fidl_next::CompatFrom::compat_from(value.options),
28502
28503 watcher: ::fidl_next::CompatFrom::compat_from(value.watcher),
28504 }
28505 }
28506 }
28507
28508 impl ::fidl_next::CompatFrom<crate::DirectoryWatchResponse>
28509 for ::fidl_fuchsia_io::DirectoryWatchResponse
28510 {
28511 #[inline]
28512 fn compat_from(value: crate::DirectoryWatchResponse) -> Self {
28513 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28514 }
28515 }
28516
28517 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatchResponse>
28518 for crate::DirectoryWatchResponse
28519 {
28520 #[inline]
28521 fn compat_from(value: ::fidl_fuchsia_io::DirectoryWatchResponse) -> Self {
28522 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28523 }
28524 }
28525
28526 impl ::fidl_next::CompatFrom<crate::NodeOnOpenRequest> for ::fidl_fuchsia_io::NodeOnOpenRequest {
28527 #[inline]
28528 fn compat_from(value: crate::NodeOnOpenRequest) -> Self {
28529 Self {
28530 s: ::fidl_next::CompatFrom::compat_from(value.s),
28531
28532 info: ::fidl_next::CompatFrom::compat_from(value.info),
28533 }
28534 }
28535 }
28536
28537 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeOnOpenRequest> for crate::NodeOnOpenRequest {
28538 #[inline]
28539 fn compat_from(value: ::fidl_fuchsia_io::NodeOnOpenRequest) -> Self {
28540 Self {
28541 s: ::fidl_next::CompatFrom::compat_from(value.s),
28542
28543 info: ::fidl_next::CompatFrom::compat_from(value.info),
28544 }
28545 }
28546 }
28547
28548 impl ::fidl_next::CompatFrom<crate::NodeListExtendedAttributesRequest>
28549 for ::fidl_fuchsia_io::NodeListExtendedAttributesRequest
28550 {
28551 #[inline]
28552 fn compat_from(value: crate::NodeListExtendedAttributesRequest) -> Self {
28553 Self { iterator: ::fidl_next::CompatFrom::compat_from(value.iterator) }
28554 }
28555 }
28556
28557 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeListExtendedAttributesRequest>
28558 for crate::NodeListExtendedAttributesRequest
28559 {
28560 #[inline]
28561 fn compat_from(value: ::fidl_fuchsia_io::NodeListExtendedAttributesRequest) -> Self {
28562 Self { iterator: ::fidl_next::CompatFrom::compat_from(value.iterator) }
28563 }
28564 }
28565
28566 impl ::fidl_next::CompatFrom<crate::NodeGetExtendedAttributeRequest>
28567 for ::fidl_fuchsia_io::NodeGetExtendedAttributeRequest
28568 {
28569 #[inline]
28570 fn compat_from(value: crate::NodeGetExtendedAttributeRequest) -> Self {
28571 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
28572 }
28573 }
28574
28575 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetExtendedAttributeRequest>
28576 for crate::NodeGetExtendedAttributeRequest
28577 {
28578 #[inline]
28579 fn compat_from(value: ::fidl_fuchsia_io::NodeGetExtendedAttributeRequest) -> Self {
28580 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
28581 }
28582 }
28583
28584 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeValue>
28585 for ::fidl_fuchsia_io::ExtendedAttributeValue
28586 {
28587 fn compat_from(value: crate::ExtendedAttributeValue) -> Self {
28588 match value {
28589 crate::ExtendedAttributeValue::Bytes(value) => {
28590 Self::Bytes(::fidl_next::CompatFrom::compat_from(value))
28591 }
28592
28593 crate::ExtendedAttributeValue::Buffer(value) => {
28594 Self::Buffer(::fidl_next::CompatFrom::compat_from(value))
28595 }
28596
28597 crate::ExtendedAttributeValue::UnknownOrdinal_(unknown_ordinal) => {
28598 Self::__SourceBreaking { unknown_ordinal }
28599 }
28600 }
28601 }
28602 }
28603
28604 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeValue>
28605 for crate::ExtendedAttributeValue
28606 {
28607 fn compat_from(value: ::fidl_fuchsia_io::ExtendedAttributeValue) -> Self {
28608 match value {
28609 ::fidl_fuchsia_io::ExtendedAttributeValue::Bytes(value) => {
28610 Self::Bytes(::fidl_next::CompatFrom::compat_from(value))
28611 }
28612
28613 ::fidl_fuchsia_io::ExtendedAttributeValue::Buffer(value) => {
28614 Self::Buffer(::fidl_next::CompatFrom::compat_from(value))
28615 }
28616
28617 ::fidl_fuchsia_io::ExtendedAttributeValue::__SourceBreaking { unknown_ordinal } => {
28618 Self::UnknownOrdinal_(unknown_ordinal)
28619 }
28620 }
28621 }
28622 }
28623
28624 impl ::fidl_next::CompatFrom<crate::SetExtendedAttributeMode>
28625 for ::fidl_fuchsia_io::SetExtendedAttributeMode
28626 {
28627 fn compat_from(value: crate::SetExtendedAttributeMode) -> Self {
28628 match value {
28629 crate::SetExtendedAttributeMode::Set => Self::Set,
28630
28631 crate::SetExtendedAttributeMode::Create => Self::Create,
28632
28633 crate::SetExtendedAttributeMode::Replace => Self::Replace,
28634 }
28635 }
28636 }
28637
28638 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SetExtendedAttributeMode>
28639 for crate::SetExtendedAttributeMode
28640 {
28641 fn compat_from(value: ::fidl_fuchsia_io::SetExtendedAttributeMode) -> Self {
28642 match value {
28643 ::fidl_fuchsia_io::SetExtendedAttributeMode::Set => Self::Set,
28644
28645 ::fidl_fuchsia_io::SetExtendedAttributeMode::Create => Self::Create,
28646
28647 ::fidl_fuchsia_io::SetExtendedAttributeMode::Replace => Self::Replace,
28648 }
28649 }
28650 }
28651
28652 impl ::fidl_next::CompatFrom<crate::NodeSetExtendedAttributeRequest>
28653 for ::fidl_fuchsia_io::NodeSetExtendedAttributeRequest
28654 {
28655 #[inline]
28656 fn compat_from(value: crate::NodeSetExtendedAttributeRequest) -> Self {
28657 Self {
28658 name: ::fidl_next::CompatFrom::compat_from(value.name),
28659
28660 value: ::fidl_next::CompatFrom::compat_from(value.value),
28661
28662 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28663 }
28664 }
28665 }
28666
28667 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeSetExtendedAttributeRequest>
28668 for crate::NodeSetExtendedAttributeRequest
28669 {
28670 #[inline]
28671 fn compat_from(value: ::fidl_fuchsia_io::NodeSetExtendedAttributeRequest) -> Self {
28672 Self {
28673 name: ::fidl_next::CompatFrom::compat_from(value.name),
28674
28675 value: ::fidl_next::CompatFrom::compat_from(value.value),
28676
28677 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28678 }
28679 }
28680 }
28681
28682 impl ::fidl_next::CompatFrom<crate::NodeRemoveExtendedAttributeRequest>
28683 for ::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest
28684 {
28685 #[inline]
28686 fn compat_from(value: crate::NodeRemoveExtendedAttributeRequest) -> Self {
28687 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
28688 }
28689 }
28690
28691 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest>
28692 for crate::NodeRemoveExtendedAttributeRequest
28693 {
28694 #[inline]
28695 fn compat_from(value: ::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest) -> Self {
28696 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
28697 }
28698 }
28699
28700 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedGetAttrResponse>
28701 for ::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse
28702 {
28703 #[inline]
28704 fn compat_from(value: crate::NodeDeprecatedGetAttrResponse) -> Self {
28705 Self {
28706 s: ::fidl_next::CompatFrom::compat_from(value.s),
28707
28708 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
28709 }
28710 }
28711 }
28712
28713 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse>
28714 for crate::NodeDeprecatedGetAttrResponse
28715 {
28716 #[inline]
28717 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedGetAttrResponse) -> Self {
28718 Self {
28719 s: ::fidl_next::CompatFrom::compat_from(value.s),
28720
28721 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
28722 }
28723 }
28724 }
28725
28726 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetAttrRequest>
28727 for ::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest
28728 {
28729 #[inline]
28730 fn compat_from(value: crate::NodeDeprecatedSetAttrRequest) -> Self {
28731 Self {
28732 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
28733
28734 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
28735 }
28736 }
28737 }
28738
28739 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest>
28740 for crate::NodeDeprecatedSetAttrRequest
28741 {
28742 #[inline]
28743 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetAttrRequest) -> Self {
28744 Self {
28745 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
28746
28747 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
28748 }
28749 }
28750 }
28751
28752 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetAttrResponse>
28753 for ::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse
28754 {
28755 #[inline]
28756 fn compat_from(value: crate::NodeDeprecatedSetAttrResponse) -> Self {
28757 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28758 }
28759 }
28760
28761 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse>
28762 for crate::NodeDeprecatedSetAttrResponse
28763 {
28764 #[inline]
28765 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetAttrResponse) -> Self {
28766 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28767 }
28768 }
28769
28770 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedGetFlagsResponse>
28771 for ::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse
28772 {
28773 #[inline]
28774 fn compat_from(value: crate::NodeDeprecatedGetFlagsResponse) -> Self {
28775 Self {
28776 s: ::fidl_next::CompatFrom::compat_from(value.s),
28777
28778 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
28779 }
28780 }
28781 }
28782
28783 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse>
28784 for crate::NodeDeprecatedGetFlagsResponse
28785 {
28786 #[inline]
28787 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse) -> Self {
28788 Self {
28789 s: ::fidl_next::CompatFrom::compat_from(value.s),
28790
28791 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
28792 }
28793 }
28794 }
28795
28796 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetFlagsRequest>
28797 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest
28798 {
28799 #[inline]
28800 fn compat_from(value: crate::NodeDeprecatedSetFlagsRequest) -> Self {
28801 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28802 }
28803 }
28804
28805 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest>
28806 for crate::NodeDeprecatedSetFlagsRequest
28807 {
28808 #[inline]
28809 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest) -> Self {
28810 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28811 }
28812 }
28813
28814 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedSetFlagsResponse>
28815 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse
28816 {
28817 #[inline]
28818 fn compat_from(value: crate::NodeDeprecatedSetFlagsResponse) -> Self {
28819 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28820 }
28821 }
28822
28823 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse>
28824 for crate::NodeDeprecatedSetFlagsResponse
28825 {
28826 #[inline]
28827 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse) -> Self {
28828 Self { s: ::fidl_next::CompatFrom::compat_from(value.s) }
28829 }
28830 }
28831
28832 impl ::fidl_next::CompatFrom<crate::Flags> for ::fidl_fuchsia_io::Flags {
28833 fn compat_from(value: crate::Flags) -> Self {
28834 Self::from_bits_retain(value.bits())
28835 }
28836 }
28837
28838 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Flags> for crate::Flags {
28839 fn compat_from(value: ::fidl_fuchsia_io::Flags) -> Self {
28840 Self::from_bits_retain(value.bits())
28841 }
28842 }
28843
28844 impl ::fidl_next::CompatFrom<crate::NodeGetFlagsResponse>
28845 for ::fidl_fuchsia_io::NodeGetFlagsResponse
28846 {
28847 #[inline]
28848 fn compat_from(value: crate::NodeGetFlagsResponse) -> Self {
28849 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28850 }
28851 }
28852
28853 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetFlagsResponse>
28854 for crate::NodeGetFlagsResponse
28855 {
28856 #[inline]
28857 fn compat_from(value: ::fidl_fuchsia_io::NodeGetFlagsResponse) -> Self {
28858 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28859 }
28860 }
28861
28862 impl ::fidl_next::CompatFrom<crate::NodeSetFlagsRequest>
28863 for ::fidl_fuchsia_io::NodeSetFlagsRequest
28864 {
28865 #[inline]
28866 fn compat_from(value: crate::NodeSetFlagsRequest) -> Self {
28867 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28868 }
28869 }
28870
28871 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeSetFlagsRequest>
28872 for crate::NodeSetFlagsRequest
28873 {
28874 #[inline]
28875 fn compat_from(value: ::fidl_fuchsia_io::NodeSetFlagsRequest) -> Self {
28876 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
28877 }
28878 }
28879
28880 impl ::fidl_next::CompatFrom<crate::EmptyStruct> for ::fidl_fuchsia_io::EmptyStruct {
28881 #[inline]
28882 fn compat_from(value: crate::EmptyStruct) -> Self {
28883 Self {}
28884 }
28885 }
28886
28887 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::EmptyStruct> for crate::EmptyStruct {
28888 #[inline]
28889 fn compat_from(value: ::fidl_fuchsia_io::EmptyStruct) -> Self {
28890 Self {}
28891 }
28892 }
28893
28894 impl ::fidl_next::CompatFrom<crate::SelinuxContext> for ::fidl_fuchsia_io::SelinuxContext {
28895 fn compat_from(value: crate::SelinuxContext) -> Self {
28896 match value {
28897 crate::SelinuxContext::Data(value) => {
28898 Self::Data(::fidl_next::CompatFrom::compat_from(value))
28899 }
28900
28901 crate::SelinuxContext::UseExtendedAttributes(value) => {
28902 Self::UseExtendedAttributes(::fidl_next::CompatFrom::compat_from(value))
28903 }
28904
28905 crate::SelinuxContext::UnknownOrdinal_(unknown_ordinal) => {
28906 Self::__SourceBreaking { unknown_ordinal }
28907 }
28908 }
28909 }
28910 }
28911
28912 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SelinuxContext> for crate::SelinuxContext {
28913 fn compat_from(value: ::fidl_fuchsia_io::SelinuxContext) -> Self {
28914 match value {
28915 ::fidl_fuchsia_io::SelinuxContext::Data(value) => {
28916 Self::Data(::fidl_next::CompatFrom::compat_from(value))
28917 }
28918
28919 ::fidl_fuchsia_io::SelinuxContext::UseExtendedAttributes(value) => {
28920 Self::UseExtendedAttributes(::fidl_next::CompatFrom::compat_from(value))
28921 }
28922
28923 ::fidl_fuchsia_io::SelinuxContext::__SourceBreaking { unknown_ordinal } => {
28924 Self::UnknownOrdinal_(unknown_ordinal)
28925 }
28926 }
28927 }
28928 }
28929
28930 impl ::fidl_next::CompatFrom<crate::MutableNodeAttributes>
28931 for ::fidl_fuchsia_io::MutableNodeAttributes
28932 {
28933 fn compat_from(value: crate::MutableNodeAttributes) -> Self {
28934 Self {
28935 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
28936
28937 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
28938
28939 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28940
28941 uid: ::fidl_next::CompatFrom::compat_from(value.uid),
28942
28943 gid: ::fidl_next::CompatFrom::compat_from(value.gid),
28944
28945 rdev: ::fidl_next::CompatFrom::compat_from(value.rdev),
28946
28947 access_time: ::fidl_next::CompatFrom::compat_from(value.access_time),
28948
28949 casefold: ::fidl_next::CompatFrom::compat_from(value.casefold),
28950
28951 selinux_context: ::fidl_next::CompatFrom::compat_from(value.selinux_context),
28952
28953 wrapping_key_id: ::fidl_next::CompatFrom::compat_from(value.wrapping_key_id),
28954
28955 __source_breaking: ::fidl::marker::SourceBreaking,
28956 }
28957 }
28958 }
28959
28960 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::MutableNodeAttributes>
28961 for crate::MutableNodeAttributes
28962 {
28963 fn compat_from(value: ::fidl_fuchsia_io::MutableNodeAttributes) -> Self {
28964 Self {
28965 creation_time: ::fidl_next::CompatFrom::compat_from(value.creation_time),
28966
28967 modification_time: ::fidl_next::CompatFrom::compat_from(value.modification_time),
28968
28969 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
28970
28971 uid: ::fidl_next::CompatFrom::compat_from(value.uid),
28972
28973 gid: ::fidl_next::CompatFrom::compat_from(value.gid),
28974
28975 rdev: ::fidl_next::CompatFrom::compat_from(value.rdev),
28976
28977 access_time: ::fidl_next::CompatFrom::compat_from(value.access_time),
28978
28979 casefold: ::fidl_next::CompatFrom::compat_from(value.casefold),
28980
28981 selinux_context: ::fidl_next::CompatFrom::compat_from(value.selinux_context),
28982
28983 wrapping_key_id: ::fidl_next::CompatFrom::compat_from(value.wrapping_key_id),
28984 }
28985 }
28986 }
28987
28988 impl ::fidl_next::CompatFrom<crate::NodeProtocolKinds> for ::fidl_fuchsia_io::NodeProtocolKinds {
28989 fn compat_from(value: crate::NodeProtocolKinds) -> Self {
28990 Self::from_bits_retain(value.bits())
28991 }
28992 }
28993
28994 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeProtocolKinds> for crate::NodeProtocolKinds {
28995 fn compat_from(value: ::fidl_fuchsia_io::NodeProtocolKinds) -> Self {
28996 Self::from_bits_retain(value.bits())
28997 }
28998 }
28999
29000 impl ::fidl_next::CompatFrom<crate::HashAlgorithm> for ::fidl_fuchsia_io::HashAlgorithm {
29001 fn compat_from(value: crate::HashAlgorithm) -> Self {
29002 match value {
29003 crate::HashAlgorithm::Sha256 => Self::Sha256,
29004
29005 crate::HashAlgorithm::Sha512 => Self::Sha512,
29006
29007 crate::HashAlgorithm::UnknownOrdinal_(unknown_ordinal) => {
29008 Self::__SourceBreaking { unknown_ordinal }
29009 }
29010 }
29011 }
29012 }
29013
29014 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::HashAlgorithm> for crate::HashAlgorithm {
29015 fn compat_from(value: ::fidl_fuchsia_io::HashAlgorithm) -> Self {
29016 match value {
29017 ::fidl_fuchsia_io::HashAlgorithm::Sha256 => Self::Sha256,
29018
29019 ::fidl_fuchsia_io::HashAlgorithm::Sha512 => Self::Sha512,
29020
29021 ::fidl_fuchsia_io::HashAlgorithm::__SourceBreaking { unknown_ordinal: value } => {
29022 Self::UnknownOrdinal_(value)
29023 }
29024 }
29025 }
29026 }
29027
29028 impl ::fidl_next::CompatFrom<crate::VerificationOptions>
29029 for ::fidl_fuchsia_io::VerificationOptions
29030 {
29031 fn compat_from(value: crate::VerificationOptions) -> Self {
29032 Self {
29033 hash_algorithm: ::fidl_next::CompatFrom::compat_from(value.hash_algorithm),
29034
29035 salt: ::fidl_next::CompatFrom::compat_from(value.salt),
29036
29037 __source_breaking: ::fidl::marker::SourceBreaking,
29038 }
29039 }
29040 }
29041
29042 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::VerificationOptions>
29043 for crate::VerificationOptions
29044 {
29045 fn compat_from(value: ::fidl_fuchsia_io::VerificationOptions) -> Self {
29046 Self {
29047 hash_algorithm: ::fidl_next::CompatFrom::compat_from(value.hash_algorithm),
29048
29049 salt: ::fidl_next::CompatFrom::compat_from(value.salt),
29050 }
29051 }
29052 }
29053
29054 impl ::fidl_next::CompatFrom<crate::ImmutableNodeAttributes>
29055 for ::fidl_fuchsia_io::ImmutableNodeAttributes
29056 {
29057 fn compat_from(value: crate::ImmutableNodeAttributes) -> Self {
29058 Self {
29059 protocols: ::fidl_next::CompatFrom::compat_from(value.protocols),
29060
29061 abilities: ::fidl_next::CompatFrom::compat_from(value.abilities),
29062
29063 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
29064
29065 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
29066
29067 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
29068
29069 id: ::fidl_next::CompatFrom::compat_from(value.id),
29070
29071 change_time: ::fidl_next::CompatFrom::compat_from(value.change_time),
29072
29073 options: ::fidl_next::CompatFrom::compat_from(value.options),
29074
29075 root_hash: ::fidl_next::CompatFrom::compat_from(value.root_hash),
29076
29077 verity_enabled: ::fidl_next::CompatFrom::compat_from(value.verity_enabled),
29078
29079 __source_breaking: ::fidl::marker::SourceBreaking,
29080 }
29081 }
29082 }
29083
29084 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ImmutableNodeAttributes>
29085 for crate::ImmutableNodeAttributes
29086 {
29087 fn compat_from(value: ::fidl_fuchsia_io::ImmutableNodeAttributes) -> Self {
29088 Self {
29089 protocols: ::fidl_next::CompatFrom::compat_from(value.protocols),
29090
29091 abilities: ::fidl_next::CompatFrom::compat_from(value.abilities),
29092
29093 content_size: ::fidl_next::CompatFrom::compat_from(value.content_size),
29094
29095 storage_size: ::fidl_next::CompatFrom::compat_from(value.storage_size),
29096
29097 link_count: ::fidl_next::CompatFrom::compat_from(value.link_count),
29098
29099 id: ::fidl_next::CompatFrom::compat_from(value.id),
29100
29101 change_time: ::fidl_next::CompatFrom::compat_from(value.change_time),
29102
29103 options: ::fidl_next::CompatFrom::compat_from(value.options),
29104
29105 root_hash: ::fidl_next::CompatFrom::compat_from(value.root_hash),
29106
29107 verity_enabled: ::fidl_next::CompatFrom::compat_from(value.verity_enabled),
29108 }
29109 }
29110 }
29111
29112 impl ::fidl_next::CompatFrom<crate::NodeAttributes2> for ::fidl_fuchsia_io::NodeAttributes2 {
29113 #[inline]
29114 fn compat_from(value: crate::NodeAttributes2) -> Self {
29115 Self {
29116 mutable_attributes: ::fidl_next::CompatFrom::compat_from(value.mutable_attributes),
29117
29118 immutable_attributes: ::fidl_next::CompatFrom::compat_from(
29119 value.immutable_attributes,
29120 ),
29121 }
29122 }
29123 }
29124
29125 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributes2> for crate::NodeAttributes2 {
29126 #[inline]
29127 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributes2) -> Self {
29128 Self {
29129 mutable_attributes: ::fidl_next::CompatFrom::compat_from(value.mutable_attributes),
29130
29131 immutable_attributes: ::fidl_next::CompatFrom::compat_from(
29132 value.immutable_attributes,
29133 ),
29134 }
29135 }
29136 }
29137
29138 impl ::fidl_next::CompatFrom<crate::NodeInfo> for ::fidl_fuchsia_io::NodeInfo {
29139 fn compat_from(value: crate::NodeInfo) -> Self {
29140 Self {
29141 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29142
29143 __source_breaking: ::fidl::marker::SourceBreaking,
29144 }
29145 }
29146 }
29147
29148 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeInfo> for crate::NodeInfo {
29149 fn compat_from(value: ::fidl_fuchsia_io::NodeInfo) -> Self {
29150 Self { attributes: ::fidl_next::CompatFrom::compat_from(value.attributes) }
29151 }
29152 }
29153
29154 impl ::fidl_next::CompatFrom<crate::DirectoryInfo> for ::fidl_fuchsia_io::DirectoryInfo {
29155 fn compat_from(value: crate::DirectoryInfo) -> Self {
29156 Self {
29157 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29158
29159 __source_breaking: ::fidl::marker::SourceBreaking,
29160 }
29161 }
29162 }
29163
29164 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryInfo> for crate::DirectoryInfo {
29165 fn compat_from(value: ::fidl_fuchsia_io::DirectoryInfo) -> Self {
29166 Self { attributes: ::fidl_next::CompatFrom::compat_from(value.attributes) }
29167 }
29168 }
29169
29170 impl ::fidl_next::CompatFrom<crate::FileInfo> for ::fidl_fuchsia_io::FileInfo {
29171 fn compat_from(value: crate::FileInfo) -> Self {
29172 Self {
29173 is_append: ::fidl_next::CompatFrom::compat_from(value.is_append),
29174
29175 observer: ::fidl_next::CompatFrom::compat_from(value.observer),
29176
29177 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
29178
29179 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29180
29181 __source_breaking: ::fidl::marker::SourceBreaking,
29182 }
29183 }
29184 }
29185
29186 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileInfo> for crate::FileInfo {
29187 fn compat_from(value: ::fidl_fuchsia_io::FileInfo) -> Self {
29188 Self {
29189 is_append: ::fidl_next::CompatFrom::compat_from(value.is_append),
29190
29191 observer: ::fidl_next::CompatFrom::compat_from(value.observer),
29192
29193 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
29194
29195 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29196 }
29197 }
29198 }
29199
29200 impl ::fidl_next::CompatFrom<crate::SymlinkInfo> for ::fidl_fuchsia_io::SymlinkInfo {
29201 fn compat_from(value: crate::SymlinkInfo) -> Self {
29202 Self {
29203 target: ::fidl_next::CompatFrom::compat_from(value.target),
29204
29205 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29206
29207 __source_breaking: ::fidl::marker::SourceBreaking,
29208 }
29209 }
29210 }
29211
29212 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkInfo> for crate::SymlinkInfo {
29213 fn compat_from(value: ::fidl_fuchsia_io::SymlinkInfo) -> Self {
29214 Self {
29215 target: ::fidl_next::CompatFrom::compat_from(value.target),
29216
29217 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29218 }
29219 }
29220 }
29221
29222 impl ::fidl_next::CompatFrom<crate::Representation> for ::fidl_fuchsia_io::Representation {
29223 fn compat_from(value: crate::Representation) -> Self {
29224 match value {
29225 crate::Representation::Node(value) => {
29226 Self::Node(::fidl_next::CompatFrom::compat_from(value))
29227 }
29228
29229 crate::Representation::Directory(value) => {
29230 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
29231 }
29232
29233 crate::Representation::File(value) => {
29234 Self::File(::fidl_next::CompatFrom::compat_from(value))
29235 }
29236
29237 crate::Representation::Symlink(value) => {
29238 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
29239 }
29240
29241 crate::Representation::UnknownOrdinal_(unknown_ordinal) => {
29242 Self::__SourceBreaking { unknown_ordinal }
29243 }
29244 }
29245 }
29246 }
29247
29248 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Representation> for crate::Representation {
29249 fn compat_from(value: ::fidl_fuchsia_io::Representation) -> Self {
29250 match value {
29251 ::fidl_fuchsia_io::Representation::Node(value) => {
29252 Self::Node(::fidl_next::CompatFrom::compat_from(value))
29253 }
29254
29255 ::fidl_fuchsia_io::Representation::Directory(value) => {
29256 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
29257 }
29258
29259 ::fidl_fuchsia_io::Representation::File(value) => {
29260 Self::File(::fidl_next::CompatFrom::compat_from(value))
29261 }
29262
29263 ::fidl_fuchsia_io::Representation::Symlink(value) => {
29264 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
29265 }
29266
29267 ::fidl_fuchsia_io::Representation::__SourceBreaking { unknown_ordinal } => {
29268 Self::UnknownOrdinal_(unknown_ordinal)
29269 }
29270 }
29271 }
29272 }
29273
29274 impl ::fidl_next::CompatFrom<crate::NodeAttributesQuery>
29275 for ::fidl_fuchsia_io::NodeAttributesQuery
29276 {
29277 fn compat_from(value: crate::NodeAttributesQuery) -> Self {
29278 Self::from_bits_retain(value.bits())
29279 }
29280 }
29281
29282 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeAttributesQuery>
29283 for crate::NodeAttributesQuery
29284 {
29285 fn compat_from(value: ::fidl_fuchsia_io::NodeAttributesQuery) -> Self {
29286 Self::from_bits_retain(value.bits())
29287 }
29288 }
29289
29290 impl ::fidl_next::CompatFrom<crate::NodeGetAttributesRequest>
29291 for ::fidl_fuchsia_io::NodeGetAttributesRequest
29292 {
29293 #[inline]
29294 fn compat_from(value: crate::NodeGetAttributesRequest) -> Self {
29295 Self { query: ::fidl_next::CompatFrom::compat_from(value.query) }
29296 }
29297 }
29298
29299 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeGetAttributesRequest>
29300 for crate::NodeGetAttributesRequest
29301 {
29302 #[inline]
29303 fn compat_from(value: ::fidl_fuchsia_io::NodeGetAttributesRequest) -> Self {
29304 Self { query: ::fidl_next::CompatFrom::compat_from(value.query) }
29305 }
29306 }
29307
29308 impl ::fidl_next::CompatFrom<crate::Options> for ::fidl_fuchsia_io::Options {
29309 fn compat_from(value: crate::Options) -> Self {
29310 Self {
29311 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29312
29313 create_attributes: ::fidl_next::CompatFrom::compat_from(value.create_attributes),
29314
29315 __source_breaking: ::fidl::marker::SourceBreaking,
29316 }
29317 }
29318 }
29319
29320 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Options> for crate::Options {
29321 fn compat_from(value: ::fidl_fuchsia_io::Options) -> Self {
29322 Self {
29323 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29324
29325 create_attributes: ::fidl_next::CompatFrom::compat_from(value.create_attributes),
29326 }
29327 }
29328 }
29329
29330 impl ::fidl_next::CompatFrom<crate::DirectoryOpenRequest>
29331 for ::fidl_fuchsia_io::DirectoryOpenRequest
29332 {
29333 #[inline]
29334 fn compat_from(value: crate::DirectoryOpenRequest) -> Self {
29335 Self {
29336 path: ::fidl_next::CompatFrom::compat_from(value.path),
29337
29338 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29339
29340 options: ::fidl_next::CompatFrom::compat_from(value.options),
29341
29342 object: ::fidl_next::CompatFrom::compat_from(value.object),
29343 }
29344 }
29345 }
29346
29347 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryOpenRequest>
29348 for crate::DirectoryOpenRequest
29349 {
29350 #[inline]
29351 fn compat_from(value: ::fidl_fuchsia_io::DirectoryOpenRequest) -> Self {
29352 Self {
29353 path: ::fidl_next::CompatFrom::compat_from(value.path),
29354
29355 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29356
29357 options: ::fidl_next::CompatFrom::compat_from(value.options),
29358
29359 object: ::fidl_next::CompatFrom::compat_from(value.object),
29360 }
29361 }
29362 }
29363
29364 impl ::fidl_next::CompatFrom<crate::NodeDeprecatedCloneRequest>
29365 for ::fidl_fuchsia_io::NodeDeprecatedCloneRequest
29366 {
29367 #[inline]
29368 fn compat_from(value: crate::NodeDeprecatedCloneRequest) -> Self {
29369 Self {
29370 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29371
29372 object: ::fidl_next::CompatFrom::compat_from(value.object),
29373 }
29374 }
29375 }
29376
29377 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeDeprecatedCloneRequest>
29378 for crate::NodeDeprecatedCloneRequest
29379 {
29380 #[inline]
29381 fn compat_from(value: ::fidl_fuchsia_io::NodeDeprecatedCloneRequest) -> Self {
29382 Self {
29383 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29384
29385 object: ::fidl_next::CompatFrom::compat_from(value.object),
29386 }
29387 }
29388 }
29389
29390 #[cfg(target_os = "fuchsia")]
29391 pub type NodeProxy = ::fidl_next::ClientSender<crate::Node>;
29394
29395 impl ::fidl_next::CompatFrom<crate::Node> for ::fidl_fuchsia_io::NodeMarker {
29396 fn compat_from(_: crate::Node) -> Self {
29397 Self
29398 }
29399 }
29400
29401 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeMarker> for crate::Node {
29402 fn compat_from(_: ::fidl_fuchsia_io::NodeMarker) -> Self {
29403 Self
29404 }
29405 }
29406
29407 #[cfg(target_os = "fuchsia")]
29408
29409 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::NodeProxy> for crate::Node {
29410 fn client_compat_from(
29411 proxy: ::fidl_fuchsia_io::NodeProxy,
29412 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29413 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29414 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29415 ::fidl_next::Client::new(client_end)
29416 }
29417 }
29418
29419 impl ::fidl_next::CompatFrom<crate::DirectoryDeprecatedOpenRequest>
29420 for ::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest
29421 {
29422 #[inline]
29423 fn compat_from(value: crate::DirectoryDeprecatedOpenRequest) -> Self {
29424 Self {
29425 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29426
29427 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
29428
29429 path: ::fidl_next::CompatFrom::compat_from(value.path),
29430
29431 object: ::fidl_next::CompatFrom::compat_from(value.object),
29432 }
29433 }
29434 }
29435
29436 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest>
29437 for crate::DirectoryDeprecatedOpenRequest
29438 {
29439 #[inline]
29440 fn compat_from(value: ::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest) -> Self {
29441 Self {
29442 flags: ::fidl_next::CompatFrom::compat_from(value.flags),
29443
29444 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
29445
29446 path: ::fidl_next::CompatFrom::compat_from(value.path),
29447
29448 object: ::fidl_next::CompatFrom::compat_from(value.object),
29449 }
29450 }
29451 }
29452
29453 impl ::fidl_next::CompatFrom<crate::DirectoryCreateSymlinkRequest>
29454 for ::fidl_fuchsia_io::DirectoryCreateSymlinkRequest
29455 {
29456 #[inline]
29457 fn compat_from(value: crate::DirectoryCreateSymlinkRequest) -> Self {
29458 Self {
29459 name: ::fidl_next::CompatFrom::compat_from(value.name),
29460
29461 target: ::fidl_next::CompatFrom::compat_from(value.target),
29462
29463 connection: ::fidl_next::CompatFrom::compat_from(value.connection),
29464 }
29465 }
29466 }
29467
29468 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryCreateSymlinkRequest>
29469 for crate::DirectoryCreateSymlinkRequest
29470 {
29471 #[inline]
29472 fn compat_from(value: ::fidl_fuchsia_io::DirectoryCreateSymlinkRequest) -> Self {
29473 Self {
29474 name: ::fidl_next::CompatFrom::compat_from(value.name),
29475
29476 target: ::fidl_next::CompatFrom::compat_from(value.target),
29477
29478 connection: ::fidl_next::CompatFrom::compat_from(value.connection),
29479 }
29480 }
29481 }
29482
29483 #[cfg(target_os = "fuchsia")]
29484 pub type DirectoryProxy = ::fidl_next::ClientSender<crate::Directory>;
29487
29488 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_io::DirectoryMarker {
29489 fn compat_from(_: crate::Directory) -> Self {
29490 Self
29491 }
29492 }
29493
29494 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryMarker> for crate::Directory {
29495 fn compat_from(_: ::fidl_fuchsia_io::DirectoryMarker) -> Self {
29496 Self
29497 }
29498 }
29499
29500 #[cfg(target_os = "fuchsia")]
29501
29502 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::DirectoryProxy> for crate::Directory {
29503 fn client_compat_from(
29504 proxy: ::fidl_fuchsia_io::DirectoryProxy,
29505 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29506 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29507 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29508 ::fidl_next::Client::new(client_end)
29509 }
29510 }
29511
29512 impl ::fidl_next::CompatFrom<crate::DirectoryObject> for ::fidl_fuchsia_io::DirectoryObject {
29513 #[inline]
29514 fn compat_from(value: crate::DirectoryObject) -> Self {
29515 Self {}
29516 }
29517 }
29518
29519 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryObject> for crate::DirectoryObject {
29520 #[inline]
29521 fn compat_from(value: ::fidl_fuchsia_io::DirectoryObject) -> Self {
29522 Self {}
29523 }
29524 }
29525
29526 #[cfg(target_os = "fuchsia")]
29527 pub type DirectoryWatcherProxy = ::fidl_next::ClientSender<crate::DirectoryWatcher>;
29530
29531 impl ::fidl_next::CompatFrom<crate::DirectoryWatcher>
29532 for ::fidl_fuchsia_io::DirectoryWatcherMarker
29533 {
29534 fn compat_from(_: crate::DirectoryWatcher) -> Self {
29535 Self
29536 }
29537 }
29538
29539 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirectoryWatcherMarker>
29540 for crate::DirectoryWatcher
29541 {
29542 fn compat_from(_: ::fidl_fuchsia_io::DirectoryWatcherMarker) -> Self {
29543 Self
29544 }
29545 }
29546
29547 #[cfg(target_os = "fuchsia")]
29548
29549 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::DirectoryWatcherProxy>
29550 for crate::DirectoryWatcher
29551 {
29552 fn client_compat_from(
29553 proxy: ::fidl_fuchsia_io::DirectoryWatcherProxy,
29554 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29555 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29556 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29557 ::fidl_next::Client::new(client_end)
29558 }
29559 }
29560
29561 impl ::fidl_next::CompatFrom<crate::DirentType> for ::fidl_fuchsia_io::DirentType {
29562 fn compat_from(value: crate::DirentType) -> Self {
29563 match value {
29564 crate::DirentType::Unknown => Self::Unknown,
29565
29566 crate::DirentType::Directory => Self::Directory,
29567
29568 crate::DirentType::BlockDevice => Self::BlockDevice,
29569
29570 crate::DirentType::File => Self::File,
29571
29572 crate::DirentType::Symlink => Self::Symlink,
29573
29574 crate::DirentType::Service => Self::Service,
29575
29576 crate::DirentType::UnknownOrdinal_(unknown_ordinal) => {
29577 Self::__SourceBreaking { unknown_ordinal }
29578 }
29579 }
29580 }
29581 }
29582
29583 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::DirentType> for crate::DirentType {
29584 fn compat_from(value: ::fidl_fuchsia_io::DirentType) -> Self {
29585 match value {
29586 ::fidl_fuchsia_io::DirentType::Unknown => Self::Unknown,
29587
29588 ::fidl_fuchsia_io::DirentType::Directory => Self::Directory,
29589
29590 ::fidl_fuchsia_io::DirentType::BlockDevice => Self::BlockDevice,
29591
29592 ::fidl_fuchsia_io::DirentType::File => Self::File,
29593
29594 ::fidl_fuchsia_io::DirentType::Symlink => Self::Symlink,
29595
29596 ::fidl_fuchsia_io::DirentType::Service => Self::Service,
29597
29598 ::fidl_fuchsia_io::DirentType::__SourceBreaking { unknown_ordinal: value } => {
29599 Self::UnknownOrdinal_(value)
29600 }
29601 }
29602 }
29603 }
29604
29605 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeIteratorGetNextResponse>
29606 for ::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse
29607 {
29608 #[inline]
29609 fn compat_from(value: crate::ExtendedAttributeIteratorGetNextResponse) -> Self {
29610 Self {
29611 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29612
29613 last: ::fidl_next::CompatFrom::compat_from(value.last),
29614 }
29615 }
29616 }
29617
29618 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse>
29619 for crate::ExtendedAttributeIteratorGetNextResponse
29620 {
29621 #[inline]
29622 fn compat_from(value: ::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse) -> Self {
29623 Self {
29624 attributes: ::fidl_next::CompatFrom::compat_from(value.attributes),
29625
29626 last: ::fidl_next::CompatFrom::compat_from(value.last),
29627 }
29628 }
29629 }
29630
29631 #[cfg(target_os = "fuchsia")]
29632 pub type ExtendedAttributeIteratorProxy =
29635 ::fidl_next::ClientSender<crate::ExtendedAttributeIterator>;
29636
29637 impl ::fidl_next::CompatFrom<crate::ExtendedAttributeIterator>
29638 for ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker
29639 {
29640 fn compat_from(_: crate::ExtendedAttributeIterator) -> Self {
29641 Self
29642 }
29643 }
29644
29645 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorMarker>
29646 for crate::ExtendedAttributeIterator
29647 {
29648 fn compat_from(_: ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker) -> Self {
29649 Self
29650 }
29651 }
29652
29653 #[cfg(target_os = "fuchsia")]
29654
29655 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::ExtendedAttributeIteratorProxy>
29656 for crate::ExtendedAttributeIterator
29657 {
29658 fn client_compat_from(
29659 proxy: ::fidl_fuchsia_io::ExtendedAttributeIteratorProxy,
29660 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29661 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29662 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29663 ::fidl_next::Client::new(client_end)
29664 }
29665 }
29666
29667 impl ::fidl_next::CompatFrom<crate::ReadableReadRequest>
29668 for ::fidl_fuchsia_io::ReadableReadRequest
29669 {
29670 #[inline]
29671 fn compat_from(value: crate::ReadableReadRequest) -> Self {
29672 Self { count: ::fidl_next::CompatFrom::compat_from(value.count) }
29673 }
29674 }
29675
29676 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableReadRequest>
29677 for crate::ReadableReadRequest
29678 {
29679 #[inline]
29680 fn compat_from(value: ::fidl_fuchsia_io::ReadableReadRequest) -> Self {
29681 Self { count: ::fidl_next::CompatFrom::compat_from(value.count) }
29682 }
29683 }
29684
29685 impl ::fidl_next::CompatFrom<crate::ReadableReadResponse>
29686 for ::fidl_fuchsia_io::ReadableReadResponse
29687 {
29688 #[inline]
29689 fn compat_from(value: crate::ReadableReadResponse) -> Self {
29690 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29691 }
29692 }
29693
29694 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableReadResponse>
29695 for crate::ReadableReadResponse
29696 {
29697 #[inline]
29698 fn compat_from(value: ::fidl_fuchsia_io::ReadableReadResponse) -> Self {
29699 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29700 }
29701 }
29702
29703 #[cfg(target_os = "fuchsia")]
29704 pub type ReadableProxy = ::fidl_next::ClientSender<crate::Readable>;
29707
29708 impl ::fidl_next::CompatFrom<crate::Readable> for ::fidl_fuchsia_io::ReadableMarker {
29709 fn compat_from(_: crate::Readable) -> Self {
29710 Self
29711 }
29712 }
29713
29714 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::ReadableMarker> for crate::Readable {
29715 fn compat_from(_: ::fidl_fuchsia_io::ReadableMarker) -> Self {
29716 Self
29717 }
29718 }
29719
29720 #[cfg(target_os = "fuchsia")]
29721
29722 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::ReadableProxy> for crate::Readable {
29723 fn client_compat_from(
29724 proxy: ::fidl_fuchsia_io::ReadableProxy,
29725 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29726 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29727 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29728 ::fidl_next::Client::new(client_end)
29729 }
29730 }
29731
29732 impl ::fidl_next::CompatFrom<crate::WritableWriteRequest>
29733 for ::fidl_fuchsia_io::WritableWriteRequest
29734 {
29735 #[inline]
29736 fn compat_from(value: crate::WritableWriteRequest) -> Self {
29737 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29738 }
29739 }
29740
29741 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableWriteRequest>
29742 for crate::WritableWriteRequest
29743 {
29744 #[inline]
29745 fn compat_from(value: ::fidl_fuchsia_io::WritableWriteRequest) -> Self {
29746 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29747 }
29748 }
29749
29750 impl ::fidl_next::CompatFrom<crate::WritableWriteResponse>
29751 for ::fidl_fuchsia_io::WritableWriteResponse
29752 {
29753 #[inline]
29754 fn compat_from(value: crate::WritableWriteResponse) -> Self {
29755 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
29756 }
29757 }
29758
29759 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableWriteResponse>
29760 for crate::WritableWriteResponse
29761 {
29762 #[inline]
29763 fn compat_from(value: ::fidl_fuchsia_io::WritableWriteResponse) -> Self {
29764 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
29765 }
29766 }
29767
29768 #[cfg(target_os = "fuchsia")]
29769 pub type WritableProxy = ::fidl_next::ClientSender<crate::Writable>;
29772
29773 impl ::fidl_next::CompatFrom<crate::Writable> for ::fidl_fuchsia_io::WritableMarker {
29774 fn compat_from(_: crate::Writable) -> Self {
29775 Self
29776 }
29777 }
29778
29779 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WritableMarker> for crate::Writable {
29780 fn compat_from(_: ::fidl_fuchsia_io::WritableMarker) -> Self {
29781 Self
29782 }
29783 }
29784
29785 #[cfg(target_os = "fuchsia")]
29786
29787 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::WritableProxy> for crate::Writable {
29788 fn client_compat_from(
29789 proxy: ::fidl_fuchsia_io::WritableProxy,
29790 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
29791 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
29792 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
29793 ::fidl_next::Client::new(client_end)
29794 }
29795 }
29796
29797 impl ::fidl_next::CompatFrom<crate::FileSeekRequest> for ::fidl_fuchsia_io::FileSeekRequest {
29798 #[inline]
29799 fn compat_from(value: crate::FileSeekRequest) -> Self {
29800 Self {
29801 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
29802
29803 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29804 }
29805 }
29806 }
29807
29808 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSeekRequest> for crate::FileSeekRequest {
29809 #[inline]
29810 fn compat_from(value: ::fidl_fuchsia_io::FileSeekRequest) -> Self {
29811 Self {
29812 origin: ::fidl_next::CompatFrom::compat_from(value.origin),
29813
29814 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29815 }
29816 }
29817 }
29818
29819 impl ::fidl_next::CompatFrom<crate::FileSeekResponse> for ::fidl_fuchsia_io::FileSeekResponse {
29820 #[inline]
29821 fn compat_from(value: crate::FileSeekResponse) -> Self {
29822 Self {
29823 offset_from_start: ::fidl_next::CompatFrom::compat_from(value.offset_from_start),
29824 }
29825 }
29826 }
29827
29828 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSeekResponse> for crate::FileSeekResponse {
29829 #[inline]
29830 fn compat_from(value: ::fidl_fuchsia_io::FileSeekResponse) -> Self {
29831 Self {
29832 offset_from_start: ::fidl_next::CompatFrom::compat_from(value.offset_from_start),
29833 }
29834 }
29835 }
29836
29837 impl ::fidl_next::CompatFrom<crate::FileReadAtRequest> for ::fidl_fuchsia_io::FileReadAtRequest {
29838 #[inline]
29839 fn compat_from(value: crate::FileReadAtRequest) -> Self {
29840 Self {
29841 count: ::fidl_next::CompatFrom::compat_from(value.count),
29842
29843 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29844 }
29845 }
29846 }
29847
29848 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileReadAtRequest> for crate::FileReadAtRequest {
29849 #[inline]
29850 fn compat_from(value: ::fidl_fuchsia_io::FileReadAtRequest) -> Self {
29851 Self {
29852 count: ::fidl_next::CompatFrom::compat_from(value.count),
29853
29854 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29855 }
29856 }
29857 }
29858
29859 impl ::fidl_next::CompatFrom<crate::FileReadAtResponse> for ::fidl_fuchsia_io::FileReadAtResponse {
29860 #[inline]
29861 fn compat_from(value: crate::FileReadAtResponse) -> Self {
29862 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29863 }
29864 }
29865
29866 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileReadAtResponse> for crate::FileReadAtResponse {
29867 #[inline]
29868 fn compat_from(value: ::fidl_fuchsia_io::FileReadAtResponse) -> Self {
29869 Self { data: ::fidl_next::CompatFrom::compat_from(value.data) }
29870 }
29871 }
29872
29873 impl ::fidl_next::CompatFrom<crate::FileWriteAtRequest> for ::fidl_fuchsia_io::FileWriteAtRequest {
29874 #[inline]
29875 fn compat_from(value: crate::FileWriteAtRequest) -> Self {
29876 Self {
29877 data: ::fidl_next::CompatFrom::compat_from(value.data),
29878
29879 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29880 }
29881 }
29882 }
29883
29884 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileWriteAtRequest> for crate::FileWriteAtRequest {
29885 #[inline]
29886 fn compat_from(value: ::fidl_fuchsia_io::FileWriteAtRequest) -> Self {
29887 Self {
29888 data: ::fidl_next::CompatFrom::compat_from(value.data),
29889
29890 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
29891 }
29892 }
29893 }
29894
29895 impl ::fidl_next::CompatFrom<crate::FileWriteAtResponse>
29896 for ::fidl_fuchsia_io::FileWriteAtResponse
29897 {
29898 #[inline]
29899 fn compat_from(value: crate::FileWriteAtResponse) -> Self {
29900 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
29901 }
29902 }
29903
29904 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileWriteAtResponse>
29905 for crate::FileWriteAtResponse
29906 {
29907 #[inline]
29908 fn compat_from(value: ::fidl_fuchsia_io::FileWriteAtResponse) -> Self {
29909 Self { actual_count: ::fidl_next::CompatFrom::compat_from(value.actual_count) }
29910 }
29911 }
29912
29913 impl ::fidl_next::CompatFrom<crate::FileResizeRequest> for ::fidl_fuchsia_io::FileResizeRequest {
29914 #[inline]
29915 fn compat_from(value: crate::FileResizeRequest) -> Self {
29916 Self { length: ::fidl_next::CompatFrom::compat_from(value.length) }
29917 }
29918 }
29919
29920 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileResizeRequest> for crate::FileResizeRequest {
29921 #[inline]
29922 fn compat_from(value: ::fidl_fuchsia_io::FileResizeRequest) -> Self {
29923 Self { length: ::fidl_next::CompatFrom::compat_from(value.length) }
29924 }
29925 }
29926
29927 impl ::fidl_next::CompatFrom<crate::VmoFlags> for ::fidl_fuchsia_io::VmoFlags {
29928 fn compat_from(value: crate::VmoFlags) -> Self {
29929 Self::from_bits_retain(value.bits())
29930 }
29931 }
29932
29933 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::VmoFlags> for crate::VmoFlags {
29934 fn compat_from(value: ::fidl_fuchsia_io::VmoFlags) -> Self {
29935 Self::from_bits_retain(value.bits())
29936 }
29937 }
29938
29939 impl ::fidl_next::CompatFrom<crate::FileGetBackingMemoryRequest>
29940 for ::fidl_fuchsia_io::FileGetBackingMemoryRequest
29941 {
29942 #[inline]
29943 fn compat_from(value: crate::FileGetBackingMemoryRequest) -> Self {
29944 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
29945 }
29946 }
29947
29948 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileGetBackingMemoryRequest>
29949 for crate::FileGetBackingMemoryRequest
29950 {
29951 #[inline]
29952 fn compat_from(value: ::fidl_fuchsia_io::FileGetBackingMemoryRequest) -> Self {
29953 Self { flags: ::fidl_next::CompatFrom::compat_from(value.flags) }
29954 }
29955 }
29956
29957 impl ::fidl_next::CompatFrom<crate::FileGetBackingMemoryResponse>
29958 for ::fidl_fuchsia_io::FileGetBackingMemoryResponse
29959 {
29960 #[inline]
29961 fn compat_from(value: crate::FileGetBackingMemoryResponse) -> Self {
29962 Self { vmo: ::fidl_next::CompatFrom::compat_from(value.vmo) }
29963 }
29964 }
29965
29966 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileGetBackingMemoryResponse>
29967 for crate::FileGetBackingMemoryResponse
29968 {
29969 #[inline]
29970 fn compat_from(value: ::fidl_fuchsia_io::FileGetBackingMemoryResponse) -> Self {
29971 Self { vmo: ::fidl_next::CompatFrom::compat_from(value.vmo) }
29972 }
29973 }
29974
29975 impl ::fidl_next::CompatFrom<crate::LinkableLinkIntoRequest>
29976 for ::fidl_fuchsia_io::LinkableLinkIntoRequest
29977 {
29978 #[inline]
29979 fn compat_from(value: crate::LinkableLinkIntoRequest) -> Self {
29980 Self {
29981 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
29982
29983 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
29984 }
29985 }
29986 }
29987
29988 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::LinkableLinkIntoRequest>
29989 for crate::LinkableLinkIntoRequest
29990 {
29991 #[inline]
29992 fn compat_from(value: ::fidl_fuchsia_io::LinkableLinkIntoRequest) -> Self {
29993 Self {
29994 dst_parent_token: ::fidl_next::CompatFrom::compat_from(value.dst_parent_token),
29995
29996 dst: ::fidl_next::CompatFrom::compat_from(value.dst),
29997 }
29998 }
29999 }
30000
30001 #[cfg(target_os = "fuchsia")]
30002 pub type LinkableProxy = ::fidl_next::ClientSender<crate::Linkable>;
30005
30006 impl ::fidl_next::CompatFrom<crate::Linkable> for ::fidl_fuchsia_io::LinkableMarker {
30007 fn compat_from(_: crate::Linkable) -> Self {
30008 Self
30009 }
30010 }
30011
30012 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::LinkableMarker> for crate::Linkable {
30013 fn compat_from(_: ::fidl_fuchsia_io::LinkableMarker) -> Self {
30014 Self
30015 }
30016 }
30017
30018 #[cfg(target_os = "fuchsia")]
30019
30020 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::LinkableProxy> for crate::Linkable {
30021 fn client_compat_from(
30022 proxy: ::fidl_fuchsia_io::LinkableProxy,
30023 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
30024 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
30025 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
30026 ::fidl_next::Client::new(client_end)
30027 }
30028 }
30029
30030 impl ::fidl_next::CompatFrom<crate::FileAllocateRequest>
30031 for ::fidl_fuchsia_io::FileAllocateRequest
30032 {
30033 #[inline]
30034 fn compat_from(value: crate::FileAllocateRequest) -> Self {
30035 Self {
30036 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
30037
30038 length: ::fidl_next::CompatFrom::compat_from(value.length),
30039
30040 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30041 }
30042 }
30043 }
30044
30045 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileAllocateRequest>
30046 for crate::FileAllocateRequest
30047 {
30048 #[inline]
30049 fn compat_from(value: ::fidl_fuchsia_io::FileAllocateRequest) -> Self {
30050 Self {
30051 offset: ::fidl_next::CompatFrom::compat_from(value.offset),
30052
30053 length: ::fidl_next::CompatFrom::compat_from(value.length),
30054
30055 mode: ::fidl_next::CompatFrom::compat_from(value.mode),
30056 }
30057 }
30058 }
30059
30060 impl ::fidl_next::CompatFrom<crate::FileEnableVerityRequest>
30061 for ::fidl_fuchsia_io::FileEnableVerityRequest
30062 {
30063 #[inline]
30064 fn compat_from(value: crate::FileEnableVerityRequest) -> Self {
30065 Self { options: ::fidl_next::CompatFrom::compat_from(value.options) }
30066 }
30067 }
30068
30069 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileEnableVerityRequest>
30070 for crate::FileEnableVerityRequest
30071 {
30072 #[inline]
30073 fn compat_from(value: ::fidl_fuchsia_io::FileEnableVerityRequest) -> Self {
30074 Self { options: ::fidl_next::CompatFrom::compat_from(value.options) }
30075 }
30076 }
30077
30078 #[cfg(target_os = "fuchsia")]
30079 pub type FileProxy = ::fidl_next::ClientSender<crate::File>;
30082
30083 impl ::fidl_next::CompatFrom<crate::File> for ::fidl_fuchsia_io::FileMarker {
30084 fn compat_from(_: crate::File) -> Self {
30085 Self
30086 }
30087 }
30088
30089 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileMarker> for crate::File {
30090 fn compat_from(_: ::fidl_fuchsia_io::FileMarker) -> Self {
30091 Self
30092 }
30093 }
30094
30095 #[cfg(target_os = "fuchsia")]
30096
30097 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::FileProxy> for crate::File {
30098 fn client_compat_from(
30099 proxy: ::fidl_fuchsia_io::FileProxy,
30100 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
30101 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
30102 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
30103 ::fidl_next::Client::new(client_end)
30104 }
30105 }
30106
30107 impl ::fidl_next::CompatFrom<crate::FileObject> for ::fidl_fuchsia_io::FileObject {
30108 #[inline]
30109 fn compat_from(value: crate::FileObject) -> Self {
30110 Self {
30111 event: ::fidl_next::CompatFrom::compat_from(value.event),
30112
30113 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
30114 }
30115 }
30116 }
30117
30118 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileObject> for crate::FileObject {
30119 #[inline]
30120 fn compat_from(value: ::fidl_fuchsia_io::FileObject) -> Self {
30121 Self {
30122 event: ::fidl_next::CompatFrom::compat_from(value.event),
30123
30124 stream: ::fidl_next::CompatFrom::compat_from(value.stream),
30125 }
30126 }
30127 }
30128
30129 impl ::fidl_next::CompatFrom<crate::FileSignal> for ::fidl_fuchsia_io::FileSignal {
30130 fn compat_from(value: crate::FileSignal) -> Self {
30131 Self::from_bits_retain(value.bits())
30132 }
30133 }
30134
30135 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FileSignal> for crate::FileSignal {
30136 fn compat_from(value: ::fidl_fuchsia_io::FileSignal) -> Self {
30137 Self::from_bits_retain(value.bits())
30138 }
30139 }
30140
30141 impl ::fidl_next::CompatFrom<crate::FilesystemInfo> for ::fidl_fuchsia_io::FilesystemInfo {
30142 #[inline]
30143 fn compat_from(value: crate::FilesystemInfo) -> Self {
30144 Self {
30145 total_bytes: ::fidl_next::CompatFrom::compat_from(value.total_bytes),
30146
30147 used_bytes: ::fidl_next::CompatFrom::compat_from(value.used_bytes),
30148
30149 total_nodes: ::fidl_next::CompatFrom::compat_from(value.total_nodes),
30150
30151 used_nodes: ::fidl_next::CompatFrom::compat_from(value.used_nodes),
30152
30153 free_shared_pool_bytes: ::fidl_next::CompatFrom::compat_from(
30154 value.free_shared_pool_bytes,
30155 ),
30156
30157 fs_id: ::fidl_next::CompatFrom::compat_from(value.fs_id),
30158
30159 block_size: ::fidl_next::CompatFrom::compat_from(value.block_size),
30160
30161 max_filename_size: ::fidl_next::CompatFrom::compat_from(value.max_filename_size),
30162
30163 fs_type: ::fidl_next::CompatFrom::compat_from(value.fs_type),
30164
30165 padding: ::fidl_next::CompatFrom::compat_from(value.padding),
30166
30167 name: ::fidl_next::CompatFrom::compat_from(value.name),
30168 }
30169 }
30170 }
30171
30172 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::FilesystemInfo> for crate::FilesystemInfo {
30173 #[inline]
30174 fn compat_from(value: ::fidl_fuchsia_io::FilesystemInfo) -> Self {
30175 Self {
30176 total_bytes: ::fidl_next::CompatFrom::compat_from(value.total_bytes),
30177
30178 used_bytes: ::fidl_next::CompatFrom::compat_from(value.used_bytes),
30179
30180 total_nodes: ::fidl_next::CompatFrom::compat_from(value.total_nodes),
30181
30182 used_nodes: ::fidl_next::CompatFrom::compat_from(value.used_nodes),
30183
30184 free_shared_pool_bytes: ::fidl_next::CompatFrom::compat_from(
30185 value.free_shared_pool_bytes,
30186 ),
30187
30188 fs_id: ::fidl_next::CompatFrom::compat_from(value.fs_id),
30189
30190 block_size: ::fidl_next::CompatFrom::compat_from(value.block_size),
30191
30192 max_filename_size: ::fidl_next::CompatFrom::compat_from(value.max_filename_size),
30193
30194 fs_type: ::fidl_next::CompatFrom::compat_from(value.fs_type),
30195
30196 padding: ::fidl_next::CompatFrom::compat_from(value.padding),
30197
30198 name: ::fidl_next::CompatFrom::compat_from(value.name),
30199 }
30200 }
30201 }
30202
30203 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_io::Service {
30204 #[inline]
30205 fn compat_from(value: crate::Service) -> Self {
30206 Self {}
30207 }
30208 }
30209
30210 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::Service> for crate::Service {
30211 #[inline]
30212 fn compat_from(value: ::fidl_fuchsia_io::Service) -> Self {
30213 Self {}
30214 }
30215 }
30216
30217 impl ::fidl_next::CompatFrom<crate::SymlinkObject> for ::fidl_fuchsia_io::SymlinkObject {
30218 #[inline]
30219 fn compat_from(value: crate::SymlinkObject) -> Self {
30220 Self { target: ::fidl_next::CompatFrom::compat_from(value.target) }
30221 }
30222 }
30223
30224 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkObject> for crate::SymlinkObject {
30225 #[inline]
30226 fn compat_from(value: ::fidl_fuchsia_io::SymlinkObject) -> Self {
30227 Self { target: ::fidl_next::CompatFrom::compat_from(value.target) }
30228 }
30229 }
30230
30231 impl ::fidl_next::CompatFrom<crate::NodeInfoDeprecated> for ::fidl_fuchsia_io::NodeInfoDeprecated {
30232 fn compat_from(value: crate::NodeInfoDeprecated) -> Self {
30233 match value {
30234 crate::NodeInfoDeprecated::Service(value) => {
30235 Self::Service(::fidl_next::CompatFrom::compat_from(value))
30236 }
30237
30238 crate::NodeInfoDeprecated::File(value) => {
30239 Self::File(::fidl_next::CompatFrom::compat_from(value))
30240 }
30241
30242 crate::NodeInfoDeprecated::Directory(value) => {
30243 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
30244 }
30245
30246 crate::NodeInfoDeprecated::Symlink(value) => {
30247 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
30248 }
30249 }
30250 }
30251 }
30252
30253 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::NodeInfoDeprecated> for crate::NodeInfoDeprecated {
30254 fn compat_from(value: ::fidl_fuchsia_io::NodeInfoDeprecated) -> Self {
30255 match value {
30256 ::fidl_fuchsia_io::NodeInfoDeprecated::Service(value) => {
30257 Self::Service(::fidl_next::CompatFrom::compat_from(value))
30258 }
30259
30260 ::fidl_fuchsia_io::NodeInfoDeprecated::File(value) => {
30261 Self::File(::fidl_next::CompatFrom::compat_from(value))
30262 }
30263
30264 ::fidl_fuchsia_io::NodeInfoDeprecated::Directory(value) => {
30265 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
30266 }
30267
30268 ::fidl_fuchsia_io::NodeInfoDeprecated::Symlink(value) => {
30269 Self::Symlink(::fidl_next::CompatFrom::compat_from(value))
30270 }
30271 }
30272 }
30273 }
30274
30275 #[cfg(target_os = "fuchsia")]
30276 pub type SymlinkProxy = ::fidl_next::ClientSender<crate::Symlink>;
30279
30280 impl ::fidl_next::CompatFrom<crate::Symlink> for ::fidl_fuchsia_io::SymlinkMarker {
30281 fn compat_from(_: crate::Symlink) -> Self {
30282 Self
30283 }
30284 }
30285
30286 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::SymlinkMarker> for crate::Symlink {
30287 fn compat_from(_: ::fidl_fuchsia_io::SymlinkMarker) -> Self {
30288 Self
30289 }
30290 }
30291
30292 #[cfg(target_os = "fuchsia")]
30293
30294 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_io::SymlinkProxy> for crate::Symlink {
30295 fn client_compat_from(
30296 proxy: ::fidl_fuchsia_io::SymlinkProxy,
30297 ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
30298 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
30299 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
30300 ::fidl_next::Client::new(client_end)
30301 }
30302 }
30303
30304 impl ::fidl_next::CompatFrom<crate::WatchEvent> for ::fidl_fuchsia_io::WatchEvent {
30305 fn compat_from(value: crate::WatchEvent) -> Self {
30306 match value {
30307 crate::WatchEvent::Deleted => Self::Deleted,
30308
30309 crate::WatchEvent::Added => Self::Added,
30310
30311 crate::WatchEvent::Removed => Self::Removed,
30312
30313 crate::WatchEvent::Existing => Self::Existing,
30314
30315 crate::WatchEvent::Idle => Self::Idle,
30316 }
30317 }
30318 }
30319
30320 impl ::fidl_next::CompatFrom<::fidl_fuchsia_io::WatchEvent> for crate::WatchEvent {
30321 fn compat_from(value: ::fidl_fuchsia_io::WatchEvent) -> Self {
30322 match value {
30323 ::fidl_fuchsia_io::WatchEvent::Deleted => Self::Deleted,
30324
30325 ::fidl_fuchsia_io::WatchEvent::Added => Self::Added,
30326
30327 ::fidl_fuchsia_io::WatchEvent::Removed => Self::Removed,
30328
30329 ::fidl_fuchsia_io::WatchEvent::Existing => Self::Existing,
30330
30331 ::fidl_fuchsia_io::WatchEvent::Idle => Self::Idle,
30332 }
30333 }
30334 }
30335}