1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 ::fidl_next::bitflags::bitflags! {
8 #[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(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct Operations: u64 {
9 #[doc = " Connecting to a service in a directory.\n"]const CONNECT = 1;
10 #[doc = " Read byte contents of a node or its children.\n"]const READ_BYTES = 2;
11 #[doc = " Writing to the byte contents of a node or its children.\n"]const WRITE_BYTES = 4;
12 #[doc = " Execute the byte contents of a node or its children.\n"]const EXECUTE = 8;
13 #[doc = " Reading the attributes of a node and/or its children.\n"]const GET_ATTRIBUTES = 16;
14 #[doc = " Updating the attributes of a node and/or its children.\n"]const UPDATE_ATTRIBUTES = 32;
15 #[doc = " Reading the list of nodes in a directory.\n"]const ENUMERATE = 64;
16 #[doc = " Opening a node from a directory.\n\n Note: It is recommended to pair this with [`Rights.ENUMERATE`] (directory contents can be\n probed by opening children), e.g. by using [`PERM_READABLE`]. If strict isolation\n is required, consider routing discrete capabilities instead.\n"]const TRAVERSE = 128;
17 #[doc = " Modifying the list of nodes in a directory, e.g. creating, renaming, link/unlink, etc...\n\n Note: It is recommended to pair this with [`Rights.ENUMERATE`] (directory contents can be\n probed via name conflicts during node creation), e.g. by using [`PERM_WRITABLE`]. If\n strict isolation is required, consider routing discrete capabilities instead.\n"]const MODIFY_DIRECTORY = 256;
18 const _ = !0;
19 }
20 }
21
22 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Operations, ___E> for Operations
23 where
24 ___E: ?Sized,
25 {
26 #[inline]
27 fn encode(
28 self,
29 encoder: &mut ___E,
30 out: &mut ::core::mem::MaybeUninit<crate::wire::Operations>,
31 _: (),
32 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33 ::fidl_next::Encode::encode(&self, encoder, out, ())
34 }
35 }
36
37 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Operations, ___E> for &'a Operations
38 where
39 ___E: ?Sized,
40 {
41 #[inline]
42 fn encode(
43 self,
44 _: &mut ___E,
45 out: &mut ::core::mem::MaybeUninit<crate::wire::Operations>,
46 _: (),
47 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
48 ::fidl_next::munge!(let crate::wire::Operations { value } = out);
49
50 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
51 Ok(())
52 }
53 }
54
55 impl ::core::convert::From<crate::wire::Operations> for Operations {
56 fn from(wire: crate::wire::Operations) -> Self {
57 Self::from_bits_retain(u64::from(wire.value))
58 }
59 }
60
61 impl ::fidl_next::FromWire<crate::wire::Operations> for Operations {
62 #[inline]
63 fn from_wire(wire: crate::wire::Operations) -> Self {
64 Self::from(wire)
65 }
66 }
67
68 impl ::fidl_next::FromWireRef<crate::wire::Operations> for Operations {
69 #[inline]
70 fn from_wire_ref(wire: &crate::wire::Operations) -> Self {
71 Self::from(*wire)
72 }
73 }
74
75 #[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"]
76 pub type Abilities = crate::natural::Operations;
77
78 #[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"]
79 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
80 #[repr(u32)]
81 pub enum SeekOrigin {
82 Start = 0,
83 Current = 1,
84 End = 2,
85 }
86 impl ::core::convert::TryFrom<u32> for SeekOrigin {
87 type Error = ::fidl_next::UnknownStrictEnumMemberError;
88 fn try_from(
89 value: u32,
90 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
91 match value {
92 0 => Ok(Self::Start),
93 1 => Ok(Self::Current),
94 2 => Ok(Self::End),
95
96 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
97 }
98 }
99 }
100
101 impl ::std::convert::From<SeekOrigin> for u32 {
102 fn from(value: SeekOrigin) -> Self {
103 match value {
104 SeekOrigin::Start => 0,
105 SeekOrigin::Current => 1,
106 SeekOrigin::End => 2,
107 }
108 }
109 }
110
111 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SeekOrigin, ___E> for SeekOrigin
112 where
113 ___E: ?Sized,
114 {
115 #[inline]
116 fn encode(
117 self,
118 encoder: &mut ___E,
119 out: &mut ::core::mem::MaybeUninit<crate::wire::SeekOrigin>,
120 _: (),
121 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
122 ::fidl_next::Encode::encode(&self, encoder, out, ())
123 }
124 }
125
126 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SeekOrigin, ___E> for &'a SeekOrigin
127 where
128 ___E: ?Sized,
129 {
130 #[inline]
131 fn encode(
132 self,
133 encoder: &mut ___E,
134 out: &mut ::core::mem::MaybeUninit<crate::wire::SeekOrigin>,
135 _: (),
136 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
137 ::fidl_next::munge!(let crate::wire::SeekOrigin { value } = out);
138 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
139 SeekOrigin::Start => 0,
140
141 SeekOrigin::Current => 1,
142
143 SeekOrigin::End => 2,
144 }));
145
146 Ok(())
147 }
148 }
149
150 impl ::core::convert::From<crate::wire::SeekOrigin> for SeekOrigin {
151 fn from(wire: crate::wire::SeekOrigin) -> Self {
152 match u32::from(wire.value) {
153 0 => Self::Start,
154
155 1 => Self::Current,
156
157 2 => Self::End,
158
159 _ => unsafe { ::core::hint::unreachable_unchecked() },
160 }
161 }
162 }
163
164 impl ::fidl_next::FromWire<crate::wire::SeekOrigin> for SeekOrigin {
165 #[inline]
166 fn from_wire(wire: crate::wire::SeekOrigin) -> Self {
167 Self::from(wire)
168 }
169 }
170
171 impl ::fidl_next::FromWireRef<crate::wire::SeekOrigin> for SeekOrigin {
172 #[inline]
173 fn from_wire_ref(wire: &crate::wire::SeekOrigin) -> Self {
174 Self::from(*wire)
175 }
176 }
177
178 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
179 pub struct AdvisoryLockRange {
180 pub origin: crate::natural::SeekOrigin,
181
182 pub offset: i64,
183
184 pub length: i64,
185 }
186
187 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AdvisoryLockRange, ___E> for AdvisoryLockRange
188 where
189 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
190 {
191 #[inline]
192 fn encode(
193 self,
194 encoder_: &mut ___E,
195 out_: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockRange>,
196 _: (),
197 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
198 ::fidl_next::munge! {
199 let crate::wire::AdvisoryLockRange {
200 origin,
201 offset,
202 length,
203
204 } = out_;
205 }
206
207 ::fidl_next::Encode::encode(self.origin, encoder_, origin, ())?;
208
209 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(origin.as_mut_ptr()) };
210
211 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
212
213 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
214
215 ::fidl_next::Encode::encode(self.length, encoder_, length, ())?;
216
217 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(length.as_mut_ptr()) };
218
219 Ok(())
220 }
221 }
222
223 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AdvisoryLockRange, ___E>
224 for &'a AdvisoryLockRange
225 where
226 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
227 {
228 #[inline]
229 fn encode(
230 self,
231 encoder_: &mut ___E,
232 out_: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockRange>,
233 _: (),
234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
235 ::fidl_next::munge! {
236 let crate::wire::AdvisoryLockRange {
237 origin,
238 offset,
239 length,
240
241 } = out_;
242 }
243
244 ::fidl_next::Encode::encode(&self.origin, encoder_, origin, ())?;
245
246 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(origin.as_mut_ptr()) };
247
248 ::fidl_next::Encode::encode(&self.offset, encoder_, offset, ())?;
249
250 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
251
252 ::fidl_next::Encode::encode(&self.length, encoder_, length, ())?;
253
254 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(length.as_mut_ptr()) };
255
256 Ok(())
257 }
258 }
259
260 unsafe impl<___E>
261 ::fidl_next::EncodeOption<
262 ::fidl_next::wire::Box<'static, crate::wire::AdvisoryLockRange>,
263 ___E,
264 > for AdvisoryLockRange
265 where
266 ___E: ::fidl_next::Encoder + ?Sized,
267 AdvisoryLockRange: ::fidl_next::Encode<crate::wire::AdvisoryLockRange, ___E>,
268 {
269 #[inline]
270 fn encode_option(
271 this: ::core::option::Option<Self>,
272 encoder: &mut ___E,
273 out: &mut ::core::mem::MaybeUninit<
274 ::fidl_next::wire::Box<'static, crate::wire::AdvisoryLockRange>,
275 >,
276 _: (),
277 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
278 if let Some(inner) = this {
279 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
280 ::fidl_next::wire::Box::encode_present(out);
281 } else {
282 ::fidl_next::wire::Box::encode_absent(out);
283 }
284
285 Ok(())
286 }
287 }
288
289 unsafe impl<'a, ___E>
290 ::fidl_next::EncodeOption<
291 ::fidl_next::wire::Box<'static, crate::wire::AdvisoryLockRange>,
292 ___E,
293 > for &'a AdvisoryLockRange
294 where
295 ___E: ::fidl_next::Encoder + ?Sized,
296 &'a AdvisoryLockRange: ::fidl_next::Encode<crate::wire::AdvisoryLockRange, ___E>,
297 {
298 #[inline]
299 fn encode_option(
300 this: ::core::option::Option<Self>,
301 encoder: &mut ___E,
302 out: &mut ::core::mem::MaybeUninit<
303 ::fidl_next::wire::Box<'static, crate::wire::AdvisoryLockRange>,
304 >,
305 _: (),
306 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
307 if let Some(inner) = this {
308 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
309 ::fidl_next::wire::Box::encode_present(out);
310 } else {
311 ::fidl_next::wire::Box::encode_absent(out);
312 }
313
314 Ok(())
315 }
316 }
317
318 impl ::fidl_next::FromWire<crate::wire::AdvisoryLockRange> for AdvisoryLockRange {
319 #[inline]
320 fn from_wire(wire: crate::wire::AdvisoryLockRange) -> Self {
321 Self {
322 origin: ::fidl_next::FromWire::from_wire(wire.origin),
323
324 offset: ::fidl_next::FromWire::from_wire(wire.offset),
325
326 length: ::fidl_next::FromWire::from_wire(wire.length),
327 }
328 }
329 }
330
331 impl ::fidl_next::FromWireRef<crate::wire::AdvisoryLockRange> for AdvisoryLockRange {
332 #[inline]
333 fn from_wire_ref(wire: &crate::wire::AdvisoryLockRange) -> Self {
334 Self {
335 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
336
337 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
338
339 length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length),
340 }
341 }
342 }
343
344 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
345 #[repr(u32)]
346 pub enum AdvisoryLockType {
347 Read = 1,
348 Write = 2,
349 Unlock = 3,
350 }
351 impl ::core::convert::TryFrom<u32> for AdvisoryLockType {
352 type Error = ::fidl_next::UnknownStrictEnumMemberError;
353 fn try_from(
354 value: u32,
355 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
356 match value {
357 1 => Ok(Self::Read),
358 2 => Ok(Self::Write),
359 3 => Ok(Self::Unlock),
360
361 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
362 }
363 }
364 }
365
366 impl ::std::convert::From<AdvisoryLockType> for u32 {
367 fn from(value: AdvisoryLockType) -> Self {
368 match value {
369 AdvisoryLockType::Read => 1,
370 AdvisoryLockType::Write => 2,
371 AdvisoryLockType::Unlock => 3,
372 }
373 }
374 }
375
376 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AdvisoryLockType, ___E> for AdvisoryLockType
377 where
378 ___E: ?Sized,
379 {
380 #[inline]
381 fn encode(
382 self,
383 encoder: &mut ___E,
384 out: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockType>,
385 _: (),
386 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
387 ::fidl_next::Encode::encode(&self, encoder, out, ())
388 }
389 }
390
391 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AdvisoryLockType, ___E>
392 for &'a AdvisoryLockType
393 where
394 ___E: ?Sized,
395 {
396 #[inline]
397 fn encode(
398 self,
399 encoder: &mut ___E,
400 out: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockType>,
401 _: (),
402 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
403 ::fidl_next::munge!(let crate::wire::AdvisoryLockType { value } = out);
404 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
405 AdvisoryLockType::Read => 1,
406
407 AdvisoryLockType::Write => 2,
408
409 AdvisoryLockType::Unlock => 3,
410 }));
411
412 Ok(())
413 }
414 }
415
416 impl ::core::convert::From<crate::wire::AdvisoryLockType> for AdvisoryLockType {
417 fn from(wire: crate::wire::AdvisoryLockType) -> Self {
418 match u32::from(wire.value) {
419 1 => Self::Read,
420
421 2 => Self::Write,
422
423 3 => Self::Unlock,
424
425 _ => unsafe { ::core::hint::unreachable_unchecked() },
426 }
427 }
428 }
429
430 impl ::fidl_next::FromWire<crate::wire::AdvisoryLockType> for AdvisoryLockType {
431 #[inline]
432 fn from_wire(wire: crate::wire::AdvisoryLockType) -> Self {
433 Self::from(wire)
434 }
435 }
436
437 impl ::fidl_next::FromWireRef<crate::wire::AdvisoryLockType> for AdvisoryLockType {
438 #[inline]
439 fn from_wire_ref(wire: &crate::wire::AdvisoryLockType) -> Self {
440 Self::from(*wire)
441 }
442 }
443
444 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
445 pub struct AdvisoryLockRequest {
446 pub type_: ::core::option::Option<crate::natural::AdvisoryLockType>,
447
448 pub range: ::core::option::Option<crate::natural::AdvisoryLockRange>,
449
450 pub wait: ::core::option::Option<bool>,
451 }
452
453 impl AdvisoryLockRequest {
454 fn __max_ordinal(&self) -> usize {
455 if self.wait.is_some() {
456 return 3;
457 }
458
459 if self.range.is_some() {
460 return 2;
461 }
462
463 if self.type_.is_some() {
464 return 1;
465 }
466
467 0
468 }
469 }
470
471 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AdvisoryLockRequest<'static>, ___E>
472 for AdvisoryLockRequest
473 where
474 ___E: ::fidl_next::Encoder + ?Sized,
475 {
476 #[inline]
477 fn encode(
478 mut self,
479 encoder: &mut ___E,
480 out: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockRequest<'static>>,
481 _: (),
482 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
483 ::fidl_next::munge!(let crate::wire::AdvisoryLockRequest { table } = out);
484
485 let max_ord = self.__max_ordinal();
486
487 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
488 ::fidl_next::Wire::zero_padding(&mut out);
489
490 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
491 ::fidl_next::wire::Envelope,
492 >(encoder, max_ord);
493
494 for i in 1..=max_ord {
495 match i {
496 3 => {
497 if let Some(value) = self.wait.take() {
498 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
499 value,
500 preallocated.encoder,
501 &mut out,
502 (),
503 )?;
504 } else {
505 ::fidl_next::wire::Envelope::encode_zero(&mut out)
506 }
507 }
508
509 2 => {
510 if let Some(value) = self.range.take() {
511 ::fidl_next::wire::Envelope::encode_value::<
512 crate::wire::AdvisoryLockRange,
513 ___E,
514 >(
515 value, preallocated.encoder, &mut out, ()
516 )?;
517 } else {
518 ::fidl_next::wire::Envelope::encode_zero(&mut out)
519 }
520 }
521
522 1 => {
523 if let Some(value) = self.type_.take() {
524 ::fidl_next::wire::Envelope::encode_value::<
525 crate::wire::AdvisoryLockType,
526 ___E,
527 >(
528 value, preallocated.encoder, &mut out, ()
529 )?;
530 } else {
531 ::fidl_next::wire::Envelope::encode_zero(&mut out)
532 }
533 }
534
535 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
536 }
537 unsafe {
538 preallocated.write_next(out.assume_init_ref());
539 }
540 }
541
542 ::fidl_next::wire::Table::encode_len(table, max_ord);
543
544 Ok(())
545 }
546 }
547
548 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AdvisoryLockRequest<'static>, ___E>
549 for &'a AdvisoryLockRequest
550 where
551 ___E: ::fidl_next::Encoder + ?Sized,
552 {
553 #[inline]
554 fn encode(
555 self,
556 encoder: &mut ___E,
557 out: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockRequest<'static>>,
558 _: (),
559 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
560 ::fidl_next::munge!(let crate::wire::AdvisoryLockRequest { table } = out);
561
562 let max_ord = self.__max_ordinal();
563
564 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
565 ::fidl_next::Wire::zero_padding(&mut out);
566
567 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
568 ::fidl_next::wire::Envelope,
569 >(encoder, max_ord);
570
571 for i in 1..=max_ord {
572 match i {
573 3 => {
574 if let Some(value) = &self.wait {
575 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
576 value,
577 preallocated.encoder,
578 &mut out,
579 (),
580 )?;
581 } else {
582 ::fidl_next::wire::Envelope::encode_zero(&mut out)
583 }
584 }
585
586 2 => {
587 if let Some(value) = &self.range {
588 ::fidl_next::wire::Envelope::encode_value::<
589 crate::wire::AdvisoryLockRange,
590 ___E,
591 >(
592 value, preallocated.encoder, &mut out, ()
593 )?;
594 } else {
595 ::fidl_next::wire::Envelope::encode_zero(&mut out)
596 }
597 }
598
599 1 => {
600 if let Some(value) = &self.type_ {
601 ::fidl_next::wire::Envelope::encode_value::<
602 crate::wire::AdvisoryLockType,
603 ___E,
604 >(
605 value, preallocated.encoder, &mut out, ()
606 )?;
607 } else {
608 ::fidl_next::wire::Envelope::encode_zero(&mut out)
609 }
610 }
611
612 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
613 }
614 unsafe {
615 preallocated.write_next(out.assume_init_ref());
616 }
617 }
618
619 ::fidl_next::wire::Table::encode_len(table, max_ord);
620
621 Ok(())
622 }
623 }
624
625 impl<'de> ::fidl_next::FromWire<crate::wire::AdvisoryLockRequest<'de>> for AdvisoryLockRequest {
626 #[inline]
627 fn from_wire(wire_: crate::wire::AdvisoryLockRequest<'de>) -> Self {
628 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
629
630 let type_ = wire_.table.get(1);
631
632 let range = wire_.table.get(2);
633
634 let wait = wire_.table.get(3);
635
636 Self {
637 type_: type_.map(|envelope| {
638 ::fidl_next::FromWire::from_wire(unsafe {
639 envelope.read_unchecked::<crate::wire::AdvisoryLockType>()
640 })
641 }),
642
643 range: range.map(|envelope| {
644 ::fidl_next::FromWire::from_wire(unsafe {
645 envelope.read_unchecked::<crate::wire::AdvisoryLockRange>()
646 })
647 }),
648
649 wait: wait.map(|envelope| {
650 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
651 }),
652 }
653 }
654 }
655
656 impl<'de> ::fidl_next::FromWireRef<crate::wire::AdvisoryLockRequest<'de>> for AdvisoryLockRequest {
657 #[inline]
658 fn from_wire_ref(wire: &crate::wire::AdvisoryLockRequest<'de>) -> Self {
659 Self {
660 type_: wire.table.get(1).map(|envelope| {
661 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
662 envelope.deref_unchecked::<crate::wire::AdvisoryLockType>()
663 })
664 }),
665
666 range: wire.table.get(2).map(|envelope| {
667 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
668 envelope.deref_unchecked::<crate::wire::AdvisoryLockRange>()
669 })
670 }),
671
672 wait: wire.table.get(3).map(|envelope| {
673 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
674 envelope.deref_unchecked::<bool>()
675 })
676 }),
677 }
678 }
679 }
680
681 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
682 pub struct AdvisoryLockingAdvisoryLockRequest {
683 pub request: crate::natural::AdvisoryLockRequest,
684 }
685
686 unsafe impl<___E>
687 ::fidl_next::Encode<crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>, ___E>
688 for AdvisoryLockingAdvisoryLockRequest
689 where
690 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
691 ___E: ::fidl_next::Encoder,
692 {
693 #[inline]
694 fn encode(
695 self,
696 encoder_: &mut ___E,
697 out_: &mut ::core::mem::MaybeUninit<
698 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
699 >,
700 _: (),
701 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
702 ::fidl_next::munge! {
703 let crate::wire::AdvisoryLockingAdvisoryLockRequest {
704 request,
705
706 } = out_;
707 }
708
709 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
710
711 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
712
713 Ok(())
714 }
715 }
716
717 unsafe impl<'a, ___E>
718 ::fidl_next::Encode<crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>, ___E>
719 for &'a AdvisoryLockingAdvisoryLockRequest
720 where
721 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
722 ___E: ::fidl_next::Encoder,
723 {
724 #[inline]
725 fn encode(
726 self,
727 encoder_: &mut ___E,
728 out_: &mut ::core::mem::MaybeUninit<
729 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
730 >,
731 _: (),
732 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
733 ::fidl_next::munge! {
734 let crate::wire::AdvisoryLockingAdvisoryLockRequest {
735 request,
736
737 } = out_;
738 }
739
740 ::fidl_next::Encode::encode(&self.request, encoder_, request, ())?;
741
742 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
743
744 Ok(())
745 }
746 }
747
748 unsafe impl<___E>
749 ::fidl_next::EncodeOption<
750 ::fidl_next::wire::Box<
751 'static,
752 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
753 >,
754 ___E,
755 > for AdvisoryLockingAdvisoryLockRequest
756 where
757 ___E: ::fidl_next::Encoder + ?Sized,
758 AdvisoryLockingAdvisoryLockRequest:
759 ::fidl_next::Encode<crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>, ___E>,
760 {
761 #[inline]
762 fn encode_option(
763 this: ::core::option::Option<Self>,
764 encoder: &mut ___E,
765 out: &mut ::core::mem::MaybeUninit<
766 ::fidl_next::wire::Box<
767 'static,
768 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
769 >,
770 >,
771 _: (),
772 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
773 if let Some(inner) = this {
774 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
775 ::fidl_next::wire::Box::encode_present(out);
776 } else {
777 ::fidl_next::wire::Box::encode_absent(out);
778 }
779
780 Ok(())
781 }
782 }
783
784 unsafe impl<'a, ___E>
785 ::fidl_next::EncodeOption<
786 ::fidl_next::wire::Box<
787 'static,
788 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
789 >,
790 ___E,
791 > for &'a AdvisoryLockingAdvisoryLockRequest
792 where
793 ___E: ::fidl_next::Encoder + ?Sized,
794 &'a AdvisoryLockingAdvisoryLockRequest:
795 ::fidl_next::Encode<crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>, ___E>,
796 {
797 #[inline]
798 fn encode_option(
799 this: ::core::option::Option<Self>,
800 encoder: &mut ___E,
801 out: &mut ::core::mem::MaybeUninit<
802 ::fidl_next::wire::Box<
803 'static,
804 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
805 >,
806 >,
807 _: (),
808 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
809 if let Some(inner) = this {
810 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
811 ::fidl_next::wire::Box::encode_present(out);
812 } else {
813 ::fidl_next::wire::Box::encode_absent(out);
814 }
815
816 Ok(())
817 }
818 }
819
820 impl<'de> ::fidl_next::FromWire<crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>>
821 for AdvisoryLockingAdvisoryLockRequest
822 {
823 #[inline]
824 fn from_wire(wire: crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
825 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
826 }
827 }
828
829 impl<'de> ::fidl_next::FromWireRef<crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>>
830 for AdvisoryLockingAdvisoryLockRequest
831 {
832 #[inline]
833 fn from_wire_ref(wire: &crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>) -> Self {
834 Self { request: ::fidl_next::FromWireRef::from_wire_ref(&wire.request) }
835 }
836 }
837
838 pub type AdvisoryLockingAdvisoryLockResponse = ();
839
840 ::fidl_next::bitflags::bitflags! {
841 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct AllocateMode: u32 {
842 const KEEP_SIZE = 1;
843 const UNSHARE_RANGE = 2;
844 const PUNCH_HOLE = 4;
845 const COLLAPSE_RANGE = 8;
846 const ZERO_RANGE = 16;
847 const INSERT_RANGE = 32;
848 const _ = !0;
849 }
850 }
851
852 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AllocateMode, ___E> for AllocateMode
853 where
854 ___E: ?Sized,
855 {
856 #[inline]
857 fn encode(
858 self,
859 encoder: &mut ___E,
860 out: &mut ::core::mem::MaybeUninit<crate::wire::AllocateMode>,
861 _: (),
862 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
863 ::fidl_next::Encode::encode(&self, encoder, out, ())
864 }
865 }
866
867 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AllocateMode, ___E> for &'a AllocateMode
868 where
869 ___E: ?Sized,
870 {
871 #[inline]
872 fn encode(
873 self,
874 _: &mut ___E,
875 out: &mut ::core::mem::MaybeUninit<crate::wire::AllocateMode>,
876 _: (),
877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
878 ::fidl_next::munge!(let crate::wire::AllocateMode { value } = out);
879
880 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
881 Ok(())
882 }
883 }
884
885 impl ::core::convert::From<crate::wire::AllocateMode> for AllocateMode {
886 fn from(wire: crate::wire::AllocateMode) -> Self {
887 Self::from_bits_retain(u32::from(wire.value))
888 }
889 }
890
891 impl ::fidl_next::FromWire<crate::wire::AllocateMode> for AllocateMode {
892 #[inline]
893 fn from_wire(wire: crate::wire::AllocateMode) -> Self {
894 Self::from(wire)
895 }
896 }
897
898 impl ::fidl_next::FromWireRef<crate::wire::AllocateMode> for AllocateMode {
899 #[inline]
900 fn from_wire_ref(wire: &crate::wire::AllocateMode) -> Self {
901 Self::from(*wire)
902 }
903 }
904
905 #[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"]
906 pub type Rights = crate::natural::Operations;
907
908 #[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"]
909 pub type Id = u64;
910
911 ::fidl_next::bitflags::bitflags! {
912 #[doc = " DEPRECATED - Use Flags instead.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct OpenFlags: u32 {
913 #[doc = " Can read from target object.\n"]const RIGHT_READABLE = 1;
914 #[doc = " Can write to target object.\n"]const RIGHT_WRITABLE = 2;
915 #[doc = " Connection can map target object executable.\n"]const RIGHT_EXECUTABLE = 8;
916 #[doc = " Create the object if it doesn\'t exist.\n"]const CREATE = 65536;
917 #[doc = " (with Create) Fail if the object already exists.\n"]const CREATE_IF_ABSENT = 131072;
918 #[doc = " Truncate the object before usage.\n"]const TRUNCATE = 262144;
919 #[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;
920 #[doc = " Seek to the end of the object before all writes.\n"]const APPEND = 1048576;
921 #[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;
922 #[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;
923 #[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;
924 #[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;
925 #[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;
926 #[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;
927 #[doc = " Open the target object as a block device.\n"]const BLOCK_DEVICE = 16777216;
928
929 }
930 }
931
932 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OpenFlags, ___E> for OpenFlags
933 where
934 ___E: ?Sized,
935 {
936 #[inline]
937 fn encode(
938 self,
939 encoder: &mut ___E,
940 out: &mut ::core::mem::MaybeUninit<crate::wire::OpenFlags>,
941 _: (),
942 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
943 ::fidl_next::Encode::encode(&self, encoder, out, ())
944 }
945 }
946
947 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OpenFlags, ___E> for &'a OpenFlags
948 where
949 ___E: ?Sized,
950 {
951 #[inline]
952 fn encode(
953 self,
954 _: &mut ___E,
955 out: &mut ::core::mem::MaybeUninit<crate::wire::OpenFlags>,
956 _: (),
957 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
958 ::fidl_next::munge!(let crate::wire::OpenFlags { value } = out);
959
960 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
961 return Err(::fidl_next::EncodeError::InvalidStrictBits);
962 }
963
964 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
965 Ok(())
966 }
967 }
968
969 impl ::core::convert::From<crate::wire::OpenFlags> for OpenFlags {
970 fn from(wire: crate::wire::OpenFlags) -> Self {
971 Self::from_bits_retain(u32::from(wire.value))
972 }
973 }
974
975 impl ::fidl_next::FromWire<crate::wire::OpenFlags> for OpenFlags {
976 #[inline]
977 fn from_wire(wire: crate::wire::OpenFlags) -> Self {
978 Self::from(wire)
979 }
980 }
981
982 impl ::fidl_next::FromWireRef<crate::wire::OpenFlags> for OpenFlags {
983 #[inline]
984 fn from_wire_ref(wire: &crate::wire::OpenFlags) -> Self {
985 Self::from(*wire)
986 }
987 }
988
989 #[doc = " NodeAttributes defines generic information about a filesystem node.\n"]
990 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
991 pub struct NodeAttributes {
992 pub mode: u32,
993
994 pub id: u64,
995
996 pub content_size: u64,
997
998 pub storage_size: u64,
999
1000 pub link_count: u64,
1001
1002 pub creation_time: u64,
1003
1004 pub modification_time: u64,
1005 }
1006
1007 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeAttributes, ___E> for NodeAttributes
1008 where
1009 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1010 {
1011 #[inline]
1012 fn encode(
1013 self,
1014 encoder_: &mut ___E,
1015 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes>,
1016 _: (),
1017 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1018 ::fidl_next::munge! {
1019 let crate::wire::NodeAttributes {
1020 mode,
1021 id,
1022 content_size,
1023 storage_size,
1024 link_count,
1025 creation_time,
1026 modification_time,
1027
1028 } = out_;
1029 }
1030
1031 ::fidl_next::Encode::encode(self.mode, encoder_, mode, ())?;
1032
1033 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(mode.as_mut_ptr()) };
1034
1035 ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
1036
1037 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
1038
1039 ::fidl_next::Encode::encode(self.content_size, encoder_, content_size, ())?;
1040
1041 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(content_size.as_mut_ptr()) };
1042
1043 ::fidl_next::Encode::encode(self.storage_size, encoder_, storage_size, ())?;
1044
1045 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(storage_size.as_mut_ptr()) };
1046
1047 ::fidl_next::Encode::encode(self.link_count, encoder_, link_count, ())?;
1048
1049 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(link_count.as_mut_ptr()) };
1050
1051 ::fidl_next::Encode::encode(self.creation_time, encoder_, creation_time, ())?;
1052
1053 let mut _field =
1054 unsafe { ::fidl_next::Slot::new_unchecked(creation_time.as_mut_ptr()) };
1055
1056 ::fidl_next::Encode::encode(self.modification_time, encoder_, modification_time, ())?;
1057
1058 let mut _field =
1059 unsafe { ::fidl_next::Slot::new_unchecked(modification_time.as_mut_ptr()) };
1060
1061 Ok(())
1062 }
1063 }
1064
1065 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeAttributes, ___E> for &'a NodeAttributes
1066 where
1067 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1068 {
1069 #[inline]
1070 fn encode(
1071 self,
1072 encoder_: &mut ___E,
1073 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes>,
1074 _: (),
1075 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1076 ::fidl_next::munge! {
1077 let crate::wire::NodeAttributes {
1078 mode,
1079 id,
1080 content_size,
1081 storage_size,
1082 link_count,
1083 creation_time,
1084 modification_time,
1085
1086 } = out_;
1087 }
1088
1089 ::fidl_next::Encode::encode(&self.mode, encoder_, mode, ())?;
1090
1091 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(mode.as_mut_ptr()) };
1092
1093 ::fidl_next::Encode::encode(&self.id, encoder_, id, ())?;
1094
1095 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
1096
1097 ::fidl_next::Encode::encode(&self.content_size, encoder_, content_size, ())?;
1098
1099 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(content_size.as_mut_ptr()) };
1100
1101 ::fidl_next::Encode::encode(&self.storage_size, encoder_, storage_size, ())?;
1102
1103 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(storage_size.as_mut_ptr()) };
1104
1105 ::fidl_next::Encode::encode(&self.link_count, encoder_, link_count, ())?;
1106
1107 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(link_count.as_mut_ptr()) };
1108
1109 ::fidl_next::Encode::encode(&self.creation_time, encoder_, creation_time, ())?;
1110
1111 let mut _field =
1112 unsafe { ::fidl_next::Slot::new_unchecked(creation_time.as_mut_ptr()) };
1113
1114 ::fidl_next::Encode::encode(&self.modification_time, encoder_, modification_time, ())?;
1115
1116 let mut _field =
1117 unsafe { ::fidl_next::Slot::new_unchecked(modification_time.as_mut_ptr()) };
1118
1119 Ok(())
1120 }
1121 }
1122
1123 unsafe impl<___E>
1124 ::fidl_next::EncodeOption<
1125 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes>,
1126 ___E,
1127 > for NodeAttributes
1128 where
1129 ___E: ::fidl_next::Encoder + ?Sized,
1130 NodeAttributes: ::fidl_next::Encode<crate::wire::NodeAttributes, ___E>,
1131 {
1132 #[inline]
1133 fn encode_option(
1134 this: ::core::option::Option<Self>,
1135 encoder: &mut ___E,
1136 out: &mut ::core::mem::MaybeUninit<
1137 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes>,
1138 >,
1139 _: (),
1140 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1141 if let Some(inner) = this {
1142 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1143 ::fidl_next::wire::Box::encode_present(out);
1144 } else {
1145 ::fidl_next::wire::Box::encode_absent(out);
1146 }
1147
1148 Ok(())
1149 }
1150 }
1151
1152 unsafe impl<'a, ___E>
1153 ::fidl_next::EncodeOption<
1154 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes>,
1155 ___E,
1156 > for &'a NodeAttributes
1157 where
1158 ___E: ::fidl_next::Encoder + ?Sized,
1159 &'a NodeAttributes: ::fidl_next::Encode<crate::wire::NodeAttributes, ___E>,
1160 {
1161 #[inline]
1162 fn encode_option(
1163 this: ::core::option::Option<Self>,
1164 encoder: &mut ___E,
1165 out: &mut ::core::mem::MaybeUninit<
1166 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes>,
1167 >,
1168 _: (),
1169 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1170 if let Some(inner) = this {
1171 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1172 ::fidl_next::wire::Box::encode_present(out);
1173 } else {
1174 ::fidl_next::wire::Box::encode_absent(out);
1175 }
1176
1177 Ok(())
1178 }
1179 }
1180
1181 impl ::fidl_next::FromWire<crate::wire::NodeAttributes> for NodeAttributes {
1182 #[inline]
1183 fn from_wire(wire: crate::wire::NodeAttributes) -> Self {
1184 Self {
1185 mode: ::fidl_next::FromWire::from_wire(wire.mode),
1186
1187 id: ::fidl_next::FromWire::from_wire(wire.id),
1188
1189 content_size: ::fidl_next::FromWire::from_wire(wire.content_size),
1190
1191 storage_size: ::fidl_next::FromWire::from_wire(wire.storage_size),
1192
1193 link_count: ::fidl_next::FromWire::from_wire(wire.link_count),
1194
1195 creation_time: ::fidl_next::FromWire::from_wire(wire.creation_time),
1196
1197 modification_time: ::fidl_next::FromWire::from_wire(wire.modification_time),
1198 }
1199 }
1200 }
1201
1202 impl ::fidl_next::FromWireRef<crate::wire::NodeAttributes> for NodeAttributes {
1203 #[inline]
1204 fn from_wire_ref(wire: &crate::wire::NodeAttributes) -> Self {
1205 Self {
1206 mode: ::fidl_next::FromWireRef::from_wire_ref(&wire.mode),
1207
1208 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
1209
1210 content_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.content_size),
1211
1212 storage_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.storage_size),
1213
1214 link_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.link_count),
1215
1216 creation_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.creation_time),
1217
1218 modification_time: ::fidl_next::FromWireRef::from_wire_ref(&wire.modification_time),
1219 }
1220 }
1221 }
1222
1223 ::fidl_next::bitflags::bitflags! {
1224 #[doc = " The fields of \'attributes\' which are used to update the Node are indicated\n by the \'flags\' argument.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct NodeAttributeFlags: u32 {
1225 const CREATION_TIME = 1;
1226 const MODIFICATION_TIME = 2;
1227
1228 }
1229 }
1230
1231 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeAttributeFlags, ___E> for NodeAttributeFlags
1232 where
1233 ___E: ?Sized,
1234 {
1235 #[inline]
1236 fn encode(
1237 self,
1238 encoder: &mut ___E,
1239 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributeFlags>,
1240 _: (),
1241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1242 ::fidl_next::Encode::encode(&self, encoder, out, ())
1243 }
1244 }
1245
1246 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeAttributeFlags, ___E>
1247 for &'a NodeAttributeFlags
1248 where
1249 ___E: ?Sized,
1250 {
1251 #[inline]
1252 fn encode(
1253 self,
1254 _: &mut ___E,
1255 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributeFlags>,
1256 _: (),
1257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1258 ::fidl_next::munge!(let crate::wire::NodeAttributeFlags { value } = out);
1259
1260 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1261 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1262 }
1263
1264 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
1265 Ok(())
1266 }
1267 }
1268
1269 impl ::core::convert::From<crate::wire::NodeAttributeFlags> for NodeAttributeFlags {
1270 fn from(wire: crate::wire::NodeAttributeFlags) -> Self {
1271 Self::from_bits_retain(u32::from(wire.value))
1272 }
1273 }
1274
1275 impl ::fidl_next::FromWire<crate::wire::NodeAttributeFlags> for NodeAttributeFlags {
1276 #[inline]
1277 fn from_wire(wire: crate::wire::NodeAttributeFlags) -> Self {
1278 Self::from(wire)
1279 }
1280 }
1281
1282 impl ::fidl_next::FromWireRef<crate::wire::NodeAttributeFlags> for NodeAttributeFlags {
1283 #[inline]
1284 fn from_wire_ref(wire: &crate::wire::NodeAttributeFlags) -> Self {
1285 Self::from(*wire)
1286 }
1287 }
1288
1289 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1290 pub struct NodeQueryFilesystemResponse {
1291 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
1292
1293 pub info: ::core::option::Option<::std::boxed::Box<crate::natural::FilesystemInfo>>,
1294 }
1295
1296 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeQueryFilesystemResponse<'static>, ___E>
1297 for NodeQueryFilesystemResponse
1298 where
1299 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1300 ___E: ::fidl_next::Encoder,
1301 {
1302 #[inline]
1303 fn encode(
1304 self,
1305 encoder_: &mut ___E,
1306 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeQueryFilesystemResponse<'static>>,
1307 _: (),
1308 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1309 ::fidl_next::munge! {
1310 let crate::wire::NodeQueryFilesystemResponse {
1311 s,
1312 info,
1313
1314 } = out_;
1315 }
1316
1317 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
1318
1319 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1320
1321 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
1322
1323 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
1324
1325 Ok(())
1326 }
1327 }
1328
1329 unsafe impl<'a, ___E>
1330 ::fidl_next::Encode<crate::wire::NodeQueryFilesystemResponse<'static>, ___E>
1331 for &'a NodeQueryFilesystemResponse
1332 where
1333 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1334 ___E: ::fidl_next::Encoder,
1335 {
1336 #[inline]
1337 fn encode(
1338 self,
1339 encoder_: &mut ___E,
1340 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeQueryFilesystemResponse<'static>>,
1341 _: (),
1342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1343 ::fidl_next::munge! {
1344 let crate::wire::NodeQueryFilesystemResponse {
1345 s,
1346 info,
1347
1348 } = out_;
1349 }
1350
1351 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
1352
1353 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1354
1355 ::fidl_next::Encode::encode(&self.info, encoder_, info, ())?;
1356
1357 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(info.as_mut_ptr()) };
1358
1359 Ok(())
1360 }
1361 }
1362
1363 unsafe impl<___E>
1364 ::fidl_next::EncodeOption<
1365 ::fidl_next::wire::Box<'static, crate::wire::NodeQueryFilesystemResponse<'static>>,
1366 ___E,
1367 > for NodeQueryFilesystemResponse
1368 where
1369 ___E: ::fidl_next::Encoder + ?Sized,
1370 NodeQueryFilesystemResponse:
1371 ::fidl_next::Encode<crate::wire::NodeQueryFilesystemResponse<'static>, ___E>,
1372 {
1373 #[inline]
1374 fn encode_option(
1375 this: ::core::option::Option<Self>,
1376 encoder: &mut ___E,
1377 out: &mut ::core::mem::MaybeUninit<
1378 ::fidl_next::wire::Box<'static, crate::wire::NodeQueryFilesystemResponse<'static>>,
1379 >,
1380 _: (),
1381 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1382 if let Some(inner) = this {
1383 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1384 ::fidl_next::wire::Box::encode_present(out);
1385 } else {
1386 ::fidl_next::wire::Box::encode_absent(out);
1387 }
1388
1389 Ok(())
1390 }
1391 }
1392
1393 unsafe impl<'a, ___E>
1394 ::fidl_next::EncodeOption<
1395 ::fidl_next::wire::Box<'static, crate::wire::NodeQueryFilesystemResponse<'static>>,
1396 ___E,
1397 > for &'a NodeQueryFilesystemResponse
1398 where
1399 ___E: ::fidl_next::Encoder + ?Sized,
1400 &'a NodeQueryFilesystemResponse:
1401 ::fidl_next::Encode<crate::wire::NodeQueryFilesystemResponse<'static>, ___E>,
1402 {
1403 #[inline]
1404 fn encode_option(
1405 this: ::core::option::Option<Self>,
1406 encoder: &mut ___E,
1407 out: &mut ::core::mem::MaybeUninit<
1408 ::fidl_next::wire::Box<'static, crate::wire::NodeQueryFilesystemResponse<'static>>,
1409 >,
1410 _: (),
1411 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1412 if let Some(inner) = this {
1413 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1414 ::fidl_next::wire::Box::encode_present(out);
1415 } else {
1416 ::fidl_next::wire::Box::encode_absent(out);
1417 }
1418
1419 Ok(())
1420 }
1421 }
1422
1423 impl<'de> ::fidl_next::FromWire<crate::wire::NodeQueryFilesystemResponse<'de>>
1424 for NodeQueryFilesystemResponse
1425 {
1426 #[inline]
1427 fn from_wire(wire: crate::wire::NodeQueryFilesystemResponse<'de>) -> Self {
1428 Self {
1429 s: ::fidl_next::FromWire::from_wire(wire.s),
1430
1431 info: ::fidl_next::FromWire::from_wire(wire.info),
1432 }
1433 }
1434 }
1435
1436 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeQueryFilesystemResponse<'de>>
1437 for NodeQueryFilesystemResponse
1438 {
1439 #[inline]
1440 fn from_wire_ref(wire: &crate::wire::NodeQueryFilesystemResponse<'de>) -> Self {
1441 Self {
1442 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
1443
1444 info: ::fidl_next::FromWireRef::from_wire_ref(&wire.info),
1445 }
1446 }
1447 }
1448
1449 pub type NodeUpdateAttributesResponse = ();
1450
1451 pub type NodeSyncResponse = ();
1452
1453 ::fidl_next::bitflags::bitflags! {
1454 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct ModeType: u32 {
1455 const DO_NOT_USE = 2147483648;
1456
1457 }
1458 }
1459
1460 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ModeType, ___E> for ModeType
1461 where
1462 ___E: ?Sized,
1463 {
1464 #[inline]
1465 fn encode(
1466 self,
1467 encoder: &mut ___E,
1468 out: &mut ::core::mem::MaybeUninit<crate::wire::ModeType>,
1469 _: (),
1470 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1471 ::fidl_next::Encode::encode(&self, encoder, out, ())
1472 }
1473 }
1474
1475 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ModeType, ___E> for &'a ModeType
1476 where
1477 ___E: ?Sized,
1478 {
1479 #[inline]
1480 fn encode(
1481 self,
1482 _: &mut ___E,
1483 out: &mut ::core::mem::MaybeUninit<crate::wire::ModeType>,
1484 _: (),
1485 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1486 ::fidl_next::munge!(let crate::wire::ModeType { value } = out);
1487
1488 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1489 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1490 }
1491
1492 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
1493 Ok(())
1494 }
1495 }
1496
1497 impl ::core::convert::From<crate::wire::ModeType> for ModeType {
1498 fn from(wire: crate::wire::ModeType) -> Self {
1499 Self::from_bits_retain(u32::from(wire.value))
1500 }
1501 }
1502
1503 impl ::fidl_next::FromWire<crate::wire::ModeType> for ModeType {
1504 #[inline]
1505 fn from_wire(wire: crate::wire::ModeType) -> Self {
1506 Self::from(wire)
1507 }
1508 }
1509
1510 impl ::fidl_next::FromWireRef<crate::wire::ModeType> for ModeType {
1511 #[inline]
1512 fn from_wire_ref(wire: &crate::wire::ModeType) -> Self {
1513 Self::from(*wire)
1514 }
1515 }
1516
1517 #[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"]
1518 pub type Path = ::std::string::String;
1519
1520 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1521 #[repr(C)]
1522 pub struct DirectoryReadDirentsRequest {
1523 pub max_bytes: u64,
1524 }
1525
1526 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryReadDirentsRequest, ___E>
1527 for DirectoryReadDirentsRequest
1528 where
1529 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1530 {
1531 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1532 Self,
1533 crate::wire::DirectoryReadDirentsRequest,
1534 > = unsafe {
1535 ::fidl_next::CopyOptimization::enable_if(
1536 true
1537
1538 && <
1539 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
1540 >::COPY_OPTIMIZATION.is_enabled()
1541
1542 )
1543 };
1544
1545 #[inline]
1546 fn encode(
1547 self,
1548 encoder_: &mut ___E,
1549 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsRequest>,
1550 _: (),
1551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1552 ::fidl_next::munge! {
1553 let crate::wire::DirectoryReadDirentsRequest {
1554 max_bytes,
1555
1556 } = out_;
1557 }
1558
1559 ::fidl_next::Encode::encode(self.max_bytes, encoder_, max_bytes, ())?;
1560
1561 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(max_bytes.as_mut_ptr()) };
1562
1563 Ok(())
1564 }
1565 }
1566
1567 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryReadDirentsRequest, ___E>
1568 for &'a DirectoryReadDirentsRequest
1569 where
1570 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1571 {
1572 #[inline]
1573 fn encode(
1574 self,
1575 encoder_: &mut ___E,
1576 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsRequest>,
1577 _: (),
1578 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1579 ::fidl_next::munge! {
1580 let crate::wire::DirectoryReadDirentsRequest {
1581 max_bytes,
1582
1583 } = out_;
1584 }
1585
1586 ::fidl_next::Encode::encode(&self.max_bytes, encoder_, max_bytes, ())?;
1587
1588 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(max_bytes.as_mut_ptr()) };
1589
1590 Ok(())
1591 }
1592 }
1593
1594 unsafe impl<___E>
1595 ::fidl_next::EncodeOption<
1596 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsRequest>,
1597 ___E,
1598 > for DirectoryReadDirentsRequest
1599 where
1600 ___E: ::fidl_next::Encoder + ?Sized,
1601 DirectoryReadDirentsRequest:
1602 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsRequest, ___E>,
1603 {
1604 #[inline]
1605 fn encode_option(
1606 this: ::core::option::Option<Self>,
1607 encoder: &mut ___E,
1608 out: &mut ::core::mem::MaybeUninit<
1609 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsRequest>,
1610 >,
1611 _: (),
1612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1613 if let Some(inner) = this {
1614 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1615 ::fidl_next::wire::Box::encode_present(out);
1616 } else {
1617 ::fidl_next::wire::Box::encode_absent(out);
1618 }
1619
1620 Ok(())
1621 }
1622 }
1623
1624 unsafe impl<'a, ___E>
1625 ::fidl_next::EncodeOption<
1626 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsRequest>,
1627 ___E,
1628 > for &'a DirectoryReadDirentsRequest
1629 where
1630 ___E: ::fidl_next::Encoder + ?Sized,
1631 &'a DirectoryReadDirentsRequest:
1632 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsRequest, ___E>,
1633 {
1634 #[inline]
1635 fn encode_option(
1636 this: ::core::option::Option<Self>,
1637 encoder: &mut ___E,
1638 out: &mut ::core::mem::MaybeUninit<
1639 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsRequest>,
1640 >,
1641 _: (),
1642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1643 if let Some(inner) = this {
1644 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1645 ::fidl_next::wire::Box::encode_present(out);
1646 } else {
1647 ::fidl_next::wire::Box::encode_absent(out);
1648 }
1649
1650 Ok(())
1651 }
1652 }
1653
1654 impl ::fidl_next::FromWire<crate::wire::DirectoryReadDirentsRequest>
1655 for DirectoryReadDirentsRequest
1656 {
1657 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1658 crate::wire::DirectoryReadDirentsRequest,
1659 Self,
1660 > = unsafe {
1661 ::fidl_next::CopyOptimization::enable_if(
1662 true
1663 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
1664 .is_enabled(),
1665 )
1666 };
1667
1668 #[inline]
1669 fn from_wire(wire: crate::wire::DirectoryReadDirentsRequest) -> Self {
1670 Self { max_bytes: ::fidl_next::FromWire::from_wire(wire.max_bytes) }
1671 }
1672 }
1673
1674 impl ::fidl_next::FromWireRef<crate::wire::DirectoryReadDirentsRequest>
1675 for DirectoryReadDirentsRequest
1676 {
1677 #[inline]
1678 fn from_wire_ref(wire: &crate::wire::DirectoryReadDirentsRequest) -> Self {
1679 Self { max_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_bytes) }
1680 }
1681 }
1682
1683 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1684 pub struct DirectoryReadDirentsResponse {
1685 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
1686
1687 pub dirents: ::std::vec::Vec<u8>,
1688 }
1689
1690 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryReadDirentsResponse<'static>, ___E>
1691 for DirectoryReadDirentsResponse
1692 where
1693 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1694 ___E: ::fidl_next::Encoder,
1695 {
1696 #[inline]
1697 fn encode(
1698 self,
1699 encoder_: &mut ___E,
1700 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsResponse<'static>>,
1701 _: (),
1702 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1703 ::fidl_next::munge! {
1704 let crate::wire::DirectoryReadDirentsResponse {
1705 s,
1706 dirents,
1707
1708 } = out_;
1709 }
1710
1711 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
1712
1713 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1714
1715 ::fidl_next::Encode::encode(self.dirents, encoder_, dirents, (8192, ()))?;
1716
1717 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(dirents.as_mut_ptr()) };
1718 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
1719
1720 Ok(())
1721 }
1722 }
1723
1724 unsafe impl<'a, ___E>
1725 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsResponse<'static>, ___E>
1726 for &'a DirectoryReadDirentsResponse
1727 where
1728 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1729 ___E: ::fidl_next::Encoder,
1730 {
1731 #[inline]
1732 fn encode(
1733 self,
1734 encoder_: &mut ___E,
1735 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsResponse<'static>>,
1736 _: (),
1737 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1738 ::fidl_next::munge! {
1739 let crate::wire::DirectoryReadDirentsResponse {
1740 s,
1741 dirents,
1742
1743 } = out_;
1744 }
1745
1746 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
1747
1748 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1749
1750 ::fidl_next::Encode::encode(&self.dirents, encoder_, dirents, (8192, ()))?;
1751
1752 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(dirents.as_mut_ptr()) };
1753 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
1754
1755 Ok(())
1756 }
1757 }
1758
1759 unsafe impl<___E>
1760 ::fidl_next::EncodeOption<
1761 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsResponse<'static>>,
1762 ___E,
1763 > for DirectoryReadDirentsResponse
1764 where
1765 ___E: ::fidl_next::Encoder + ?Sized,
1766 DirectoryReadDirentsResponse:
1767 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsResponse<'static>, ___E>,
1768 {
1769 #[inline]
1770 fn encode_option(
1771 this: ::core::option::Option<Self>,
1772 encoder: &mut ___E,
1773 out: &mut ::core::mem::MaybeUninit<
1774 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsResponse<'static>>,
1775 >,
1776 _: (),
1777 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1778 if let Some(inner) = this {
1779 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1780 ::fidl_next::wire::Box::encode_present(out);
1781 } else {
1782 ::fidl_next::wire::Box::encode_absent(out);
1783 }
1784
1785 Ok(())
1786 }
1787 }
1788
1789 unsafe impl<'a, ___E>
1790 ::fidl_next::EncodeOption<
1791 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsResponse<'static>>,
1792 ___E,
1793 > for &'a DirectoryReadDirentsResponse
1794 where
1795 ___E: ::fidl_next::Encoder + ?Sized,
1796 &'a DirectoryReadDirentsResponse:
1797 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsResponse<'static>, ___E>,
1798 {
1799 #[inline]
1800 fn encode_option(
1801 this: ::core::option::Option<Self>,
1802 encoder: &mut ___E,
1803 out: &mut ::core::mem::MaybeUninit<
1804 ::fidl_next::wire::Box<'static, crate::wire::DirectoryReadDirentsResponse<'static>>,
1805 >,
1806 _: (),
1807 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1808 if let Some(inner) = this {
1809 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1810 ::fidl_next::wire::Box::encode_present(out);
1811 } else {
1812 ::fidl_next::wire::Box::encode_absent(out);
1813 }
1814
1815 Ok(())
1816 }
1817 }
1818
1819 impl<'de> ::fidl_next::FromWire<crate::wire::DirectoryReadDirentsResponse<'de>>
1820 for DirectoryReadDirentsResponse
1821 {
1822 #[inline]
1823 fn from_wire(wire: crate::wire::DirectoryReadDirentsResponse<'de>) -> Self {
1824 Self {
1825 s: ::fidl_next::FromWire::from_wire(wire.s),
1826
1827 dirents: ::fidl_next::FromWire::from_wire(wire.dirents),
1828 }
1829 }
1830 }
1831
1832 impl<'de> ::fidl_next::FromWireRef<crate::wire::DirectoryReadDirentsResponse<'de>>
1833 for DirectoryReadDirentsResponse
1834 {
1835 #[inline]
1836 fn from_wire_ref(wire: &crate::wire::DirectoryReadDirentsResponse<'de>) -> Self {
1837 Self {
1838 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
1839
1840 dirents: ::fidl_next::FromWireRef::from_wire_ref(&wire.dirents),
1841 }
1842 }
1843 }
1844
1845 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1846 #[repr(C)]
1847 pub struct DirectoryRewindResponse {
1848 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
1849 }
1850
1851 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryRewindResponse, ___E>
1852 for DirectoryRewindResponse
1853 where
1854 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1855 {
1856 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1857 Self,
1858 crate::wire::DirectoryRewindResponse,
1859 > = unsafe {
1860 ::fidl_next::CopyOptimization::enable_if(
1861 true
1862
1863 && <
1864 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
1865 >::COPY_OPTIMIZATION.is_enabled()
1866
1867 )
1868 };
1869
1870 #[inline]
1871 fn encode(
1872 self,
1873 encoder_: &mut ___E,
1874 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryRewindResponse>,
1875 _: (),
1876 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1877 ::fidl_next::munge! {
1878 let crate::wire::DirectoryRewindResponse {
1879 s,
1880
1881 } = out_;
1882 }
1883
1884 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
1885
1886 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1887
1888 Ok(())
1889 }
1890 }
1891
1892 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryRewindResponse, ___E>
1893 for &'a DirectoryRewindResponse
1894 where
1895 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1896 {
1897 #[inline]
1898 fn encode(
1899 self,
1900 encoder_: &mut ___E,
1901 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryRewindResponse>,
1902 _: (),
1903 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1904 ::fidl_next::munge! {
1905 let crate::wire::DirectoryRewindResponse {
1906 s,
1907
1908 } = out_;
1909 }
1910
1911 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
1912
1913 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1914
1915 Ok(())
1916 }
1917 }
1918
1919 unsafe impl<___E>
1920 ::fidl_next::EncodeOption<
1921 ::fidl_next::wire::Box<'static, crate::wire::DirectoryRewindResponse>,
1922 ___E,
1923 > for DirectoryRewindResponse
1924 where
1925 ___E: ::fidl_next::Encoder + ?Sized,
1926 DirectoryRewindResponse: ::fidl_next::Encode<crate::wire::DirectoryRewindResponse, ___E>,
1927 {
1928 #[inline]
1929 fn encode_option(
1930 this: ::core::option::Option<Self>,
1931 encoder: &mut ___E,
1932 out: &mut ::core::mem::MaybeUninit<
1933 ::fidl_next::wire::Box<'static, crate::wire::DirectoryRewindResponse>,
1934 >,
1935 _: (),
1936 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1937 if let Some(inner) = this {
1938 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1939 ::fidl_next::wire::Box::encode_present(out);
1940 } else {
1941 ::fidl_next::wire::Box::encode_absent(out);
1942 }
1943
1944 Ok(())
1945 }
1946 }
1947
1948 unsafe impl<'a, ___E>
1949 ::fidl_next::EncodeOption<
1950 ::fidl_next::wire::Box<'static, crate::wire::DirectoryRewindResponse>,
1951 ___E,
1952 > for &'a DirectoryRewindResponse
1953 where
1954 ___E: ::fidl_next::Encoder + ?Sized,
1955 &'a DirectoryRewindResponse:
1956 ::fidl_next::Encode<crate::wire::DirectoryRewindResponse, ___E>,
1957 {
1958 #[inline]
1959 fn encode_option(
1960 this: ::core::option::Option<Self>,
1961 encoder: &mut ___E,
1962 out: &mut ::core::mem::MaybeUninit<
1963 ::fidl_next::wire::Box<'static, crate::wire::DirectoryRewindResponse>,
1964 >,
1965 _: (),
1966 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1967 if let Some(inner) = this {
1968 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1969 ::fidl_next::wire::Box::encode_present(out);
1970 } else {
1971 ::fidl_next::wire::Box::encode_absent(out);
1972 }
1973
1974 Ok(())
1975 }
1976 }
1977
1978 impl ::fidl_next::FromWire<crate::wire::DirectoryRewindResponse> for DirectoryRewindResponse {
1979 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1980 crate::wire::DirectoryRewindResponse,
1981 Self,
1982 > = unsafe {
1983 ::fidl_next::CopyOptimization::enable_if(
1984 true
1985
1986 && <
1987 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
1988 >::COPY_OPTIMIZATION.is_enabled()
1989
1990 )
1991 };
1992
1993 #[inline]
1994 fn from_wire(wire: crate::wire::DirectoryRewindResponse) -> Self {
1995 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
1996 }
1997 }
1998
1999 impl ::fidl_next::FromWireRef<crate::wire::DirectoryRewindResponse> for DirectoryRewindResponse {
2000 #[inline]
2001 fn from_wire_ref(wire: &crate::wire::DirectoryRewindResponse) -> Self {
2002 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
2003 }
2004 }
2005
2006 #[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"]
2007 pub type Name = ::std::string::String;
2008
2009 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2010 #[repr(C)]
2011 pub struct DirectoryLinkResponse {
2012 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
2013 }
2014
2015 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryLinkResponse, ___E>
2016 for DirectoryLinkResponse
2017 where
2018 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2019 {
2020 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2021 Self,
2022 crate::wire::DirectoryLinkResponse,
2023 > = unsafe {
2024 ::fidl_next::CopyOptimization::enable_if(
2025 true
2026
2027 && <
2028 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
2029 >::COPY_OPTIMIZATION.is_enabled()
2030
2031 )
2032 };
2033
2034 #[inline]
2035 fn encode(
2036 self,
2037 encoder_: &mut ___E,
2038 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryLinkResponse>,
2039 _: (),
2040 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2041 ::fidl_next::munge! {
2042 let crate::wire::DirectoryLinkResponse {
2043 s,
2044
2045 } = out_;
2046 }
2047
2048 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
2049
2050 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
2051
2052 Ok(())
2053 }
2054 }
2055
2056 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryLinkResponse, ___E>
2057 for &'a DirectoryLinkResponse
2058 where
2059 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2060 {
2061 #[inline]
2062 fn encode(
2063 self,
2064 encoder_: &mut ___E,
2065 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryLinkResponse>,
2066 _: (),
2067 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2068 ::fidl_next::munge! {
2069 let crate::wire::DirectoryLinkResponse {
2070 s,
2071
2072 } = out_;
2073 }
2074
2075 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
2076
2077 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
2078
2079 Ok(())
2080 }
2081 }
2082
2083 unsafe impl<___E>
2084 ::fidl_next::EncodeOption<
2085 ::fidl_next::wire::Box<'static, crate::wire::DirectoryLinkResponse>,
2086 ___E,
2087 > for DirectoryLinkResponse
2088 where
2089 ___E: ::fidl_next::Encoder + ?Sized,
2090 DirectoryLinkResponse: ::fidl_next::Encode<crate::wire::DirectoryLinkResponse, ___E>,
2091 {
2092 #[inline]
2093 fn encode_option(
2094 this: ::core::option::Option<Self>,
2095 encoder: &mut ___E,
2096 out: &mut ::core::mem::MaybeUninit<
2097 ::fidl_next::wire::Box<'static, crate::wire::DirectoryLinkResponse>,
2098 >,
2099 _: (),
2100 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2101 if let Some(inner) = this {
2102 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2103 ::fidl_next::wire::Box::encode_present(out);
2104 } else {
2105 ::fidl_next::wire::Box::encode_absent(out);
2106 }
2107
2108 Ok(())
2109 }
2110 }
2111
2112 unsafe impl<'a, ___E>
2113 ::fidl_next::EncodeOption<
2114 ::fidl_next::wire::Box<'static, crate::wire::DirectoryLinkResponse>,
2115 ___E,
2116 > for &'a DirectoryLinkResponse
2117 where
2118 ___E: ::fidl_next::Encoder + ?Sized,
2119 &'a DirectoryLinkResponse: ::fidl_next::Encode<crate::wire::DirectoryLinkResponse, ___E>,
2120 {
2121 #[inline]
2122 fn encode_option(
2123 this: ::core::option::Option<Self>,
2124 encoder: &mut ___E,
2125 out: &mut ::core::mem::MaybeUninit<
2126 ::fidl_next::wire::Box<'static, crate::wire::DirectoryLinkResponse>,
2127 >,
2128 _: (),
2129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2130 if let Some(inner) = this {
2131 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2132 ::fidl_next::wire::Box::encode_present(out);
2133 } else {
2134 ::fidl_next::wire::Box::encode_absent(out);
2135 }
2136
2137 Ok(())
2138 }
2139 }
2140
2141 impl ::fidl_next::FromWire<crate::wire::DirectoryLinkResponse> for DirectoryLinkResponse {
2142 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2143 crate::wire::DirectoryLinkResponse,
2144 Self,
2145 > = unsafe {
2146 ::fidl_next::CopyOptimization::enable_if(
2147 true
2148
2149 && <
2150 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
2151 >::COPY_OPTIMIZATION.is_enabled()
2152
2153 )
2154 };
2155
2156 #[inline]
2157 fn from_wire(wire: crate::wire::DirectoryLinkResponse) -> Self {
2158 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
2159 }
2160 }
2161
2162 impl ::fidl_next::FromWireRef<crate::wire::DirectoryLinkResponse> for DirectoryLinkResponse {
2163 #[inline]
2164 fn from_wire_ref(wire: &crate::wire::DirectoryLinkResponse) -> Self {
2165 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
2166 }
2167 }
2168
2169 ::fidl_next::bitflags::bitflags! {
2170 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct UnlinkFlags: u64 {
2171 #[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;
2172 const _ = !0;
2173 }
2174 }
2175
2176 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UnlinkFlags, ___E> for UnlinkFlags
2177 where
2178 ___E: ?Sized,
2179 {
2180 #[inline]
2181 fn encode(
2182 self,
2183 encoder: &mut ___E,
2184 out: &mut ::core::mem::MaybeUninit<crate::wire::UnlinkFlags>,
2185 _: (),
2186 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2187 ::fidl_next::Encode::encode(&self, encoder, out, ())
2188 }
2189 }
2190
2191 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UnlinkFlags, ___E> for &'a UnlinkFlags
2192 where
2193 ___E: ?Sized,
2194 {
2195 #[inline]
2196 fn encode(
2197 self,
2198 _: &mut ___E,
2199 out: &mut ::core::mem::MaybeUninit<crate::wire::UnlinkFlags>,
2200 _: (),
2201 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2202 ::fidl_next::munge!(let crate::wire::UnlinkFlags { value } = out);
2203
2204 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
2205 Ok(())
2206 }
2207 }
2208
2209 impl ::core::convert::From<crate::wire::UnlinkFlags> for UnlinkFlags {
2210 fn from(wire: crate::wire::UnlinkFlags) -> Self {
2211 Self::from_bits_retain(u64::from(wire.value))
2212 }
2213 }
2214
2215 impl ::fidl_next::FromWire<crate::wire::UnlinkFlags> for UnlinkFlags {
2216 #[inline]
2217 fn from_wire(wire: crate::wire::UnlinkFlags) -> Self {
2218 Self::from(wire)
2219 }
2220 }
2221
2222 impl ::fidl_next::FromWireRef<crate::wire::UnlinkFlags> for UnlinkFlags {
2223 #[inline]
2224 fn from_wire_ref(wire: &crate::wire::UnlinkFlags) -> Self {
2225 Self::from(*wire)
2226 }
2227 }
2228
2229 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2230 pub struct UnlinkOptions {
2231 pub flags: ::core::option::Option<crate::natural::UnlinkFlags>,
2232 }
2233
2234 impl UnlinkOptions {
2235 fn __max_ordinal(&self) -> usize {
2236 if self.flags.is_some() {
2237 return 1;
2238 }
2239
2240 0
2241 }
2242 }
2243
2244 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UnlinkOptions<'static>, ___E> for UnlinkOptions
2245 where
2246 ___E: ::fidl_next::Encoder + ?Sized,
2247 {
2248 #[inline]
2249 fn encode(
2250 mut self,
2251 encoder: &mut ___E,
2252 out: &mut ::core::mem::MaybeUninit<crate::wire::UnlinkOptions<'static>>,
2253 _: (),
2254 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2255 ::fidl_next::munge!(let crate::wire::UnlinkOptions { table } = out);
2256
2257 let max_ord = self.__max_ordinal();
2258
2259 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2260 ::fidl_next::Wire::zero_padding(&mut out);
2261
2262 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2263 ::fidl_next::wire::Envelope,
2264 >(encoder, max_ord);
2265
2266 for i in 1..=max_ord {
2267 match i {
2268 1 => {
2269 if let Some(value) = self.flags.take() {
2270 ::fidl_next::wire::Envelope::encode_value::<
2271 crate::wire::UnlinkFlags,
2272 ___E,
2273 >(
2274 value, preallocated.encoder, &mut out, ()
2275 )?;
2276 } else {
2277 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2278 }
2279 }
2280
2281 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2282 }
2283 unsafe {
2284 preallocated.write_next(out.assume_init_ref());
2285 }
2286 }
2287
2288 ::fidl_next::wire::Table::encode_len(table, max_ord);
2289
2290 Ok(())
2291 }
2292 }
2293
2294 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UnlinkOptions<'static>, ___E>
2295 for &'a UnlinkOptions
2296 where
2297 ___E: ::fidl_next::Encoder + ?Sized,
2298 {
2299 #[inline]
2300 fn encode(
2301 self,
2302 encoder: &mut ___E,
2303 out: &mut ::core::mem::MaybeUninit<crate::wire::UnlinkOptions<'static>>,
2304 _: (),
2305 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2306 ::fidl_next::munge!(let crate::wire::UnlinkOptions { table } = out);
2307
2308 let max_ord = self.__max_ordinal();
2309
2310 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2311 ::fidl_next::Wire::zero_padding(&mut out);
2312
2313 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2314 ::fidl_next::wire::Envelope,
2315 >(encoder, max_ord);
2316
2317 for i in 1..=max_ord {
2318 match i {
2319 1 => {
2320 if let Some(value) = &self.flags {
2321 ::fidl_next::wire::Envelope::encode_value::<
2322 crate::wire::UnlinkFlags,
2323 ___E,
2324 >(
2325 value, preallocated.encoder, &mut out, ()
2326 )?;
2327 } else {
2328 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2329 }
2330 }
2331
2332 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2333 }
2334 unsafe {
2335 preallocated.write_next(out.assume_init_ref());
2336 }
2337 }
2338
2339 ::fidl_next::wire::Table::encode_len(table, max_ord);
2340
2341 Ok(())
2342 }
2343 }
2344
2345 impl<'de> ::fidl_next::FromWire<crate::wire::UnlinkOptions<'de>> for UnlinkOptions {
2346 #[inline]
2347 fn from_wire(wire_: crate::wire::UnlinkOptions<'de>) -> Self {
2348 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2349
2350 let flags = wire_.table.get(1);
2351
2352 Self {
2353 flags: flags.map(|envelope| {
2354 ::fidl_next::FromWire::from_wire(unsafe {
2355 envelope.read_unchecked::<crate::wire::UnlinkFlags>()
2356 })
2357 }),
2358 }
2359 }
2360 }
2361
2362 impl<'de> ::fidl_next::FromWireRef<crate::wire::UnlinkOptions<'de>> for UnlinkOptions {
2363 #[inline]
2364 fn from_wire_ref(wire: &crate::wire::UnlinkOptions<'de>) -> Self {
2365 Self {
2366 flags: wire.table.get(1).map(|envelope| {
2367 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2368 envelope.deref_unchecked::<crate::wire::UnlinkFlags>()
2369 })
2370 }),
2371 }
2372 }
2373 }
2374
2375 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2376 pub struct DirectoryUnlinkRequest {
2377 pub name: ::std::string::String,
2378
2379 pub options: crate::natural::UnlinkOptions,
2380 }
2381
2382 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryUnlinkRequest<'static>, ___E>
2383 for DirectoryUnlinkRequest
2384 where
2385 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2386 ___E: ::fidl_next::Encoder,
2387 {
2388 #[inline]
2389 fn encode(
2390 self,
2391 encoder_: &mut ___E,
2392 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryUnlinkRequest<'static>>,
2393 _: (),
2394 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2395 ::fidl_next::munge! {
2396 let crate::wire::DirectoryUnlinkRequest {
2397 name,
2398 options,
2399
2400 } = out_;
2401 }
2402
2403 ::fidl_next::Encode::encode(self.name, encoder_, name, 255)?;
2404
2405 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
2406 ::fidl_next::Constrained::validate(_field, 255)?;
2407
2408 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
2409
2410 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
2411
2412 Ok(())
2413 }
2414 }
2415
2416 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryUnlinkRequest<'static>, ___E>
2417 for &'a DirectoryUnlinkRequest
2418 where
2419 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2420 ___E: ::fidl_next::Encoder,
2421 {
2422 #[inline]
2423 fn encode(
2424 self,
2425 encoder_: &mut ___E,
2426 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryUnlinkRequest<'static>>,
2427 _: (),
2428 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2429 ::fidl_next::munge! {
2430 let crate::wire::DirectoryUnlinkRequest {
2431 name,
2432 options,
2433
2434 } = out_;
2435 }
2436
2437 ::fidl_next::Encode::encode(&self.name, encoder_, name, 255)?;
2438
2439 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
2440 ::fidl_next::Constrained::validate(_field, 255)?;
2441
2442 ::fidl_next::Encode::encode(&self.options, encoder_, options, ())?;
2443
2444 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
2445
2446 Ok(())
2447 }
2448 }
2449
2450 unsafe impl<___E>
2451 ::fidl_next::EncodeOption<
2452 ::fidl_next::wire::Box<'static, crate::wire::DirectoryUnlinkRequest<'static>>,
2453 ___E,
2454 > for DirectoryUnlinkRequest
2455 where
2456 ___E: ::fidl_next::Encoder + ?Sized,
2457 DirectoryUnlinkRequest:
2458 ::fidl_next::Encode<crate::wire::DirectoryUnlinkRequest<'static>, ___E>,
2459 {
2460 #[inline]
2461 fn encode_option(
2462 this: ::core::option::Option<Self>,
2463 encoder: &mut ___E,
2464 out: &mut ::core::mem::MaybeUninit<
2465 ::fidl_next::wire::Box<'static, crate::wire::DirectoryUnlinkRequest<'static>>,
2466 >,
2467 _: (),
2468 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2469 if let Some(inner) = this {
2470 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2471 ::fidl_next::wire::Box::encode_present(out);
2472 } else {
2473 ::fidl_next::wire::Box::encode_absent(out);
2474 }
2475
2476 Ok(())
2477 }
2478 }
2479
2480 unsafe impl<'a, ___E>
2481 ::fidl_next::EncodeOption<
2482 ::fidl_next::wire::Box<'static, crate::wire::DirectoryUnlinkRequest<'static>>,
2483 ___E,
2484 > for &'a DirectoryUnlinkRequest
2485 where
2486 ___E: ::fidl_next::Encoder + ?Sized,
2487 &'a DirectoryUnlinkRequest:
2488 ::fidl_next::Encode<crate::wire::DirectoryUnlinkRequest<'static>, ___E>,
2489 {
2490 #[inline]
2491 fn encode_option(
2492 this: ::core::option::Option<Self>,
2493 encoder: &mut ___E,
2494 out: &mut ::core::mem::MaybeUninit<
2495 ::fidl_next::wire::Box<'static, crate::wire::DirectoryUnlinkRequest<'static>>,
2496 >,
2497 _: (),
2498 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2499 if let Some(inner) = this {
2500 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2501 ::fidl_next::wire::Box::encode_present(out);
2502 } else {
2503 ::fidl_next::wire::Box::encode_absent(out);
2504 }
2505
2506 Ok(())
2507 }
2508 }
2509
2510 impl<'de> ::fidl_next::FromWire<crate::wire::DirectoryUnlinkRequest<'de>>
2511 for DirectoryUnlinkRequest
2512 {
2513 #[inline]
2514 fn from_wire(wire: crate::wire::DirectoryUnlinkRequest<'de>) -> Self {
2515 Self {
2516 name: ::fidl_next::FromWire::from_wire(wire.name),
2517
2518 options: ::fidl_next::FromWire::from_wire(wire.options),
2519 }
2520 }
2521 }
2522
2523 impl<'de> ::fidl_next::FromWireRef<crate::wire::DirectoryUnlinkRequest<'de>>
2524 for DirectoryUnlinkRequest
2525 {
2526 #[inline]
2527 fn from_wire_ref(wire: &crate::wire::DirectoryUnlinkRequest<'de>) -> Self {
2528 Self {
2529 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
2530
2531 options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options),
2532 }
2533 }
2534 }
2535
2536 pub type DirectoryUnlinkResponse = ();
2537
2538 pub type DirectoryRenameResponse = ();
2539
2540 ::fidl_next::bitflags::bitflags! {
2541 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct WatchMask: u32 {
2542 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.\n"]const DELETED = 1;
2543 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.\n"]const ADDED = 2;
2544 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.\n"]const REMOVED = 4;
2545 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.\n"]const EXISTING = 8;
2546 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.\n"]const IDLE = 16;
2547
2548 }
2549 }
2550
2551 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WatchMask, ___E> for WatchMask
2552 where
2553 ___E: ?Sized,
2554 {
2555 #[inline]
2556 fn encode(
2557 self,
2558 encoder: &mut ___E,
2559 out: &mut ::core::mem::MaybeUninit<crate::wire::WatchMask>,
2560 _: (),
2561 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2562 ::fidl_next::Encode::encode(&self, encoder, out, ())
2563 }
2564 }
2565
2566 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WatchMask, ___E> for &'a WatchMask
2567 where
2568 ___E: ?Sized,
2569 {
2570 #[inline]
2571 fn encode(
2572 self,
2573 _: &mut ___E,
2574 out: &mut ::core::mem::MaybeUninit<crate::wire::WatchMask>,
2575 _: (),
2576 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2577 ::fidl_next::munge!(let crate::wire::WatchMask { value } = out);
2578
2579 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
2580 return Err(::fidl_next::EncodeError::InvalidStrictBits);
2581 }
2582
2583 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
2584 Ok(())
2585 }
2586 }
2587
2588 impl ::core::convert::From<crate::wire::WatchMask> for WatchMask {
2589 fn from(wire: crate::wire::WatchMask) -> Self {
2590 Self::from_bits_retain(u32::from(wire.value))
2591 }
2592 }
2593
2594 impl ::fidl_next::FromWire<crate::wire::WatchMask> for WatchMask {
2595 #[inline]
2596 fn from_wire(wire: crate::wire::WatchMask) -> Self {
2597 Self::from(wire)
2598 }
2599 }
2600
2601 impl ::fidl_next::FromWireRef<crate::wire::WatchMask> for WatchMask {
2602 #[inline]
2603 fn from_wire_ref(wire: &crate::wire::WatchMask) -> Self {
2604 Self::from(*wire)
2605 }
2606 }
2607
2608 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2609 #[repr(C)]
2610 pub struct DirectoryWatchResponse {
2611 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
2612 }
2613
2614 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryWatchResponse, ___E>
2615 for DirectoryWatchResponse
2616 where
2617 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2618 {
2619 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2620 Self,
2621 crate::wire::DirectoryWatchResponse,
2622 > = unsafe {
2623 ::fidl_next::CopyOptimization::enable_if(
2624 true
2625
2626 && <
2627 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
2628 >::COPY_OPTIMIZATION.is_enabled()
2629
2630 )
2631 };
2632
2633 #[inline]
2634 fn encode(
2635 self,
2636 encoder_: &mut ___E,
2637 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryWatchResponse>,
2638 _: (),
2639 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2640 ::fidl_next::munge! {
2641 let crate::wire::DirectoryWatchResponse {
2642 s,
2643
2644 } = out_;
2645 }
2646
2647 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
2648
2649 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
2650
2651 Ok(())
2652 }
2653 }
2654
2655 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryWatchResponse, ___E>
2656 for &'a DirectoryWatchResponse
2657 where
2658 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2659 {
2660 #[inline]
2661 fn encode(
2662 self,
2663 encoder_: &mut ___E,
2664 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryWatchResponse>,
2665 _: (),
2666 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2667 ::fidl_next::munge! {
2668 let crate::wire::DirectoryWatchResponse {
2669 s,
2670
2671 } = out_;
2672 }
2673
2674 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
2675
2676 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
2677
2678 Ok(())
2679 }
2680 }
2681
2682 unsafe impl<___E>
2683 ::fidl_next::EncodeOption<
2684 ::fidl_next::wire::Box<'static, crate::wire::DirectoryWatchResponse>,
2685 ___E,
2686 > for DirectoryWatchResponse
2687 where
2688 ___E: ::fidl_next::Encoder + ?Sized,
2689 DirectoryWatchResponse: ::fidl_next::Encode<crate::wire::DirectoryWatchResponse, ___E>,
2690 {
2691 #[inline]
2692 fn encode_option(
2693 this: ::core::option::Option<Self>,
2694 encoder: &mut ___E,
2695 out: &mut ::core::mem::MaybeUninit<
2696 ::fidl_next::wire::Box<'static, crate::wire::DirectoryWatchResponse>,
2697 >,
2698 _: (),
2699 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2700 if let Some(inner) = this {
2701 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2702 ::fidl_next::wire::Box::encode_present(out);
2703 } else {
2704 ::fidl_next::wire::Box::encode_absent(out);
2705 }
2706
2707 Ok(())
2708 }
2709 }
2710
2711 unsafe impl<'a, ___E>
2712 ::fidl_next::EncodeOption<
2713 ::fidl_next::wire::Box<'static, crate::wire::DirectoryWatchResponse>,
2714 ___E,
2715 > for &'a DirectoryWatchResponse
2716 where
2717 ___E: ::fidl_next::Encoder + ?Sized,
2718 &'a DirectoryWatchResponse: ::fidl_next::Encode<crate::wire::DirectoryWatchResponse, ___E>,
2719 {
2720 #[inline]
2721 fn encode_option(
2722 this: ::core::option::Option<Self>,
2723 encoder: &mut ___E,
2724 out: &mut ::core::mem::MaybeUninit<
2725 ::fidl_next::wire::Box<'static, crate::wire::DirectoryWatchResponse>,
2726 >,
2727 _: (),
2728 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2729 if let Some(inner) = this {
2730 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2731 ::fidl_next::wire::Box::encode_present(out);
2732 } else {
2733 ::fidl_next::wire::Box::encode_absent(out);
2734 }
2735
2736 Ok(())
2737 }
2738 }
2739
2740 impl ::fidl_next::FromWire<crate::wire::DirectoryWatchResponse> for DirectoryWatchResponse {
2741 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2742 crate::wire::DirectoryWatchResponse,
2743 Self,
2744 > = unsafe {
2745 ::fidl_next::CopyOptimization::enable_if(
2746 true
2747
2748 && <
2749 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
2750 >::COPY_OPTIMIZATION.is_enabled()
2751
2752 )
2753 };
2754
2755 #[inline]
2756 fn from_wire(wire: crate::wire::DirectoryWatchResponse) -> Self {
2757 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
2758 }
2759 }
2760
2761 impl ::fidl_next::FromWireRef<crate::wire::DirectoryWatchResponse> for DirectoryWatchResponse {
2762 #[inline]
2763 fn from_wire_ref(wire: &crate::wire::DirectoryWatchResponse) -> Self {
2764 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
2765 }
2766 }
2767
2768 pub type SymlinkTarget = ::std::vec::Vec<u8>;
2769
2770 #[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"]
2771 pub type ExtendedAttributeName = ::std::vec::Vec<u8>;
2772
2773 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2774 pub struct NodeGetExtendedAttributeRequest {
2775 pub name: ::std::vec::Vec<u8>,
2776 }
2777
2778 unsafe impl<___E>
2779 ::fidl_next::Encode<crate::wire::NodeGetExtendedAttributeRequest<'static>, ___E>
2780 for NodeGetExtendedAttributeRequest
2781 where
2782 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2783 ___E: ::fidl_next::Encoder,
2784 {
2785 #[inline]
2786 fn encode(
2787 self,
2788 encoder_: &mut ___E,
2789 out_: &mut ::core::mem::MaybeUninit<
2790 crate::wire::NodeGetExtendedAttributeRequest<'static>,
2791 >,
2792 _: (),
2793 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2794 ::fidl_next::munge! {
2795 let crate::wire::NodeGetExtendedAttributeRequest {
2796 name,
2797
2798 } = out_;
2799 }
2800
2801 ::fidl_next::Encode::encode(self.name, encoder_, name, (255, ()))?;
2802
2803 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
2804 ::fidl_next::Constrained::validate(_field, (255, ()))?;
2805
2806 Ok(())
2807 }
2808 }
2809
2810 unsafe impl<'a, ___E>
2811 ::fidl_next::Encode<crate::wire::NodeGetExtendedAttributeRequest<'static>, ___E>
2812 for &'a NodeGetExtendedAttributeRequest
2813 where
2814 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2815 ___E: ::fidl_next::Encoder,
2816 {
2817 #[inline]
2818 fn encode(
2819 self,
2820 encoder_: &mut ___E,
2821 out_: &mut ::core::mem::MaybeUninit<
2822 crate::wire::NodeGetExtendedAttributeRequest<'static>,
2823 >,
2824 _: (),
2825 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2826 ::fidl_next::munge! {
2827 let crate::wire::NodeGetExtendedAttributeRequest {
2828 name,
2829
2830 } = out_;
2831 }
2832
2833 ::fidl_next::Encode::encode(&self.name, encoder_, name, (255, ()))?;
2834
2835 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
2836 ::fidl_next::Constrained::validate(_field, (255, ()))?;
2837
2838 Ok(())
2839 }
2840 }
2841
2842 unsafe impl<___E>
2843 ::fidl_next::EncodeOption<
2844 ::fidl_next::wire::Box<'static, crate::wire::NodeGetExtendedAttributeRequest<'static>>,
2845 ___E,
2846 > for NodeGetExtendedAttributeRequest
2847 where
2848 ___E: ::fidl_next::Encoder + ?Sized,
2849 NodeGetExtendedAttributeRequest:
2850 ::fidl_next::Encode<crate::wire::NodeGetExtendedAttributeRequest<'static>, ___E>,
2851 {
2852 #[inline]
2853 fn encode_option(
2854 this: ::core::option::Option<Self>,
2855 encoder: &mut ___E,
2856 out: &mut ::core::mem::MaybeUninit<
2857 ::fidl_next::wire::Box<
2858 'static,
2859 crate::wire::NodeGetExtendedAttributeRequest<'static>,
2860 >,
2861 >,
2862 _: (),
2863 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2864 if let Some(inner) = this {
2865 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2866 ::fidl_next::wire::Box::encode_present(out);
2867 } else {
2868 ::fidl_next::wire::Box::encode_absent(out);
2869 }
2870
2871 Ok(())
2872 }
2873 }
2874
2875 unsafe impl<'a, ___E>
2876 ::fidl_next::EncodeOption<
2877 ::fidl_next::wire::Box<'static, crate::wire::NodeGetExtendedAttributeRequest<'static>>,
2878 ___E,
2879 > for &'a NodeGetExtendedAttributeRequest
2880 where
2881 ___E: ::fidl_next::Encoder + ?Sized,
2882 &'a NodeGetExtendedAttributeRequest:
2883 ::fidl_next::Encode<crate::wire::NodeGetExtendedAttributeRequest<'static>, ___E>,
2884 {
2885 #[inline]
2886 fn encode_option(
2887 this: ::core::option::Option<Self>,
2888 encoder: &mut ___E,
2889 out: &mut ::core::mem::MaybeUninit<
2890 ::fidl_next::wire::Box<
2891 'static,
2892 crate::wire::NodeGetExtendedAttributeRequest<'static>,
2893 >,
2894 >,
2895 _: (),
2896 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2897 if let Some(inner) = this {
2898 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2899 ::fidl_next::wire::Box::encode_present(out);
2900 } else {
2901 ::fidl_next::wire::Box::encode_absent(out);
2902 }
2903
2904 Ok(())
2905 }
2906 }
2907
2908 impl<'de> ::fidl_next::FromWire<crate::wire::NodeGetExtendedAttributeRequest<'de>>
2909 for NodeGetExtendedAttributeRequest
2910 {
2911 #[inline]
2912 fn from_wire(wire: crate::wire::NodeGetExtendedAttributeRequest<'de>) -> Self {
2913 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
2914 }
2915 }
2916
2917 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeGetExtendedAttributeRequest<'de>>
2918 for NodeGetExtendedAttributeRequest
2919 {
2920 #[inline]
2921 fn from_wire_ref(wire: &crate::wire::NodeGetExtendedAttributeRequest<'de>) -> Self {
2922 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
2923 }
2924 }
2925
2926 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2927 #[repr(u32)]
2928 pub enum SetExtendedAttributeMode {
2929 Set = 1,
2930 Create = 2,
2931 Replace = 3,
2932 }
2933 impl ::core::convert::TryFrom<u32> for SetExtendedAttributeMode {
2934 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2935 fn try_from(
2936 value: u32,
2937 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2938 match value {
2939 1 => Ok(Self::Set),
2940 2 => Ok(Self::Create),
2941 3 => Ok(Self::Replace),
2942
2943 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2944 }
2945 }
2946 }
2947
2948 impl ::std::convert::From<SetExtendedAttributeMode> for u32 {
2949 fn from(value: SetExtendedAttributeMode) -> Self {
2950 match value {
2951 SetExtendedAttributeMode::Set => 1,
2952 SetExtendedAttributeMode::Create => 2,
2953 SetExtendedAttributeMode::Replace => 3,
2954 }
2955 }
2956 }
2957
2958 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SetExtendedAttributeMode, ___E>
2959 for SetExtendedAttributeMode
2960 where
2961 ___E: ?Sized,
2962 {
2963 #[inline]
2964 fn encode(
2965 self,
2966 encoder: &mut ___E,
2967 out: &mut ::core::mem::MaybeUninit<crate::wire::SetExtendedAttributeMode>,
2968 _: (),
2969 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2970 ::fidl_next::Encode::encode(&self, encoder, out, ())
2971 }
2972 }
2973
2974 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SetExtendedAttributeMode, ___E>
2975 for &'a SetExtendedAttributeMode
2976 where
2977 ___E: ?Sized,
2978 {
2979 #[inline]
2980 fn encode(
2981 self,
2982 encoder: &mut ___E,
2983 out: &mut ::core::mem::MaybeUninit<crate::wire::SetExtendedAttributeMode>,
2984 _: (),
2985 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2986 ::fidl_next::munge!(let crate::wire::SetExtendedAttributeMode { value } = out);
2987 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2988 SetExtendedAttributeMode::Set => 1,
2989
2990 SetExtendedAttributeMode::Create => 2,
2991
2992 SetExtendedAttributeMode::Replace => 3,
2993 }));
2994
2995 Ok(())
2996 }
2997 }
2998
2999 impl ::core::convert::From<crate::wire::SetExtendedAttributeMode> for SetExtendedAttributeMode {
3000 fn from(wire: crate::wire::SetExtendedAttributeMode) -> Self {
3001 match u32::from(wire.value) {
3002 1 => Self::Set,
3003
3004 2 => Self::Create,
3005
3006 3 => Self::Replace,
3007
3008 _ => unsafe { ::core::hint::unreachable_unchecked() },
3009 }
3010 }
3011 }
3012
3013 impl ::fidl_next::FromWire<crate::wire::SetExtendedAttributeMode> for SetExtendedAttributeMode {
3014 #[inline]
3015 fn from_wire(wire: crate::wire::SetExtendedAttributeMode) -> Self {
3016 Self::from(wire)
3017 }
3018 }
3019
3020 impl ::fidl_next::FromWireRef<crate::wire::SetExtendedAttributeMode> for SetExtendedAttributeMode {
3021 #[inline]
3022 fn from_wire_ref(wire: &crate::wire::SetExtendedAttributeMode) -> Self {
3023 Self::from(*wire)
3024 }
3025 }
3026
3027 pub type NodeSetExtendedAttributeResponse = ();
3028
3029 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3030 pub struct NodeRemoveExtendedAttributeRequest {
3031 pub name: ::std::vec::Vec<u8>,
3032 }
3033
3034 unsafe impl<___E>
3035 ::fidl_next::Encode<crate::wire::NodeRemoveExtendedAttributeRequest<'static>, ___E>
3036 for NodeRemoveExtendedAttributeRequest
3037 where
3038 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3039 ___E: ::fidl_next::Encoder,
3040 {
3041 #[inline]
3042 fn encode(
3043 self,
3044 encoder_: &mut ___E,
3045 out_: &mut ::core::mem::MaybeUninit<
3046 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3047 >,
3048 _: (),
3049 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3050 ::fidl_next::munge! {
3051 let crate::wire::NodeRemoveExtendedAttributeRequest {
3052 name,
3053
3054 } = out_;
3055 }
3056
3057 ::fidl_next::Encode::encode(self.name, encoder_, name, (255, ()))?;
3058
3059 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
3060 ::fidl_next::Constrained::validate(_field, (255, ()))?;
3061
3062 Ok(())
3063 }
3064 }
3065
3066 unsafe impl<'a, ___E>
3067 ::fidl_next::Encode<crate::wire::NodeRemoveExtendedAttributeRequest<'static>, ___E>
3068 for &'a NodeRemoveExtendedAttributeRequest
3069 where
3070 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3071 ___E: ::fidl_next::Encoder,
3072 {
3073 #[inline]
3074 fn encode(
3075 self,
3076 encoder_: &mut ___E,
3077 out_: &mut ::core::mem::MaybeUninit<
3078 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3079 >,
3080 _: (),
3081 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3082 ::fidl_next::munge! {
3083 let crate::wire::NodeRemoveExtendedAttributeRequest {
3084 name,
3085
3086 } = out_;
3087 }
3088
3089 ::fidl_next::Encode::encode(&self.name, encoder_, name, (255, ()))?;
3090
3091 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
3092 ::fidl_next::Constrained::validate(_field, (255, ()))?;
3093
3094 Ok(())
3095 }
3096 }
3097
3098 unsafe impl<___E>
3099 ::fidl_next::EncodeOption<
3100 ::fidl_next::wire::Box<
3101 'static,
3102 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3103 >,
3104 ___E,
3105 > for NodeRemoveExtendedAttributeRequest
3106 where
3107 ___E: ::fidl_next::Encoder + ?Sized,
3108 NodeRemoveExtendedAttributeRequest:
3109 ::fidl_next::Encode<crate::wire::NodeRemoveExtendedAttributeRequest<'static>, ___E>,
3110 {
3111 #[inline]
3112 fn encode_option(
3113 this: ::core::option::Option<Self>,
3114 encoder: &mut ___E,
3115 out: &mut ::core::mem::MaybeUninit<
3116 ::fidl_next::wire::Box<
3117 'static,
3118 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3119 >,
3120 >,
3121 _: (),
3122 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3123 if let Some(inner) = this {
3124 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3125 ::fidl_next::wire::Box::encode_present(out);
3126 } else {
3127 ::fidl_next::wire::Box::encode_absent(out);
3128 }
3129
3130 Ok(())
3131 }
3132 }
3133
3134 unsafe impl<'a, ___E>
3135 ::fidl_next::EncodeOption<
3136 ::fidl_next::wire::Box<
3137 'static,
3138 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3139 >,
3140 ___E,
3141 > for &'a NodeRemoveExtendedAttributeRequest
3142 where
3143 ___E: ::fidl_next::Encoder + ?Sized,
3144 &'a NodeRemoveExtendedAttributeRequest:
3145 ::fidl_next::Encode<crate::wire::NodeRemoveExtendedAttributeRequest<'static>, ___E>,
3146 {
3147 #[inline]
3148 fn encode_option(
3149 this: ::core::option::Option<Self>,
3150 encoder: &mut ___E,
3151 out: &mut ::core::mem::MaybeUninit<
3152 ::fidl_next::wire::Box<
3153 'static,
3154 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
3155 >,
3156 >,
3157 _: (),
3158 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3159 if let Some(inner) = this {
3160 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3161 ::fidl_next::wire::Box::encode_present(out);
3162 } else {
3163 ::fidl_next::wire::Box::encode_absent(out);
3164 }
3165
3166 Ok(())
3167 }
3168 }
3169
3170 impl<'de> ::fidl_next::FromWire<crate::wire::NodeRemoveExtendedAttributeRequest<'de>>
3171 for NodeRemoveExtendedAttributeRequest
3172 {
3173 #[inline]
3174 fn from_wire(wire: crate::wire::NodeRemoveExtendedAttributeRequest<'de>) -> Self {
3175 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
3176 }
3177 }
3178
3179 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeRemoveExtendedAttributeRequest<'de>>
3180 for NodeRemoveExtendedAttributeRequest
3181 {
3182 #[inline]
3183 fn from_wire_ref(wire: &crate::wire::NodeRemoveExtendedAttributeRequest<'de>) -> Self {
3184 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
3185 }
3186 }
3187
3188 pub type NodeRemoveExtendedAttributeResponse = ();
3189
3190 pub type DirectoryCreateSymlinkResponse = ();
3191
3192 pub type NodeSetFlagsResponse = ();
3193
3194 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3195 pub struct NodeDeprecatedGetAttrResponse {
3196 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
3197
3198 pub attributes: crate::natural::NodeAttributes,
3199 }
3200
3201 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetAttrResponse, ___E>
3202 for NodeDeprecatedGetAttrResponse
3203 where
3204 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3205 {
3206 #[inline]
3207 fn encode(
3208 self,
3209 encoder_: &mut ___E,
3210 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetAttrResponse>,
3211 _: (),
3212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3213 ::fidl_next::munge! {
3214 let crate::wire::NodeDeprecatedGetAttrResponse {
3215 s,
3216 attributes,
3217
3218 } = out_;
3219 }
3220
3221 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
3222
3223 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3224
3225 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, ())?;
3226
3227 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
3228
3229 Ok(())
3230 }
3231 }
3232
3233 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetAttrResponse, ___E>
3234 for &'a NodeDeprecatedGetAttrResponse
3235 where
3236 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3237 {
3238 #[inline]
3239 fn encode(
3240 self,
3241 encoder_: &mut ___E,
3242 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetAttrResponse>,
3243 _: (),
3244 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3245 ::fidl_next::munge! {
3246 let crate::wire::NodeDeprecatedGetAttrResponse {
3247 s,
3248 attributes,
3249
3250 } = out_;
3251 }
3252
3253 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
3254
3255 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3256
3257 ::fidl_next::Encode::encode(&self.attributes, encoder_, attributes, ())?;
3258
3259 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
3260
3261 Ok(())
3262 }
3263 }
3264
3265 unsafe impl<___E>
3266 ::fidl_next::EncodeOption<
3267 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetAttrResponse>,
3268 ___E,
3269 > for NodeDeprecatedGetAttrResponse
3270 where
3271 ___E: ::fidl_next::Encoder + ?Sized,
3272 NodeDeprecatedGetAttrResponse:
3273 ::fidl_next::Encode<crate::wire::NodeDeprecatedGetAttrResponse, ___E>,
3274 {
3275 #[inline]
3276 fn encode_option(
3277 this: ::core::option::Option<Self>,
3278 encoder: &mut ___E,
3279 out: &mut ::core::mem::MaybeUninit<
3280 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetAttrResponse>,
3281 >,
3282 _: (),
3283 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3284 if let Some(inner) = this {
3285 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3286 ::fidl_next::wire::Box::encode_present(out);
3287 } else {
3288 ::fidl_next::wire::Box::encode_absent(out);
3289 }
3290
3291 Ok(())
3292 }
3293 }
3294
3295 unsafe impl<'a, ___E>
3296 ::fidl_next::EncodeOption<
3297 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetAttrResponse>,
3298 ___E,
3299 > for &'a NodeDeprecatedGetAttrResponse
3300 where
3301 ___E: ::fidl_next::Encoder + ?Sized,
3302 &'a NodeDeprecatedGetAttrResponse:
3303 ::fidl_next::Encode<crate::wire::NodeDeprecatedGetAttrResponse, ___E>,
3304 {
3305 #[inline]
3306 fn encode_option(
3307 this: ::core::option::Option<Self>,
3308 encoder: &mut ___E,
3309 out: &mut ::core::mem::MaybeUninit<
3310 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetAttrResponse>,
3311 >,
3312 _: (),
3313 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3314 if let Some(inner) = this {
3315 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3316 ::fidl_next::wire::Box::encode_present(out);
3317 } else {
3318 ::fidl_next::wire::Box::encode_absent(out);
3319 }
3320
3321 Ok(())
3322 }
3323 }
3324
3325 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedGetAttrResponse>
3326 for NodeDeprecatedGetAttrResponse
3327 {
3328 #[inline]
3329 fn from_wire(wire: crate::wire::NodeDeprecatedGetAttrResponse) -> Self {
3330 Self {
3331 s: ::fidl_next::FromWire::from_wire(wire.s),
3332
3333 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
3334 }
3335 }
3336 }
3337
3338 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedGetAttrResponse>
3339 for NodeDeprecatedGetAttrResponse
3340 {
3341 #[inline]
3342 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedGetAttrResponse) -> Self {
3343 Self {
3344 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
3345
3346 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
3347 }
3348 }
3349 }
3350
3351 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3352 pub struct NodeDeprecatedSetAttrRequest {
3353 pub flags: crate::natural::NodeAttributeFlags,
3354
3355 pub attributes: crate::natural::NodeAttributes,
3356 }
3357
3358 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrRequest, ___E>
3359 for NodeDeprecatedSetAttrRequest
3360 where
3361 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3362 {
3363 #[inline]
3364 fn encode(
3365 self,
3366 encoder_: &mut ___E,
3367 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrRequest>,
3368 _: (),
3369 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3370 ::fidl_next::munge! {
3371 let crate::wire::NodeDeprecatedSetAttrRequest {
3372 flags,
3373 attributes,
3374
3375 } = out_;
3376 }
3377
3378 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
3379
3380 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3381
3382 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, ())?;
3383
3384 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
3385
3386 Ok(())
3387 }
3388 }
3389
3390 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrRequest, ___E>
3391 for &'a NodeDeprecatedSetAttrRequest
3392 where
3393 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3394 {
3395 #[inline]
3396 fn encode(
3397 self,
3398 encoder_: &mut ___E,
3399 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrRequest>,
3400 _: (),
3401 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3402 ::fidl_next::munge! {
3403 let crate::wire::NodeDeprecatedSetAttrRequest {
3404 flags,
3405 attributes,
3406
3407 } = out_;
3408 }
3409
3410 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
3411
3412 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3413
3414 ::fidl_next::Encode::encode(&self.attributes, encoder_, attributes, ())?;
3415
3416 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
3417
3418 Ok(())
3419 }
3420 }
3421
3422 unsafe impl<___E>
3423 ::fidl_next::EncodeOption<
3424 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrRequest>,
3425 ___E,
3426 > for NodeDeprecatedSetAttrRequest
3427 where
3428 ___E: ::fidl_next::Encoder + ?Sized,
3429 NodeDeprecatedSetAttrRequest:
3430 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrRequest, ___E>,
3431 {
3432 #[inline]
3433 fn encode_option(
3434 this: ::core::option::Option<Self>,
3435 encoder: &mut ___E,
3436 out: &mut ::core::mem::MaybeUninit<
3437 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrRequest>,
3438 >,
3439 _: (),
3440 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3441 if let Some(inner) = this {
3442 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3443 ::fidl_next::wire::Box::encode_present(out);
3444 } else {
3445 ::fidl_next::wire::Box::encode_absent(out);
3446 }
3447
3448 Ok(())
3449 }
3450 }
3451
3452 unsafe impl<'a, ___E>
3453 ::fidl_next::EncodeOption<
3454 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrRequest>,
3455 ___E,
3456 > for &'a NodeDeprecatedSetAttrRequest
3457 where
3458 ___E: ::fidl_next::Encoder + ?Sized,
3459 &'a NodeDeprecatedSetAttrRequest:
3460 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrRequest, ___E>,
3461 {
3462 #[inline]
3463 fn encode_option(
3464 this: ::core::option::Option<Self>,
3465 encoder: &mut ___E,
3466 out: &mut ::core::mem::MaybeUninit<
3467 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrRequest>,
3468 >,
3469 _: (),
3470 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3471 if let Some(inner) = this {
3472 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3473 ::fidl_next::wire::Box::encode_present(out);
3474 } else {
3475 ::fidl_next::wire::Box::encode_absent(out);
3476 }
3477
3478 Ok(())
3479 }
3480 }
3481
3482 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedSetAttrRequest>
3483 for NodeDeprecatedSetAttrRequest
3484 {
3485 #[inline]
3486 fn from_wire(wire: crate::wire::NodeDeprecatedSetAttrRequest) -> Self {
3487 Self {
3488 flags: ::fidl_next::FromWire::from_wire(wire.flags),
3489
3490 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
3491 }
3492 }
3493 }
3494
3495 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedSetAttrRequest>
3496 for NodeDeprecatedSetAttrRequest
3497 {
3498 #[inline]
3499 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedSetAttrRequest) -> Self {
3500 Self {
3501 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
3502
3503 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
3504 }
3505 }
3506 }
3507
3508 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3509 #[repr(C)]
3510 pub struct NodeDeprecatedSetAttrResponse {
3511 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
3512 }
3513
3514 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrResponse, ___E>
3515 for NodeDeprecatedSetAttrResponse
3516 where
3517 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3518 {
3519 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3520 Self,
3521 crate::wire::NodeDeprecatedSetAttrResponse,
3522 > = unsafe {
3523 ::fidl_next::CopyOptimization::enable_if(
3524 true
3525
3526 && <
3527 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
3528 >::COPY_OPTIMIZATION.is_enabled()
3529
3530 )
3531 };
3532
3533 #[inline]
3534 fn encode(
3535 self,
3536 encoder_: &mut ___E,
3537 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrResponse>,
3538 _: (),
3539 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3540 ::fidl_next::munge! {
3541 let crate::wire::NodeDeprecatedSetAttrResponse {
3542 s,
3543
3544 } = out_;
3545 }
3546
3547 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
3548
3549 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3550
3551 Ok(())
3552 }
3553 }
3554
3555 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrResponse, ___E>
3556 for &'a NodeDeprecatedSetAttrResponse
3557 where
3558 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3559 {
3560 #[inline]
3561 fn encode(
3562 self,
3563 encoder_: &mut ___E,
3564 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrResponse>,
3565 _: (),
3566 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3567 ::fidl_next::munge! {
3568 let crate::wire::NodeDeprecatedSetAttrResponse {
3569 s,
3570
3571 } = out_;
3572 }
3573
3574 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
3575
3576 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3577
3578 Ok(())
3579 }
3580 }
3581
3582 unsafe impl<___E>
3583 ::fidl_next::EncodeOption<
3584 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrResponse>,
3585 ___E,
3586 > for NodeDeprecatedSetAttrResponse
3587 where
3588 ___E: ::fidl_next::Encoder + ?Sized,
3589 NodeDeprecatedSetAttrResponse:
3590 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrResponse, ___E>,
3591 {
3592 #[inline]
3593 fn encode_option(
3594 this: ::core::option::Option<Self>,
3595 encoder: &mut ___E,
3596 out: &mut ::core::mem::MaybeUninit<
3597 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrResponse>,
3598 >,
3599 _: (),
3600 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3601 if let Some(inner) = this {
3602 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3603 ::fidl_next::wire::Box::encode_present(out);
3604 } else {
3605 ::fidl_next::wire::Box::encode_absent(out);
3606 }
3607
3608 Ok(())
3609 }
3610 }
3611
3612 unsafe impl<'a, ___E>
3613 ::fidl_next::EncodeOption<
3614 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrResponse>,
3615 ___E,
3616 > for &'a NodeDeprecatedSetAttrResponse
3617 where
3618 ___E: ::fidl_next::Encoder + ?Sized,
3619 &'a NodeDeprecatedSetAttrResponse:
3620 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrResponse, ___E>,
3621 {
3622 #[inline]
3623 fn encode_option(
3624 this: ::core::option::Option<Self>,
3625 encoder: &mut ___E,
3626 out: &mut ::core::mem::MaybeUninit<
3627 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetAttrResponse>,
3628 >,
3629 _: (),
3630 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3631 if let Some(inner) = this {
3632 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3633 ::fidl_next::wire::Box::encode_present(out);
3634 } else {
3635 ::fidl_next::wire::Box::encode_absent(out);
3636 }
3637
3638 Ok(())
3639 }
3640 }
3641
3642 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedSetAttrResponse>
3643 for NodeDeprecatedSetAttrResponse
3644 {
3645 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3646 crate::wire::NodeDeprecatedSetAttrResponse,
3647 Self,
3648 > = unsafe {
3649 ::fidl_next::CopyOptimization::enable_if(
3650 true
3651
3652 && <
3653 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
3654 >::COPY_OPTIMIZATION.is_enabled()
3655
3656 )
3657 };
3658
3659 #[inline]
3660 fn from_wire(wire: crate::wire::NodeDeprecatedSetAttrResponse) -> Self {
3661 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
3662 }
3663 }
3664
3665 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedSetAttrResponse>
3666 for NodeDeprecatedSetAttrResponse
3667 {
3668 #[inline]
3669 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedSetAttrResponse) -> Self {
3670 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
3671 }
3672 }
3673
3674 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3675 #[repr(C)]
3676 pub struct NodeDeprecatedGetFlagsResponse {
3677 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
3678
3679 pub flags: crate::natural::OpenFlags,
3680 }
3681
3682 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetFlagsResponse, ___E>
3683 for NodeDeprecatedGetFlagsResponse
3684 where
3685 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3686 {
3687 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3688 Self,
3689 crate::wire::NodeDeprecatedGetFlagsResponse,
3690 > = unsafe {
3691 ::fidl_next::CopyOptimization::enable_if(
3692 true
3693
3694 && <
3695 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
3696 >::COPY_OPTIMIZATION.is_enabled()
3697
3698 && <
3699 crate::natural::OpenFlags as ::fidl_next::Encode<crate::wire::OpenFlags, ___E>
3700 >::COPY_OPTIMIZATION.is_enabled()
3701
3702 )
3703 };
3704
3705 #[inline]
3706 fn encode(
3707 self,
3708 encoder_: &mut ___E,
3709 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetFlagsResponse>,
3710 _: (),
3711 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3712 ::fidl_next::munge! {
3713 let crate::wire::NodeDeprecatedGetFlagsResponse {
3714 s,
3715 flags,
3716
3717 } = out_;
3718 }
3719
3720 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
3721
3722 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3723
3724 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
3725
3726 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3727
3728 Ok(())
3729 }
3730 }
3731
3732 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetFlagsResponse, ___E>
3733 for &'a NodeDeprecatedGetFlagsResponse
3734 where
3735 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3736 {
3737 #[inline]
3738 fn encode(
3739 self,
3740 encoder_: &mut ___E,
3741 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetFlagsResponse>,
3742 _: (),
3743 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3744 ::fidl_next::munge! {
3745 let crate::wire::NodeDeprecatedGetFlagsResponse {
3746 s,
3747 flags,
3748
3749 } = out_;
3750 }
3751
3752 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
3753
3754 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
3755
3756 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
3757
3758 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3759
3760 Ok(())
3761 }
3762 }
3763
3764 unsafe impl<___E>
3765 ::fidl_next::EncodeOption<
3766 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetFlagsResponse>,
3767 ___E,
3768 > for NodeDeprecatedGetFlagsResponse
3769 where
3770 ___E: ::fidl_next::Encoder + ?Sized,
3771 NodeDeprecatedGetFlagsResponse:
3772 ::fidl_next::Encode<crate::wire::NodeDeprecatedGetFlagsResponse, ___E>,
3773 {
3774 #[inline]
3775 fn encode_option(
3776 this: ::core::option::Option<Self>,
3777 encoder: &mut ___E,
3778 out: &mut ::core::mem::MaybeUninit<
3779 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetFlagsResponse>,
3780 >,
3781 _: (),
3782 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3783 if let Some(inner) = this {
3784 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3785 ::fidl_next::wire::Box::encode_present(out);
3786 } else {
3787 ::fidl_next::wire::Box::encode_absent(out);
3788 }
3789
3790 Ok(())
3791 }
3792 }
3793
3794 unsafe impl<'a, ___E>
3795 ::fidl_next::EncodeOption<
3796 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetFlagsResponse>,
3797 ___E,
3798 > for &'a NodeDeprecatedGetFlagsResponse
3799 where
3800 ___E: ::fidl_next::Encoder + ?Sized,
3801 &'a NodeDeprecatedGetFlagsResponse:
3802 ::fidl_next::Encode<crate::wire::NodeDeprecatedGetFlagsResponse, ___E>,
3803 {
3804 #[inline]
3805 fn encode_option(
3806 this: ::core::option::Option<Self>,
3807 encoder: &mut ___E,
3808 out: &mut ::core::mem::MaybeUninit<
3809 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedGetFlagsResponse>,
3810 >,
3811 _: (),
3812 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3813 if let Some(inner) = this {
3814 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3815 ::fidl_next::wire::Box::encode_present(out);
3816 } else {
3817 ::fidl_next::wire::Box::encode_absent(out);
3818 }
3819
3820 Ok(())
3821 }
3822 }
3823
3824 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedGetFlagsResponse>
3825 for NodeDeprecatedGetFlagsResponse
3826 {
3827 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3828 crate::wire::NodeDeprecatedGetFlagsResponse,
3829 Self,
3830 > = unsafe {
3831 ::fidl_next::CopyOptimization::enable_if(
3832 true
3833
3834 && <
3835 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
3836 >::COPY_OPTIMIZATION.is_enabled()
3837
3838 && <
3839 crate::natural::OpenFlags as ::fidl_next::FromWire<crate::wire::OpenFlags>
3840 >::COPY_OPTIMIZATION.is_enabled()
3841
3842 )
3843 };
3844
3845 #[inline]
3846 fn from_wire(wire: crate::wire::NodeDeprecatedGetFlagsResponse) -> Self {
3847 Self {
3848 s: ::fidl_next::FromWire::from_wire(wire.s),
3849
3850 flags: ::fidl_next::FromWire::from_wire(wire.flags),
3851 }
3852 }
3853 }
3854
3855 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedGetFlagsResponse>
3856 for NodeDeprecatedGetFlagsResponse
3857 {
3858 #[inline]
3859 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedGetFlagsResponse) -> Self {
3860 Self {
3861 s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s),
3862
3863 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
3864 }
3865 }
3866 }
3867
3868 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3869 #[repr(C)]
3870 pub struct NodeDeprecatedSetFlagsRequest {
3871 pub flags: crate::natural::OpenFlags,
3872 }
3873
3874 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsRequest, ___E>
3875 for NodeDeprecatedSetFlagsRequest
3876 where
3877 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3878 {
3879 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3880 Self,
3881 crate::wire::NodeDeprecatedSetFlagsRequest,
3882 > = unsafe {
3883 ::fidl_next::CopyOptimization::enable_if(
3884 true && <crate::natural::OpenFlags as ::fidl_next::Encode<
3885 crate::wire::OpenFlags,
3886 ___E,
3887 >>::COPY_OPTIMIZATION
3888 .is_enabled(),
3889 )
3890 };
3891
3892 #[inline]
3893 fn encode(
3894 self,
3895 encoder_: &mut ___E,
3896 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsRequest>,
3897 _: (),
3898 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3899 ::fidl_next::munge! {
3900 let crate::wire::NodeDeprecatedSetFlagsRequest {
3901 flags,
3902
3903 } = out_;
3904 }
3905
3906 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
3907
3908 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3909
3910 Ok(())
3911 }
3912 }
3913
3914 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsRequest, ___E>
3915 for &'a NodeDeprecatedSetFlagsRequest
3916 where
3917 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3918 {
3919 #[inline]
3920 fn encode(
3921 self,
3922 encoder_: &mut ___E,
3923 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsRequest>,
3924 _: (),
3925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3926 ::fidl_next::munge! {
3927 let crate::wire::NodeDeprecatedSetFlagsRequest {
3928 flags,
3929
3930 } = out_;
3931 }
3932
3933 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
3934
3935 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
3936
3937 Ok(())
3938 }
3939 }
3940
3941 unsafe impl<___E>
3942 ::fidl_next::EncodeOption<
3943 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsRequest>,
3944 ___E,
3945 > for NodeDeprecatedSetFlagsRequest
3946 where
3947 ___E: ::fidl_next::Encoder + ?Sized,
3948 NodeDeprecatedSetFlagsRequest:
3949 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsRequest, ___E>,
3950 {
3951 #[inline]
3952 fn encode_option(
3953 this: ::core::option::Option<Self>,
3954 encoder: &mut ___E,
3955 out: &mut ::core::mem::MaybeUninit<
3956 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsRequest>,
3957 >,
3958 _: (),
3959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3960 if let Some(inner) = this {
3961 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3962 ::fidl_next::wire::Box::encode_present(out);
3963 } else {
3964 ::fidl_next::wire::Box::encode_absent(out);
3965 }
3966
3967 Ok(())
3968 }
3969 }
3970
3971 unsafe impl<'a, ___E>
3972 ::fidl_next::EncodeOption<
3973 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsRequest>,
3974 ___E,
3975 > for &'a NodeDeprecatedSetFlagsRequest
3976 where
3977 ___E: ::fidl_next::Encoder + ?Sized,
3978 &'a NodeDeprecatedSetFlagsRequest:
3979 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsRequest, ___E>,
3980 {
3981 #[inline]
3982 fn encode_option(
3983 this: ::core::option::Option<Self>,
3984 encoder: &mut ___E,
3985 out: &mut ::core::mem::MaybeUninit<
3986 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsRequest>,
3987 >,
3988 _: (),
3989 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3990 if let Some(inner) = this {
3991 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3992 ::fidl_next::wire::Box::encode_present(out);
3993 } else {
3994 ::fidl_next::wire::Box::encode_absent(out);
3995 }
3996
3997 Ok(())
3998 }
3999 }
4000
4001 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedSetFlagsRequest>
4002 for NodeDeprecatedSetFlagsRequest
4003 {
4004 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4005 crate::wire::NodeDeprecatedSetFlagsRequest,
4006 Self,
4007 > = unsafe {
4008 ::fidl_next::CopyOptimization::enable_if(
4009 true && <crate::natural::OpenFlags as ::fidl_next::FromWire<
4010 crate::wire::OpenFlags,
4011 >>::COPY_OPTIMIZATION
4012 .is_enabled(),
4013 )
4014 };
4015
4016 #[inline]
4017 fn from_wire(wire: crate::wire::NodeDeprecatedSetFlagsRequest) -> Self {
4018 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
4019 }
4020 }
4021
4022 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedSetFlagsRequest>
4023 for NodeDeprecatedSetFlagsRequest
4024 {
4025 #[inline]
4026 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedSetFlagsRequest) -> Self {
4027 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
4028 }
4029 }
4030
4031 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4032 #[repr(C)]
4033 pub struct NodeDeprecatedSetFlagsResponse {
4034 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
4035 }
4036
4037 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsResponse, ___E>
4038 for NodeDeprecatedSetFlagsResponse
4039 where
4040 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4041 {
4042 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4043 Self,
4044 crate::wire::NodeDeprecatedSetFlagsResponse,
4045 > = unsafe {
4046 ::fidl_next::CopyOptimization::enable_if(
4047 true
4048
4049 && <
4050 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
4051 >::COPY_OPTIMIZATION.is_enabled()
4052
4053 )
4054 };
4055
4056 #[inline]
4057 fn encode(
4058 self,
4059 encoder_: &mut ___E,
4060 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsResponse>,
4061 _: (),
4062 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4063 ::fidl_next::munge! {
4064 let crate::wire::NodeDeprecatedSetFlagsResponse {
4065 s,
4066
4067 } = out_;
4068 }
4069
4070 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
4071
4072 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
4073
4074 Ok(())
4075 }
4076 }
4077
4078 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsResponse, ___E>
4079 for &'a NodeDeprecatedSetFlagsResponse
4080 where
4081 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4082 {
4083 #[inline]
4084 fn encode(
4085 self,
4086 encoder_: &mut ___E,
4087 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsResponse>,
4088 _: (),
4089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4090 ::fidl_next::munge! {
4091 let crate::wire::NodeDeprecatedSetFlagsResponse {
4092 s,
4093
4094 } = out_;
4095 }
4096
4097 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
4098
4099 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
4100
4101 Ok(())
4102 }
4103 }
4104
4105 unsafe impl<___E>
4106 ::fidl_next::EncodeOption<
4107 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsResponse>,
4108 ___E,
4109 > for NodeDeprecatedSetFlagsResponse
4110 where
4111 ___E: ::fidl_next::Encoder + ?Sized,
4112 NodeDeprecatedSetFlagsResponse:
4113 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsResponse, ___E>,
4114 {
4115 #[inline]
4116 fn encode_option(
4117 this: ::core::option::Option<Self>,
4118 encoder: &mut ___E,
4119 out: &mut ::core::mem::MaybeUninit<
4120 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsResponse>,
4121 >,
4122 _: (),
4123 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4124 if let Some(inner) = this {
4125 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4126 ::fidl_next::wire::Box::encode_present(out);
4127 } else {
4128 ::fidl_next::wire::Box::encode_absent(out);
4129 }
4130
4131 Ok(())
4132 }
4133 }
4134
4135 unsafe impl<'a, ___E>
4136 ::fidl_next::EncodeOption<
4137 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsResponse>,
4138 ___E,
4139 > for &'a NodeDeprecatedSetFlagsResponse
4140 where
4141 ___E: ::fidl_next::Encoder + ?Sized,
4142 &'a NodeDeprecatedSetFlagsResponse:
4143 ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsResponse, ___E>,
4144 {
4145 #[inline]
4146 fn encode_option(
4147 this: ::core::option::Option<Self>,
4148 encoder: &mut ___E,
4149 out: &mut ::core::mem::MaybeUninit<
4150 ::fidl_next::wire::Box<'static, crate::wire::NodeDeprecatedSetFlagsResponse>,
4151 >,
4152 _: (),
4153 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4154 if let Some(inner) = this {
4155 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4156 ::fidl_next::wire::Box::encode_present(out);
4157 } else {
4158 ::fidl_next::wire::Box::encode_absent(out);
4159 }
4160
4161 Ok(())
4162 }
4163 }
4164
4165 impl ::fidl_next::FromWire<crate::wire::NodeDeprecatedSetFlagsResponse>
4166 for NodeDeprecatedSetFlagsResponse
4167 {
4168 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4169 crate::wire::NodeDeprecatedSetFlagsResponse,
4170 Self,
4171 > = unsafe {
4172 ::fidl_next::CopyOptimization::enable_if(
4173 true
4174
4175 && <
4176 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
4177 >::COPY_OPTIMIZATION.is_enabled()
4178
4179 )
4180 };
4181
4182 #[inline]
4183 fn from_wire(wire: crate::wire::NodeDeprecatedSetFlagsResponse) -> Self {
4184 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
4185 }
4186 }
4187
4188 impl ::fidl_next::FromWireRef<crate::wire::NodeDeprecatedSetFlagsResponse>
4189 for NodeDeprecatedSetFlagsResponse
4190 {
4191 #[inline]
4192 fn from_wire_ref(wire: &crate::wire::NodeDeprecatedSetFlagsResponse) -> Self {
4193 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
4194 }
4195 }
4196
4197 ::fidl_next::bitflags::bitflags! {
4198 #[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(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct Flags: u64 {
4199 #[doc = " Allows opening child nodes with [`PROTOCOL_SERVICE`].\n"]const PERM_CONNECT = 1;
4200 #[doc = " Read byte contents of a file.\n"]const PERM_READ_BYTES = 2;
4201 #[doc = " Write byte contents to a file.\n"]const PERM_WRITE_BYTES = 4;
4202 #[doc = " Execute byte contents of a file.\n"]const PERM_EXECUTE = 8;
4203 #[doc = " Get/query attributes of a node.\n"]const PERM_GET_ATTRIBUTES = 16;
4204 #[doc = " Set/update attributes of a node.\n"]const PERM_UPDATE_ATTRIBUTES = 32;
4205 #[doc = " Enumerate (list) directory entries.\n"]const PERM_ENUMERATE = 64;
4206 #[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;
4207 #[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;
4208 #[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;
4209 #[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;
4210 #[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;
4211 #[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;
4212 #[doc = " Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.\n"]const PROTOCOL_DIRECTORY = 524288;
4213 #[doc = " Caller accepts [`fuchsia.io/File`] protocol.\n"]const PROTOCOL_FILE = 8589934592;
4214 #[doc = " Caller accepts [`fuchsia.io/Symlink`] protocol.\n"]const PROTOCOL_SYMLINK = 17179869184;
4215 #[doc = " Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.\n"]const FLAG_SEND_REPRESENTATION = 1099511627776;
4216 #[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;
4217 #[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;
4218 #[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;
4219 #[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;
4220 #[doc = " Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.\n"]const FILE_TRUNCATE = 262144;
4221 const _ = !0;
4222 }
4223 }
4224
4225 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Flags, ___E> for Flags
4226 where
4227 ___E: ?Sized,
4228 {
4229 #[inline]
4230 fn encode(
4231 self,
4232 encoder: &mut ___E,
4233 out: &mut ::core::mem::MaybeUninit<crate::wire::Flags>,
4234 _: (),
4235 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4236 ::fidl_next::Encode::encode(&self, encoder, out, ())
4237 }
4238 }
4239
4240 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Flags, ___E> for &'a Flags
4241 where
4242 ___E: ?Sized,
4243 {
4244 #[inline]
4245 fn encode(
4246 self,
4247 _: &mut ___E,
4248 out: &mut ::core::mem::MaybeUninit<crate::wire::Flags>,
4249 _: (),
4250 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4251 ::fidl_next::munge!(let crate::wire::Flags { value } = out);
4252
4253 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
4254 Ok(())
4255 }
4256 }
4257
4258 impl ::core::convert::From<crate::wire::Flags> for Flags {
4259 fn from(wire: crate::wire::Flags) -> Self {
4260 Self::from_bits_retain(u64::from(wire.value))
4261 }
4262 }
4263
4264 impl ::fidl_next::FromWire<crate::wire::Flags> for Flags {
4265 #[inline]
4266 fn from_wire(wire: crate::wire::Flags) -> Self {
4267 Self::from(wire)
4268 }
4269 }
4270
4271 impl ::fidl_next::FromWireRef<crate::wire::Flags> for Flags {
4272 #[inline]
4273 fn from_wire_ref(wire: &crate::wire::Flags) -> Self {
4274 Self::from(*wire)
4275 }
4276 }
4277
4278 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4279 #[repr(C)]
4280 pub struct NodeGetFlagsResponse {
4281 pub flags: crate::natural::Flags,
4282 }
4283
4284 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeGetFlagsResponse, ___E>
4285 for NodeGetFlagsResponse
4286 where
4287 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4288 {
4289 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4290 Self,
4291 crate::wire::NodeGetFlagsResponse,
4292 > = unsafe {
4293 ::fidl_next::CopyOptimization::enable_if(
4294 true
4295
4296 && <
4297 crate::natural::Flags as ::fidl_next::Encode<crate::wire::Flags, ___E>
4298 >::COPY_OPTIMIZATION.is_enabled()
4299
4300 )
4301 };
4302
4303 #[inline]
4304 fn encode(
4305 self,
4306 encoder_: &mut ___E,
4307 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetFlagsResponse>,
4308 _: (),
4309 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4310 ::fidl_next::munge! {
4311 let crate::wire::NodeGetFlagsResponse {
4312 flags,
4313
4314 } = out_;
4315 }
4316
4317 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
4318
4319 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4320
4321 Ok(())
4322 }
4323 }
4324
4325 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeGetFlagsResponse, ___E>
4326 for &'a NodeGetFlagsResponse
4327 where
4328 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4329 {
4330 #[inline]
4331 fn encode(
4332 self,
4333 encoder_: &mut ___E,
4334 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetFlagsResponse>,
4335 _: (),
4336 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4337 ::fidl_next::munge! {
4338 let crate::wire::NodeGetFlagsResponse {
4339 flags,
4340
4341 } = out_;
4342 }
4343
4344 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
4345
4346 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4347
4348 Ok(())
4349 }
4350 }
4351
4352 unsafe impl<___E>
4353 ::fidl_next::EncodeOption<
4354 ::fidl_next::wire::Box<'static, crate::wire::NodeGetFlagsResponse>,
4355 ___E,
4356 > for NodeGetFlagsResponse
4357 where
4358 ___E: ::fidl_next::Encoder + ?Sized,
4359 NodeGetFlagsResponse: ::fidl_next::Encode<crate::wire::NodeGetFlagsResponse, ___E>,
4360 {
4361 #[inline]
4362 fn encode_option(
4363 this: ::core::option::Option<Self>,
4364 encoder: &mut ___E,
4365 out: &mut ::core::mem::MaybeUninit<
4366 ::fidl_next::wire::Box<'static, crate::wire::NodeGetFlagsResponse>,
4367 >,
4368 _: (),
4369 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4370 if let Some(inner) = this {
4371 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4372 ::fidl_next::wire::Box::encode_present(out);
4373 } else {
4374 ::fidl_next::wire::Box::encode_absent(out);
4375 }
4376
4377 Ok(())
4378 }
4379 }
4380
4381 unsafe impl<'a, ___E>
4382 ::fidl_next::EncodeOption<
4383 ::fidl_next::wire::Box<'static, crate::wire::NodeGetFlagsResponse>,
4384 ___E,
4385 > for &'a NodeGetFlagsResponse
4386 where
4387 ___E: ::fidl_next::Encoder + ?Sized,
4388 &'a NodeGetFlagsResponse: ::fidl_next::Encode<crate::wire::NodeGetFlagsResponse, ___E>,
4389 {
4390 #[inline]
4391 fn encode_option(
4392 this: ::core::option::Option<Self>,
4393 encoder: &mut ___E,
4394 out: &mut ::core::mem::MaybeUninit<
4395 ::fidl_next::wire::Box<'static, crate::wire::NodeGetFlagsResponse>,
4396 >,
4397 _: (),
4398 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4399 if let Some(inner) = this {
4400 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4401 ::fidl_next::wire::Box::encode_present(out);
4402 } else {
4403 ::fidl_next::wire::Box::encode_absent(out);
4404 }
4405
4406 Ok(())
4407 }
4408 }
4409
4410 impl ::fidl_next::FromWire<crate::wire::NodeGetFlagsResponse> for NodeGetFlagsResponse {
4411 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4412 crate::wire::NodeGetFlagsResponse,
4413 Self,
4414 > = unsafe {
4415 ::fidl_next::CopyOptimization::enable_if(
4416 true
4417
4418 && <
4419 crate::natural::Flags as ::fidl_next::FromWire<crate::wire::Flags>
4420 >::COPY_OPTIMIZATION.is_enabled()
4421
4422 )
4423 };
4424
4425 #[inline]
4426 fn from_wire(wire: crate::wire::NodeGetFlagsResponse) -> Self {
4427 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
4428 }
4429 }
4430
4431 impl ::fidl_next::FromWireRef<crate::wire::NodeGetFlagsResponse> for NodeGetFlagsResponse {
4432 #[inline]
4433 fn from_wire_ref(wire: &crate::wire::NodeGetFlagsResponse) -> Self {
4434 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
4435 }
4436 }
4437
4438 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4439 #[repr(C)]
4440 pub struct NodeSetFlagsRequest {
4441 pub flags: crate::natural::Flags,
4442 }
4443
4444 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeSetFlagsRequest, ___E>
4445 for NodeSetFlagsRequest
4446 where
4447 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4448 {
4449 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4450 Self,
4451 crate::wire::NodeSetFlagsRequest,
4452 > = unsafe {
4453 ::fidl_next::CopyOptimization::enable_if(
4454 true
4455
4456 && <
4457 crate::natural::Flags as ::fidl_next::Encode<crate::wire::Flags, ___E>
4458 >::COPY_OPTIMIZATION.is_enabled()
4459
4460 )
4461 };
4462
4463 #[inline]
4464 fn encode(
4465 self,
4466 encoder_: &mut ___E,
4467 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetFlagsRequest>,
4468 _: (),
4469 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4470 ::fidl_next::munge! {
4471 let crate::wire::NodeSetFlagsRequest {
4472 flags,
4473
4474 } = out_;
4475 }
4476
4477 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
4478
4479 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4480
4481 Ok(())
4482 }
4483 }
4484
4485 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeSetFlagsRequest, ___E>
4486 for &'a NodeSetFlagsRequest
4487 where
4488 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4489 {
4490 #[inline]
4491 fn encode(
4492 self,
4493 encoder_: &mut ___E,
4494 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetFlagsRequest>,
4495 _: (),
4496 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4497 ::fidl_next::munge! {
4498 let crate::wire::NodeSetFlagsRequest {
4499 flags,
4500
4501 } = out_;
4502 }
4503
4504 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
4505
4506 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4507
4508 Ok(())
4509 }
4510 }
4511
4512 unsafe impl<___E>
4513 ::fidl_next::EncodeOption<
4514 ::fidl_next::wire::Box<'static, crate::wire::NodeSetFlagsRequest>,
4515 ___E,
4516 > for NodeSetFlagsRequest
4517 where
4518 ___E: ::fidl_next::Encoder + ?Sized,
4519 NodeSetFlagsRequest: ::fidl_next::Encode<crate::wire::NodeSetFlagsRequest, ___E>,
4520 {
4521 #[inline]
4522 fn encode_option(
4523 this: ::core::option::Option<Self>,
4524 encoder: &mut ___E,
4525 out: &mut ::core::mem::MaybeUninit<
4526 ::fidl_next::wire::Box<'static, crate::wire::NodeSetFlagsRequest>,
4527 >,
4528 _: (),
4529 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4530 if let Some(inner) = this {
4531 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4532 ::fidl_next::wire::Box::encode_present(out);
4533 } else {
4534 ::fidl_next::wire::Box::encode_absent(out);
4535 }
4536
4537 Ok(())
4538 }
4539 }
4540
4541 unsafe impl<'a, ___E>
4542 ::fidl_next::EncodeOption<
4543 ::fidl_next::wire::Box<'static, crate::wire::NodeSetFlagsRequest>,
4544 ___E,
4545 > for &'a NodeSetFlagsRequest
4546 where
4547 ___E: ::fidl_next::Encoder + ?Sized,
4548 &'a NodeSetFlagsRequest: ::fidl_next::Encode<crate::wire::NodeSetFlagsRequest, ___E>,
4549 {
4550 #[inline]
4551 fn encode_option(
4552 this: ::core::option::Option<Self>,
4553 encoder: &mut ___E,
4554 out: &mut ::core::mem::MaybeUninit<
4555 ::fidl_next::wire::Box<'static, crate::wire::NodeSetFlagsRequest>,
4556 >,
4557 _: (),
4558 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4559 if let Some(inner) = this {
4560 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4561 ::fidl_next::wire::Box::encode_present(out);
4562 } else {
4563 ::fidl_next::wire::Box::encode_absent(out);
4564 }
4565
4566 Ok(())
4567 }
4568 }
4569
4570 impl ::fidl_next::FromWire<crate::wire::NodeSetFlagsRequest> for NodeSetFlagsRequest {
4571 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4572 crate::wire::NodeSetFlagsRequest,
4573 Self,
4574 > = unsafe {
4575 ::fidl_next::CopyOptimization::enable_if(
4576 true
4577
4578 && <
4579 crate::natural::Flags as ::fidl_next::FromWire<crate::wire::Flags>
4580 >::COPY_OPTIMIZATION.is_enabled()
4581
4582 )
4583 };
4584
4585 #[inline]
4586 fn from_wire(wire: crate::wire::NodeSetFlagsRequest) -> Self {
4587 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
4588 }
4589 }
4590
4591 impl ::fidl_next::FromWireRef<crate::wire::NodeSetFlagsRequest> for NodeSetFlagsRequest {
4592 #[inline]
4593 fn from_wire_ref(wire: &crate::wire::NodeSetFlagsRequest) -> Self {
4594 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
4595 }
4596 }
4597
4598 #[doc = " Used in places where empty structs are needed, such as empty union members, to avoid creating\n new struct types.\n"]
4599 pub type EmptyStruct = ();
4600
4601 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4602 pub enum SelinuxContext {
4603 Data(::std::vec::Vec<u8>),
4604
4605 UseExtendedAttributes(crate::natural::EmptyStruct),
4606
4607 UnknownOrdinal_(u64),
4608 }
4609
4610 impl SelinuxContext {
4611 pub fn is_unknown(&self) -> bool {
4612 #[allow(unreachable_patterns)]
4613 match self {
4614 Self::UnknownOrdinal_(_) => true,
4615 _ => false,
4616 }
4617 }
4618 }
4619
4620 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelinuxContext<'static>, ___E> for SelinuxContext
4621 where
4622 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4623 ___E: ::fidl_next::Encoder,
4624 {
4625 #[inline]
4626 fn encode(
4627 self,
4628 encoder: &mut ___E,
4629 out: &mut ::core::mem::MaybeUninit<crate::wire::SelinuxContext<'static>>,
4630 _: (),
4631 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4632 ::fidl_next::munge!(let crate::wire::SelinuxContext { raw, _phantom: _ } = out);
4633
4634 match self {
4635 Self::Data(value) => ::fidl_next::wire::Union::encode_as::<
4636 ___E,
4637 ::fidl_next::wire::Vector<'static, u8>,
4638 >(value, 1, encoder, raw, (256, ()))?,
4639
4640 Self::UseExtendedAttributes(value) => ::fidl_next::wire::Union::encode_as::<
4641 ___E,
4642 crate::wire::EmptyStruct,
4643 >(value, 2, encoder, raw, ())?,
4644
4645 Self::UnknownOrdinal_(ordinal) => {
4646 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4647 }
4648 }
4649
4650 Ok(())
4651 }
4652 }
4653
4654 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SelinuxContext<'static>, ___E>
4655 for &'a SelinuxContext
4656 where
4657 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4658 ___E: ::fidl_next::Encoder,
4659 {
4660 #[inline]
4661 fn encode(
4662 self,
4663 encoder: &mut ___E,
4664 out: &mut ::core::mem::MaybeUninit<crate::wire::SelinuxContext<'static>>,
4665 _: (),
4666 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4667 ::fidl_next::munge!(let crate::wire::SelinuxContext { raw, _phantom: _ } = out);
4668
4669 match self {
4670 SelinuxContext::Data(value) => ::fidl_next::wire::Union::encode_as::<
4671 ___E,
4672 ::fidl_next::wire::Vector<'static, u8>,
4673 >(value, 1, encoder, raw, (256, ()))?,
4674
4675 SelinuxContext::UseExtendedAttributes(value) => {
4676 ::fidl_next::wire::Union::encode_as::<___E, crate::wire::EmptyStruct>(
4677 value,
4678 2,
4679 encoder,
4680 raw,
4681 (),
4682 )?
4683 }
4684
4685 SelinuxContext::UnknownOrdinal_(ordinal) => {
4686 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4687 }
4688 }
4689
4690 Ok(())
4691 }
4692 }
4693
4694 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::SelinuxContext<'static>, ___E>
4695 for SelinuxContext
4696 where
4697 ___E: ?Sized,
4698 SelinuxContext: ::fidl_next::Encode<crate::wire::SelinuxContext<'static>, ___E>,
4699 {
4700 #[inline]
4701 fn encode_option(
4702 this: ::core::option::Option<Self>,
4703 encoder: &mut ___E,
4704 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SelinuxContext<'static>>,
4705 _: (),
4706 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4707 ::fidl_next::munge!(let crate::wire_optional::SelinuxContext { raw, _phantom: _ } = &mut *out);
4708
4709 if let Some(inner) = this {
4710 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4711 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4712 } else {
4713 ::fidl_next::wire::Union::encode_absent(raw);
4714 }
4715
4716 Ok(())
4717 }
4718 }
4719
4720 unsafe impl<'a, ___E>
4721 ::fidl_next::EncodeOption<crate::wire_optional::SelinuxContext<'static>, ___E>
4722 for &'a SelinuxContext
4723 where
4724 ___E: ?Sized,
4725 &'a SelinuxContext: ::fidl_next::Encode<crate::wire::SelinuxContext<'static>, ___E>,
4726 {
4727 #[inline]
4728 fn encode_option(
4729 this: ::core::option::Option<Self>,
4730 encoder: &mut ___E,
4731 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SelinuxContext<'static>>,
4732 _: (),
4733 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4734 ::fidl_next::munge!(let crate::wire_optional::SelinuxContext { raw, _phantom: _ } = &mut *out);
4735
4736 if let Some(inner) = this {
4737 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4738 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4739 } else {
4740 ::fidl_next::wire::Union::encode_absent(raw);
4741 }
4742
4743 Ok(())
4744 }
4745 }
4746
4747 impl<'de> ::fidl_next::FromWire<crate::wire::SelinuxContext<'de>> for SelinuxContext {
4748 #[inline]
4749 fn from_wire(wire: crate::wire::SelinuxContext<'de>) -> Self {
4750 let wire = ::core::mem::ManuallyDrop::new(wire);
4751 match wire.raw.ordinal() {
4752 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
4753 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
4754 })),
4755
4756 2 => Self::UseExtendedAttributes(::fidl_next::FromWire::from_wire(unsafe {
4757 wire.raw.get().read_unchecked::<crate::wire::EmptyStruct>()
4758 })),
4759
4760 ord => return Self::UnknownOrdinal_(ord as u64),
4761 }
4762 }
4763 }
4764
4765 impl<'de> ::fidl_next::FromWireRef<crate::wire::SelinuxContext<'de>> for SelinuxContext {
4766 #[inline]
4767 fn from_wire_ref(wire: &crate::wire::SelinuxContext<'de>) -> Self {
4768 match wire.raw.ordinal() {
4769 1 => Self::Data(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4770 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
4771 })),
4772
4773 2 => Self::UseExtendedAttributes(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4774 wire.raw.get().deref_unchecked::<crate::wire::EmptyStruct>()
4775 })),
4776
4777 ord => return Self::UnknownOrdinal_(ord as u64),
4778 }
4779 }
4780 }
4781
4782 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SelinuxContext<'de>>
4783 for SelinuxContext
4784 {
4785 #[inline]
4786 fn from_wire_option(
4787 wire: crate::wire_optional::SelinuxContext<'de>,
4788 ) -> ::core::option::Option<Self> {
4789 if let Some(inner) = wire.into_option() {
4790 Some(::fidl_next::FromWire::from_wire(inner))
4791 } else {
4792 None
4793 }
4794 }
4795 }
4796
4797 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SelinuxContext<'de>>
4798 for Box<SelinuxContext>
4799 {
4800 #[inline]
4801 fn from_wire_option(
4802 wire: crate::wire_optional::SelinuxContext<'de>,
4803 ) -> ::core::option::Option<Self> {
4804 <SelinuxContext as ::fidl_next::FromWireOption<
4805 crate::wire_optional::SelinuxContext<'de>,
4806 >>::from_wire_option(wire)
4807 .map(Box::new)
4808 }
4809 }
4810
4811 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::SelinuxContext<'de>>
4812 for Box<SelinuxContext>
4813 {
4814 #[inline]
4815 fn from_wire_option_ref(
4816 wire: &crate::wire_optional::SelinuxContext<'de>,
4817 ) -> ::core::option::Option<Self> {
4818 if let Some(inner) = wire.as_ref() {
4819 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4820 } else {
4821 None
4822 }
4823 }
4824 }
4825
4826 ::fidl_next::bitflags::bitflags! {
4827 #[doc = " Flags configuring an fscrypt encryption policy.\n\n These flags are byte-compatible with the Linux fscrypt UAPI: each member has the same value as\n the corresponding `FSCRYPT_POLICY_FLAG*` constant in `<linux/fscrypt.h>`, so the `flags` field\n of a Linux `fscrypt_policy_v2` can be converted to and from this type without translation.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct FscryptPolicyFlags: u8 {
4828 #[doc = " Pad encrypted filenames to 8-byte boundaries (when neither PAD_8 nor PAD_16 is set,\n filenames are padded to 4-byte boundaries; when both PAD_8 and PAD_16 are set, filenames\n are padded to 32-byte boundaries).\n"]const PAD_8 = 1;
4829 #[doc = " Pad encrypted filenames to 16-byte boundaries.\n"]const PAD_16 = 2;
4830 #[doc = " Use direct key mode.\n"]const DIRECT_KEY = 4;
4831 #[doc = " Derive IVs/DUNs by hashing the inode number and combining with the 64-bit logical block\n number (`FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64`).\n"]const IV_INO_LBLK_64 = 8;
4832 #[doc = " Derive IVs/DUNs by hashing the main key and inode number and adding the 32-bit logical\n block number (`FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32`).\n"]const IV_INO_LBLK_32 = 16;
4833 const _ = !0;
4834 }
4835 }
4836
4837 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FscryptPolicyFlags, ___E> for FscryptPolicyFlags
4838 where
4839 ___E: ?Sized,
4840 {
4841 #[inline]
4842 fn encode(
4843 self,
4844 encoder: &mut ___E,
4845 out: &mut ::core::mem::MaybeUninit<crate::wire::FscryptPolicyFlags>,
4846 _: (),
4847 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4848 ::fidl_next::Encode::encode(&self, encoder, out, ())
4849 }
4850 }
4851
4852 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FscryptPolicyFlags, ___E>
4853 for &'a FscryptPolicyFlags
4854 where
4855 ___E: ?Sized,
4856 {
4857 #[inline]
4858 fn encode(
4859 self,
4860 _: &mut ___E,
4861 out: &mut ::core::mem::MaybeUninit<crate::wire::FscryptPolicyFlags>,
4862 _: (),
4863 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4864 ::fidl_next::munge!(let crate::wire::FscryptPolicyFlags { value } = out);
4865
4866 let _ = value.write(u8::from(self.bits()));
4867 Ok(())
4868 }
4869 }
4870
4871 impl ::core::convert::From<crate::wire::FscryptPolicyFlags> for FscryptPolicyFlags {
4872 fn from(wire: crate::wire::FscryptPolicyFlags) -> Self {
4873 Self::from_bits_retain(u8::from(wire.value))
4874 }
4875 }
4876
4877 impl ::fidl_next::FromWire<crate::wire::FscryptPolicyFlags> for FscryptPolicyFlags {
4878 #[inline]
4879 fn from_wire(wire: crate::wire::FscryptPolicyFlags) -> Self {
4880 Self::from(wire)
4881 }
4882 }
4883
4884 impl ::fidl_next::FromWireRef<crate::wire::FscryptPolicyFlags> for FscryptPolicyFlags {
4885 #[inline]
4886 fn from_wire_ref(wire: &crate::wire::FscryptPolicyFlags) -> Self {
4887 Self::from(*wire)
4888 }
4889 }
4890
4891 #[doc = " Fscrypt encryption policy associated with an encrypted directory or file.\n"]
4892 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4893 #[repr(C)]
4894 pub struct FscryptPolicy {
4895 pub key_identifier: [u8; 16],
4896
4897 pub flags: crate::natural::FscryptPolicyFlags,
4898 }
4899
4900 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FscryptPolicy, ___E> for FscryptPolicy
4901 where
4902 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4903 {
4904 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::FscryptPolicy> = unsafe {
4905 ::fidl_next::CopyOptimization::enable_if(
4906 true && <[u8; 16] as ::fidl_next::Encode<[u8; 16], ___E>>::COPY_OPTIMIZATION
4907 .is_enabled()
4908 && <crate::natural::FscryptPolicyFlags as ::fidl_next::Encode<
4909 crate::wire::FscryptPolicyFlags,
4910 ___E,
4911 >>::COPY_OPTIMIZATION
4912 .is_enabled(),
4913 )
4914 };
4915
4916 #[inline]
4917 fn encode(
4918 self,
4919 encoder_: &mut ___E,
4920 out_: &mut ::core::mem::MaybeUninit<crate::wire::FscryptPolicy>,
4921 _: (),
4922 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4923 ::fidl_next::munge! {
4924 let crate::wire::FscryptPolicy {
4925 key_identifier,
4926 flags,
4927
4928 } = out_;
4929 }
4930
4931 ::fidl_next::Encode::encode(self.key_identifier, encoder_, key_identifier, ())?;
4932
4933 let mut _field =
4934 unsafe { ::fidl_next::Slot::new_unchecked(key_identifier.as_mut_ptr()) };
4935
4936 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
4937
4938 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4939
4940 Ok(())
4941 }
4942 }
4943
4944 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FscryptPolicy, ___E> for &'a FscryptPolicy
4945 where
4946 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4947 {
4948 #[inline]
4949 fn encode(
4950 self,
4951 encoder_: &mut ___E,
4952 out_: &mut ::core::mem::MaybeUninit<crate::wire::FscryptPolicy>,
4953 _: (),
4954 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4955 ::fidl_next::munge! {
4956 let crate::wire::FscryptPolicy {
4957 key_identifier,
4958 flags,
4959
4960 } = out_;
4961 }
4962
4963 ::fidl_next::Encode::encode(&self.key_identifier, encoder_, key_identifier, ())?;
4964
4965 let mut _field =
4966 unsafe { ::fidl_next::Slot::new_unchecked(key_identifier.as_mut_ptr()) };
4967
4968 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
4969
4970 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
4971
4972 Ok(())
4973 }
4974 }
4975
4976 unsafe impl<___E>
4977 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::FscryptPolicy>, ___E>
4978 for FscryptPolicy
4979 where
4980 ___E: ::fidl_next::Encoder + ?Sized,
4981 FscryptPolicy: ::fidl_next::Encode<crate::wire::FscryptPolicy, ___E>,
4982 {
4983 #[inline]
4984 fn encode_option(
4985 this: ::core::option::Option<Self>,
4986 encoder: &mut ___E,
4987 out: &mut ::core::mem::MaybeUninit<
4988 ::fidl_next::wire::Box<'static, crate::wire::FscryptPolicy>,
4989 >,
4990 _: (),
4991 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4992 if let Some(inner) = this {
4993 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4994 ::fidl_next::wire::Box::encode_present(out);
4995 } else {
4996 ::fidl_next::wire::Box::encode_absent(out);
4997 }
4998
4999 Ok(())
5000 }
5001 }
5002
5003 unsafe impl<'a, ___E>
5004 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::FscryptPolicy>, ___E>
5005 for &'a FscryptPolicy
5006 where
5007 ___E: ::fidl_next::Encoder + ?Sized,
5008 &'a FscryptPolicy: ::fidl_next::Encode<crate::wire::FscryptPolicy, ___E>,
5009 {
5010 #[inline]
5011 fn encode_option(
5012 this: ::core::option::Option<Self>,
5013 encoder: &mut ___E,
5014 out: &mut ::core::mem::MaybeUninit<
5015 ::fidl_next::wire::Box<'static, crate::wire::FscryptPolicy>,
5016 >,
5017 _: (),
5018 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5019 if let Some(inner) = this {
5020 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5021 ::fidl_next::wire::Box::encode_present(out);
5022 } else {
5023 ::fidl_next::wire::Box::encode_absent(out);
5024 }
5025
5026 Ok(())
5027 }
5028 }
5029
5030 impl ::fidl_next::FromWire<crate::wire::FscryptPolicy> for FscryptPolicy {
5031 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::FscryptPolicy, Self> = unsafe {
5032 ::fidl_next::CopyOptimization::enable_if(
5033 true && <[u8; 16] as ::fidl_next::FromWire<[u8; 16]>>::COPY_OPTIMIZATION
5034 .is_enabled()
5035 && <crate::natural::FscryptPolicyFlags as ::fidl_next::FromWire<
5036 crate::wire::FscryptPolicyFlags,
5037 >>::COPY_OPTIMIZATION
5038 .is_enabled(),
5039 )
5040 };
5041
5042 #[inline]
5043 fn from_wire(wire: crate::wire::FscryptPolicy) -> Self {
5044 Self {
5045 key_identifier: ::fidl_next::FromWire::from_wire(wire.key_identifier),
5046
5047 flags: ::fidl_next::FromWire::from_wire(wire.flags),
5048 }
5049 }
5050 }
5051
5052 impl ::fidl_next::FromWireRef<crate::wire::FscryptPolicy> for FscryptPolicy {
5053 #[inline]
5054 fn from_wire_ref(wire: &crate::wire::FscryptPolicy) -> Self {
5055 Self {
5056 key_identifier: ::fidl_next::FromWireRef::from_wire_ref(&wire.key_identifier),
5057
5058 flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags),
5059 }
5060 }
5061 }
5062
5063 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5064 pub struct MutableNodeAttributes {
5065 pub creation_time: ::core::option::Option<u64>,
5066
5067 pub modification_time: ::core::option::Option<u64>,
5068
5069 pub mode: ::core::option::Option<u32>,
5070
5071 pub uid: ::core::option::Option<u32>,
5072
5073 pub gid: ::core::option::Option<u32>,
5074
5075 pub rdev: ::core::option::Option<u64>,
5076
5077 pub access_time: ::core::option::Option<u64>,
5078
5079 pub casefold: ::core::option::Option<bool>,
5080
5081 pub selinux_context: ::core::option::Option<crate::natural::SelinuxContext>,
5082
5083 pub encryption_policy: ::core::option::Option<crate::natural::FscryptPolicy>,
5084 }
5085
5086 impl MutableNodeAttributes {
5087 fn __max_ordinal(&self) -> usize {
5088 if self.encryption_policy.is_some() {
5089 return 10;
5090 }
5091
5092 if self.selinux_context.is_some() {
5093 return 9;
5094 }
5095
5096 if self.casefold.is_some() {
5097 return 8;
5098 }
5099
5100 if self.access_time.is_some() {
5101 return 7;
5102 }
5103
5104 if self.rdev.is_some() {
5105 return 6;
5106 }
5107
5108 if self.gid.is_some() {
5109 return 5;
5110 }
5111
5112 if self.uid.is_some() {
5113 return 4;
5114 }
5115
5116 if self.mode.is_some() {
5117 return 3;
5118 }
5119
5120 if self.modification_time.is_some() {
5121 return 2;
5122 }
5123
5124 if self.creation_time.is_some() {
5125 return 1;
5126 }
5127
5128 0
5129 }
5130 }
5131
5132 unsafe impl<___E> ::fidl_next::Encode<crate::wire::MutableNodeAttributes<'static>, ___E>
5133 for MutableNodeAttributes
5134 where
5135 ___E: ::fidl_next::Encoder + ?Sized,
5136 {
5137 #[inline]
5138 fn encode(
5139 mut self,
5140 encoder: &mut ___E,
5141 out: &mut ::core::mem::MaybeUninit<crate::wire::MutableNodeAttributes<'static>>,
5142 _: (),
5143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5144 ::fidl_next::munge!(let crate::wire::MutableNodeAttributes { table } = out);
5145
5146 let max_ord = self.__max_ordinal();
5147
5148 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5149 ::fidl_next::Wire::zero_padding(&mut out);
5150
5151 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5152 ::fidl_next::wire::Envelope,
5153 >(encoder, max_ord);
5154
5155 for i in 1..=max_ord {
5156 match i {
5157 10 => {
5158 if let Some(value) = self.encryption_policy.take() {
5159 ::fidl_next::wire::Envelope::encode_value::<
5160 crate::wire::FscryptPolicy,
5161 ___E,
5162 >(
5163 value, preallocated.encoder, &mut out, ()
5164 )?;
5165 } else {
5166 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5167 }
5168 }
5169
5170 9 => {
5171 if let Some(value) = self.selinux_context.take() {
5172 ::fidl_next::wire::Envelope::encode_value::<
5173 crate::wire::SelinuxContext<'static>,
5174 ___E,
5175 >(
5176 value, preallocated.encoder, &mut out, ()
5177 )?;
5178 } else {
5179 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5180 }
5181 }
5182
5183 8 => {
5184 if let Some(value) = self.casefold.take() {
5185 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5186 value,
5187 preallocated.encoder,
5188 &mut out,
5189 (),
5190 )?;
5191 } else {
5192 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5193 }
5194 }
5195
5196 7 => {
5197 if let Some(value) = self.access_time.take() {
5198 ::fidl_next::wire::Envelope::encode_value::<
5199 ::fidl_next::wire::Uint64,
5200 ___E,
5201 >(
5202 value, preallocated.encoder, &mut out, ()
5203 )?;
5204 } else {
5205 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5206 }
5207 }
5208
5209 6 => {
5210 if let Some(value) = self.rdev.take() {
5211 ::fidl_next::wire::Envelope::encode_value::<
5212 ::fidl_next::wire::Uint64,
5213 ___E,
5214 >(
5215 value, preallocated.encoder, &mut out, ()
5216 )?;
5217 } else {
5218 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5219 }
5220 }
5221
5222 5 => {
5223 if let Some(value) = self.gid.take() {
5224 ::fidl_next::wire::Envelope::encode_value::<
5225 ::fidl_next::wire::Uint32,
5226 ___E,
5227 >(
5228 value, preallocated.encoder, &mut out, ()
5229 )?;
5230 } else {
5231 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5232 }
5233 }
5234
5235 4 => {
5236 if let Some(value) = self.uid.take() {
5237 ::fidl_next::wire::Envelope::encode_value::<
5238 ::fidl_next::wire::Uint32,
5239 ___E,
5240 >(
5241 value, preallocated.encoder, &mut out, ()
5242 )?;
5243 } else {
5244 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5245 }
5246 }
5247
5248 3 => {
5249 if let Some(value) = self.mode.take() {
5250 ::fidl_next::wire::Envelope::encode_value::<
5251 ::fidl_next::wire::Uint32,
5252 ___E,
5253 >(
5254 value, preallocated.encoder, &mut out, ()
5255 )?;
5256 } else {
5257 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5258 }
5259 }
5260
5261 2 => {
5262 if let Some(value) = self.modification_time.take() {
5263 ::fidl_next::wire::Envelope::encode_value::<
5264 ::fidl_next::wire::Uint64,
5265 ___E,
5266 >(
5267 value, preallocated.encoder, &mut out, ()
5268 )?;
5269 } else {
5270 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5271 }
5272 }
5273
5274 1 => {
5275 if let Some(value) = self.creation_time.take() {
5276 ::fidl_next::wire::Envelope::encode_value::<
5277 ::fidl_next::wire::Uint64,
5278 ___E,
5279 >(
5280 value, preallocated.encoder, &mut out, ()
5281 )?;
5282 } else {
5283 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5284 }
5285 }
5286
5287 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5288 }
5289 unsafe {
5290 preallocated.write_next(out.assume_init_ref());
5291 }
5292 }
5293
5294 ::fidl_next::wire::Table::encode_len(table, max_ord);
5295
5296 Ok(())
5297 }
5298 }
5299
5300 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::MutableNodeAttributes<'static>, ___E>
5301 for &'a MutableNodeAttributes
5302 where
5303 ___E: ::fidl_next::Encoder + ?Sized,
5304 {
5305 #[inline]
5306 fn encode(
5307 self,
5308 encoder: &mut ___E,
5309 out: &mut ::core::mem::MaybeUninit<crate::wire::MutableNodeAttributes<'static>>,
5310 _: (),
5311 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5312 ::fidl_next::munge!(let crate::wire::MutableNodeAttributes { table } = out);
5313
5314 let max_ord = self.__max_ordinal();
5315
5316 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5317 ::fidl_next::Wire::zero_padding(&mut out);
5318
5319 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5320 ::fidl_next::wire::Envelope,
5321 >(encoder, max_ord);
5322
5323 for i in 1..=max_ord {
5324 match i {
5325 10 => {
5326 if let Some(value) = &self.encryption_policy {
5327 ::fidl_next::wire::Envelope::encode_value::<
5328 crate::wire::FscryptPolicy,
5329 ___E,
5330 >(
5331 value, preallocated.encoder, &mut out, ()
5332 )?;
5333 } else {
5334 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5335 }
5336 }
5337
5338 9 => {
5339 if let Some(value) = &self.selinux_context {
5340 ::fidl_next::wire::Envelope::encode_value::<
5341 crate::wire::SelinuxContext<'static>,
5342 ___E,
5343 >(
5344 value, preallocated.encoder, &mut out, ()
5345 )?;
5346 } else {
5347 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5348 }
5349 }
5350
5351 8 => {
5352 if let Some(value) = &self.casefold {
5353 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5354 value,
5355 preallocated.encoder,
5356 &mut out,
5357 (),
5358 )?;
5359 } else {
5360 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5361 }
5362 }
5363
5364 7 => {
5365 if let Some(value) = &self.access_time {
5366 ::fidl_next::wire::Envelope::encode_value::<
5367 ::fidl_next::wire::Uint64,
5368 ___E,
5369 >(
5370 value, preallocated.encoder, &mut out, ()
5371 )?;
5372 } else {
5373 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5374 }
5375 }
5376
5377 6 => {
5378 if let Some(value) = &self.rdev {
5379 ::fidl_next::wire::Envelope::encode_value::<
5380 ::fidl_next::wire::Uint64,
5381 ___E,
5382 >(
5383 value, preallocated.encoder, &mut out, ()
5384 )?;
5385 } else {
5386 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5387 }
5388 }
5389
5390 5 => {
5391 if let Some(value) = &self.gid {
5392 ::fidl_next::wire::Envelope::encode_value::<
5393 ::fidl_next::wire::Uint32,
5394 ___E,
5395 >(
5396 value, preallocated.encoder, &mut out, ()
5397 )?;
5398 } else {
5399 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5400 }
5401 }
5402
5403 4 => {
5404 if let Some(value) = &self.uid {
5405 ::fidl_next::wire::Envelope::encode_value::<
5406 ::fidl_next::wire::Uint32,
5407 ___E,
5408 >(
5409 value, preallocated.encoder, &mut out, ()
5410 )?;
5411 } else {
5412 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5413 }
5414 }
5415
5416 3 => {
5417 if let Some(value) = &self.mode {
5418 ::fidl_next::wire::Envelope::encode_value::<
5419 ::fidl_next::wire::Uint32,
5420 ___E,
5421 >(
5422 value, preallocated.encoder, &mut out, ()
5423 )?;
5424 } else {
5425 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5426 }
5427 }
5428
5429 2 => {
5430 if let Some(value) = &self.modification_time {
5431 ::fidl_next::wire::Envelope::encode_value::<
5432 ::fidl_next::wire::Uint64,
5433 ___E,
5434 >(
5435 value, preallocated.encoder, &mut out, ()
5436 )?;
5437 } else {
5438 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5439 }
5440 }
5441
5442 1 => {
5443 if let Some(value) = &self.creation_time {
5444 ::fidl_next::wire::Envelope::encode_value::<
5445 ::fidl_next::wire::Uint64,
5446 ___E,
5447 >(
5448 value, preallocated.encoder, &mut out, ()
5449 )?;
5450 } else {
5451 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5452 }
5453 }
5454
5455 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5456 }
5457 unsafe {
5458 preallocated.write_next(out.assume_init_ref());
5459 }
5460 }
5461
5462 ::fidl_next::wire::Table::encode_len(table, max_ord);
5463
5464 Ok(())
5465 }
5466 }
5467
5468 impl<'de> ::fidl_next::FromWire<crate::wire::MutableNodeAttributes<'de>> for MutableNodeAttributes {
5469 #[inline]
5470 fn from_wire(wire_: crate::wire::MutableNodeAttributes<'de>) -> Self {
5471 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5472
5473 let creation_time = wire_.table.get(1);
5474
5475 let modification_time = wire_.table.get(2);
5476
5477 let mode = wire_.table.get(3);
5478
5479 let uid = wire_.table.get(4);
5480
5481 let gid = wire_.table.get(5);
5482
5483 let rdev = wire_.table.get(6);
5484
5485 let access_time = wire_.table.get(7);
5486
5487 let casefold = wire_.table.get(8);
5488
5489 let selinux_context = wire_.table.get(9);
5490
5491 let encryption_policy = wire_.table.get(10);
5492
5493 Self {
5494 creation_time: creation_time.map(|envelope| {
5495 ::fidl_next::FromWire::from_wire(unsafe {
5496 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
5497 })
5498 }),
5499
5500 modification_time: modification_time.map(|envelope| {
5501 ::fidl_next::FromWire::from_wire(unsafe {
5502 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
5503 })
5504 }),
5505
5506 mode: mode.map(|envelope| {
5507 ::fidl_next::FromWire::from_wire(unsafe {
5508 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
5509 })
5510 }),
5511
5512 uid: uid.map(|envelope| {
5513 ::fidl_next::FromWire::from_wire(unsafe {
5514 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
5515 })
5516 }),
5517
5518 gid: gid.map(|envelope| {
5519 ::fidl_next::FromWire::from_wire(unsafe {
5520 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
5521 })
5522 }),
5523
5524 rdev: rdev.map(|envelope| {
5525 ::fidl_next::FromWire::from_wire(unsafe {
5526 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
5527 })
5528 }),
5529
5530 access_time: access_time.map(|envelope| {
5531 ::fidl_next::FromWire::from_wire(unsafe {
5532 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
5533 })
5534 }),
5535
5536 casefold: casefold.map(|envelope| {
5537 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
5538 }),
5539
5540 selinux_context: selinux_context.map(|envelope| {
5541 ::fidl_next::FromWire::from_wire(unsafe {
5542 envelope.read_unchecked::<crate::wire::SelinuxContext<'de>>()
5543 })
5544 }),
5545
5546 encryption_policy: encryption_policy.map(|envelope| {
5547 ::fidl_next::FromWire::from_wire(unsafe {
5548 envelope.read_unchecked::<crate::wire::FscryptPolicy>()
5549 })
5550 }),
5551 }
5552 }
5553 }
5554
5555 impl<'de> ::fidl_next::FromWireRef<crate::wire::MutableNodeAttributes<'de>>
5556 for MutableNodeAttributes
5557 {
5558 #[inline]
5559 fn from_wire_ref(wire: &crate::wire::MutableNodeAttributes<'de>) -> Self {
5560 Self {
5561 creation_time: wire.table.get(1).map(|envelope| {
5562 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5563 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
5564 })
5565 }),
5566
5567 modification_time: wire.table.get(2).map(|envelope| {
5568 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5569 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
5570 })
5571 }),
5572
5573 mode: wire.table.get(3).map(|envelope| {
5574 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5575 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
5576 })
5577 }),
5578
5579 uid: wire.table.get(4).map(|envelope| {
5580 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5581 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
5582 })
5583 }),
5584
5585 gid: wire.table.get(5).map(|envelope| {
5586 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5587 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
5588 })
5589 }),
5590
5591 rdev: wire.table.get(6).map(|envelope| {
5592 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5593 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
5594 })
5595 }),
5596
5597 access_time: wire.table.get(7).map(|envelope| {
5598 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5599 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
5600 })
5601 }),
5602
5603 casefold: wire.table.get(8).map(|envelope| {
5604 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5605 envelope.deref_unchecked::<bool>()
5606 })
5607 }),
5608
5609 selinux_context: wire.table.get(9).map(|envelope| {
5610 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5611 envelope.deref_unchecked::<crate::wire::SelinuxContext<'de>>()
5612 })
5613 }),
5614
5615 encryption_policy: wire.table.get(10).map(|envelope| {
5616 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5617 envelope.deref_unchecked::<crate::wire::FscryptPolicy>()
5618 })
5619 }),
5620 }
5621 }
5622 }
5623
5624 ::fidl_next::bitflags::bitflags! {
5625 #[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(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct NodeProtocolKinds: u64 {
5626 #[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;
5627 #[doc = " The directory representation of a node.\n\n The connection will speak the [`Directory`] protocol.\n"]const DIRECTORY = 2;
5628 #[doc = " The file representation of a node.\n\n The connection will speak the [`File`] protocol.\n"]const FILE = 4;
5629 #[doc = " The symlink representation of a node.\n\n The connection will speak the [`Symlink`] protocol.\n"]const SYMLINK = 8;
5630 const _ = !0;
5631 }
5632 }
5633
5634 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeProtocolKinds, ___E> for NodeProtocolKinds
5635 where
5636 ___E: ?Sized,
5637 {
5638 #[inline]
5639 fn encode(
5640 self,
5641 encoder: &mut ___E,
5642 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeProtocolKinds>,
5643 _: (),
5644 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5645 ::fidl_next::Encode::encode(&self, encoder, out, ())
5646 }
5647 }
5648
5649 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeProtocolKinds, ___E>
5650 for &'a NodeProtocolKinds
5651 where
5652 ___E: ?Sized,
5653 {
5654 #[inline]
5655 fn encode(
5656 self,
5657 _: &mut ___E,
5658 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeProtocolKinds>,
5659 _: (),
5660 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5661 ::fidl_next::munge!(let crate::wire::NodeProtocolKinds { value } = out);
5662
5663 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
5664 Ok(())
5665 }
5666 }
5667
5668 impl ::core::convert::From<crate::wire::NodeProtocolKinds> for NodeProtocolKinds {
5669 fn from(wire: crate::wire::NodeProtocolKinds) -> Self {
5670 Self::from_bits_retain(u64::from(wire.value))
5671 }
5672 }
5673
5674 impl ::fidl_next::FromWire<crate::wire::NodeProtocolKinds> for NodeProtocolKinds {
5675 #[inline]
5676 fn from_wire(wire: crate::wire::NodeProtocolKinds) -> Self {
5677 Self::from(wire)
5678 }
5679 }
5680
5681 impl ::fidl_next::FromWireRef<crate::wire::NodeProtocolKinds> for NodeProtocolKinds {
5682 #[inline]
5683 fn from_wire_ref(wire: &crate::wire::NodeProtocolKinds) -> Self {
5684 Self::from(*wire)
5685 }
5686 }
5687
5688 #[doc = " Denotes which hash algorithm is used to build the merkle tree for\n fsverity-enabled files.\n"]
5689 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5690 #[repr(u8)]
5691 pub enum HashAlgorithm {
5692 Sha256 = 1,
5693 Sha512 = 2,
5694 UnknownOrdinal_(u8) = 3,
5695 }
5696 impl ::std::convert::From<u8> for HashAlgorithm {
5697 fn from(value: u8) -> Self {
5698 match value {
5699 1 => Self::Sha256,
5700 2 => Self::Sha512,
5701
5702 _ => Self::UnknownOrdinal_(value),
5703 }
5704 }
5705 }
5706
5707 impl ::std::convert::From<HashAlgorithm> for u8 {
5708 fn from(value: HashAlgorithm) -> Self {
5709 match value {
5710 HashAlgorithm::Sha256 => 1,
5711 HashAlgorithm::Sha512 => 2,
5712
5713 HashAlgorithm::UnknownOrdinal_(value) => value,
5714 }
5715 }
5716 }
5717
5718 unsafe impl<___E> ::fidl_next::Encode<crate::wire::HashAlgorithm, ___E> for HashAlgorithm
5719 where
5720 ___E: ?Sized,
5721 {
5722 #[inline]
5723 fn encode(
5724 self,
5725 encoder: &mut ___E,
5726 out: &mut ::core::mem::MaybeUninit<crate::wire::HashAlgorithm>,
5727 _: (),
5728 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5729 ::fidl_next::Encode::encode(&self, encoder, out, ())
5730 }
5731 }
5732
5733 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::HashAlgorithm, ___E> for &'a HashAlgorithm
5734 where
5735 ___E: ?Sized,
5736 {
5737 #[inline]
5738 fn encode(
5739 self,
5740 encoder: &mut ___E,
5741 out: &mut ::core::mem::MaybeUninit<crate::wire::HashAlgorithm>,
5742 _: (),
5743 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5744 ::fidl_next::munge!(let crate::wire::HashAlgorithm { value } = out);
5745 let _ = value.write(u8::from(match *self {
5746 HashAlgorithm::Sha256 => 1,
5747
5748 HashAlgorithm::Sha512 => 2,
5749
5750 HashAlgorithm::UnknownOrdinal_(value) => value,
5751 }));
5752
5753 Ok(())
5754 }
5755 }
5756
5757 impl ::core::convert::From<crate::wire::HashAlgorithm> for HashAlgorithm {
5758 fn from(wire: crate::wire::HashAlgorithm) -> Self {
5759 match u8::from(wire.value) {
5760 1 => Self::Sha256,
5761
5762 2 => Self::Sha512,
5763
5764 value => Self::UnknownOrdinal_(value),
5765 }
5766 }
5767 }
5768
5769 impl ::fidl_next::FromWire<crate::wire::HashAlgorithm> for HashAlgorithm {
5770 #[inline]
5771 fn from_wire(wire: crate::wire::HashAlgorithm) -> Self {
5772 Self::from(wire)
5773 }
5774 }
5775
5776 impl ::fidl_next::FromWireRef<crate::wire::HashAlgorithm> for HashAlgorithm {
5777 #[inline]
5778 fn from_wire_ref(wire: &crate::wire::HashAlgorithm) -> Self {
5779 Self::from(*wire)
5780 }
5781 }
5782
5783 #[doc = " Set of options used to enable verity on a file.\n"]
5784 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5785 pub struct VerificationOptions {
5786 pub hash_algorithm: ::core::option::Option<crate::natural::HashAlgorithm>,
5787
5788 pub salt: ::core::option::Option<::std::vec::Vec<u8>>,
5789 }
5790
5791 impl VerificationOptions {
5792 fn __max_ordinal(&self) -> usize {
5793 if self.salt.is_some() {
5794 return 2;
5795 }
5796
5797 if self.hash_algorithm.is_some() {
5798 return 1;
5799 }
5800
5801 0
5802 }
5803 }
5804
5805 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VerificationOptions<'static>, ___E>
5806 for VerificationOptions
5807 where
5808 ___E: ::fidl_next::Encoder + ?Sized,
5809 {
5810 #[inline]
5811 fn encode(
5812 mut self,
5813 encoder: &mut ___E,
5814 out: &mut ::core::mem::MaybeUninit<crate::wire::VerificationOptions<'static>>,
5815 _: (),
5816 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5817 ::fidl_next::munge!(let crate::wire::VerificationOptions { table } = out);
5818
5819 let max_ord = self.__max_ordinal();
5820
5821 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5822 ::fidl_next::Wire::zero_padding(&mut out);
5823
5824 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5825 ::fidl_next::wire::Envelope,
5826 >(encoder, max_ord);
5827
5828 for i in 1..=max_ord {
5829 match i {
5830 2 => {
5831 if let Some(value) = self.salt.take() {
5832 ::fidl_next::wire::Envelope::encode_value::<
5833 ::fidl_next::wire::Vector<'static, u8>,
5834 ___E,
5835 >(
5836 value, preallocated.encoder, &mut out, (32, ())
5837 )?;
5838 } else {
5839 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5840 }
5841 }
5842
5843 1 => {
5844 if let Some(value) = self.hash_algorithm.take() {
5845 ::fidl_next::wire::Envelope::encode_value::<
5846 crate::wire::HashAlgorithm,
5847 ___E,
5848 >(
5849 value, preallocated.encoder, &mut out, ()
5850 )?;
5851 } else {
5852 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5853 }
5854 }
5855
5856 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5857 }
5858 unsafe {
5859 preallocated.write_next(out.assume_init_ref());
5860 }
5861 }
5862
5863 ::fidl_next::wire::Table::encode_len(table, max_ord);
5864
5865 Ok(())
5866 }
5867 }
5868
5869 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::VerificationOptions<'static>, ___E>
5870 for &'a VerificationOptions
5871 where
5872 ___E: ::fidl_next::Encoder + ?Sized,
5873 {
5874 #[inline]
5875 fn encode(
5876 self,
5877 encoder: &mut ___E,
5878 out: &mut ::core::mem::MaybeUninit<crate::wire::VerificationOptions<'static>>,
5879 _: (),
5880 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5881 ::fidl_next::munge!(let crate::wire::VerificationOptions { table } = out);
5882
5883 let max_ord = self.__max_ordinal();
5884
5885 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5886 ::fidl_next::Wire::zero_padding(&mut out);
5887
5888 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5889 ::fidl_next::wire::Envelope,
5890 >(encoder, max_ord);
5891
5892 for i in 1..=max_ord {
5893 match i {
5894 2 => {
5895 if let Some(value) = &self.salt {
5896 ::fidl_next::wire::Envelope::encode_value::<
5897 ::fidl_next::wire::Vector<'static, u8>,
5898 ___E,
5899 >(
5900 value, preallocated.encoder, &mut out, (32, ())
5901 )?;
5902 } else {
5903 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5904 }
5905 }
5906
5907 1 => {
5908 if let Some(value) = &self.hash_algorithm {
5909 ::fidl_next::wire::Envelope::encode_value::<
5910 crate::wire::HashAlgorithm,
5911 ___E,
5912 >(
5913 value, preallocated.encoder, &mut out, ()
5914 )?;
5915 } else {
5916 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5917 }
5918 }
5919
5920 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5921 }
5922 unsafe {
5923 preallocated.write_next(out.assume_init_ref());
5924 }
5925 }
5926
5927 ::fidl_next::wire::Table::encode_len(table, max_ord);
5928
5929 Ok(())
5930 }
5931 }
5932
5933 impl<'de> ::fidl_next::FromWire<crate::wire::VerificationOptions<'de>> for VerificationOptions {
5934 #[inline]
5935 fn from_wire(wire_: crate::wire::VerificationOptions<'de>) -> Self {
5936 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5937
5938 let hash_algorithm = wire_.table.get(1);
5939
5940 let salt = wire_.table.get(2);
5941
5942 Self {
5943 hash_algorithm: hash_algorithm.map(|envelope| {
5944 ::fidl_next::FromWire::from_wire(unsafe {
5945 envelope.read_unchecked::<crate::wire::HashAlgorithm>()
5946 })
5947 }),
5948
5949 salt: salt.map(|envelope| {
5950 ::fidl_next::FromWire::from_wire(unsafe {
5951 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
5952 })
5953 }),
5954 }
5955 }
5956 }
5957
5958 impl<'de> ::fidl_next::FromWireRef<crate::wire::VerificationOptions<'de>> for VerificationOptions {
5959 #[inline]
5960 fn from_wire_ref(wire: &crate::wire::VerificationOptions<'de>) -> Self {
5961 Self {
5962 hash_algorithm: wire.table.get(1).map(|envelope| {
5963 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5964 envelope.deref_unchecked::<crate::wire::HashAlgorithm>()
5965 })
5966 }),
5967
5968 salt: wire.table.get(2).map(|envelope| {
5969 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5970 envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
5971 })
5972 }),
5973 }
5974 }
5975 }
5976
5977 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5978 pub struct ImmutableNodeAttributes {
5979 pub protocols: ::core::option::Option<crate::natural::NodeProtocolKinds>,
5980
5981 pub abilities: ::core::option::Option<crate::natural::Operations>,
5982
5983 pub content_size: ::core::option::Option<u64>,
5984
5985 pub storage_size: ::core::option::Option<u64>,
5986
5987 pub link_count: ::core::option::Option<u64>,
5988
5989 pub id: ::core::option::Option<u64>,
5990
5991 pub change_time: ::core::option::Option<u64>,
5992
5993 pub options: ::core::option::Option<crate::natural::VerificationOptions>,
5994
5995 pub root_hash: ::core::option::Option<::std::vec::Vec<u8>>,
5996
5997 pub verity_enabled: ::core::option::Option<bool>,
5998 }
5999
6000 impl ImmutableNodeAttributes {
6001 fn __max_ordinal(&self) -> usize {
6002 if self.verity_enabled.is_some() {
6003 return 10;
6004 }
6005
6006 if self.root_hash.is_some() {
6007 return 9;
6008 }
6009
6010 if self.options.is_some() {
6011 return 8;
6012 }
6013
6014 if self.change_time.is_some() {
6015 return 7;
6016 }
6017
6018 if self.id.is_some() {
6019 return 6;
6020 }
6021
6022 if self.link_count.is_some() {
6023 return 5;
6024 }
6025
6026 if self.storage_size.is_some() {
6027 return 4;
6028 }
6029
6030 if self.content_size.is_some() {
6031 return 3;
6032 }
6033
6034 if self.abilities.is_some() {
6035 return 2;
6036 }
6037
6038 if self.protocols.is_some() {
6039 return 1;
6040 }
6041
6042 0
6043 }
6044 }
6045
6046 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ImmutableNodeAttributes<'static>, ___E>
6047 for ImmutableNodeAttributes
6048 where
6049 ___E: ::fidl_next::Encoder + ?Sized,
6050 {
6051 #[inline]
6052 fn encode(
6053 mut self,
6054 encoder: &mut ___E,
6055 out: &mut ::core::mem::MaybeUninit<crate::wire::ImmutableNodeAttributes<'static>>,
6056 _: (),
6057 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6058 ::fidl_next::munge!(let crate::wire::ImmutableNodeAttributes { table } = out);
6059
6060 let max_ord = self.__max_ordinal();
6061
6062 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6063 ::fidl_next::Wire::zero_padding(&mut out);
6064
6065 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6066 ::fidl_next::wire::Envelope,
6067 >(encoder, max_ord);
6068
6069 for i in 1..=max_ord {
6070 match i {
6071 10 => {
6072 if let Some(value) = self.verity_enabled.take() {
6073 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6074 value,
6075 preallocated.encoder,
6076 &mut out,
6077 (),
6078 )?;
6079 } else {
6080 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6081 }
6082 }
6083
6084 9 => {
6085 if let Some(value) = self.root_hash.take() {
6086 ::fidl_next::wire::Envelope::encode_value::<
6087 ::fidl_next::wire::Vector<'static, u8>,
6088 ___E,
6089 >(
6090 value, preallocated.encoder, &mut out, (64, ())
6091 )?;
6092 } else {
6093 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6094 }
6095 }
6096
6097 8 => {
6098 if let Some(value) = self.options.take() {
6099 ::fidl_next::wire::Envelope::encode_value::<
6100 crate::wire::VerificationOptions<'static>,
6101 ___E,
6102 >(
6103 value, preallocated.encoder, &mut out, ()
6104 )?;
6105 } else {
6106 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6107 }
6108 }
6109
6110 7 => {
6111 if let Some(value) = self.change_time.take() {
6112 ::fidl_next::wire::Envelope::encode_value::<
6113 ::fidl_next::wire::Uint64,
6114 ___E,
6115 >(
6116 value, preallocated.encoder, &mut out, ()
6117 )?;
6118 } else {
6119 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6120 }
6121 }
6122
6123 6 => {
6124 if let Some(value) = self.id.take() {
6125 ::fidl_next::wire::Envelope::encode_value::<
6126 ::fidl_next::wire::Uint64,
6127 ___E,
6128 >(
6129 value, preallocated.encoder, &mut out, ()
6130 )?;
6131 } else {
6132 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6133 }
6134 }
6135
6136 5 => {
6137 if let Some(value) = self.link_count.take() {
6138 ::fidl_next::wire::Envelope::encode_value::<
6139 ::fidl_next::wire::Uint64,
6140 ___E,
6141 >(
6142 value, preallocated.encoder, &mut out, ()
6143 )?;
6144 } else {
6145 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6146 }
6147 }
6148
6149 4 => {
6150 if let Some(value) = self.storage_size.take() {
6151 ::fidl_next::wire::Envelope::encode_value::<
6152 ::fidl_next::wire::Uint64,
6153 ___E,
6154 >(
6155 value, preallocated.encoder, &mut out, ()
6156 )?;
6157 } else {
6158 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6159 }
6160 }
6161
6162 3 => {
6163 if let Some(value) = self.content_size.take() {
6164 ::fidl_next::wire::Envelope::encode_value::<
6165 ::fidl_next::wire::Uint64,
6166 ___E,
6167 >(
6168 value, preallocated.encoder, &mut out, ()
6169 )?;
6170 } else {
6171 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6172 }
6173 }
6174
6175 2 => {
6176 if let Some(value) = self.abilities.take() {
6177 ::fidl_next::wire::Envelope::encode_value::<
6178 crate::wire::Operations,
6179 ___E,
6180 >(
6181 value, preallocated.encoder, &mut out, ()
6182 )?;
6183 } else {
6184 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6185 }
6186 }
6187
6188 1 => {
6189 if let Some(value) = self.protocols.take() {
6190 ::fidl_next::wire::Envelope::encode_value::<
6191 crate::wire::NodeProtocolKinds,
6192 ___E,
6193 >(
6194 value, preallocated.encoder, &mut out, ()
6195 )?;
6196 } else {
6197 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6198 }
6199 }
6200
6201 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6202 }
6203 unsafe {
6204 preallocated.write_next(out.assume_init_ref());
6205 }
6206 }
6207
6208 ::fidl_next::wire::Table::encode_len(table, max_ord);
6209
6210 Ok(())
6211 }
6212 }
6213
6214 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ImmutableNodeAttributes<'static>, ___E>
6215 for &'a ImmutableNodeAttributes
6216 where
6217 ___E: ::fidl_next::Encoder + ?Sized,
6218 {
6219 #[inline]
6220 fn encode(
6221 self,
6222 encoder: &mut ___E,
6223 out: &mut ::core::mem::MaybeUninit<crate::wire::ImmutableNodeAttributes<'static>>,
6224 _: (),
6225 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6226 ::fidl_next::munge!(let crate::wire::ImmutableNodeAttributes { table } = out);
6227
6228 let max_ord = self.__max_ordinal();
6229
6230 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6231 ::fidl_next::Wire::zero_padding(&mut out);
6232
6233 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6234 ::fidl_next::wire::Envelope,
6235 >(encoder, max_ord);
6236
6237 for i in 1..=max_ord {
6238 match i {
6239 10 => {
6240 if let Some(value) = &self.verity_enabled {
6241 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6242 value,
6243 preallocated.encoder,
6244 &mut out,
6245 (),
6246 )?;
6247 } else {
6248 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6249 }
6250 }
6251
6252 9 => {
6253 if let Some(value) = &self.root_hash {
6254 ::fidl_next::wire::Envelope::encode_value::<
6255 ::fidl_next::wire::Vector<'static, u8>,
6256 ___E,
6257 >(
6258 value, preallocated.encoder, &mut out, (64, ())
6259 )?;
6260 } else {
6261 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6262 }
6263 }
6264
6265 8 => {
6266 if let Some(value) = &self.options {
6267 ::fidl_next::wire::Envelope::encode_value::<
6268 crate::wire::VerificationOptions<'static>,
6269 ___E,
6270 >(
6271 value, preallocated.encoder, &mut out, ()
6272 )?;
6273 } else {
6274 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6275 }
6276 }
6277
6278 7 => {
6279 if let Some(value) = &self.change_time {
6280 ::fidl_next::wire::Envelope::encode_value::<
6281 ::fidl_next::wire::Uint64,
6282 ___E,
6283 >(
6284 value, preallocated.encoder, &mut out, ()
6285 )?;
6286 } else {
6287 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6288 }
6289 }
6290
6291 6 => {
6292 if let Some(value) = &self.id {
6293 ::fidl_next::wire::Envelope::encode_value::<
6294 ::fidl_next::wire::Uint64,
6295 ___E,
6296 >(
6297 value, preallocated.encoder, &mut out, ()
6298 )?;
6299 } else {
6300 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6301 }
6302 }
6303
6304 5 => {
6305 if let Some(value) = &self.link_count {
6306 ::fidl_next::wire::Envelope::encode_value::<
6307 ::fidl_next::wire::Uint64,
6308 ___E,
6309 >(
6310 value, preallocated.encoder, &mut out, ()
6311 )?;
6312 } else {
6313 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6314 }
6315 }
6316
6317 4 => {
6318 if let Some(value) = &self.storage_size {
6319 ::fidl_next::wire::Envelope::encode_value::<
6320 ::fidl_next::wire::Uint64,
6321 ___E,
6322 >(
6323 value, preallocated.encoder, &mut out, ()
6324 )?;
6325 } else {
6326 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6327 }
6328 }
6329
6330 3 => {
6331 if let Some(value) = &self.content_size {
6332 ::fidl_next::wire::Envelope::encode_value::<
6333 ::fidl_next::wire::Uint64,
6334 ___E,
6335 >(
6336 value, preallocated.encoder, &mut out, ()
6337 )?;
6338 } else {
6339 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6340 }
6341 }
6342
6343 2 => {
6344 if let Some(value) = &self.abilities {
6345 ::fidl_next::wire::Envelope::encode_value::<
6346 crate::wire::Operations,
6347 ___E,
6348 >(
6349 value, preallocated.encoder, &mut out, ()
6350 )?;
6351 } else {
6352 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6353 }
6354 }
6355
6356 1 => {
6357 if let Some(value) = &self.protocols {
6358 ::fidl_next::wire::Envelope::encode_value::<
6359 crate::wire::NodeProtocolKinds,
6360 ___E,
6361 >(
6362 value, preallocated.encoder, &mut out, ()
6363 )?;
6364 } else {
6365 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6366 }
6367 }
6368
6369 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6370 }
6371 unsafe {
6372 preallocated.write_next(out.assume_init_ref());
6373 }
6374 }
6375
6376 ::fidl_next::wire::Table::encode_len(table, max_ord);
6377
6378 Ok(())
6379 }
6380 }
6381
6382 impl<'de> ::fidl_next::FromWire<crate::wire::ImmutableNodeAttributes<'de>>
6383 for ImmutableNodeAttributes
6384 {
6385 #[inline]
6386 fn from_wire(wire_: crate::wire::ImmutableNodeAttributes<'de>) -> Self {
6387 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6388
6389 let protocols = wire_.table.get(1);
6390
6391 let abilities = wire_.table.get(2);
6392
6393 let content_size = wire_.table.get(3);
6394
6395 let storage_size = wire_.table.get(4);
6396
6397 let link_count = wire_.table.get(5);
6398
6399 let id = wire_.table.get(6);
6400
6401 let change_time = wire_.table.get(7);
6402
6403 let options = wire_.table.get(8);
6404
6405 let root_hash = wire_.table.get(9);
6406
6407 let verity_enabled = wire_.table.get(10);
6408
6409 Self {
6410 protocols: protocols.map(|envelope| {
6411 ::fidl_next::FromWire::from_wire(unsafe {
6412 envelope.read_unchecked::<crate::wire::NodeProtocolKinds>()
6413 })
6414 }),
6415
6416 abilities: abilities.map(|envelope| {
6417 ::fidl_next::FromWire::from_wire(unsafe {
6418 envelope.read_unchecked::<crate::wire::Operations>()
6419 })
6420 }),
6421
6422 content_size: content_size.map(|envelope| {
6423 ::fidl_next::FromWire::from_wire(unsafe {
6424 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6425 })
6426 }),
6427
6428 storage_size: storage_size.map(|envelope| {
6429 ::fidl_next::FromWire::from_wire(unsafe {
6430 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6431 })
6432 }),
6433
6434 link_count: link_count.map(|envelope| {
6435 ::fidl_next::FromWire::from_wire(unsafe {
6436 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6437 })
6438 }),
6439
6440 id: id.map(|envelope| {
6441 ::fidl_next::FromWire::from_wire(unsafe {
6442 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6443 })
6444 }),
6445
6446 change_time: change_time.map(|envelope| {
6447 ::fidl_next::FromWire::from_wire(unsafe {
6448 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
6449 })
6450 }),
6451
6452 options: options.map(|envelope| {
6453 ::fidl_next::FromWire::from_wire(unsafe {
6454 envelope.read_unchecked::<crate::wire::VerificationOptions<'de>>()
6455 })
6456 }),
6457
6458 root_hash: root_hash.map(|envelope| {
6459 ::fidl_next::FromWire::from_wire(unsafe {
6460 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
6461 })
6462 }),
6463
6464 verity_enabled: verity_enabled.map(|envelope| {
6465 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
6466 }),
6467 }
6468 }
6469 }
6470
6471 impl<'de> ::fidl_next::FromWireRef<crate::wire::ImmutableNodeAttributes<'de>>
6472 for ImmutableNodeAttributes
6473 {
6474 #[inline]
6475 fn from_wire_ref(wire: &crate::wire::ImmutableNodeAttributes<'de>) -> Self {
6476 Self {
6477 protocols: wire.table.get(1).map(|envelope| {
6478 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6479 envelope.deref_unchecked::<crate::wire::NodeProtocolKinds>()
6480 })
6481 }),
6482
6483 abilities: wire.table.get(2).map(|envelope| {
6484 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6485 envelope.deref_unchecked::<crate::wire::Operations>()
6486 })
6487 }),
6488
6489 content_size: wire.table.get(3).map(|envelope| {
6490 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6491 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6492 })
6493 }),
6494
6495 storage_size: wire.table.get(4).map(|envelope| {
6496 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6497 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6498 })
6499 }),
6500
6501 link_count: wire.table.get(5).map(|envelope| {
6502 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6503 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6504 })
6505 }),
6506
6507 id: wire.table.get(6).map(|envelope| {
6508 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6509 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6510 })
6511 }),
6512
6513 change_time: wire.table.get(7).map(|envelope| {
6514 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6515 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
6516 })
6517 }),
6518
6519 options: wire.table.get(8).map(|envelope| {
6520 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6521 envelope.deref_unchecked::<crate::wire::VerificationOptions<'de>>()
6522 })
6523 }),
6524
6525 root_hash: wire.table.get(9).map(|envelope| {
6526 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6527 envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
6528 })
6529 }),
6530
6531 verity_enabled: wire.table.get(10).map(|envelope| {
6532 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6533 envelope.deref_unchecked::<bool>()
6534 })
6535 }),
6536 }
6537 }
6538 }
6539
6540 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6541 pub struct NodeAttributes2 {
6542 pub mutable_attributes: crate::natural::MutableNodeAttributes,
6543
6544 pub immutable_attributes: crate::natural::ImmutableNodeAttributes,
6545 }
6546
6547 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeAttributes2<'static>, ___E>
6548 for NodeAttributes2
6549 where
6550 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6551 ___E: ::fidl_next::Encoder,
6552 {
6553 #[inline]
6554 fn encode(
6555 self,
6556 encoder_: &mut ___E,
6557 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes2<'static>>,
6558 _: (),
6559 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6560 ::fidl_next::munge! {
6561 let crate::wire::NodeAttributes2 {
6562 mutable_attributes,
6563 immutable_attributes,
6564
6565 } = out_;
6566 }
6567
6568 ::fidl_next::Encode::encode(self.mutable_attributes, encoder_, mutable_attributes, ())?;
6569
6570 let mut _field =
6571 unsafe { ::fidl_next::Slot::new_unchecked(mutable_attributes.as_mut_ptr()) };
6572
6573 ::fidl_next::Encode::encode(
6574 self.immutable_attributes,
6575 encoder_,
6576 immutable_attributes,
6577 (),
6578 )?;
6579
6580 let mut _field =
6581 unsafe { ::fidl_next::Slot::new_unchecked(immutable_attributes.as_mut_ptr()) };
6582
6583 Ok(())
6584 }
6585 }
6586
6587 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeAttributes2<'static>, ___E>
6588 for &'a NodeAttributes2
6589 where
6590 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6591 ___E: ::fidl_next::Encoder,
6592 {
6593 #[inline]
6594 fn encode(
6595 self,
6596 encoder_: &mut ___E,
6597 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes2<'static>>,
6598 _: (),
6599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6600 ::fidl_next::munge! {
6601 let crate::wire::NodeAttributes2 {
6602 mutable_attributes,
6603 immutable_attributes,
6604
6605 } = out_;
6606 }
6607
6608 ::fidl_next::Encode::encode(
6609 &self.mutable_attributes,
6610 encoder_,
6611 mutable_attributes,
6612 (),
6613 )?;
6614
6615 let mut _field =
6616 unsafe { ::fidl_next::Slot::new_unchecked(mutable_attributes.as_mut_ptr()) };
6617
6618 ::fidl_next::Encode::encode(
6619 &self.immutable_attributes,
6620 encoder_,
6621 immutable_attributes,
6622 (),
6623 )?;
6624
6625 let mut _field =
6626 unsafe { ::fidl_next::Slot::new_unchecked(immutable_attributes.as_mut_ptr()) };
6627
6628 Ok(())
6629 }
6630 }
6631
6632 unsafe impl<___E>
6633 ::fidl_next::EncodeOption<
6634 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes2<'static>>,
6635 ___E,
6636 > for NodeAttributes2
6637 where
6638 ___E: ::fidl_next::Encoder + ?Sized,
6639 NodeAttributes2: ::fidl_next::Encode<crate::wire::NodeAttributes2<'static>, ___E>,
6640 {
6641 #[inline]
6642 fn encode_option(
6643 this: ::core::option::Option<Self>,
6644 encoder: &mut ___E,
6645 out: &mut ::core::mem::MaybeUninit<
6646 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes2<'static>>,
6647 >,
6648 _: (),
6649 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6650 if let Some(inner) = this {
6651 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6652 ::fidl_next::wire::Box::encode_present(out);
6653 } else {
6654 ::fidl_next::wire::Box::encode_absent(out);
6655 }
6656
6657 Ok(())
6658 }
6659 }
6660
6661 unsafe impl<'a, ___E>
6662 ::fidl_next::EncodeOption<
6663 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes2<'static>>,
6664 ___E,
6665 > for &'a NodeAttributes2
6666 where
6667 ___E: ::fidl_next::Encoder + ?Sized,
6668 &'a NodeAttributes2: ::fidl_next::Encode<crate::wire::NodeAttributes2<'static>, ___E>,
6669 {
6670 #[inline]
6671 fn encode_option(
6672 this: ::core::option::Option<Self>,
6673 encoder: &mut ___E,
6674 out: &mut ::core::mem::MaybeUninit<
6675 ::fidl_next::wire::Box<'static, crate::wire::NodeAttributes2<'static>>,
6676 >,
6677 _: (),
6678 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6679 if let Some(inner) = this {
6680 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6681 ::fidl_next::wire::Box::encode_present(out);
6682 } else {
6683 ::fidl_next::wire::Box::encode_absent(out);
6684 }
6685
6686 Ok(())
6687 }
6688 }
6689
6690 impl<'de> ::fidl_next::FromWire<crate::wire::NodeAttributes2<'de>> for NodeAttributes2 {
6691 #[inline]
6692 fn from_wire(wire: crate::wire::NodeAttributes2<'de>) -> Self {
6693 Self {
6694 mutable_attributes: ::fidl_next::FromWire::from_wire(wire.mutable_attributes),
6695
6696 immutable_attributes: ::fidl_next::FromWire::from_wire(wire.immutable_attributes),
6697 }
6698 }
6699 }
6700
6701 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeAttributes2<'de>> for NodeAttributes2 {
6702 #[inline]
6703 fn from_wire_ref(wire: &crate::wire::NodeAttributes2<'de>) -> Self {
6704 Self {
6705 mutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(
6706 &wire.mutable_attributes,
6707 ),
6708
6709 immutable_attributes: ::fidl_next::FromWireRef::from_wire_ref(
6710 &wire.immutable_attributes,
6711 ),
6712 }
6713 }
6714 }
6715
6716 #[doc = " Information that describes the target node.\n"]
6717 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6718 pub struct NodeInfo {
6719 pub attributes: ::core::option::Option<crate::natural::NodeAttributes2>,
6720 }
6721
6722 impl NodeInfo {
6723 fn __max_ordinal(&self) -> usize {
6724 if self.attributes.is_some() {
6725 return 1;
6726 }
6727
6728 0
6729 }
6730 }
6731
6732 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeInfo<'static>, ___E> for NodeInfo
6733 where
6734 ___E: ::fidl_next::Encoder + ?Sized,
6735 {
6736 #[inline]
6737 fn encode(
6738 mut self,
6739 encoder: &mut ___E,
6740 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeInfo<'static>>,
6741 _: (),
6742 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6743 ::fidl_next::munge!(let crate::wire::NodeInfo { table } = out);
6744
6745 let max_ord = self.__max_ordinal();
6746
6747 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6748 ::fidl_next::Wire::zero_padding(&mut out);
6749
6750 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6751 ::fidl_next::wire::Envelope,
6752 >(encoder, max_ord);
6753
6754 for i in 1..=max_ord {
6755 match i {
6756 1 => {
6757 if let Some(value) = self.attributes.take() {
6758 ::fidl_next::wire::Envelope::encode_value::<
6759 crate::wire::NodeAttributes2<'static>,
6760 ___E,
6761 >(
6762 value, preallocated.encoder, &mut out, ()
6763 )?;
6764 } else {
6765 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6766 }
6767 }
6768
6769 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6770 }
6771 unsafe {
6772 preallocated.write_next(out.assume_init_ref());
6773 }
6774 }
6775
6776 ::fidl_next::wire::Table::encode_len(table, max_ord);
6777
6778 Ok(())
6779 }
6780 }
6781
6782 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeInfo<'static>, ___E> for &'a NodeInfo
6783 where
6784 ___E: ::fidl_next::Encoder + ?Sized,
6785 {
6786 #[inline]
6787 fn encode(
6788 self,
6789 encoder: &mut ___E,
6790 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeInfo<'static>>,
6791 _: (),
6792 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6793 ::fidl_next::munge!(let crate::wire::NodeInfo { table } = out);
6794
6795 let max_ord = self.__max_ordinal();
6796
6797 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6798 ::fidl_next::Wire::zero_padding(&mut out);
6799
6800 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6801 ::fidl_next::wire::Envelope,
6802 >(encoder, max_ord);
6803
6804 for i in 1..=max_ord {
6805 match i {
6806 1 => {
6807 if let Some(value) = &self.attributes {
6808 ::fidl_next::wire::Envelope::encode_value::<
6809 crate::wire::NodeAttributes2<'static>,
6810 ___E,
6811 >(
6812 value, preallocated.encoder, &mut out, ()
6813 )?;
6814 } else {
6815 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6816 }
6817 }
6818
6819 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6820 }
6821 unsafe {
6822 preallocated.write_next(out.assume_init_ref());
6823 }
6824 }
6825
6826 ::fidl_next::wire::Table::encode_len(table, max_ord);
6827
6828 Ok(())
6829 }
6830 }
6831
6832 impl<'de> ::fidl_next::FromWire<crate::wire::NodeInfo<'de>> for NodeInfo {
6833 #[inline]
6834 fn from_wire(wire_: crate::wire::NodeInfo<'de>) -> Self {
6835 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6836
6837 let attributes = wire_.table.get(1);
6838
6839 Self {
6840 attributes: attributes.map(|envelope| {
6841 ::fidl_next::FromWire::from_wire(unsafe {
6842 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
6843 })
6844 }),
6845 }
6846 }
6847 }
6848
6849 impl<'de> ::fidl_next::FromWireRef<crate::wire::NodeInfo<'de>> for NodeInfo {
6850 #[inline]
6851 fn from_wire_ref(wire: &crate::wire::NodeInfo<'de>) -> Self {
6852 Self {
6853 attributes: wire.table.get(1).map(|envelope| {
6854 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6855 envelope.deref_unchecked::<crate::wire::NodeAttributes2<'de>>()
6856 })
6857 }),
6858 }
6859 }
6860 }
6861
6862 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6863 pub struct DirectoryInfo {
6864 pub attributes: ::core::option::Option<crate::natural::NodeAttributes2>,
6865 }
6866
6867 impl DirectoryInfo {
6868 fn __max_ordinal(&self) -> usize {
6869 if self.attributes.is_some() {
6870 return 1;
6871 }
6872
6873 0
6874 }
6875 }
6876
6877 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirectoryInfo<'static>, ___E> for DirectoryInfo
6878 where
6879 ___E: ::fidl_next::Encoder + ?Sized,
6880 {
6881 #[inline]
6882 fn encode(
6883 mut self,
6884 encoder: &mut ___E,
6885 out: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryInfo<'static>>,
6886 _: (),
6887 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6888 ::fidl_next::munge!(let crate::wire::DirectoryInfo { table } = out);
6889
6890 let max_ord = self.__max_ordinal();
6891
6892 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6893 ::fidl_next::Wire::zero_padding(&mut out);
6894
6895 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6896 ::fidl_next::wire::Envelope,
6897 >(encoder, max_ord);
6898
6899 for i in 1..=max_ord {
6900 match i {
6901 1 => {
6902 if let Some(value) = self.attributes.take() {
6903 ::fidl_next::wire::Envelope::encode_value::<
6904 crate::wire::NodeAttributes2<'static>,
6905 ___E,
6906 >(
6907 value, preallocated.encoder, &mut out, ()
6908 )?;
6909 } else {
6910 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6911 }
6912 }
6913
6914 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6915 }
6916 unsafe {
6917 preallocated.write_next(out.assume_init_ref());
6918 }
6919 }
6920
6921 ::fidl_next::wire::Table::encode_len(table, max_ord);
6922
6923 Ok(())
6924 }
6925 }
6926
6927 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirectoryInfo<'static>, ___E>
6928 for &'a DirectoryInfo
6929 where
6930 ___E: ::fidl_next::Encoder + ?Sized,
6931 {
6932 #[inline]
6933 fn encode(
6934 self,
6935 encoder: &mut ___E,
6936 out: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryInfo<'static>>,
6937 _: (),
6938 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6939 ::fidl_next::munge!(let crate::wire::DirectoryInfo { table } = out);
6940
6941 let max_ord = self.__max_ordinal();
6942
6943 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6944 ::fidl_next::Wire::zero_padding(&mut out);
6945
6946 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6947 ::fidl_next::wire::Envelope,
6948 >(encoder, max_ord);
6949
6950 for i in 1..=max_ord {
6951 match i {
6952 1 => {
6953 if let Some(value) = &self.attributes {
6954 ::fidl_next::wire::Envelope::encode_value::<
6955 crate::wire::NodeAttributes2<'static>,
6956 ___E,
6957 >(
6958 value, preallocated.encoder, &mut out, ()
6959 )?;
6960 } else {
6961 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6962 }
6963 }
6964
6965 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6966 }
6967 unsafe {
6968 preallocated.write_next(out.assume_init_ref());
6969 }
6970 }
6971
6972 ::fidl_next::wire::Table::encode_len(table, max_ord);
6973
6974 Ok(())
6975 }
6976 }
6977
6978 impl<'de> ::fidl_next::FromWire<crate::wire::DirectoryInfo<'de>> for DirectoryInfo {
6979 #[inline]
6980 fn from_wire(wire_: crate::wire::DirectoryInfo<'de>) -> Self {
6981 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6982
6983 let attributes = wire_.table.get(1);
6984
6985 Self {
6986 attributes: attributes.map(|envelope| {
6987 ::fidl_next::FromWire::from_wire(unsafe {
6988 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
6989 })
6990 }),
6991 }
6992 }
6993 }
6994
6995 impl<'de> ::fidl_next::FromWireRef<crate::wire::DirectoryInfo<'de>> for DirectoryInfo {
6996 #[inline]
6997 fn from_wire_ref(wire: &crate::wire::DirectoryInfo<'de>) -> Self {
6998 Self {
6999 attributes: wire.table.get(1).map(|envelope| {
7000 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7001 envelope.deref_unchecked::<crate::wire::NodeAttributes2<'de>>()
7002 })
7003 }),
7004 }
7005 }
7006 }
7007
7008 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7009 pub struct SymlinkInfo {
7010 pub target: ::core::option::Option<::std::vec::Vec<u8>>,
7011
7012 pub attributes: ::core::option::Option<crate::natural::NodeAttributes2>,
7013 }
7014
7015 impl SymlinkInfo {
7016 fn __max_ordinal(&self) -> usize {
7017 if self.attributes.is_some() {
7018 return 2;
7019 }
7020
7021 if self.target.is_some() {
7022 return 1;
7023 }
7024
7025 0
7026 }
7027 }
7028
7029 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SymlinkInfo<'static>, ___E> for SymlinkInfo
7030 where
7031 ___E: ::fidl_next::Encoder + ?Sized,
7032 {
7033 #[inline]
7034 fn encode(
7035 mut self,
7036 encoder: &mut ___E,
7037 out: &mut ::core::mem::MaybeUninit<crate::wire::SymlinkInfo<'static>>,
7038 _: (),
7039 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7040 ::fidl_next::munge!(let crate::wire::SymlinkInfo { table } = out);
7041
7042 let max_ord = self.__max_ordinal();
7043
7044 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7045 ::fidl_next::Wire::zero_padding(&mut out);
7046
7047 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7048 ::fidl_next::wire::Envelope,
7049 >(encoder, max_ord);
7050
7051 for i in 1..=max_ord {
7052 match i {
7053 2 => {
7054 if let Some(value) = self.attributes.take() {
7055 ::fidl_next::wire::Envelope::encode_value::<
7056 crate::wire::NodeAttributes2<'static>,
7057 ___E,
7058 >(
7059 value, preallocated.encoder, &mut out, ()
7060 )?;
7061 } else {
7062 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7063 }
7064 }
7065
7066 1 => {
7067 if let Some(value) = self.target.take() {
7068 ::fidl_next::wire::Envelope::encode_value::<
7069 ::fidl_next::wire::Vector<'static, u8>,
7070 ___E,
7071 >(
7072 value, preallocated.encoder, &mut out, (4095, ())
7073 )?;
7074 } else {
7075 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7076 }
7077 }
7078
7079 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7080 }
7081 unsafe {
7082 preallocated.write_next(out.assume_init_ref());
7083 }
7084 }
7085
7086 ::fidl_next::wire::Table::encode_len(table, max_ord);
7087
7088 Ok(())
7089 }
7090 }
7091
7092 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SymlinkInfo<'static>, ___E>
7093 for &'a SymlinkInfo
7094 where
7095 ___E: ::fidl_next::Encoder + ?Sized,
7096 {
7097 #[inline]
7098 fn encode(
7099 self,
7100 encoder: &mut ___E,
7101 out: &mut ::core::mem::MaybeUninit<crate::wire::SymlinkInfo<'static>>,
7102 _: (),
7103 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7104 ::fidl_next::munge!(let crate::wire::SymlinkInfo { table } = out);
7105
7106 let max_ord = self.__max_ordinal();
7107
7108 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7109 ::fidl_next::Wire::zero_padding(&mut out);
7110
7111 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7112 ::fidl_next::wire::Envelope,
7113 >(encoder, max_ord);
7114
7115 for i in 1..=max_ord {
7116 match i {
7117 2 => {
7118 if let Some(value) = &self.attributes {
7119 ::fidl_next::wire::Envelope::encode_value::<
7120 crate::wire::NodeAttributes2<'static>,
7121 ___E,
7122 >(
7123 value, preallocated.encoder, &mut out, ()
7124 )?;
7125 } else {
7126 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7127 }
7128 }
7129
7130 1 => {
7131 if let Some(value) = &self.target {
7132 ::fidl_next::wire::Envelope::encode_value::<
7133 ::fidl_next::wire::Vector<'static, u8>,
7134 ___E,
7135 >(
7136 value, preallocated.encoder, &mut out, (4095, ())
7137 )?;
7138 } else {
7139 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7140 }
7141 }
7142
7143 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7144 }
7145 unsafe {
7146 preallocated.write_next(out.assume_init_ref());
7147 }
7148 }
7149
7150 ::fidl_next::wire::Table::encode_len(table, max_ord);
7151
7152 Ok(())
7153 }
7154 }
7155
7156 impl<'de> ::fidl_next::FromWire<crate::wire::SymlinkInfo<'de>> for SymlinkInfo {
7157 #[inline]
7158 fn from_wire(wire_: crate::wire::SymlinkInfo<'de>) -> Self {
7159 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7160
7161 let target = wire_.table.get(1);
7162
7163 let attributes = wire_.table.get(2);
7164
7165 Self {
7166 target: target.map(|envelope| {
7167 ::fidl_next::FromWire::from_wire(unsafe {
7168 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
7169 })
7170 }),
7171
7172 attributes: attributes.map(|envelope| {
7173 ::fidl_next::FromWire::from_wire(unsafe {
7174 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
7175 })
7176 }),
7177 }
7178 }
7179 }
7180
7181 impl<'de> ::fidl_next::FromWireRef<crate::wire::SymlinkInfo<'de>> for SymlinkInfo {
7182 #[inline]
7183 fn from_wire_ref(wire: &crate::wire::SymlinkInfo<'de>) -> Self {
7184 Self {
7185 target: wire.table.get(1).map(|envelope| {
7186 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7187 envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
7188 })
7189 }),
7190
7191 attributes: wire.table.get(2).map(|envelope| {
7192 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7193 envelope.deref_unchecked::<crate::wire::NodeAttributes2<'de>>()
7194 })
7195 }),
7196 }
7197 }
7198 }
7199
7200 ::fidl_next::bitflags::bitflags! {
7201 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct NodeAttributesQuery: u64 {
7202 #[doc = " Requests [`NodeAttributes.protocols`].\n"]const PROTOCOLS = 1;
7203 #[doc = " Requests [`NodeAttributes.abilities`].\n"]const ABILITIES = 2;
7204 #[doc = " Requests [`NodeAttributes.content_size`].\n"]const CONTENT_SIZE = 4;
7205 #[doc = " Requests [`NodeAttributes.storage_size`].\n"]const STORAGE_SIZE = 8;
7206 #[doc = " Requests [`NodeAttributes.link_count`].\n"]const LINK_COUNT = 16;
7207 #[doc = " Requests [`NodeAttributes.id`].\n"]const ID = 32;
7208 #[doc = " Requests [`NodeAttributes.creation_time`].\n"]const CREATION_TIME = 64;
7209 #[doc = " Requests [`NodeAttributes.modification_time`].\n"]const MODIFICATION_TIME = 128;
7210 #[doc = " Posix attributes.\n"]const MODE = 256;
7211 const UID = 512;
7212 const GID = 1024;
7213 const RDEV = 2048;
7214 const ACCESS_TIME = 4096;
7215 const CHANGE_TIME = 8192;
7216 #[doc = " Verity attributes.\n"]const OPTIONS = 16384;
7217 const ROOT_HASH = 32768;
7218 const VERITY_ENABLED = 65536;
7219 #[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;
7220 #[doc = " Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.\n"]const SELINUX_CONTEXT = 262144;
7221 #[doc = " Requests [`MutableNodeAttributes.encryption_policy`].\n"]const ENCRYPTION_POLICY = 524288;
7222 #[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;
7223 const _ = !0;
7224 }
7225 }
7226
7227 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeAttributesQuery, ___E>
7228 for NodeAttributesQuery
7229 where
7230 ___E: ?Sized,
7231 {
7232 #[inline]
7233 fn encode(
7234 self,
7235 encoder: &mut ___E,
7236 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributesQuery>,
7237 _: (),
7238 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7239 ::fidl_next::Encode::encode(&self, encoder, out, ())
7240 }
7241 }
7242
7243 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeAttributesQuery, ___E>
7244 for &'a NodeAttributesQuery
7245 where
7246 ___E: ?Sized,
7247 {
7248 #[inline]
7249 fn encode(
7250 self,
7251 _: &mut ___E,
7252 out: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributesQuery>,
7253 _: (),
7254 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7255 ::fidl_next::munge!(let crate::wire::NodeAttributesQuery { value } = out);
7256
7257 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
7258 Ok(())
7259 }
7260 }
7261
7262 impl ::core::convert::From<crate::wire::NodeAttributesQuery> for NodeAttributesQuery {
7263 fn from(wire: crate::wire::NodeAttributesQuery) -> Self {
7264 Self::from_bits_retain(u64::from(wire.value))
7265 }
7266 }
7267
7268 impl ::fidl_next::FromWire<crate::wire::NodeAttributesQuery> for NodeAttributesQuery {
7269 #[inline]
7270 fn from_wire(wire: crate::wire::NodeAttributesQuery) -> Self {
7271 Self::from(wire)
7272 }
7273 }
7274
7275 impl ::fidl_next::FromWireRef<crate::wire::NodeAttributesQuery> for NodeAttributesQuery {
7276 #[inline]
7277 fn from_wire_ref(wire: &crate::wire::NodeAttributesQuery) -> Self {
7278 Self::from(*wire)
7279 }
7280 }
7281
7282 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7283 #[repr(C)]
7284 pub struct NodeGetAttributesRequest {
7285 pub query: crate::natural::NodeAttributesQuery,
7286 }
7287
7288 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NodeGetAttributesRequest, ___E>
7289 for NodeGetAttributesRequest
7290 where
7291 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7292 {
7293 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7294 Self,
7295 crate::wire::NodeGetAttributesRequest,
7296 > = unsafe {
7297 ::fidl_next::CopyOptimization::enable_if(
7298 true && <crate::natural::NodeAttributesQuery as ::fidl_next::Encode<
7299 crate::wire::NodeAttributesQuery,
7300 ___E,
7301 >>::COPY_OPTIMIZATION
7302 .is_enabled(),
7303 )
7304 };
7305
7306 #[inline]
7307 fn encode(
7308 self,
7309 encoder_: &mut ___E,
7310 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetAttributesRequest>,
7311 _: (),
7312 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7313 ::fidl_next::munge! {
7314 let crate::wire::NodeGetAttributesRequest {
7315 query,
7316
7317 } = out_;
7318 }
7319
7320 ::fidl_next::Encode::encode(self.query, encoder_, query, ())?;
7321
7322 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(query.as_mut_ptr()) };
7323
7324 Ok(())
7325 }
7326 }
7327
7328 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NodeGetAttributesRequest, ___E>
7329 for &'a NodeGetAttributesRequest
7330 where
7331 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7332 {
7333 #[inline]
7334 fn encode(
7335 self,
7336 encoder_: &mut ___E,
7337 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetAttributesRequest>,
7338 _: (),
7339 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7340 ::fidl_next::munge! {
7341 let crate::wire::NodeGetAttributesRequest {
7342 query,
7343
7344 } = out_;
7345 }
7346
7347 ::fidl_next::Encode::encode(&self.query, encoder_, query, ())?;
7348
7349 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(query.as_mut_ptr()) };
7350
7351 Ok(())
7352 }
7353 }
7354
7355 unsafe impl<___E>
7356 ::fidl_next::EncodeOption<
7357 ::fidl_next::wire::Box<'static, crate::wire::NodeGetAttributesRequest>,
7358 ___E,
7359 > for NodeGetAttributesRequest
7360 where
7361 ___E: ::fidl_next::Encoder + ?Sized,
7362 NodeGetAttributesRequest: ::fidl_next::Encode<crate::wire::NodeGetAttributesRequest, ___E>,
7363 {
7364 #[inline]
7365 fn encode_option(
7366 this: ::core::option::Option<Self>,
7367 encoder: &mut ___E,
7368 out: &mut ::core::mem::MaybeUninit<
7369 ::fidl_next::wire::Box<'static, crate::wire::NodeGetAttributesRequest>,
7370 >,
7371 _: (),
7372 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7373 if let Some(inner) = this {
7374 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7375 ::fidl_next::wire::Box::encode_present(out);
7376 } else {
7377 ::fidl_next::wire::Box::encode_absent(out);
7378 }
7379
7380 Ok(())
7381 }
7382 }
7383
7384 unsafe impl<'a, ___E>
7385 ::fidl_next::EncodeOption<
7386 ::fidl_next::wire::Box<'static, crate::wire::NodeGetAttributesRequest>,
7387 ___E,
7388 > for &'a NodeGetAttributesRequest
7389 where
7390 ___E: ::fidl_next::Encoder + ?Sized,
7391 &'a NodeGetAttributesRequest:
7392 ::fidl_next::Encode<crate::wire::NodeGetAttributesRequest, ___E>,
7393 {
7394 #[inline]
7395 fn encode_option(
7396 this: ::core::option::Option<Self>,
7397 encoder: &mut ___E,
7398 out: &mut ::core::mem::MaybeUninit<
7399 ::fidl_next::wire::Box<'static, crate::wire::NodeGetAttributesRequest>,
7400 >,
7401 _: (),
7402 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7403 if let Some(inner) = this {
7404 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7405 ::fidl_next::wire::Box::encode_present(out);
7406 } else {
7407 ::fidl_next::wire::Box::encode_absent(out);
7408 }
7409
7410 Ok(())
7411 }
7412 }
7413
7414 impl ::fidl_next::FromWire<crate::wire::NodeGetAttributesRequest> for NodeGetAttributesRequest {
7415 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7416 crate::wire::NodeGetAttributesRequest,
7417 Self,
7418 > = unsafe {
7419 ::fidl_next::CopyOptimization::enable_if(
7420 true && <crate::natural::NodeAttributesQuery as ::fidl_next::FromWire<
7421 crate::wire::NodeAttributesQuery,
7422 >>::COPY_OPTIMIZATION
7423 .is_enabled(),
7424 )
7425 };
7426
7427 #[inline]
7428 fn from_wire(wire: crate::wire::NodeGetAttributesRequest) -> Self {
7429 Self { query: ::fidl_next::FromWire::from_wire(wire.query) }
7430 }
7431 }
7432
7433 impl ::fidl_next::FromWireRef<crate::wire::NodeGetAttributesRequest> for NodeGetAttributesRequest {
7434 #[inline]
7435 fn from_wire_ref(wire: &crate::wire::NodeGetAttributesRequest) -> Self {
7436 Self { query: ::fidl_next::FromWireRef::from_wire_ref(&wire.query) }
7437 }
7438 }
7439
7440 #[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"]
7441 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7442 pub struct Options {
7443 pub attributes: ::core::option::Option<crate::natural::NodeAttributesQuery>,
7444
7445 pub create_attributes: ::core::option::Option<crate::natural::MutableNodeAttributes>,
7446 }
7447
7448 impl Options {
7449 fn __max_ordinal(&self) -> usize {
7450 if self.create_attributes.is_some() {
7451 return 2;
7452 }
7453
7454 if self.attributes.is_some() {
7455 return 1;
7456 }
7457
7458 0
7459 }
7460 }
7461
7462 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Options<'static>, ___E> for Options
7463 where
7464 ___E: ::fidl_next::Encoder + ?Sized,
7465 {
7466 #[inline]
7467 fn encode(
7468 mut self,
7469 encoder: &mut ___E,
7470 out: &mut ::core::mem::MaybeUninit<crate::wire::Options<'static>>,
7471 _: (),
7472 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7473 ::fidl_next::munge!(let crate::wire::Options { table } = out);
7474
7475 let max_ord = self.__max_ordinal();
7476
7477 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7478 ::fidl_next::Wire::zero_padding(&mut out);
7479
7480 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7481 ::fidl_next::wire::Envelope,
7482 >(encoder, max_ord);
7483
7484 for i in 1..=max_ord {
7485 match i {
7486 2 => {
7487 if let Some(value) = self.create_attributes.take() {
7488 ::fidl_next::wire::Envelope::encode_value::<
7489 crate::wire::MutableNodeAttributes<'static>,
7490 ___E,
7491 >(
7492 value, preallocated.encoder, &mut out, ()
7493 )?;
7494 } else {
7495 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7496 }
7497 }
7498
7499 1 => {
7500 if let Some(value) = self.attributes.take() {
7501 ::fidl_next::wire::Envelope::encode_value::<
7502 crate::wire::NodeAttributesQuery,
7503 ___E,
7504 >(
7505 value, preallocated.encoder, &mut out, ()
7506 )?;
7507 } else {
7508 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7509 }
7510 }
7511
7512 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7513 }
7514 unsafe {
7515 preallocated.write_next(out.assume_init_ref());
7516 }
7517 }
7518
7519 ::fidl_next::wire::Table::encode_len(table, max_ord);
7520
7521 Ok(())
7522 }
7523 }
7524
7525 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Options<'static>, ___E> for &'a Options
7526 where
7527 ___E: ::fidl_next::Encoder + ?Sized,
7528 {
7529 #[inline]
7530 fn encode(
7531 self,
7532 encoder: &mut ___E,
7533 out: &mut ::core::mem::MaybeUninit<crate::wire::Options<'static>>,
7534 _: (),
7535 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7536 ::fidl_next::munge!(let crate::wire::Options { table } = out);
7537
7538 let max_ord = self.__max_ordinal();
7539
7540 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7541 ::fidl_next::Wire::zero_padding(&mut out);
7542
7543 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7544 ::fidl_next::wire::Envelope,
7545 >(encoder, max_ord);
7546
7547 for i in 1..=max_ord {
7548 match i {
7549 2 => {
7550 if let Some(value) = &self.create_attributes {
7551 ::fidl_next::wire::Envelope::encode_value::<
7552 crate::wire::MutableNodeAttributes<'static>,
7553 ___E,
7554 >(
7555 value, preallocated.encoder, &mut out, ()
7556 )?;
7557 } else {
7558 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7559 }
7560 }
7561
7562 1 => {
7563 if let Some(value) = &self.attributes {
7564 ::fidl_next::wire::Envelope::encode_value::<
7565 crate::wire::NodeAttributesQuery,
7566 ___E,
7567 >(
7568 value, preallocated.encoder, &mut out, ()
7569 )?;
7570 } else {
7571 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7572 }
7573 }
7574
7575 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7576 }
7577 unsafe {
7578 preallocated.write_next(out.assume_init_ref());
7579 }
7580 }
7581
7582 ::fidl_next::wire::Table::encode_len(table, max_ord);
7583
7584 Ok(())
7585 }
7586 }
7587
7588 impl<'de> ::fidl_next::FromWire<crate::wire::Options<'de>> for Options {
7589 #[inline]
7590 fn from_wire(wire_: crate::wire::Options<'de>) -> Self {
7591 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7592
7593 let attributes = wire_.table.get(1);
7594
7595 let create_attributes = wire_.table.get(2);
7596
7597 Self {
7598 attributes: attributes.map(|envelope| {
7599 ::fidl_next::FromWire::from_wire(unsafe {
7600 envelope.read_unchecked::<crate::wire::NodeAttributesQuery>()
7601 })
7602 }),
7603
7604 create_attributes: create_attributes.map(|envelope| {
7605 ::fidl_next::FromWire::from_wire(unsafe {
7606 envelope.read_unchecked::<crate::wire::MutableNodeAttributes<'de>>()
7607 })
7608 }),
7609 }
7610 }
7611 }
7612
7613 impl<'de> ::fidl_next::FromWireRef<crate::wire::Options<'de>> for Options {
7614 #[inline]
7615 fn from_wire_ref(wire: &crate::wire::Options<'de>) -> Self {
7616 Self {
7617 attributes: wire.table.get(1).map(|envelope| {
7618 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7619 envelope.deref_unchecked::<crate::wire::NodeAttributesQuery>()
7620 })
7621 }),
7622
7623 create_attributes: wire.table.get(2).map(|envelope| {
7624 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7625 envelope.deref_unchecked::<crate::wire::MutableNodeAttributes<'de>>()
7626 })
7627 }),
7628 }
7629 }
7630 }
7631
7632 pub type DirectoryObject = ();
7633
7634 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7635 #[repr(u8)]
7636 pub enum DirentType {
7637 Unknown = 0,
7638 Directory = 4,
7639 BlockDevice = 6,
7640 File = 8,
7641 Symlink = 10,
7642 Service = 16,
7643 UnknownOrdinal_(u8) = 17,
7644 }
7645 impl ::std::convert::From<u8> for DirentType {
7646 fn from(value: u8) -> Self {
7647 match value {
7648 0 => Self::Unknown,
7649 4 => Self::Directory,
7650 6 => Self::BlockDevice,
7651 8 => Self::File,
7652 10 => Self::Symlink,
7653 16 => Self::Service,
7654
7655 _ => Self::UnknownOrdinal_(value),
7656 }
7657 }
7658 }
7659
7660 impl ::std::convert::From<DirentType> for u8 {
7661 fn from(value: DirentType) -> Self {
7662 match value {
7663 DirentType::Unknown => 0,
7664 DirentType::Directory => 4,
7665 DirentType::BlockDevice => 6,
7666 DirentType::File => 8,
7667 DirentType::Symlink => 10,
7668 DirentType::Service => 16,
7669
7670 DirentType::UnknownOrdinal_(value) => value,
7671 }
7672 }
7673 }
7674
7675 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DirentType, ___E> for DirentType
7676 where
7677 ___E: ?Sized,
7678 {
7679 #[inline]
7680 fn encode(
7681 self,
7682 encoder: &mut ___E,
7683 out: &mut ::core::mem::MaybeUninit<crate::wire::DirentType>,
7684 _: (),
7685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7686 ::fidl_next::Encode::encode(&self, encoder, out, ())
7687 }
7688 }
7689
7690 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DirentType, ___E> for &'a DirentType
7691 where
7692 ___E: ?Sized,
7693 {
7694 #[inline]
7695 fn encode(
7696 self,
7697 encoder: &mut ___E,
7698 out: &mut ::core::mem::MaybeUninit<crate::wire::DirentType>,
7699 _: (),
7700 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7701 ::fidl_next::munge!(let crate::wire::DirentType { value } = out);
7702 let _ = value.write(u8::from(match *self {
7703 DirentType::Unknown => 0,
7704
7705 DirentType::Directory => 4,
7706
7707 DirentType::BlockDevice => 6,
7708
7709 DirentType::File => 8,
7710
7711 DirentType::Symlink => 10,
7712
7713 DirentType::Service => 16,
7714
7715 DirentType::UnknownOrdinal_(value) => value,
7716 }));
7717
7718 Ok(())
7719 }
7720 }
7721
7722 impl ::core::convert::From<crate::wire::DirentType> for DirentType {
7723 fn from(wire: crate::wire::DirentType) -> Self {
7724 match u8::from(wire.value) {
7725 0 => Self::Unknown,
7726
7727 4 => Self::Directory,
7728
7729 6 => Self::BlockDevice,
7730
7731 8 => Self::File,
7732
7733 10 => Self::Symlink,
7734
7735 16 => Self::Service,
7736
7737 value => Self::UnknownOrdinal_(value),
7738 }
7739 }
7740 }
7741
7742 impl ::fidl_next::FromWire<crate::wire::DirentType> for DirentType {
7743 #[inline]
7744 fn from_wire(wire: crate::wire::DirentType) -> Self {
7745 Self::from(wire)
7746 }
7747 }
7748
7749 impl ::fidl_next::FromWireRef<crate::wire::DirentType> for DirentType {
7750 #[inline]
7751 fn from_wire_ref(wire: &crate::wire::DirentType) -> Self {
7752 Self::from(*wire)
7753 }
7754 }
7755
7756 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7757 pub struct ExtendedAttributeIteratorGetNextResponse {
7758 pub attributes: ::std::vec::Vec<::std::vec::Vec<u8>>,
7759
7760 pub last: bool,
7761 }
7762
7763 unsafe impl<___E>
7764 ::fidl_next::Encode<crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>, ___E>
7765 for ExtendedAttributeIteratorGetNextResponse
7766 where
7767 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7768 ___E: ::fidl_next::Encoder,
7769 {
7770 #[inline]
7771 fn encode(
7772 self,
7773 encoder_: &mut ___E,
7774 out_: &mut ::core::mem::MaybeUninit<
7775 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7776 >,
7777 _: (),
7778 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7779 ::fidl_next::munge! {
7780 let crate::wire::ExtendedAttributeIteratorGetNextResponse {
7781 attributes,
7782 last,
7783
7784 } = out_;
7785 }
7786
7787 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, (128, (255, ())))?;
7788
7789 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
7790 ::fidl_next::Constrained::validate(_field, (128, (255, ())))?;
7791
7792 ::fidl_next::Encode::encode(self.last, encoder_, last, ())?;
7793
7794 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last.as_mut_ptr()) };
7795
7796 Ok(())
7797 }
7798 }
7799
7800 unsafe impl<'a, ___E>
7801 ::fidl_next::Encode<crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>, ___E>
7802 for &'a ExtendedAttributeIteratorGetNextResponse
7803 where
7804 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7805 ___E: ::fidl_next::Encoder,
7806 {
7807 #[inline]
7808 fn encode(
7809 self,
7810 encoder_: &mut ___E,
7811 out_: &mut ::core::mem::MaybeUninit<
7812 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7813 >,
7814 _: (),
7815 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7816 ::fidl_next::munge! {
7817 let crate::wire::ExtendedAttributeIteratorGetNextResponse {
7818 attributes,
7819 last,
7820
7821 } = out_;
7822 }
7823
7824 ::fidl_next::Encode::encode(&self.attributes, encoder_, attributes, (128, (255, ())))?;
7825
7826 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(attributes.as_mut_ptr()) };
7827 ::fidl_next::Constrained::validate(_field, (128, (255, ())))?;
7828
7829 ::fidl_next::Encode::encode(&self.last, encoder_, last, ())?;
7830
7831 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last.as_mut_ptr()) };
7832
7833 Ok(())
7834 }
7835 }
7836
7837 unsafe impl<___E>
7838 ::fidl_next::EncodeOption<
7839 ::fidl_next::wire::Box<
7840 'static,
7841 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7842 >,
7843 ___E,
7844 > for ExtendedAttributeIteratorGetNextResponse
7845 where
7846 ___E: ::fidl_next::Encoder + ?Sized,
7847 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<
7848 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7849 ___E,
7850 >,
7851 {
7852 #[inline]
7853 fn encode_option(
7854 this: ::core::option::Option<Self>,
7855 encoder: &mut ___E,
7856 out: &mut ::core::mem::MaybeUninit<
7857 ::fidl_next::wire::Box<
7858 'static,
7859 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7860 >,
7861 >,
7862 _: (),
7863 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7864 if let Some(inner) = this {
7865 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7866 ::fidl_next::wire::Box::encode_present(out);
7867 } else {
7868 ::fidl_next::wire::Box::encode_absent(out);
7869 }
7870
7871 Ok(())
7872 }
7873 }
7874
7875 unsafe impl<'a, ___E>
7876 ::fidl_next::EncodeOption<
7877 ::fidl_next::wire::Box<
7878 'static,
7879 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7880 >,
7881 ___E,
7882 > for &'a ExtendedAttributeIteratorGetNextResponse
7883 where
7884 ___E: ::fidl_next::Encoder + ?Sized,
7885 &'a ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<
7886 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7887 ___E,
7888 >,
7889 {
7890 #[inline]
7891 fn encode_option(
7892 this: ::core::option::Option<Self>,
7893 encoder: &mut ___E,
7894 out: &mut ::core::mem::MaybeUninit<
7895 ::fidl_next::wire::Box<
7896 'static,
7897 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
7898 >,
7899 >,
7900 _: (),
7901 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7902 if let Some(inner) = this {
7903 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7904 ::fidl_next::wire::Box::encode_present(out);
7905 } else {
7906 ::fidl_next::wire::Box::encode_absent(out);
7907 }
7908
7909 Ok(())
7910 }
7911 }
7912
7913 impl<'de> ::fidl_next::FromWire<crate::wire::ExtendedAttributeIteratorGetNextResponse<'de>>
7914 for ExtendedAttributeIteratorGetNextResponse
7915 {
7916 #[inline]
7917 fn from_wire(wire: crate::wire::ExtendedAttributeIteratorGetNextResponse<'de>) -> Self {
7918 Self {
7919 attributes: ::fidl_next::FromWire::from_wire(wire.attributes),
7920
7921 last: ::fidl_next::FromWire::from_wire(wire.last),
7922 }
7923 }
7924 }
7925
7926 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExtendedAttributeIteratorGetNextResponse<'de>>
7927 for ExtendedAttributeIteratorGetNextResponse
7928 {
7929 #[inline]
7930 fn from_wire_ref(
7931 wire: &crate::wire::ExtendedAttributeIteratorGetNextResponse<'de>,
7932 ) -> Self {
7933 Self {
7934 attributes: ::fidl_next::FromWireRef::from_wire_ref(&wire.attributes),
7935
7936 last: ::fidl_next::FromWireRef::from_wire_ref(&wire.last),
7937 }
7938 }
7939 }
7940
7941 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7942 #[repr(C)]
7943 pub struct ReadableReadRequest {
7944 pub count: u64,
7945 }
7946
7947 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ReadableReadRequest, ___E>
7948 for ReadableReadRequest
7949 where
7950 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7951 {
7952 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
7953 Self,
7954 crate::wire::ReadableReadRequest,
7955 > = unsafe {
7956 ::fidl_next::CopyOptimization::enable_if(
7957 true
7958
7959 && <
7960 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
7961 >::COPY_OPTIMIZATION.is_enabled()
7962
7963 )
7964 };
7965
7966 #[inline]
7967 fn encode(
7968 self,
7969 encoder_: &mut ___E,
7970 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadRequest>,
7971 _: (),
7972 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7973 ::fidl_next::munge! {
7974 let crate::wire::ReadableReadRequest {
7975 count,
7976
7977 } = out_;
7978 }
7979
7980 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
7981
7982 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
7983
7984 Ok(())
7985 }
7986 }
7987
7988 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ReadableReadRequest, ___E>
7989 for &'a ReadableReadRequest
7990 where
7991 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7992 {
7993 #[inline]
7994 fn encode(
7995 self,
7996 encoder_: &mut ___E,
7997 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadRequest>,
7998 _: (),
7999 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8000 ::fidl_next::munge! {
8001 let crate::wire::ReadableReadRequest {
8002 count,
8003
8004 } = out_;
8005 }
8006
8007 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
8008
8009 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
8010
8011 Ok(())
8012 }
8013 }
8014
8015 unsafe impl<___E>
8016 ::fidl_next::EncodeOption<
8017 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadRequest>,
8018 ___E,
8019 > for ReadableReadRequest
8020 where
8021 ___E: ::fidl_next::Encoder + ?Sized,
8022 ReadableReadRequest: ::fidl_next::Encode<crate::wire::ReadableReadRequest, ___E>,
8023 {
8024 #[inline]
8025 fn encode_option(
8026 this: ::core::option::Option<Self>,
8027 encoder: &mut ___E,
8028 out: &mut ::core::mem::MaybeUninit<
8029 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadRequest>,
8030 >,
8031 _: (),
8032 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8033 if let Some(inner) = this {
8034 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8035 ::fidl_next::wire::Box::encode_present(out);
8036 } else {
8037 ::fidl_next::wire::Box::encode_absent(out);
8038 }
8039
8040 Ok(())
8041 }
8042 }
8043
8044 unsafe impl<'a, ___E>
8045 ::fidl_next::EncodeOption<
8046 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadRequest>,
8047 ___E,
8048 > for &'a ReadableReadRequest
8049 where
8050 ___E: ::fidl_next::Encoder + ?Sized,
8051 &'a ReadableReadRequest: ::fidl_next::Encode<crate::wire::ReadableReadRequest, ___E>,
8052 {
8053 #[inline]
8054 fn encode_option(
8055 this: ::core::option::Option<Self>,
8056 encoder: &mut ___E,
8057 out: &mut ::core::mem::MaybeUninit<
8058 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadRequest>,
8059 >,
8060 _: (),
8061 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8062 if let Some(inner) = this {
8063 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8064 ::fidl_next::wire::Box::encode_present(out);
8065 } else {
8066 ::fidl_next::wire::Box::encode_absent(out);
8067 }
8068
8069 Ok(())
8070 }
8071 }
8072
8073 impl ::fidl_next::FromWire<crate::wire::ReadableReadRequest> for ReadableReadRequest {
8074 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8075 crate::wire::ReadableReadRequest,
8076 Self,
8077 > = unsafe {
8078 ::fidl_next::CopyOptimization::enable_if(
8079 true
8080 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
8081 .is_enabled(),
8082 )
8083 };
8084
8085 #[inline]
8086 fn from_wire(wire: crate::wire::ReadableReadRequest) -> Self {
8087 Self { count: ::fidl_next::FromWire::from_wire(wire.count) }
8088 }
8089 }
8090
8091 impl ::fidl_next::FromWireRef<crate::wire::ReadableReadRequest> for ReadableReadRequest {
8092 #[inline]
8093 fn from_wire_ref(wire: &crate::wire::ReadableReadRequest) -> Self {
8094 Self { count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count) }
8095 }
8096 }
8097
8098 #[doc = " The byte vector type used for read/write operations.\n"]
8099 pub type Transfer = ::std::vec::Vec<u8>;
8100
8101 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8102 pub struct ReadableReadResponse {
8103 pub data: ::std::vec::Vec<u8>,
8104 }
8105
8106 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ReadableReadResponse<'static>, ___E>
8107 for ReadableReadResponse
8108 where
8109 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8110 ___E: ::fidl_next::Encoder,
8111 {
8112 #[inline]
8113 fn encode(
8114 self,
8115 encoder_: &mut ___E,
8116 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadResponse<'static>>,
8117 _: (),
8118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8119 ::fidl_next::munge! {
8120 let crate::wire::ReadableReadResponse {
8121 data,
8122
8123 } = out_;
8124 }
8125
8126 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
8127
8128 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
8129 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
8130
8131 Ok(())
8132 }
8133 }
8134
8135 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ReadableReadResponse<'static>, ___E>
8136 for &'a ReadableReadResponse
8137 where
8138 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8139 ___E: ::fidl_next::Encoder,
8140 {
8141 #[inline]
8142 fn encode(
8143 self,
8144 encoder_: &mut ___E,
8145 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadResponse<'static>>,
8146 _: (),
8147 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8148 ::fidl_next::munge! {
8149 let crate::wire::ReadableReadResponse {
8150 data,
8151
8152 } = out_;
8153 }
8154
8155 ::fidl_next::Encode::encode(&self.data, encoder_, data, (8192, ()))?;
8156
8157 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
8158 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
8159
8160 Ok(())
8161 }
8162 }
8163
8164 unsafe impl<___E>
8165 ::fidl_next::EncodeOption<
8166 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadResponse<'static>>,
8167 ___E,
8168 > for ReadableReadResponse
8169 where
8170 ___E: ::fidl_next::Encoder + ?Sized,
8171 ReadableReadResponse: ::fidl_next::Encode<crate::wire::ReadableReadResponse<'static>, ___E>,
8172 {
8173 #[inline]
8174 fn encode_option(
8175 this: ::core::option::Option<Self>,
8176 encoder: &mut ___E,
8177 out: &mut ::core::mem::MaybeUninit<
8178 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadResponse<'static>>,
8179 >,
8180 _: (),
8181 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8182 if let Some(inner) = this {
8183 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8184 ::fidl_next::wire::Box::encode_present(out);
8185 } else {
8186 ::fidl_next::wire::Box::encode_absent(out);
8187 }
8188
8189 Ok(())
8190 }
8191 }
8192
8193 unsafe impl<'a, ___E>
8194 ::fidl_next::EncodeOption<
8195 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadResponse<'static>>,
8196 ___E,
8197 > for &'a ReadableReadResponse
8198 where
8199 ___E: ::fidl_next::Encoder + ?Sized,
8200 &'a ReadableReadResponse:
8201 ::fidl_next::Encode<crate::wire::ReadableReadResponse<'static>, ___E>,
8202 {
8203 #[inline]
8204 fn encode_option(
8205 this: ::core::option::Option<Self>,
8206 encoder: &mut ___E,
8207 out: &mut ::core::mem::MaybeUninit<
8208 ::fidl_next::wire::Box<'static, crate::wire::ReadableReadResponse<'static>>,
8209 >,
8210 _: (),
8211 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8212 if let Some(inner) = this {
8213 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8214 ::fidl_next::wire::Box::encode_present(out);
8215 } else {
8216 ::fidl_next::wire::Box::encode_absent(out);
8217 }
8218
8219 Ok(())
8220 }
8221 }
8222
8223 impl<'de> ::fidl_next::FromWire<crate::wire::ReadableReadResponse<'de>> for ReadableReadResponse {
8224 #[inline]
8225 fn from_wire(wire: crate::wire::ReadableReadResponse<'de>) -> Self {
8226 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
8227 }
8228 }
8229
8230 impl<'de> ::fidl_next::FromWireRef<crate::wire::ReadableReadResponse<'de>>
8231 for ReadableReadResponse
8232 {
8233 #[inline]
8234 fn from_wire_ref(wire: &crate::wire::ReadableReadResponse<'de>) -> Self {
8235 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
8236 }
8237 }
8238
8239 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8240 pub struct WritableWriteRequest {
8241 pub data: ::std::vec::Vec<u8>,
8242 }
8243
8244 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WritableWriteRequest<'static>, ___E>
8245 for WritableWriteRequest
8246 where
8247 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8248 ___E: ::fidl_next::Encoder,
8249 {
8250 #[inline]
8251 fn encode(
8252 self,
8253 encoder_: &mut ___E,
8254 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteRequest<'static>>,
8255 _: (),
8256 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8257 ::fidl_next::munge! {
8258 let crate::wire::WritableWriteRequest {
8259 data,
8260
8261 } = out_;
8262 }
8263
8264 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
8265
8266 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
8267 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
8268
8269 Ok(())
8270 }
8271 }
8272
8273 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WritableWriteRequest<'static>, ___E>
8274 for &'a WritableWriteRequest
8275 where
8276 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8277 ___E: ::fidl_next::Encoder,
8278 {
8279 #[inline]
8280 fn encode(
8281 self,
8282 encoder_: &mut ___E,
8283 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteRequest<'static>>,
8284 _: (),
8285 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8286 ::fidl_next::munge! {
8287 let crate::wire::WritableWriteRequest {
8288 data,
8289
8290 } = out_;
8291 }
8292
8293 ::fidl_next::Encode::encode(&self.data, encoder_, data, (8192, ()))?;
8294
8295 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
8296 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
8297
8298 Ok(())
8299 }
8300 }
8301
8302 unsafe impl<___E>
8303 ::fidl_next::EncodeOption<
8304 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteRequest<'static>>,
8305 ___E,
8306 > for WritableWriteRequest
8307 where
8308 ___E: ::fidl_next::Encoder + ?Sized,
8309 WritableWriteRequest: ::fidl_next::Encode<crate::wire::WritableWriteRequest<'static>, ___E>,
8310 {
8311 #[inline]
8312 fn encode_option(
8313 this: ::core::option::Option<Self>,
8314 encoder: &mut ___E,
8315 out: &mut ::core::mem::MaybeUninit<
8316 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteRequest<'static>>,
8317 >,
8318 _: (),
8319 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8320 if let Some(inner) = this {
8321 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8322 ::fidl_next::wire::Box::encode_present(out);
8323 } else {
8324 ::fidl_next::wire::Box::encode_absent(out);
8325 }
8326
8327 Ok(())
8328 }
8329 }
8330
8331 unsafe impl<'a, ___E>
8332 ::fidl_next::EncodeOption<
8333 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteRequest<'static>>,
8334 ___E,
8335 > for &'a WritableWriteRequest
8336 where
8337 ___E: ::fidl_next::Encoder + ?Sized,
8338 &'a WritableWriteRequest:
8339 ::fidl_next::Encode<crate::wire::WritableWriteRequest<'static>, ___E>,
8340 {
8341 #[inline]
8342 fn encode_option(
8343 this: ::core::option::Option<Self>,
8344 encoder: &mut ___E,
8345 out: &mut ::core::mem::MaybeUninit<
8346 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteRequest<'static>>,
8347 >,
8348 _: (),
8349 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8350 if let Some(inner) = this {
8351 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8352 ::fidl_next::wire::Box::encode_present(out);
8353 } else {
8354 ::fidl_next::wire::Box::encode_absent(out);
8355 }
8356
8357 Ok(())
8358 }
8359 }
8360
8361 impl<'de> ::fidl_next::FromWire<crate::wire::WritableWriteRequest<'de>> for WritableWriteRequest {
8362 #[inline]
8363 fn from_wire(wire: crate::wire::WritableWriteRequest<'de>) -> Self {
8364 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
8365 }
8366 }
8367
8368 impl<'de> ::fidl_next::FromWireRef<crate::wire::WritableWriteRequest<'de>>
8369 for WritableWriteRequest
8370 {
8371 #[inline]
8372 fn from_wire_ref(wire: &crate::wire::WritableWriteRequest<'de>) -> Self {
8373 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
8374 }
8375 }
8376
8377 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8378 #[repr(C)]
8379 pub struct WritableWriteResponse {
8380 pub actual_count: u64,
8381 }
8382
8383 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WritableWriteResponse, ___E>
8384 for WritableWriteResponse
8385 where
8386 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8387 {
8388 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8389 Self,
8390 crate::wire::WritableWriteResponse,
8391 > = unsafe {
8392 ::fidl_next::CopyOptimization::enable_if(
8393 true
8394
8395 && <
8396 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
8397 >::COPY_OPTIMIZATION.is_enabled()
8398
8399 )
8400 };
8401
8402 #[inline]
8403 fn encode(
8404 self,
8405 encoder_: &mut ___E,
8406 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteResponse>,
8407 _: (),
8408 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8409 ::fidl_next::munge! {
8410 let crate::wire::WritableWriteResponse {
8411 actual_count,
8412
8413 } = out_;
8414 }
8415
8416 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count, ())?;
8417
8418 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(actual_count.as_mut_ptr()) };
8419
8420 Ok(())
8421 }
8422 }
8423
8424 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WritableWriteResponse, ___E>
8425 for &'a WritableWriteResponse
8426 where
8427 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8428 {
8429 #[inline]
8430 fn encode(
8431 self,
8432 encoder_: &mut ___E,
8433 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteResponse>,
8434 _: (),
8435 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8436 ::fidl_next::munge! {
8437 let crate::wire::WritableWriteResponse {
8438 actual_count,
8439
8440 } = out_;
8441 }
8442
8443 ::fidl_next::Encode::encode(&self.actual_count, encoder_, actual_count, ())?;
8444
8445 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(actual_count.as_mut_ptr()) };
8446
8447 Ok(())
8448 }
8449 }
8450
8451 unsafe impl<___E>
8452 ::fidl_next::EncodeOption<
8453 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteResponse>,
8454 ___E,
8455 > for WritableWriteResponse
8456 where
8457 ___E: ::fidl_next::Encoder + ?Sized,
8458 WritableWriteResponse: ::fidl_next::Encode<crate::wire::WritableWriteResponse, ___E>,
8459 {
8460 #[inline]
8461 fn encode_option(
8462 this: ::core::option::Option<Self>,
8463 encoder: &mut ___E,
8464 out: &mut ::core::mem::MaybeUninit<
8465 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteResponse>,
8466 >,
8467 _: (),
8468 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8469 if let Some(inner) = this {
8470 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8471 ::fidl_next::wire::Box::encode_present(out);
8472 } else {
8473 ::fidl_next::wire::Box::encode_absent(out);
8474 }
8475
8476 Ok(())
8477 }
8478 }
8479
8480 unsafe impl<'a, ___E>
8481 ::fidl_next::EncodeOption<
8482 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteResponse>,
8483 ___E,
8484 > for &'a WritableWriteResponse
8485 where
8486 ___E: ::fidl_next::Encoder + ?Sized,
8487 &'a WritableWriteResponse: ::fidl_next::Encode<crate::wire::WritableWriteResponse, ___E>,
8488 {
8489 #[inline]
8490 fn encode_option(
8491 this: ::core::option::Option<Self>,
8492 encoder: &mut ___E,
8493 out: &mut ::core::mem::MaybeUninit<
8494 ::fidl_next::wire::Box<'static, crate::wire::WritableWriteResponse>,
8495 >,
8496 _: (),
8497 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8498 if let Some(inner) = this {
8499 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8500 ::fidl_next::wire::Box::encode_present(out);
8501 } else {
8502 ::fidl_next::wire::Box::encode_absent(out);
8503 }
8504
8505 Ok(())
8506 }
8507 }
8508
8509 impl ::fidl_next::FromWire<crate::wire::WritableWriteResponse> for WritableWriteResponse {
8510 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8511 crate::wire::WritableWriteResponse,
8512 Self,
8513 > = unsafe {
8514 ::fidl_next::CopyOptimization::enable_if(
8515 true
8516 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
8517 .is_enabled(),
8518 )
8519 };
8520
8521 #[inline]
8522 fn from_wire(wire: crate::wire::WritableWriteResponse) -> Self {
8523 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
8524 }
8525 }
8526
8527 impl ::fidl_next::FromWireRef<crate::wire::WritableWriteResponse> for WritableWriteResponse {
8528 #[inline]
8529 fn from_wire_ref(wire: &crate::wire::WritableWriteResponse) -> Self {
8530 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
8531 }
8532 }
8533
8534 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8535 pub struct FileSeekRequest {
8536 pub origin: crate::natural::SeekOrigin,
8537
8538 pub offset: i64,
8539 }
8540
8541 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileSeekRequest, ___E> for FileSeekRequest
8542 where
8543 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8544 {
8545 #[inline]
8546 fn encode(
8547 self,
8548 encoder_: &mut ___E,
8549 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekRequest>,
8550 _: (),
8551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8552 ::fidl_next::munge! {
8553 let crate::wire::FileSeekRequest {
8554 origin,
8555 offset,
8556
8557 } = out_;
8558 }
8559
8560 ::fidl_next::Encode::encode(self.origin, encoder_, origin, ())?;
8561
8562 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(origin.as_mut_ptr()) };
8563
8564 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
8565
8566 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
8567
8568 Ok(())
8569 }
8570 }
8571
8572 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileSeekRequest, ___E>
8573 for &'a FileSeekRequest
8574 where
8575 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8576 {
8577 #[inline]
8578 fn encode(
8579 self,
8580 encoder_: &mut ___E,
8581 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekRequest>,
8582 _: (),
8583 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8584 ::fidl_next::munge! {
8585 let crate::wire::FileSeekRequest {
8586 origin,
8587 offset,
8588
8589 } = out_;
8590 }
8591
8592 ::fidl_next::Encode::encode(&self.origin, encoder_, origin, ())?;
8593
8594 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(origin.as_mut_ptr()) };
8595
8596 ::fidl_next::Encode::encode(&self.offset, encoder_, offset, ())?;
8597
8598 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
8599
8600 Ok(())
8601 }
8602 }
8603
8604 unsafe impl<___E>
8605 ::fidl_next::EncodeOption<
8606 ::fidl_next::wire::Box<'static, crate::wire::FileSeekRequest>,
8607 ___E,
8608 > for FileSeekRequest
8609 where
8610 ___E: ::fidl_next::Encoder + ?Sized,
8611 FileSeekRequest: ::fidl_next::Encode<crate::wire::FileSeekRequest, ___E>,
8612 {
8613 #[inline]
8614 fn encode_option(
8615 this: ::core::option::Option<Self>,
8616 encoder: &mut ___E,
8617 out: &mut ::core::mem::MaybeUninit<
8618 ::fidl_next::wire::Box<'static, crate::wire::FileSeekRequest>,
8619 >,
8620 _: (),
8621 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8622 if let Some(inner) = this {
8623 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8624 ::fidl_next::wire::Box::encode_present(out);
8625 } else {
8626 ::fidl_next::wire::Box::encode_absent(out);
8627 }
8628
8629 Ok(())
8630 }
8631 }
8632
8633 unsafe impl<'a, ___E>
8634 ::fidl_next::EncodeOption<
8635 ::fidl_next::wire::Box<'static, crate::wire::FileSeekRequest>,
8636 ___E,
8637 > for &'a FileSeekRequest
8638 where
8639 ___E: ::fidl_next::Encoder + ?Sized,
8640 &'a FileSeekRequest: ::fidl_next::Encode<crate::wire::FileSeekRequest, ___E>,
8641 {
8642 #[inline]
8643 fn encode_option(
8644 this: ::core::option::Option<Self>,
8645 encoder: &mut ___E,
8646 out: &mut ::core::mem::MaybeUninit<
8647 ::fidl_next::wire::Box<'static, crate::wire::FileSeekRequest>,
8648 >,
8649 _: (),
8650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8651 if let Some(inner) = this {
8652 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8653 ::fidl_next::wire::Box::encode_present(out);
8654 } else {
8655 ::fidl_next::wire::Box::encode_absent(out);
8656 }
8657
8658 Ok(())
8659 }
8660 }
8661
8662 impl ::fidl_next::FromWire<crate::wire::FileSeekRequest> for FileSeekRequest {
8663 #[inline]
8664 fn from_wire(wire: crate::wire::FileSeekRequest) -> Self {
8665 Self {
8666 origin: ::fidl_next::FromWire::from_wire(wire.origin),
8667
8668 offset: ::fidl_next::FromWire::from_wire(wire.offset),
8669 }
8670 }
8671 }
8672
8673 impl ::fidl_next::FromWireRef<crate::wire::FileSeekRequest> for FileSeekRequest {
8674 #[inline]
8675 fn from_wire_ref(wire: &crate::wire::FileSeekRequest) -> Self {
8676 Self {
8677 origin: ::fidl_next::FromWireRef::from_wire_ref(&wire.origin),
8678
8679 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
8680 }
8681 }
8682 }
8683
8684 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8685 #[repr(C)]
8686 pub struct FileSeekResponse {
8687 pub offset_from_start: u64,
8688 }
8689
8690 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileSeekResponse, ___E> for FileSeekResponse
8691 where
8692 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8693 {
8694 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8695 Self,
8696 crate::wire::FileSeekResponse,
8697 > = unsafe {
8698 ::fidl_next::CopyOptimization::enable_if(
8699 true
8700
8701 && <
8702 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
8703 >::COPY_OPTIMIZATION.is_enabled()
8704
8705 )
8706 };
8707
8708 #[inline]
8709 fn encode(
8710 self,
8711 encoder_: &mut ___E,
8712 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekResponse>,
8713 _: (),
8714 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8715 ::fidl_next::munge! {
8716 let crate::wire::FileSeekResponse {
8717 offset_from_start,
8718
8719 } = out_;
8720 }
8721
8722 ::fidl_next::Encode::encode(self.offset_from_start, encoder_, offset_from_start, ())?;
8723
8724 let mut _field =
8725 unsafe { ::fidl_next::Slot::new_unchecked(offset_from_start.as_mut_ptr()) };
8726
8727 Ok(())
8728 }
8729 }
8730
8731 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileSeekResponse, ___E>
8732 for &'a FileSeekResponse
8733 where
8734 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8735 {
8736 #[inline]
8737 fn encode(
8738 self,
8739 encoder_: &mut ___E,
8740 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekResponse>,
8741 _: (),
8742 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8743 ::fidl_next::munge! {
8744 let crate::wire::FileSeekResponse {
8745 offset_from_start,
8746
8747 } = out_;
8748 }
8749
8750 ::fidl_next::Encode::encode(&self.offset_from_start, encoder_, offset_from_start, ())?;
8751
8752 let mut _field =
8753 unsafe { ::fidl_next::Slot::new_unchecked(offset_from_start.as_mut_ptr()) };
8754
8755 Ok(())
8756 }
8757 }
8758
8759 unsafe impl<___E>
8760 ::fidl_next::EncodeOption<
8761 ::fidl_next::wire::Box<'static, crate::wire::FileSeekResponse>,
8762 ___E,
8763 > for FileSeekResponse
8764 where
8765 ___E: ::fidl_next::Encoder + ?Sized,
8766 FileSeekResponse: ::fidl_next::Encode<crate::wire::FileSeekResponse, ___E>,
8767 {
8768 #[inline]
8769 fn encode_option(
8770 this: ::core::option::Option<Self>,
8771 encoder: &mut ___E,
8772 out: &mut ::core::mem::MaybeUninit<
8773 ::fidl_next::wire::Box<'static, crate::wire::FileSeekResponse>,
8774 >,
8775 _: (),
8776 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8777 if let Some(inner) = this {
8778 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8779 ::fidl_next::wire::Box::encode_present(out);
8780 } else {
8781 ::fidl_next::wire::Box::encode_absent(out);
8782 }
8783
8784 Ok(())
8785 }
8786 }
8787
8788 unsafe impl<'a, ___E>
8789 ::fidl_next::EncodeOption<
8790 ::fidl_next::wire::Box<'static, crate::wire::FileSeekResponse>,
8791 ___E,
8792 > for &'a FileSeekResponse
8793 where
8794 ___E: ::fidl_next::Encoder + ?Sized,
8795 &'a FileSeekResponse: ::fidl_next::Encode<crate::wire::FileSeekResponse, ___E>,
8796 {
8797 #[inline]
8798 fn encode_option(
8799 this: ::core::option::Option<Self>,
8800 encoder: &mut ___E,
8801 out: &mut ::core::mem::MaybeUninit<
8802 ::fidl_next::wire::Box<'static, crate::wire::FileSeekResponse>,
8803 >,
8804 _: (),
8805 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8806 if let Some(inner) = this {
8807 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8808 ::fidl_next::wire::Box::encode_present(out);
8809 } else {
8810 ::fidl_next::wire::Box::encode_absent(out);
8811 }
8812
8813 Ok(())
8814 }
8815 }
8816
8817 impl ::fidl_next::FromWire<crate::wire::FileSeekResponse> for FileSeekResponse {
8818 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8819 crate::wire::FileSeekResponse,
8820 Self,
8821 > = unsafe {
8822 ::fidl_next::CopyOptimization::enable_if(
8823 true
8824 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
8825 .is_enabled(),
8826 )
8827 };
8828
8829 #[inline]
8830 fn from_wire(wire: crate::wire::FileSeekResponse) -> Self {
8831 Self { offset_from_start: ::fidl_next::FromWire::from_wire(wire.offset_from_start) }
8832 }
8833 }
8834
8835 impl ::fidl_next::FromWireRef<crate::wire::FileSeekResponse> for FileSeekResponse {
8836 #[inline]
8837 fn from_wire_ref(wire: &crate::wire::FileSeekResponse) -> Self {
8838 Self {
8839 offset_from_start: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset_from_start),
8840 }
8841 }
8842 }
8843
8844 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8845 #[repr(C)]
8846 pub struct FileReadAtRequest {
8847 pub count: u64,
8848
8849 pub offset: u64,
8850 }
8851
8852 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileReadAtRequest, ___E> for FileReadAtRequest
8853 where
8854 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8855 {
8856 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8857 Self,
8858 crate::wire::FileReadAtRequest,
8859 > = unsafe {
8860 ::fidl_next::CopyOptimization::enable_if(
8861 true
8862
8863 && <
8864 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
8865 >::COPY_OPTIMIZATION.is_enabled()
8866
8867 && <
8868 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
8869 >::COPY_OPTIMIZATION.is_enabled()
8870
8871 )
8872 };
8873
8874 #[inline]
8875 fn encode(
8876 self,
8877 encoder_: &mut ___E,
8878 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtRequest>,
8879 _: (),
8880 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8881 ::fidl_next::munge! {
8882 let crate::wire::FileReadAtRequest {
8883 count,
8884 offset,
8885
8886 } = out_;
8887 }
8888
8889 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
8890
8891 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
8892
8893 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
8894
8895 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
8896
8897 Ok(())
8898 }
8899 }
8900
8901 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileReadAtRequest, ___E>
8902 for &'a FileReadAtRequest
8903 where
8904 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8905 {
8906 #[inline]
8907 fn encode(
8908 self,
8909 encoder_: &mut ___E,
8910 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtRequest>,
8911 _: (),
8912 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8913 ::fidl_next::munge! {
8914 let crate::wire::FileReadAtRequest {
8915 count,
8916 offset,
8917
8918 } = out_;
8919 }
8920
8921 ::fidl_next::Encode::encode(&self.count, encoder_, count, ())?;
8922
8923 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(count.as_mut_ptr()) };
8924
8925 ::fidl_next::Encode::encode(&self.offset, encoder_, offset, ())?;
8926
8927 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
8928
8929 Ok(())
8930 }
8931 }
8932
8933 unsafe impl<___E>
8934 ::fidl_next::EncodeOption<
8935 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtRequest>,
8936 ___E,
8937 > for FileReadAtRequest
8938 where
8939 ___E: ::fidl_next::Encoder + ?Sized,
8940 FileReadAtRequest: ::fidl_next::Encode<crate::wire::FileReadAtRequest, ___E>,
8941 {
8942 #[inline]
8943 fn encode_option(
8944 this: ::core::option::Option<Self>,
8945 encoder: &mut ___E,
8946 out: &mut ::core::mem::MaybeUninit<
8947 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtRequest>,
8948 >,
8949 _: (),
8950 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8951 if let Some(inner) = this {
8952 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8953 ::fidl_next::wire::Box::encode_present(out);
8954 } else {
8955 ::fidl_next::wire::Box::encode_absent(out);
8956 }
8957
8958 Ok(())
8959 }
8960 }
8961
8962 unsafe impl<'a, ___E>
8963 ::fidl_next::EncodeOption<
8964 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtRequest>,
8965 ___E,
8966 > for &'a FileReadAtRequest
8967 where
8968 ___E: ::fidl_next::Encoder + ?Sized,
8969 &'a FileReadAtRequest: ::fidl_next::Encode<crate::wire::FileReadAtRequest, ___E>,
8970 {
8971 #[inline]
8972 fn encode_option(
8973 this: ::core::option::Option<Self>,
8974 encoder: &mut ___E,
8975 out: &mut ::core::mem::MaybeUninit<
8976 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtRequest>,
8977 >,
8978 _: (),
8979 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8980 if let Some(inner) = this {
8981 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8982 ::fidl_next::wire::Box::encode_present(out);
8983 } else {
8984 ::fidl_next::wire::Box::encode_absent(out);
8985 }
8986
8987 Ok(())
8988 }
8989 }
8990
8991 impl ::fidl_next::FromWire<crate::wire::FileReadAtRequest> for FileReadAtRequest {
8992 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8993 crate::wire::FileReadAtRequest,
8994 Self,
8995 > = unsafe {
8996 ::fidl_next::CopyOptimization::enable_if(
8997 true
8998 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
8999 .is_enabled()
9000 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
9001 .is_enabled(),
9002 )
9003 };
9004
9005 #[inline]
9006 fn from_wire(wire: crate::wire::FileReadAtRequest) -> Self {
9007 Self {
9008 count: ::fidl_next::FromWire::from_wire(wire.count),
9009
9010 offset: ::fidl_next::FromWire::from_wire(wire.offset),
9011 }
9012 }
9013 }
9014
9015 impl ::fidl_next::FromWireRef<crate::wire::FileReadAtRequest> for FileReadAtRequest {
9016 #[inline]
9017 fn from_wire_ref(wire: &crate::wire::FileReadAtRequest) -> Self {
9018 Self {
9019 count: ::fidl_next::FromWireRef::from_wire_ref(&wire.count),
9020
9021 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
9022 }
9023 }
9024 }
9025
9026 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9027 pub struct FileReadAtResponse {
9028 pub data: ::std::vec::Vec<u8>,
9029 }
9030
9031 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileReadAtResponse<'static>, ___E>
9032 for FileReadAtResponse
9033 where
9034 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9035 ___E: ::fidl_next::Encoder,
9036 {
9037 #[inline]
9038 fn encode(
9039 self,
9040 encoder_: &mut ___E,
9041 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtResponse<'static>>,
9042 _: (),
9043 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9044 ::fidl_next::munge! {
9045 let crate::wire::FileReadAtResponse {
9046 data,
9047
9048 } = out_;
9049 }
9050
9051 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
9052
9053 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
9054 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
9055
9056 Ok(())
9057 }
9058 }
9059
9060 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileReadAtResponse<'static>, ___E>
9061 for &'a FileReadAtResponse
9062 where
9063 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9064 ___E: ::fidl_next::Encoder,
9065 {
9066 #[inline]
9067 fn encode(
9068 self,
9069 encoder_: &mut ___E,
9070 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtResponse<'static>>,
9071 _: (),
9072 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9073 ::fidl_next::munge! {
9074 let crate::wire::FileReadAtResponse {
9075 data,
9076
9077 } = out_;
9078 }
9079
9080 ::fidl_next::Encode::encode(&self.data, encoder_, data, (8192, ()))?;
9081
9082 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
9083 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
9084
9085 Ok(())
9086 }
9087 }
9088
9089 unsafe impl<___E>
9090 ::fidl_next::EncodeOption<
9091 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtResponse<'static>>,
9092 ___E,
9093 > for FileReadAtResponse
9094 where
9095 ___E: ::fidl_next::Encoder + ?Sized,
9096 FileReadAtResponse: ::fidl_next::Encode<crate::wire::FileReadAtResponse<'static>, ___E>,
9097 {
9098 #[inline]
9099 fn encode_option(
9100 this: ::core::option::Option<Self>,
9101 encoder: &mut ___E,
9102 out: &mut ::core::mem::MaybeUninit<
9103 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtResponse<'static>>,
9104 >,
9105 _: (),
9106 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9107 if let Some(inner) = this {
9108 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9109 ::fidl_next::wire::Box::encode_present(out);
9110 } else {
9111 ::fidl_next::wire::Box::encode_absent(out);
9112 }
9113
9114 Ok(())
9115 }
9116 }
9117
9118 unsafe impl<'a, ___E>
9119 ::fidl_next::EncodeOption<
9120 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtResponse<'static>>,
9121 ___E,
9122 > for &'a FileReadAtResponse
9123 where
9124 ___E: ::fidl_next::Encoder + ?Sized,
9125 &'a FileReadAtResponse: ::fidl_next::Encode<crate::wire::FileReadAtResponse<'static>, ___E>,
9126 {
9127 #[inline]
9128 fn encode_option(
9129 this: ::core::option::Option<Self>,
9130 encoder: &mut ___E,
9131 out: &mut ::core::mem::MaybeUninit<
9132 ::fidl_next::wire::Box<'static, crate::wire::FileReadAtResponse<'static>>,
9133 >,
9134 _: (),
9135 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9136 if let Some(inner) = this {
9137 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9138 ::fidl_next::wire::Box::encode_present(out);
9139 } else {
9140 ::fidl_next::wire::Box::encode_absent(out);
9141 }
9142
9143 Ok(())
9144 }
9145 }
9146
9147 impl<'de> ::fidl_next::FromWire<crate::wire::FileReadAtResponse<'de>> for FileReadAtResponse {
9148 #[inline]
9149 fn from_wire(wire: crate::wire::FileReadAtResponse<'de>) -> Self {
9150 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
9151 }
9152 }
9153
9154 impl<'de> ::fidl_next::FromWireRef<crate::wire::FileReadAtResponse<'de>> for FileReadAtResponse {
9155 #[inline]
9156 fn from_wire_ref(wire: &crate::wire::FileReadAtResponse<'de>) -> Self {
9157 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
9158 }
9159 }
9160
9161 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9162 pub struct FileWriteAtRequest {
9163 pub data: ::std::vec::Vec<u8>,
9164
9165 pub offset: u64,
9166 }
9167
9168 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileWriteAtRequest<'static>, ___E>
9169 for FileWriteAtRequest
9170 where
9171 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9172 ___E: ::fidl_next::Encoder,
9173 {
9174 #[inline]
9175 fn encode(
9176 self,
9177 encoder_: &mut ___E,
9178 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtRequest<'static>>,
9179 _: (),
9180 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9181 ::fidl_next::munge! {
9182 let crate::wire::FileWriteAtRequest {
9183 data,
9184 offset,
9185
9186 } = out_;
9187 }
9188
9189 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
9190
9191 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
9192 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
9193
9194 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
9195
9196 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
9197
9198 Ok(())
9199 }
9200 }
9201
9202 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileWriteAtRequest<'static>, ___E>
9203 for &'a FileWriteAtRequest
9204 where
9205 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9206 ___E: ::fidl_next::Encoder,
9207 {
9208 #[inline]
9209 fn encode(
9210 self,
9211 encoder_: &mut ___E,
9212 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtRequest<'static>>,
9213 _: (),
9214 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9215 ::fidl_next::munge! {
9216 let crate::wire::FileWriteAtRequest {
9217 data,
9218 offset,
9219
9220 } = out_;
9221 }
9222
9223 ::fidl_next::Encode::encode(&self.data, encoder_, data, (8192, ()))?;
9224
9225 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
9226 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
9227
9228 ::fidl_next::Encode::encode(&self.offset, encoder_, offset, ())?;
9229
9230 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(offset.as_mut_ptr()) };
9231
9232 Ok(())
9233 }
9234 }
9235
9236 unsafe impl<___E>
9237 ::fidl_next::EncodeOption<
9238 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtRequest<'static>>,
9239 ___E,
9240 > for FileWriteAtRequest
9241 where
9242 ___E: ::fidl_next::Encoder + ?Sized,
9243 FileWriteAtRequest: ::fidl_next::Encode<crate::wire::FileWriteAtRequest<'static>, ___E>,
9244 {
9245 #[inline]
9246 fn encode_option(
9247 this: ::core::option::Option<Self>,
9248 encoder: &mut ___E,
9249 out: &mut ::core::mem::MaybeUninit<
9250 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtRequest<'static>>,
9251 >,
9252 _: (),
9253 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9254 if let Some(inner) = this {
9255 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9256 ::fidl_next::wire::Box::encode_present(out);
9257 } else {
9258 ::fidl_next::wire::Box::encode_absent(out);
9259 }
9260
9261 Ok(())
9262 }
9263 }
9264
9265 unsafe impl<'a, ___E>
9266 ::fidl_next::EncodeOption<
9267 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtRequest<'static>>,
9268 ___E,
9269 > for &'a FileWriteAtRequest
9270 where
9271 ___E: ::fidl_next::Encoder + ?Sized,
9272 &'a FileWriteAtRequest: ::fidl_next::Encode<crate::wire::FileWriteAtRequest<'static>, ___E>,
9273 {
9274 #[inline]
9275 fn encode_option(
9276 this: ::core::option::Option<Self>,
9277 encoder: &mut ___E,
9278 out: &mut ::core::mem::MaybeUninit<
9279 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtRequest<'static>>,
9280 >,
9281 _: (),
9282 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9283 if let Some(inner) = this {
9284 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9285 ::fidl_next::wire::Box::encode_present(out);
9286 } else {
9287 ::fidl_next::wire::Box::encode_absent(out);
9288 }
9289
9290 Ok(())
9291 }
9292 }
9293
9294 impl<'de> ::fidl_next::FromWire<crate::wire::FileWriteAtRequest<'de>> for FileWriteAtRequest {
9295 #[inline]
9296 fn from_wire(wire: crate::wire::FileWriteAtRequest<'de>) -> Self {
9297 Self {
9298 data: ::fidl_next::FromWire::from_wire(wire.data),
9299
9300 offset: ::fidl_next::FromWire::from_wire(wire.offset),
9301 }
9302 }
9303 }
9304
9305 impl<'de> ::fidl_next::FromWireRef<crate::wire::FileWriteAtRequest<'de>> for FileWriteAtRequest {
9306 #[inline]
9307 fn from_wire_ref(wire: &crate::wire::FileWriteAtRequest<'de>) -> Self {
9308 Self {
9309 data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data),
9310
9311 offset: ::fidl_next::FromWireRef::from_wire_ref(&wire.offset),
9312 }
9313 }
9314 }
9315
9316 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9317 #[repr(C)]
9318 pub struct FileWriteAtResponse {
9319 pub actual_count: u64,
9320 }
9321
9322 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileWriteAtResponse, ___E>
9323 for FileWriteAtResponse
9324 where
9325 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9326 {
9327 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9328 Self,
9329 crate::wire::FileWriteAtResponse,
9330 > = unsafe {
9331 ::fidl_next::CopyOptimization::enable_if(
9332 true
9333
9334 && <
9335 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9336 >::COPY_OPTIMIZATION.is_enabled()
9337
9338 )
9339 };
9340
9341 #[inline]
9342 fn encode(
9343 self,
9344 encoder_: &mut ___E,
9345 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtResponse>,
9346 _: (),
9347 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9348 ::fidl_next::munge! {
9349 let crate::wire::FileWriteAtResponse {
9350 actual_count,
9351
9352 } = out_;
9353 }
9354
9355 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count, ())?;
9356
9357 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(actual_count.as_mut_ptr()) };
9358
9359 Ok(())
9360 }
9361 }
9362
9363 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileWriteAtResponse, ___E>
9364 for &'a FileWriteAtResponse
9365 where
9366 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9367 {
9368 #[inline]
9369 fn encode(
9370 self,
9371 encoder_: &mut ___E,
9372 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtResponse>,
9373 _: (),
9374 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9375 ::fidl_next::munge! {
9376 let crate::wire::FileWriteAtResponse {
9377 actual_count,
9378
9379 } = out_;
9380 }
9381
9382 ::fidl_next::Encode::encode(&self.actual_count, encoder_, actual_count, ())?;
9383
9384 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(actual_count.as_mut_ptr()) };
9385
9386 Ok(())
9387 }
9388 }
9389
9390 unsafe impl<___E>
9391 ::fidl_next::EncodeOption<
9392 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtResponse>,
9393 ___E,
9394 > for FileWriteAtResponse
9395 where
9396 ___E: ::fidl_next::Encoder + ?Sized,
9397 FileWriteAtResponse: ::fidl_next::Encode<crate::wire::FileWriteAtResponse, ___E>,
9398 {
9399 #[inline]
9400 fn encode_option(
9401 this: ::core::option::Option<Self>,
9402 encoder: &mut ___E,
9403 out: &mut ::core::mem::MaybeUninit<
9404 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtResponse>,
9405 >,
9406 _: (),
9407 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9408 if let Some(inner) = this {
9409 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9410 ::fidl_next::wire::Box::encode_present(out);
9411 } else {
9412 ::fidl_next::wire::Box::encode_absent(out);
9413 }
9414
9415 Ok(())
9416 }
9417 }
9418
9419 unsafe impl<'a, ___E>
9420 ::fidl_next::EncodeOption<
9421 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtResponse>,
9422 ___E,
9423 > for &'a FileWriteAtResponse
9424 where
9425 ___E: ::fidl_next::Encoder + ?Sized,
9426 &'a FileWriteAtResponse: ::fidl_next::Encode<crate::wire::FileWriteAtResponse, ___E>,
9427 {
9428 #[inline]
9429 fn encode_option(
9430 this: ::core::option::Option<Self>,
9431 encoder: &mut ___E,
9432 out: &mut ::core::mem::MaybeUninit<
9433 ::fidl_next::wire::Box<'static, crate::wire::FileWriteAtResponse>,
9434 >,
9435 _: (),
9436 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9437 if let Some(inner) = this {
9438 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9439 ::fidl_next::wire::Box::encode_present(out);
9440 } else {
9441 ::fidl_next::wire::Box::encode_absent(out);
9442 }
9443
9444 Ok(())
9445 }
9446 }
9447
9448 impl ::fidl_next::FromWire<crate::wire::FileWriteAtResponse> for FileWriteAtResponse {
9449 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9450 crate::wire::FileWriteAtResponse,
9451 Self,
9452 > = unsafe {
9453 ::fidl_next::CopyOptimization::enable_if(
9454 true
9455 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
9456 .is_enabled(),
9457 )
9458 };
9459
9460 #[inline]
9461 fn from_wire(wire: crate::wire::FileWriteAtResponse) -> Self {
9462 Self { actual_count: ::fidl_next::FromWire::from_wire(wire.actual_count) }
9463 }
9464 }
9465
9466 impl ::fidl_next::FromWireRef<crate::wire::FileWriteAtResponse> for FileWriteAtResponse {
9467 #[inline]
9468 fn from_wire_ref(wire: &crate::wire::FileWriteAtResponse) -> Self {
9469 Self { actual_count: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_count) }
9470 }
9471 }
9472
9473 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9474 #[repr(C)]
9475 pub struct FileResizeRequest {
9476 pub length: u64,
9477 }
9478
9479 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileResizeRequest, ___E> for FileResizeRequest
9480 where
9481 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9482 {
9483 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9484 Self,
9485 crate::wire::FileResizeRequest,
9486 > = unsafe {
9487 ::fidl_next::CopyOptimization::enable_if(
9488 true
9489
9490 && <
9491 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9492 >::COPY_OPTIMIZATION.is_enabled()
9493
9494 )
9495 };
9496
9497 #[inline]
9498 fn encode(
9499 self,
9500 encoder_: &mut ___E,
9501 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileResizeRequest>,
9502 _: (),
9503 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9504 ::fidl_next::munge! {
9505 let crate::wire::FileResizeRequest {
9506 length,
9507
9508 } = out_;
9509 }
9510
9511 ::fidl_next::Encode::encode(self.length, encoder_, length, ())?;
9512
9513 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(length.as_mut_ptr()) };
9514
9515 Ok(())
9516 }
9517 }
9518
9519 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileResizeRequest, ___E>
9520 for &'a FileResizeRequest
9521 where
9522 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9523 {
9524 #[inline]
9525 fn encode(
9526 self,
9527 encoder_: &mut ___E,
9528 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileResizeRequest>,
9529 _: (),
9530 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9531 ::fidl_next::munge! {
9532 let crate::wire::FileResizeRequest {
9533 length,
9534
9535 } = out_;
9536 }
9537
9538 ::fidl_next::Encode::encode(&self.length, encoder_, length, ())?;
9539
9540 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(length.as_mut_ptr()) };
9541
9542 Ok(())
9543 }
9544 }
9545
9546 unsafe impl<___E>
9547 ::fidl_next::EncodeOption<
9548 ::fidl_next::wire::Box<'static, crate::wire::FileResizeRequest>,
9549 ___E,
9550 > for FileResizeRequest
9551 where
9552 ___E: ::fidl_next::Encoder + ?Sized,
9553 FileResizeRequest: ::fidl_next::Encode<crate::wire::FileResizeRequest, ___E>,
9554 {
9555 #[inline]
9556 fn encode_option(
9557 this: ::core::option::Option<Self>,
9558 encoder: &mut ___E,
9559 out: &mut ::core::mem::MaybeUninit<
9560 ::fidl_next::wire::Box<'static, crate::wire::FileResizeRequest>,
9561 >,
9562 _: (),
9563 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9564 if let Some(inner) = this {
9565 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9566 ::fidl_next::wire::Box::encode_present(out);
9567 } else {
9568 ::fidl_next::wire::Box::encode_absent(out);
9569 }
9570
9571 Ok(())
9572 }
9573 }
9574
9575 unsafe impl<'a, ___E>
9576 ::fidl_next::EncodeOption<
9577 ::fidl_next::wire::Box<'static, crate::wire::FileResizeRequest>,
9578 ___E,
9579 > for &'a FileResizeRequest
9580 where
9581 ___E: ::fidl_next::Encoder + ?Sized,
9582 &'a FileResizeRequest: ::fidl_next::Encode<crate::wire::FileResizeRequest, ___E>,
9583 {
9584 #[inline]
9585 fn encode_option(
9586 this: ::core::option::Option<Self>,
9587 encoder: &mut ___E,
9588 out: &mut ::core::mem::MaybeUninit<
9589 ::fidl_next::wire::Box<'static, crate::wire::FileResizeRequest>,
9590 >,
9591 _: (),
9592 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9593 if let Some(inner) = this {
9594 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9595 ::fidl_next::wire::Box::encode_present(out);
9596 } else {
9597 ::fidl_next::wire::Box::encode_absent(out);
9598 }
9599
9600 Ok(())
9601 }
9602 }
9603
9604 impl ::fidl_next::FromWire<crate::wire::FileResizeRequest> for FileResizeRequest {
9605 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9606 crate::wire::FileResizeRequest,
9607 Self,
9608 > = unsafe {
9609 ::fidl_next::CopyOptimization::enable_if(
9610 true
9611 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
9612 .is_enabled(),
9613 )
9614 };
9615
9616 #[inline]
9617 fn from_wire(wire: crate::wire::FileResizeRequest) -> Self {
9618 Self { length: ::fidl_next::FromWire::from_wire(wire.length) }
9619 }
9620 }
9621
9622 impl ::fidl_next::FromWireRef<crate::wire::FileResizeRequest> for FileResizeRequest {
9623 #[inline]
9624 fn from_wire_ref(wire: &crate::wire::FileResizeRequest) -> Self {
9625 Self { length: ::fidl_next::FromWireRef::from_wire_ref(&wire.length) }
9626 }
9627 }
9628
9629 pub type FileResizeResponse = ();
9630
9631 ::fidl_next::bitflags::bitflags! {
9632 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct VmoFlags: u32 {
9633 #[doc = " Requests that the VMO be readable.\n"]const READ = 1;
9634 #[doc = " Requests that the VMO be writable.\n"]const WRITE = 2;
9635 #[doc = " Request that the VMO be executable.\n"]const EXECUTE = 4;
9636 #[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;
9637 #[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;
9638
9639 }
9640 }
9641
9642 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VmoFlags, ___E> for VmoFlags
9643 where
9644 ___E: ?Sized,
9645 {
9646 #[inline]
9647 fn encode(
9648 self,
9649 encoder: &mut ___E,
9650 out: &mut ::core::mem::MaybeUninit<crate::wire::VmoFlags>,
9651 _: (),
9652 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9653 ::fidl_next::Encode::encode(&self, encoder, out, ())
9654 }
9655 }
9656
9657 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::VmoFlags, ___E> for &'a VmoFlags
9658 where
9659 ___E: ?Sized,
9660 {
9661 #[inline]
9662 fn encode(
9663 self,
9664 _: &mut ___E,
9665 out: &mut ::core::mem::MaybeUninit<crate::wire::VmoFlags>,
9666 _: (),
9667 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9668 ::fidl_next::munge!(let crate::wire::VmoFlags { value } = out);
9669
9670 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
9671 return Err(::fidl_next::EncodeError::InvalidStrictBits);
9672 }
9673
9674 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
9675 Ok(())
9676 }
9677 }
9678
9679 impl ::core::convert::From<crate::wire::VmoFlags> for VmoFlags {
9680 fn from(wire: crate::wire::VmoFlags) -> Self {
9681 Self::from_bits_retain(u32::from(wire.value))
9682 }
9683 }
9684
9685 impl ::fidl_next::FromWire<crate::wire::VmoFlags> for VmoFlags {
9686 #[inline]
9687 fn from_wire(wire: crate::wire::VmoFlags) -> Self {
9688 Self::from(wire)
9689 }
9690 }
9691
9692 impl ::fidl_next::FromWireRef<crate::wire::VmoFlags> for VmoFlags {
9693 #[inline]
9694 fn from_wire_ref(wire: &crate::wire::VmoFlags) -> Self {
9695 Self::from(*wire)
9696 }
9697 }
9698
9699 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9700 #[repr(C)]
9701 pub struct FileGetBackingMemoryRequest {
9702 pub flags: crate::natural::VmoFlags,
9703 }
9704
9705 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileGetBackingMemoryRequest, ___E>
9706 for FileGetBackingMemoryRequest
9707 where
9708 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9709 {
9710 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9711 Self,
9712 crate::wire::FileGetBackingMemoryRequest,
9713 > = unsafe {
9714 ::fidl_next::CopyOptimization::enable_if(
9715 true && <crate::natural::VmoFlags as ::fidl_next::Encode<
9716 crate::wire::VmoFlags,
9717 ___E,
9718 >>::COPY_OPTIMIZATION
9719 .is_enabled(),
9720 )
9721 };
9722
9723 #[inline]
9724 fn encode(
9725 self,
9726 encoder_: &mut ___E,
9727 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileGetBackingMemoryRequest>,
9728 _: (),
9729 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9730 ::fidl_next::munge! {
9731 let crate::wire::FileGetBackingMemoryRequest {
9732 flags,
9733
9734 } = out_;
9735 }
9736
9737 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
9738
9739 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
9740
9741 Ok(())
9742 }
9743 }
9744
9745 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileGetBackingMemoryRequest, ___E>
9746 for &'a FileGetBackingMemoryRequest
9747 where
9748 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9749 {
9750 #[inline]
9751 fn encode(
9752 self,
9753 encoder_: &mut ___E,
9754 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileGetBackingMemoryRequest>,
9755 _: (),
9756 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9757 ::fidl_next::munge! {
9758 let crate::wire::FileGetBackingMemoryRequest {
9759 flags,
9760
9761 } = out_;
9762 }
9763
9764 ::fidl_next::Encode::encode(&self.flags, encoder_, flags, ())?;
9765
9766 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(flags.as_mut_ptr()) };
9767
9768 Ok(())
9769 }
9770 }
9771
9772 unsafe impl<___E>
9773 ::fidl_next::EncodeOption<
9774 ::fidl_next::wire::Box<'static, crate::wire::FileGetBackingMemoryRequest>,
9775 ___E,
9776 > for FileGetBackingMemoryRequest
9777 where
9778 ___E: ::fidl_next::Encoder + ?Sized,
9779 FileGetBackingMemoryRequest:
9780 ::fidl_next::Encode<crate::wire::FileGetBackingMemoryRequest, ___E>,
9781 {
9782 #[inline]
9783 fn encode_option(
9784 this: ::core::option::Option<Self>,
9785 encoder: &mut ___E,
9786 out: &mut ::core::mem::MaybeUninit<
9787 ::fidl_next::wire::Box<'static, crate::wire::FileGetBackingMemoryRequest>,
9788 >,
9789 _: (),
9790 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9791 if let Some(inner) = this {
9792 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9793 ::fidl_next::wire::Box::encode_present(out);
9794 } else {
9795 ::fidl_next::wire::Box::encode_absent(out);
9796 }
9797
9798 Ok(())
9799 }
9800 }
9801
9802 unsafe impl<'a, ___E>
9803 ::fidl_next::EncodeOption<
9804 ::fidl_next::wire::Box<'static, crate::wire::FileGetBackingMemoryRequest>,
9805 ___E,
9806 > for &'a FileGetBackingMemoryRequest
9807 where
9808 ___E: ::fidl_next::Encoder + ?Sized,
9809 &'a FileGetBackingMemoryRequest:
9810 ::fidl_next::Encode<crate::wire::FileGetBackingMemoryRequest, ___E>,
9811 {
9812 #[inline]
9813 fn encode_option(
9814 this: ::core::option::Option<Self>,
9815 encoder: &mut ___E,
9816 out: &mut ::core::mem::MaybeUninit<
9817 ::fidl_next::wire::Box<'static, crate::wire::FileGetBackingMemoryRequest>,
9818 >,
9819 _: (),
9820 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9821 if let Some(inner) = this {
9822 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9823 ::fidl_next::wire::Box::encode_present(out);
9824 } else {
9825 ::fidl_next::wire::Box::encode_absent(out);
9826 }
9827
9828 Ok(())
9829 }
9830 }
9831
9832 impl ::fidl_next::FromWire<crate::wire::FileGetBackingMemoryRequest>
9833 for FileGetBackingMemoryRequest
9834 {
9835 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
9836 crate::wire::FileGetBackingMemoryRequest,
9837 Self,
9838 > = unsafe {
9839 ::fidl_next::CopyOptimization::enable_if(
9840 true && <crate::natural::VmoFlags as ::fidl_next::FromWire<
9841 crate::wire::VmoFlags,
9842 >>::COPY_OPTIMIZATION
9843 .is_enabled(),
9844 )
9845 };
9846
9847 #[inline]
9848 fn from_wire(wire: crate::wire::FileGetBackingMemoryRequest) -> Self {
9849 Self { flags: ::fidl_next::FromWire::from_wire(wire.flags) }
9850 }
9851 }
9852
9853 impl ::fidl_next::FromWireRef<crate::wire::FileGetBackingMemoryRequest>
9854 for FileGetBackingMemoryRequest
9855 {
9856 #[inline]
9857 fn from_wire_ref(wire: &crate::wire::FileGetBackingMemoryRequest) -> Self {
9858 Self { flags: ::fidl_next::FromWireRef::from_wire_ref(&wire.flags) }
9859 }
9860 }
9861
9862 pub type LinkableLinkIntoResponse = ();
9863
9864 pub type FileAllocateResponse = ();
9865
9866 pub type FileEnableVerityResponse = ();
9867
9868 ::fidl_next::bitflags::bitflags! {
9869 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct FileSignal: u32 {
9870 #[doc = " Indicates the file is ready for reading.\n"]const READABLE = 16777216;
9871 #[doc = " Indicates the file is ready for writing.\n"]const WRITABLE = 33554432;
9872
9873 }
9874 }
9875
9876 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileSignal, ___E> for FileSignal
9877 where
9878 ___E: ?Sized,
9879 {
9880 #[inline]
9881 fn encode(
9882 self,
9883 encoder: &mut ___E,
9884 out: &mut ::core::mem::MaybeUninit<crate::wire::FileSignal>,
9885 _: (),
9886 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9887 ::fidl_next::Encode::encode(&self, encoder, out, ())
9888 }
9889 }
9890
9891 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileSignal, ___E> for &'a FileSignal
9892 where
9893 ___E: ?Sized,
9894 {
9895 #[inline]
9896 fn encode(
9897 self,
9898 _: &mut ___E,
9899 out: &mut ::core::mem::MaybeUninit<crate::wire::FileSignal>,
9900 _: (),
9901 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9902 ::fidl_next::munge!(let crate::wire::FileSignal { value } = out);
9903
9904 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
9905 return Err(::fidl_next::EncodeError::InvalidStrictBits);
9906 }
9907
9908 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
9909 Ok(())
9910 }
9911 }
9912
9913 impl ::core::convert::From<crate::wire::FileSignal> for FileSignal {
9914 fn from(wire: crate::wire::FileSignal) -> Self {
9915 Self::from_bits_retain(u32::from(wire.value))
9916 }
9917 }
9918
9919 impl ::fidl_next::FromWire<crate::wire::FileSignal> for FileSignal {
9920 #[inline]
9921 fn from_wire(wire: crate::wire::FileSignal) -> Self {
9922 Self::from(wire)
9923 }
9924 }
9925
9926 impl ::fidl_next::FromWireRef<crate::wire::FileSignal> for FileSignal {
9927 #[inline]
9928 fn from_wire_ref(wire: &crate::wire::FileSignal) -> Self {
9929 Self::from(*wire)
9930 }
9931 }
9932
9933 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9934 #[repr(C)]
9935 pub struct FilesystemInfo {
9936 pub total_bytes: u64,
9937
9938 pub used_bytes: u64,
9939
9940 pub total_nodes: u64,
9941
9942 pub used_nodes: u64,
9943
9944 pub free_shared_pool_bytes: u64,
9945
9946 pub fs_id: u64,
9947
9948 pub block_size: u32,
9949
9950 pub max_filename_size: u32,
9951
9952 pub fs_type: u32,
9953
9954 pub padding: u32,
9955
9956 pub name: [i8; 32],
9957 }
9958
9959 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FilesystemInfo, ___E> for FilesystemInfo
9960 where
9961 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9962 {
9963 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::FilesystemInfo> = unsafe {
9964 ::fidl_next::CopyOptimization::enable_if(
9965 true
9966
9967 && <
9968 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9969 >::COPY_OPTIMIZATION.is_enabled()
9970
9971 && <
9972 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9973 >::COPY_OPTIMIZATION.is_enabled()
9974
9975 && <
9976 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9977 >::COPY_OPTIMIZATION.is_enabled()
9978
9979 && <
9980 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9981 >::COPY_OPTIMIZATION.is_enabled()
9982
9983 && <
9984 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9985 >::COPY_OPTIMIZATION.is_enabled()
9986
9987 && <
9988 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
9989 >::COPY_OPTIMIZATION.is_enabled()
9990
9991 && <
9992 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
9993 >::COPY_OPTIMIZATION.is_enabled()
9994
9995 && <
9996 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
9997 >::COPY_OPTIMIZATION.is_enabled()
9998
9999 && <
10000 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
10001 >::COPY_OPTIMIZATION.is_enabled()
10002
10003 && <
10004 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
10005 >::COPY_OPTIMIZATION.is_enabled()
10006
10007 && <
10008 [i8; 32] as ::fidl_next::Encode<[i8; 32], ___E>
10009 >::COPY_OPTIMIZATION.is_enabled()
10010
10011 )
10012 };
10013
10014 #[inline]
10015 fn encode(
10016 self,
10017 encoder_: &mut ___E,
10018 out_: &mut ::core::mem::MaybeUninit<crate::wire::FilesystemInfo>,
10019 _: (),
10020 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10021 ::fidl_next::munge! {
10022 let crate::wire::FilesystemInfo {
10023 total_bytes,
10024 used_bytes,
10025 total_nodes,
10026 used_nodes,
10027 free_shared_pool_bytes,
10028 fs_id,
10029 block_size,
10030 max_filename_size,
10031 fs_type,
10032 padding,
10033 name,
10034
10035 } = out_;
10036 }
10037
10038 ::fidl_next::Encode::encode(self.total_bytes, encoder_, total_bytes, ())?;
10039
10040 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(total_bytes.as_mut_ptr()) };
10041
10042 ::fidl_next::Encode::encode(self.used_bytes, encoder_, used_bytes, ())?;
10043
10044 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(used_bytes.as_mut_ptr()) };
10045
10046 ::fidl_next::Encode::encode(self.total_nodes, encoder_, total_nodes, ())?;
10047
10048 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(total_nodes.as_mut_ptr()) };
10049
10050 ::fidl_next::Encode::encode(self.used_nodes, encoder_, used_nodes, ())?;
10051
10052 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(used_nodes.as_mut_ptr()) };
10053
10054 ::fidl_next::Encode::encode(
10055 self.free_shared_pool_bytes,
10056 encoder_,
10057 free_shared_pool_bytes,
10058 (),
10059 )?;
10060
10061 let mut _field =
10062 unsafe { ::fidl_next::Slot::new_unchecked(free_shared_pool_bytes.as_mut_ptr()) };
10063
10064 ::fidl_next::Encode::encode(self.fs_id, encoder_, fs_id, ())?;
10065
10066 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fs_id.as_mut_ptr()) };
10067
10068 ::fidl_next::Encode::encode(self.block_size, encoder_, block_size, ())?;
10069
10070 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(block_size.as_mut_ptr()) };
10071
10072 ::fidl_next::Encode::encode(self.max_filename_size, encoder_, max_filename_size, ())?;
10073
10074 let mut _field =
10075 unsafe { ::fidl_next::Slot::new_unchecked(max_filename_size.as_mut_ptr()) };
10076
10077 ::fidl_next::Encode::encode(self.fs_type, encoder_, fs_type, ())?;
10078
10079 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fs_type.as_mut_ptr()) };
10080
10081 ::fidl_next::Encode::encode(self.padding, encoder_, padding, ())?;
10082
10083 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(padding.as_mut_ptr()) };
10084
10085 ::fidl_next::Encode::encode(self.name, encoder_, name, ())?;
10086
10087 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
10088
10089 Ok(())
10090 }
10091 }
10092
10093 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FilesystemInfo, ___E> for &'a FilesystemInfo
10094 where
10095 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10096 {
10097 #[inline]
10098 fn encode(
10099 self,
10100 encoder_: &mut ___E,
10101 out_: &mut ::core::mem::MaybeUninit<crate::wire::FilesystemInfo>,
10102 _: (),
10103 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10104 ::fidl_next::munge! {
10105 let crate::wire::FilesystemInfo {
10106 total_bytes,
10107 used_bytes,
10108 total_nodes,
10109 used_nodes,
10110 free_shared_pool_bytes,
10111 fs_id,
10112 block_size,
10113 max_filename_size,
10114 fs_type,
10115 padding,
10116 name,
10117
10118 } = out_;
10119 }
10120
10121 ::fidl_next::Encode::encode(&self.total_bytes, encoder_, total_bytes, ())?;
10122
10123 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(total_bytes.as_mut_ptr()) };
10124
10125 ::fidl_next::Encode::encode(&self.used_bytes, encoder_, used_bytes, ())?;
10126
10127 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(used_bytes.as_mut_ptr()) };
10128
10129 ::fidl_next::Encode::encode(&self.total_nodes, encoder_, total_nodes, ())?;
10130
10131 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(total_nodes.as_mut_ptr()) };
10132
10133 ::fidl_next::Encode::encode(&self.used_nodes, encoder_, used_nodes, ())?;
10134
10135 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(used_nodes.as_mut_ptr()) };
10136
10137 ::fidl_next::Encode::encode(
10138 &self.free_shared_pool_bytes,
10139 encoder_,
10140 free_shared_pool_bytes,
10141 (),
10142 )?;
10143
10144 let mut _field =
10145 unsafe { ::fidl_next::Slot::new_unchecked(free_shared_pool_bytes.as_mut_ptr()) };
10146
10147 ::fidl_next::Encode::encode(&self.fs_id, encoder_, fs_id, ())?;
10148
10149 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fs_id.as_mut_ptr()) };
10150
10151 ::fidl_next::Encode::encode(&self.block_size, encoder_, block_size, ())?;
10152
10153 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(block_size.as_mut_ptr()) };
10154
10155 ::fidl_next::Encode::encode(&self.max_filename_size, encoder_, max_filename_size, ())?;
10156
10157 let mut _field =
10158 unsafe { ::fidl_next::Slot::new_unchecked(max_filename_size.as_mut_ptr()) };
10159
10160 ::fidl_next::Encode::encode(&self.fs_type, encoder_, fs_type, ())?;
10161
10162 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fs_type.as_mut_ptr()) };
10163
10164 ::fidl_next::Encode::encode(&self.padding, encoder_, padding, ())?;
10165
10166 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(padding.as_mut_ptr()) };
10167
10168 ::fidl_next::Encode::encode(&self.name, encoder_, name, ())?;
10169
10170 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
10171
10172 Ok(())
10173 }
10174 }
10175
10176 unsafe impl<___E>
10177 ::fidl_next::EncodeOption<
10178 ::fidl_next::wire::Box<'static, crate::wire::FilesystemInfo>,
10179 ___E,
10180 > for FilesystemInfo
10181 where
10182 ___E: ::fidl_next::Encoder + ?Sized,
10183 FilesystemInfo: ::fidl_next::Encode<crate::wire::FilesystemInfo, ___E>,
10184 {
10185 #[inline]
10186 fn encode_option(
10187 this: ::core::option::Option<Self>,
10188 encoder: &mut ___E,
10189 out: &mut ::core::mem::MaybeUninit<
10190 ::fidl_next::wire::Box<'static, crate::wire::FilesystemInfo>,
10191 >,
10192 _: (),
10193 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10194 if let Some(inner) = this {
10195 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10196 ::fidl_next::wire::Box::encode_present(out);
10197 } else {
10198 ::fidl_next::wire::Box::encode_absent(out);
10199 }
10200
10201 Ok(())
10202 }
10203 }
10204
10205 unsafe impl<'a, ___E>
10206 ::fidl_next::EncodeOption<
10207 ::fidl_next::wire::Box<'static, crate::wire::FilesystemInfo>,
10208 ___E,
10209 > for &'a FilesystemInfo
10210 where
10211 ___E: ::fidl_next::Encoder + ?Sized,
10212 &'a FilesystemInfo: ::fidl_next::Encode<crate::wire::FilesystemInfo, ___E>,
10213 {
10214 #[inline]
10215 fn encode_option(
10216 this: ::core::option::Option<Self>,
10217 encoder: &mut ___E,
10218 out: &mut ::core::mem::MaybeUninit<
10219 ::fidl_next::wire::Box<'static, crate::wire::FilesystemInfo>,
10220 >,
10221 _: (),
10222 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10223 if let Some(inner) = this {
10224 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10225 ::fidl_next::wire::Box::encode_present(out);
10226 } else {
10227 ::fidl_next::wire::Box::encode_absent(out);
10228 }
10229
10230 Ok(())
10231 }
10232 }
10233
10234 impl ::fidl_next::FromWire<crate::wire::FilesystemInfo> for FilesystemInfo {
10235 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::FilesystemInfo, Self> = unsafe {
10236 ::fidl_next::CopyOptimization::enable_if(
10237 true
10238 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10239 .is_enabled()
10240 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10241 .is_enabled()
10242 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10243 .is_enabled()
10244 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10245 .is_enabled()
10246 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10247 .is_enabled()
10248 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
10249 .is_enabled()
10250 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
10251 .is_enabled()
10252 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
10253 .is_enabled()
10254 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
10255 .is_enabled()
10256 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
10257 .is_enabled()
10258 && <[i8; 32] as ::fidl_next::FromWire<[i8; 32]>>::COPY_OPTIMIZATION
10259 .is_enabled(),
10260 )
10261 };
10262
10263 #[inline]
10264 fn from_wire(wire: crate::wire::FilesystemInfo) -> Self {
10265 Self {
10266 total_bytes: ::fidl_next::FromWire::from_wire(wire.total_bytes),
10267
10268 used_bytes: ::fidl_next::FromWire::from_wire(wire.used_bytes),
10269
10270 total_nodes: ::fidl_next::FromWire::from_wire(wire.total_nodes),
10271
10272 used_nodes: ::fidl_next::FromWire::from_wire(wire.used_nodes),
10273
10274 free_shared_pool_bytes: ::fidl_next::FromWire::from_wire(
10275 wire.free_shared_pool_bytes,
10276 ),
10277
10278 fs_id: ::fidl_next::FromWire::from_wire(wire.fs_id),
10279
10280 block_size: ::fidl_next::FromWire::from_wire(wire.block_size),
10281
10282 max_filename_size: ::fidl_next::FromWire::from_wire(wire.max_filename_size),
10283
10284 fs_type: ::fidl_next::FromWire::from_wire(wire.fs_type),
10285
10286 padding: ::fidl_next::FromWire::from_wire(wire.padding),
10287
10288 name: ::fidl_next::FromWire::from_wire(wire.name),
10289 }
10290 }
10291 }
10292
10293 impl ::fidl_next::FromWireRef<crate::wire::FilesystemInfo> for FilesystemInfo {
10294 #[inline]
10295 fn from_wire_ref(wire: &crate::wire::FilesystemInfo) -> Self {
10296 Self {
10297 total_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_bytes),
10298
10299 used_bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_bytes),
10300
10301 total_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.total_nodes),
10302
10303 used_nodes: ::fidl_next::FromWireRef::from_wire_ref(&wire.used_nodes),
10304
10305 free_shared_pool_bytes: ::fidl_next::FromWireRef::from_wire_ref(
10306 &wire.free_shared_pool_bytes,
10307 ),
10308
10309 fs_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_id),
10310
10311 block_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.block_size),
10312
10313 max_filename_size: ::fidl_next::FromWireRef::from_wire_ref(&wire.max_filename_size),
10314
10315 fs_type: ::fidl_next::FromWireRef::from_wire_ref(&wire.fs_type),
10316
10317 padding: ::fidl_next::FromWireRef::from_wire_ref(&wire.padding),
10318
10319 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
10320 }
10321 }
10322 }
10323
10324 pub type Service = ();
10325
10326 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10327 pub struct SymlinkObject {
10328 pub target: ::std::vec::Vec<u8>,
10329 }
10330
10331 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SymlinkObject<'static>, ___E> for SymlinkObject
10332 where
10333 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10334 ___E: ::fidl_next::Encoder,
10335 {
10336 #[inline]
10337 fn encode(
10338 self,
10339 encoder_: &mut ___E,
10340 out_: &mut ::core::mem::MaybeUninit<crate::wire::SymlinkObject<'static>>,
10341 _: (),
10342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10343 ::fidl_next::munge! {
10344 let crate::wire::SymlinkObject {
10345 target,
10346
10347 } = out_;
10348 }
10349
10350 ::fidl_next::Encode::encode(self.target, encoder_, target, (4095, ()))?;
10351
10352 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target.as_mut_ptr()) };
10353 ::fidl_next::Constrained::validate(_field, (4095, ()))?;
10354
10355 Ok(())
10356 }
10357 }
10358
10359 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SymlinkObject<'static>, ___E>
10360 for &'a SymlinkObject
10361 where
10362 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10363 ___E: ::fidl_next::Encoder,
10364 {
10365 #[inline]
10366 fn encode(
10367 self,
10368 encoder_: &mut ___E,
10369 out_: &mut ::core::mem::MaybeUninit<crate::wire::SymlinkObject<'static>>,
10370 _: (),
10371 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10372 ::fidl_next::munge! {
10373 let crate::wire::SymlinkObject {
10374 target,
10375
10376 } = out_;
10377 }
10378
10379 ::fidl_next::Encode::encode(&self.target, encoder_, target, (4095, ()))?;
10380
10381 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target.as_mut_ptr()) };
10382 ::fidl_next::Constrained::validate(_field, (4095, ()))?;
10383
10384 Ok(())
10385 }
10386 }
10387
10388 unsafe impl<___E>
10389 ::fidl_next::EncodeOption<
10390 ::fidl_next::wire::Box<'static, crate::wire::SymlinkObject<'static>>,
10391 ___E,
10392 > for SymlinkObject
10393 where
10394 ___E: ::fidl_next::Encoder + ?Sized,
10395 SymlinkObject: ::fidl_next::Encode<crate::wire::SymlinkObject<'static>, ___E>,
10396 {
10397 #[inline]
10398 fn encode_option(
10399 this: ::core::option::Option<Self>,
10400 encoder: &mut ___E,
10401 out: &mut ::core::mem::MaybeUninit<
10402 ::fidl_next::wire::Box<'static, crate::wire::SymlinkObject<'static>>,
10403 >,
10404 _: (),
10405 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10406 if let Some(inner) = this {
10407 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10408 ::fidl_next::wire::Box::encode_present(out);
10409 } else {
10410 ::fidl_next::wire::Box::encode_absent(out);
10411 }
10412
10413 Ok(())
10414 }
10415 }
10416
10417 unsafe impl<'a, ___E>
10418 ::fidl_next::EncodeOption<
10419 ::fidl_next::wire::Box<'static, crate::wire::SymlinkObject<'static>>,
10420 ___E,
10421 > for &'a SymlinkObject
10422 where
10423 ___E: ::fidl_next::Encoder + ?Sized,
10424 &'a SymlinkObject: ::fidl_next::Encode<crate::wire::SymlinkObject<'static>, ___E>,
10425 {
10426 #[inline]
10427 fn encode_option(
10428 this: ::core::option::Option<Self>,
10429 encoder: &mut ___E,
10430 out: &mut ::core::mem::MaybeUninit<
10431 ::fidl_next::wire::Box<'static, crate::wire::SymlinkObject<'static>>,
10432 >,
10433 _: (),
10434 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10435 if let Some(inner) = this {
10436 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10437 ::fidl_next::wire::Box::encode_present(out);
10438 } else {
10439 ::fidl_next::wire::Box::encode_absent(out);
10440 }
10441
10442 Ok(())
10443 }
10444 }
10445
10446 impl<'de> ::fidl_next::FromWire<crate::wire::SymlinkObject<'de>> for SymlinkObject {
10447 #[inline]
10448 fn from_wire(wire: crate::wire::SymlinkObject<'de>) -> Self {
10449 Self { target: ::fidl_next::FromWire::from_wire(wire.target) }
10450 }
10451 }
10452
10453 impl<'de> ::fidl_next::FromWireRef<crate::wire::SymlinkObject<'de>> for SymlinkObject {
10454 #[inline]
10455 fn from_wire_ref(wire: &crate::wire::SymlinkObject<'de>) -> Self {
10456 Self { target: ::fidl_next::FromWireRef::from_wire_ref(&wire.target) }
10457 }
10458 }
10459
10460 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10461 #[repr(u8)]
10462 pub enum WatchEvent {
10463 Deleted = 0,
10464 Added = 1,
10465 Removed = 2,
10466 Existing = 3,
10467 Idle = 4,
10468 }
10469 impl ::core::convert::TryFrom<u8> for WatchEvent {
10470 type Error = ::fidl_next::UnknownStrictEnumMemberError;
10471 fn try_from(
10472 value: u8,
10473 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
10474 match value {
10475 0 => Ok(Self::Deleted),
10476 1 => Ok(Self::Added),
10477 2 => Ok(Self::Removed),
10478 3 => Ok(Self::Existing),
10479 4 => Ok(Self::Idle),
10480
10481 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
10482 }
10483 }
10484 }
10485
10486 impl ::std::convert::From<WatchEvent> for u8 {
10487 fn from(value: WatchEvent) -> Self {
10488 match value {
10489 WatchEvent::Deleted => 0,
10490 WatchEvent::Added => 1,
10491 WatchEvent::Removed => 2,
10492 WatchEvent::Existing => 3,
10493 WatchEvent::Idle => 4,
10494 }
10495 }
10496 }
10497
10498 unsafe impl<___E> ::fidl_next::Encode<crate::wire::WatchEvent, ___E> for WatchEvent
10499 where
10500 ___E: ?Sized,
10501 {
10502 #[inline]
10503 fn encode(
10504 self,
10505 encoder: &mut ___E,
10506 out: &mut ::core::mem::MaybeUninit<crate::wire::WatchEvent>,
10507 _: (),
10508 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10509 ::fidl_next::Encode::encode(&self, encoder, out, ())
10510 }
10511 }
10512
10513 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::WatchEvent, ___E> for &'a WatchEvent
10514 where
10515 ___E: ?Sized,
10516 {
10517 #[inline]
10518 fn encode(
10519 self,
10520 encoder: &mut ___E,
10521 out: &mut ::core::mem::MaybeUninit<crate::wire::WatchEvent>,
10522 _: (),
10523 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10524 ::fidl_next::munge!(let crate::wire::WatchEvent { value } = out);
10525 let _ = value.write(u8::from(match *self {
10526 WatchEvent::Deleted => 0,
10527
10528 WatchEvent::Added => 1,
10529
10530 WatchEvent::Removed => 2,
10531
10532 WatchEvent::Existing => 3,
10533
10534 WatchEvent::Idle => 4,
10535 }));
10536
10537 Ok(())
10538 }
10539 }
10540
10541 impl ::core::convert::From<crate::wire::WatchEvent> for WatchEvent {
10542 fn from(wire: crate::wire::WatchEvent) -> Self {
10543 match u8::from(wire.value) {
10544 0 => Self::Deleted,
10545
10546 1 => Self::Added,
10547
10548 2 => Self::Removed,
10549
10550 3 => Self::Existing,
10551
10552 4 => Self::Idle,
10553
10554 _ => unsafe { ::core::hint::unreachable_unchecked() },
10555 }
10556 }
10557 }
10558
10559 impl ::fidl_next::FromWire<crate::wire::WatchEvent> for WatchEvent {
10560 #[inline]
10561 fn from_wire(wire: crate::wire::WatchEvent) -> Self {
10562 Self::from(wire)
10563 }
10564 }
10565
10566 impl ::fidl_next::FromWireRef<crate::wire::WatchEvent> for WatchEvent {
10567 #[inline]
10568 fn from_wire_ref(wire: &crate::wire::WatchEvent) -> Self {
10569 Self::from(*wire)
10570 }
10571 }
10572}
10573
10574pub mod wire {
10575
10576 #[derive(Clone, Copy, Debug)]
10578 #[repr(transparent)]
10579 pub struct Operations {
10580 pub(crate) value: ::fidl_next::wire::Uint64,
10581 }
10582
10583 impl ::fidl_next::Constrained for Operations {
10584 type Constraint = ();
10585
10586 fn validate(
10587 _: ::fidl_next::Slot<'_, Self>,
10588 _: Self::Constraint,
10589 ) -> Result<(), ::fidl_next::ValidationError> {
10590 Ok(())
10591 }
10592 }
10593
10594 unsafe impl ::fidl_next::Wire for Operations {
10595 type Narrowed<'de> = Self;
10596
10597 #[inline]
10598 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10599 }
10601 }
10602
10603 unsafe impl<___D> ::fidl_next::Decode<___D> for Operations
10604 where
10605 ___D: ?Sized,
10606 {
10607 fn decode(
10608 slot: ::fidl_next::Slot<'_, Self>,
10609 _: &mut ___D,
10610 _: (),
10611 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10612 Ok(())
10613 }
10614 }
10615
10616 impl ::core::convert::From<crate::natural::Operations> for Operations {
10617 fn from(natural: crate::natural::Operations) -> Self {
10618 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
10619 }
10620 }
10621
10622 impl ::fidl_next::IntoNatural for Operations {
10623 type Natural = crate::natural::Operations;
10624 }
10625
10626 pub type Abilities = crate::wire::Operations;
10628
10629 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10631 #[repr(transparent)]
10632 pub struct SeekOrigin {
10633 pub(crate) value: ::fidl_next::wire::Uint32,
10634 }
10635
10636 impl ::fidl_next::Constrained for SeekOrigin {
10637 type Constraint = ();
10638
10639 fn validate(
10640 _: ::fidl_next::Slot<'_, Self>,
10641 _: Self::Constraint,
10642 ) -> Result<(), ::fidl_next::ValidationError> {
10643 Ok(())
10644 }
10645 }
10646
10647 unsafe impl ::fidl_next::Wire for SeekOrigin {
10648 type Narrowed<'de> = Self;
10649
10650 #[inline]
10651 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10652 }
10654 }
10655
10656 impl SeekOrigin {
10657 pub const START: SeekOrigin = SeekOrigin { value: ::fidl_next::wire::Uint32(0) };
10658
10659 pub const CURRENT: SeekOrigin = SeekOrigin { value: ::fidl_next::wire::Uint32(1) };
10660
10661 pub const END: SeekOrigin = SeekOrigin { value: ::fidl_next::wire::Uint32(2) };
10662 }
10663
10664 unsafe impl<___D> ::fidl_next::Decode<___D> for SeekOrigin
10665 where
10666 ___D: ?Sized,
10667 {
10668 fn decode(
10669 slot: ::fidl_next::Slot<'_, Self>,
10670 _: &mut ___D,
10671 _: (),
10672 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10673 ::fidl_next::munge!(let Self { value } = slot);
10674
10675 match u32::from(*value) {
10676 0 | 1 | 2 => (),
10677 unknown => {
10678 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
10679 }
10680 }
10681
10682 Ok(())
10683 }
10684 }
10685
10686 impl ::core::convert::From<crate::natural::SeekOrigin> for SeekOrigin {
10687 fn from(natural: crate::natural::SeekOrigin) -> Self {
10688 match natural {
10689 crate::natural::SeekOrigin::Start => SeekOrigin::START,
10690
10691 crate::natural::SeekOrigin::Current => SeekOrigin::CURRENT,
10692
10693 crate::natural::SeekOrigin::End => SeekOrigin::END,
10694 }
10695 }
10696 }
10697
10698 impl ::fidl_next::IntoNatural for SeekOrigin {
10699 type Natural = crate::natural::SeekOrigin;
10700 }
10701
10702 #[derive(Clone, Debug)]
10704 #[repr(C)]
10705 pub struct AdvisoryLockRange {
10706 pub origin: crate::wire::SeekOrigin,
10707
10708 pub offset: ::fidl_next::wire::Int64,
10709
10710 pub length: ::fidl_next::wire::Int64,
10711 }
10712
10713 static_assertions::const_assert_eq!(std::mem::size_of::<AdvisoryLockRange>(), 24);
10714 static_assertions::const_assert_eq!(std::mem::align_of::<AdvisoryLockRange>(), 8);
10715
10716 static_assertions::const_assert_eq!(std::mem::offset_of!(AdvisoryLockRange, origin), 0);
10717
10718 static_assertions::const_assert_eq!(std::mem::offset_of!(AdvisoryLockRange, offset), 8);
10719
10720 static_assertions::const_assert_eq!(std::mem::offset_of!(AdvisoryLockRange, length), 16);
10721
10722 impl ::fidl_next::Constrained for AdvisoryLockRange {
10723 type Constraint = ();
10724
10725 fn validate(
10726 _: ::fidl_next::Slot<'_, Self>,
10727 _: Self::Constraint,
10728 ) -> Result<(), ::fidl_next::ValidationError> {
10729 Ok(())
10730 }
10731 }
10732
10733 unsafe impl ::fidl_next::Wire for AdvisoryLockRange {
10734 type Narrowed<'de> = AdvisoryLockRange;
10735
10736 #[inline]
10737 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
10738 ::fidl_next::munge! {
10739 let Self {
10740 origin,
10741 offset,
10742 length,
10743
10744 } = &mut *out_;
10745 }
10746
10747 ::fidl_next::Wire::zero_padding(origin);
10748
10749 ::fidl_next::Wire::zero_padding(offset);
10750
10751 ::fidl_next::Wire::zero_padding(length);
10752
10753 unsafe {
10754 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
10755 }
10756 }
10757 }
10758
10759 unsafe impl<___D> ::fidl_next::Decode<___D> for AdvisoryLockRange
10760 where
10761 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10762 {
10763 fn decode(
10764 slot_: ::fidl_next::Slot<'_, Self>,
10765 decoder_: &mut ___D,
10766 _: (),
10767 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10768 if slot_.as_bytes()[4..8] != [0u8; 4] {
10769 return Err(::fidl_next::DecodeError::InvalidPadding);
10770 }
10771
10772 ::fidl_next::munge! {
10773 let Self {
10774 mut origin,
10775 mut offset,
10776 mut length,
10777
10778 } = slot_;
10779 }
10780
10781 let _field = origin.as_mut();
10782
10783 ::fidl_next::Decode::decode(origin.as_mut(), decoder_, ())?;
10784
10785 let _field = offset.as_mut();
10786
10787 ::fidl_next::Decode::decode(offset.as_mut(), decoder_, ())?;
10788
10789 let _field = length.as_mut();
10790
10791 ::fidl_next::Decode::decode(length.as_mut(), decoder_, ())?;
10792
10793 Ok(())
10794 }
10795 }
10796
10797 impl ::fidl_next::IntoNatural for AdvisoryLockRange {
10798 type Natural = crate::natural::AdvisoryLockRange;
10799 }
10800
10801 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10803 #[repr(transparent)]
10804 pub struct AdvisoryLockType {
10805 pub(crate) value: ::fidl_next::wire::Uint32,
10806 }
10807
10808 impl ::fidl_next::Constrained for AdvisoryLockType {
10809 type Constraint = ();
10810
10811 fn validate(
10812 _: ::fidl_next::Slot<'_, Self>,
10813 _: Self::Constraint,
10814 ) -> Result<(), ::fidl_next::ValidationError> {
10815 Ok(())
10816 }
10817 }
10818
10819 unsafe impl ::fidl_next::Wire for AdvisoryLockType {
10820 type Narrowed<'de> = Self;
10821
10822 #[inline]
10823 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10824 }
10826 }
10827
10828 impl AdvisoryLockType {
10829 pub const READ: AdvisoryLockType = AdvisoryLockType { value: ::fidl_next::wire::Uint32(1) };
10830
10831 pub const WRITE: AdvisoryLockType =
10832 AdvisoryLockType { value: ::fidl_next::wire::Uint32(2) };
10833
10834 pub const UNLOCK: AdvisoryLockType =
10835 AdvisoryLockType { value: ::fidl_next::wire::Uint32(3) };
10836 }
10837
10838 unsafe impl<___D> ::fidl_next::Decode<___D> for AdvisoryLockType
10839 where
10840 ___D: ?Sized,
10841 {
10842 fn decode(
10843 slot: ::fidl_next::Slot<'_, Self>,
10844 _: &mut ___D,
10845 _: (),
10846 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10847 ::fidl_next::munge!(let Self { value } = slot);
10848
10849 match u32::from(*value) {
10850 1 | 2 | 3 => (),
10851 unknown => {
10852 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
10853 }
10854 }
10855
10856 Ok(())
10857 }
10858 }
10859
10860 impl ::core::convert::From<crate::natural::AdvisoryLockType> for AdvisoryLockType {
10861 fn from(natural: crate::natural::AdvisoryLockType) -> Self {
10862 match natural {
10863 crate::natural::AdvisoryLockType::Read => AdvisoryLockType::READ,
10864
10865 crate::natural::AdvisoryLockType::Write => AdvisoryLockType::WRITE,
10866
10867 crate::natural::AdvisoryLockType::Unlock => AdvisoryLockType::UNLOCK,
10868 }
10869 }
10870 }
10871
10872 impl ::fidl_next::IntoNatural for AdvisoryLockType {
10873 type Natural = crate::natural::AdvisoryLockType;
10874 }
10875
10876 #[repr(C)]
10878 pub struct AdvisoryLockRequest<'de> {
10879 pub(crate) table: ::fidl_next::wire::Table<'de>,
10880 }
10881
10882 impl<'de> Drop for AdvisoryLockRequest<'de> {
10883 fn drop(&mut self) {
10884 let _ = self.table.get(1).map(|envelope| unsafe {
10885 envelope.read_unchecked::<crate::wire::AdvisoryLockType>()
10886 });
10887
10888 let _ = self.table.get(2).map(|envelope| unsafe {
10889 envelope.read_unchecked::<crate::wire::AdvisoryLockRange>()
10890 });
10891
10892 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10893 }
10894 }
10895
10896 impl ::fidl_next::Constrained for AdvisoryLockRequest<'_> {
10897 type Constraint = ();
10898
10899 fn validate(
10900 _: ::fidl_next::Slot<'_, Self>,
10901 _: Self::Constraint,
10902 ) -> Result<(), ::fidl_next::ValidationError> {
10903 Ok(())
10904 }
10905 }
10906
10907 unsafe impl ::fidl_next::Wire for AdvisoryLockRequest<'static> {
10908 type Narrowed<'de> = AdvisoryLockRequest<'de>;
10909
10910 #[inline]
10911 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10912 ::fidl_next::munge!(let Self { table } = out);
10913 ::fidl_next::wire::Table::zero_padding(table);
10914 }
10915 }
10916
10917 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for AdvisoryLockRequest<'de>
10918 where
10919 ___D: ::fidl_next::Decoder<'de> + ?Sized,
10920 {
10921 fn decode(
10922 slot: ::fidl_next::Slot<'_, Self>,
10923 decoder: &mut ___D,
10924 _: (),
10925 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10926 ::fidl_next::munge!(let Self { table } = slot);
10927
10928 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10929 match ordinal {
10930 0 => unsafe { ::core::hint::unreachable_unchecked() },
10931
10932 1 => {
10933 ::fidl_next::wire::Envelope::decode_as::<
10934 ___D,
10935 crate::wire::AdvisoryLockType,
10936 >(slot.as_mut(), decoder, ())?;
10937
10938 Ok(())
10939 }
10940
10941 2 => {
10942 ::fidl_next::wire::Envelope::decode_as::<
10943 ___D,
10944 crate::wire::AdvisoryLockRange,
10945 >(slot.as_mut(), decoder, ())?;
10946
10947 Ok(())
10948 }
10949
10950 3 => {
10951 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
10952 slot.as_mut(),
10953 decoder,
10954 (),
10955 )?;
10956
10957 Ok(())
10958 }
10959
10960 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
10961 }
10962 })
10963 }
10964 }
10965
10966 impl<'de> AdvisoryLockRequest<'de> {
10967 pub fn type_(&self) -> ::core::option::Option<&crate::wire::AdvisoryLockType> {
10968 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10969 }
10970
10971 pub fn take_type_(&mut self) -> ::core::option::Option<crate::wire::AdvisoryLockType> {
10972 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
10973 }
10974
10975 pub fn range(&self) -> ::core::option::Option<&crate::wire::AdvisoryLockRange> {
10976 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10977 }
10978
10979 pub fn take_range(&mut self) -> ::core::option::Option<crate::wire::AdvisoryLockRange> {
10980 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
10981 }
10982
10983 pub fn wait(&self) -> ::core::option::Option<&bool> {
10984 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10985 }
10986
10987 pub fn take_wait(&mut self) -> ::core::option::Option<bool> {
10988 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
10989 }
10990 }
10991
10992 impl<'de> ::core::fmt::Debug for AdvisoryLockRequest<'de> {
10993 fn fmt(
10994 &self,
10995 f: &mut ::core::fmt::Formatter<'_>,
10996 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10997 f.debug_struct("AdvisoryLockRequest")
10998 .field("type_", &self.type_())
10999 .field("range", &self.range())
11000 .field("wait", &self.wait())
11001 .finish()
11002 }
11003 }
11004
11005 impl<'de> ::fidl_next::IntoNatural for AdvisoryLockRequest<'de> {
11006 type Natural = crate::natural::AdvisoryLockRequest;
11007 }
11008
11009 #[derive(Debug)]
11011 #[repr(C)]
11012 pub struct AdvisoryLockingAdvisoryLockRequest<'de> {
11013 pub request: crate::wire::AdvisoryLockRequest<'de>,
11014 }
11015
11016 static_assertions::const_assert_eq!(
11017 std::mem::size_of::<AdvisoryLockingAdvisoryLockRequest<'_>>(),
11018 16
11019 );
11020 static_assertions::const_assert_eq!(
11021 std::mem::align_of::<AdvisoryLockingAdvisoryLockRequest<'_>>(),
11022 8
11023 );
11024
11025 static_assertions::const_assert_eq!(
11026 std::mem::offset_of!(AdvisoryLockingAdvisoryLockRequest<'_>, request),
11027 0
11028 );
11029
11030 impl ::fidl_next::Constrained for AdvisoryLockingAdvisoryLockRequest<'_> {
11031 type Constraint = ();
11032
11033 fn validate(
11034 _: ::fidl_next::Slot<'_, Self>,
11035 _: Self::Constraint,
11036 ) -> Result<(), ::fidl_next::ValidationError> {
11037 Ok(())
11038 }
11039 }
11040
11041 unsafe impl ::fidl_next::Wire for AdvisoryLockingAdvisoryLockRequest<'static> {
11042 type Narrowed<'de> = AdvisoryLockingAdvisoryLockRequest<'de>;
11043
11044 #[inline]
11045 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11046 ::fidl_next::munge! {
11047 let Self {
11048 request,
11049
11050 } = &mut *out_;
11051 }
11052
11053 ::fidl_next::Wire::zero_padding(request);
11054 }
11055 }
11056
11057 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for AdvisoryLockingAdvisoryLockRequest<'de>
11058 where
11059 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11060 ___D: ::fidl_next::Decoder<'de>,
11061 {
11062 fn decode(
11063 slot_: ::fidl_next::Slot<'_, Self>,
11064 decoder_: &mut ___D,
11065 _: (),
11066 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11067 ::fidl_next::munge! {
11068 let Self {
11069 mut request,
11070
11071 } = slot_;
11072 }
11073
11074 let _field = request.as_mut();
11075
11076 ::fidl_next::Decode::decode(request.as_mut(), decoder_, ())?;
11077
11078 Ok(())
11079 }
11080 }
11081
11082 impl<'de> ::fidl_next::IntoNatural for AdvisoryLockingAdvisoryLockRequest<'de> {
11083 type Natural = crate::natural::AdvisoryLockingAdvisoryLockRequest;
11084 }
11085
11086 pub type AdvisoryLockingAdvisoryLockResponse = ::fidl_next::wire::Unit;
11088
11089 #[derive(Clone, Copy, Debug)]
11091 #[repr(transparent)]
11092 pub struct AllocateMode {
11093 pub(crate) value: ::fidl_next::wire::Uint32,
11094 }
11095
11096 impl ::fidl_next::Constrained for AllocateMode {
11097 type Constraint = ();
11098
11099 fn validate(
11100 _: ::fidl_next::Slot<'_, Self>,
11101 _: Self::Constraint,
11102 ) -> Result<(), ::fidl_next::ValidationError> {
11103 Ok(())
11104 }
11105 }
11106
11107 unsafe impl ::fidl_next::Wire for AllocateMode {
11108 type Narrowed<'de> = Self;
11109
11110 #[inline]
11111 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11112 }
11114 }
11115
11116 unsafe impl<___D> ::fidl_next::Decode<___D> for AllocateMode
11117 where
11118 ___D: ?Sized,
11119 {
11120 fn decode(
11121 slot: ::fidl_next::Slot<'_, Self>,
11122 _: &mut ___D,
11123 _: (),
11124 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11125 Ok(())
11126 }
11127 }
11128
11129 impl ::core::convert::From<crate::natural::AllocateMode> for AllocateMode {
11130 fn from(natural: crate::natural::AllocateMode) -> Self {
11131 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
11132 }
11133 }
11134
11135 impl ::fidl_next::IntoNatural for AllocateMode {
11136 type Natural = crate::natural::AllocateMode;
11137 }
11138
11139 pub type Rights = crate::wire::Operations;
11141
11142 pub type Id = ::fidl_next::wire::Uint64;
11144
11145 #[derive(Clone, Copy, Debug)]
11147 #[repr(transparent)]
11148 pub struct OpenFlags {
11149 pub(crate) value: ::fidl_next::wire::Uint32,
11150 }
11151
11152 impl ::fidl_next::Constrained for OpenFlags {
11153 type Constraint = ();
11154
11155 fn validate(
11156 _: ::fidl_next::Slot<'_, Self>,
11157 _: Self::Constraint,
11158 ) -> Result<(), ::fidl_next::ValidationError> {
11159 Ok(())
11160 }
11161 }
11162
11163 unsafe impl ::fidl_next::Wire for OpenFlags {
11164 type Narrowed<'de> = Self;
11165
11166 #[inline]
11167 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11168 }
11170 }
11171
11172 unsafe impl<___D> ::fidl_next::Decode<___D> for OpenFlags
11173 where
11174 ___D: ?Sized,
11175 {
11176 fn decode(
11177 slot: ::fidl_next::Slot<'_, Self>,
11178 _: &mut ___D,
11179 _: (),
11180 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11181 ::fidl_next::munge!(let Self { value } = slot);
11182 let set = u32::from(*value);
11183 if set & !crate::natural::OpenFlags::all().bits() != 0 {
11184 return Err(::fidl_next::DecodeError::InvalidBits {
11185 expected: crate::natural::OpenFlags::all().bits() as usize,
11186 actual: set as usize,
11187 });
11188 }
11189
11190 Ok(())
11191 }
11192 }
11193
11194 impl ::core::convert::From<crate::natural::OpenFlags> for OpenFlags {
11195 fn from(natural: crate::natural::OpenFlags) -> Self {
11196 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
11197 }
11198 }
11199
11200 impl ::fidl_next::IntoNatural for OpenFlags {
11201 type Natural = crate::natural::OpenFlags;
11202 }
11203
11204 #[derive(Clone, Debug)]
11206 #[repr(C)]
11207 pub struct NodeAttributes {
11208 pub mode: ::fidl_next::wire::Uint32,
11209
11210 pub id: ::fidl_next::wire::Uint64,
11211
11212 pub content_size: ::fidl_next::wire::Uint64,
11213
11214 pub storage_size: ::fidl_next::wire::Uint64,
11215
11216 pub link_count: ::fidl_next::wire::Uint64,
11217
11218 pub creation_time: ::fidl_next::wire::Uint64,
11219
11220 pub modification_time: ::fidl_next::wire::Uint64,
11221 }
11222
11223 static_assertions::const_assert_eq!(std::mem::size_of::<NodeAttributes>(), 56);
11224 static_assertions::const_assert_eq!(std::mem::align_of::<NodeAttributes>(), 8);
11225
11226 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, mode), 0);
11227
11228 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, id), 8);
11229
11230 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, content_size), 16);
11231
11232 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, storage_size), 24);
11233
11234 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, link_count), 32);
11235
11236 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeAttributes, creation_time), 40);
11237
11238 static_assertions::const_assert_eq!(
11239 std::mem::offset_of!(NodeAttributes, modification_time),
11240 48
11241 );
11242
11243 impl ::fidl_next::Constrained for NodeAttributes {
11244 type Constraint = ();
11245
11246 fn validate(
11247 _: ::fidl_next::Slot<'_, Self>,
11248 _: Self::Constraint,
11249 ) -> Result<(), ::fidl_next::ValidationError> {
11250 Ok(())
11251 }
11252 }
11253
11254 unsafe impl ::fidl_next::Wire for NodeAttributes {
11255 type Narrowed<'de> = NodeAttributes;
11256
11257 #[inline]
11258 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11259 ::fidl_next::munge! {
11260 let Self {
11261 mode,
11262 id,
11263 content_size,
11264 storage_size,
11265 link_count,
11266 creation_time,
11267 modification_time,
11268
11269 } = &mut *out_;
11270 }
11271
11272 ::fidl_next::Wire::zero_padding(mode);
11273
11274 ::fidl_next::Wire::zero_padding(id);
11275
11276 ::fidl_next::Wire::zero_padding(content_size);
11277
11278 ::fidl_next::Wire::zero_padding(storage_size);
11279
11280 ::fidl_next::Wire::zero_padding(link_count);
11281
11282 ::fidl_next::Wire::zero_padding(creation_time);
11283
11284 ::fidl_next::Wire::zero_padding(modification_time);
11285
11286 unsafe {
11287 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
11288 }
11289 }
11290 }
11291
11292 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeAttributes
11293 where
11294 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11295 {
11296 fn decode(
11297 slot_: ::fidl_next::Slot<'_, Self>,
11298 decoder_: &mut ___D,
11299 _: (),
11300 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11301 if slot_.as_bytes()[4..8] != [0u8; 4] {
11302 return Err(::fidl_next::DecodeError::InvalidPadding);
11303 }
11304
11305 ::fidl_next::munge! {
11306 let Self {
11307 mut mode,
11308 mut id,
11309 mut content_size,
11310 mut storage_size,
11311 mut link_count,
11312 mut creation_time,
11313 mut modification_time,
11314
11315 } = slot_;
11316 }
11317
11318 let _field = mode.as_mut();
11319
11320 ::fidl_next::Decode::decode(mode.as_mut(), decoder_, ())?;
11321
11322 let _field = id.as_mut();
11323
11324 ::fidl_next::Decode::decode(id.as_mut(), decoder_, ())?;
11325
11326 let _field = content_size.as_mut();
11327
11328 ::fidl_next::Decode::decode(content_size.as_mut(), decoder_, ())?;
11329
11330 let _field = storage_size.as_mut();
11331
11332 ::fidl_next::Decode::decode(storage_size.as_mut(), decoder_, ())?;
11333
11334 let _field = link_count.as_mut();
11335
11336 ::fidl_next::Decode::decode(link_count.as_mut(), decoder_, ())?;
11337
11338 let _field = creation_time.as_mut();
11339
11340 ::fidl_next::Decode::decode(creation_time.as_mut(), decoder_, ())?;
11341
11342 let _field = modification_time.as_mut();
11343
11344 ::fidl_next::Decode::decode(modification_time.as_mut(), decoder_, ())?;
11345
11346 Ok(())
11347 }
11348 }
11349
11350 impl ::fidl_next::IntoNatural for NodeAttributes {
11351 type Natural = crate::natural::NodeAttributes;
11352 }
11353
11354 #[derive(Clone, Copy, Debug)]
11356 #[repr(transparent)]
11357 pub struct NodeAttributeFlags {
11358 pub(crate) value: ::fidl_next::wire::Uint32,
11359 }
11360
11361 impl ::fidl_next::Constrained for NodeAttributeFlags {
11362 type Constraint = ();
11363
11364 fn validate(
11365 _: ::fidl_next::Slot<'_, Self>,
11366 _: Self::Constraint,
11367 ) -> Result<(), ::fidl_next::ValidationError> {
11368 Ok(())
11369 }
11370 }
11371
11372 unsafe impl ::fidl_next::Wire for NodeAttributeFlags {
11373 type Narrowed<'de> = Self;
11374
11375 #[inline]
11376 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11377 }
11379 }
11380
11381 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeAttributeFlags
11382 where
11383 ___D: ?Sized,
11384 {
11385 fn decode(
11386 slot: ::fidl_next::Slot<'_, Self>,
11387 _: &mut ___D,
11388 _: (),
11389 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11390 ::fidl_next::munge!(let Self { value } = slot);
11391 let set = u32::from(*value);
11392 if set & !crate::natural::NodeAttributeFlags::all().bits() != 0 {
11393 return Err(::fidl_next::DecodeError::InvalidBits {
11394 expected: crate::natural::NodeAttributeFlags::all().bits() as usize,
11395 actual: set as usize,
11396 });
11397 }
11398
11399 Ok(())
11400 }
11401 }
11402
11403 impl ::core::convert::From<crate::natural::NodeAttributeFlags> for NodeAttributeFlags {
11404 fn from(natural: crate::natural::NodeAttributeFlags) -> Self {
11405 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
11406 }
11407 }
11408
11409 impl ::fidl_next::IntoNatural for NodeAttributeFlags {
11410 type Natural = crate::natural::NodeAttributeFlags;
11411 }
11412
11413 #[derive(Debug)]
11415 #[repr(C)]
11416 pub struct NodeQueryFilesystemResponse<'de> {
11417 pub s: ::fidl_next::wire::fuchsia::StatusResult,
11418
11419 pub info: ::fidl_next::wire::Box<'de, crate::wire::FilesystemInfo>,
11420 }
11421
11422 static_assertions::const_assert_eq!(std::mem::size_of::<NodeQueryFilesystemResponse<'_>>(), 16);
11423 static_assertions::const_assert_eq!(std::mem::align_of::<NodeQueryFilesystemResponse<'_>>(), 8);
11424
11425 static_assertions::const_assert_eq!(
11426 std::mem::offset_of!(NodeQueryFilesystemResponse<'_>, s),
11427 0
11428 );
11429
11430 static_assertions::const_assert_eq!(
11431 std::mem::offset_of!(NodeQueryFilesystemResponse<'_>, info),
11432 8
11433 );
11434
11435 impl ::fidl_next::Constrained for NodeQueryFilesystemResponse<'_> {
11436 type Constraint = ();
11437
11438 fn validate(
11439 _: ::fidl_next::Slot<'_, Self>,
11440 _: Self::Constraint,
11441 ) -> Result<(), ::fidl_next::ValidationError> {
11442 Ok(())
11443 }
11444 }
11445
11446 unsafe impl ::fidl_next::Wire for NodeQueryFilesystemResponse<'static> {
11447 type Narrowed<'de> = NodeQueryFilesystemResponse<'de>;
11448
11449 #[inline]
11450 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11451 ::fidl_next::munge! {
11452 let Self {
11453 s,
11454 info,
11455
11456 } = &mut *out_;
11457 }
11458
11459 ::fidl_next::Wire::zero_padding(s);
11460
11461 ::fidl_next::Wire::zero_padding(info);
11462
11463 unsafe {
11464 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
11465 }
11466 }
11467 }
11468
11469 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeQueryFilesystemResponse<'de>
11470 where
11471 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11472 ___D: ::fidl_next::Decoder<'de>,
11473 {
11474 fn decode(
11475 slot_: ::fidl_next::Slot<'_, Self>,
11476 decoder_: &mut ___D,
11477 _: (),
11478 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11479 if slot_.as_bytes()[4..8] != [0u8; 4] {
11480 return Err(::fidl_next::DecodeError::InvalidPadding);
11481 }
11482
11483 ::fidl_next::munge! {
11484 let Self {
11485 mut s,
11486 mut info,
11487
11488 } = slot_;
11489 }
11490
11491 let _field = s.as_mut();
11492
11493 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
11494
11495 let _field = info.as_mut();
11496
11497 ::fidl_next::Decode::decode(info.as_mut(), decoder_, ())?;
11498
11499 Ok(())
11500 }
11501 }
11502
11503 impl<'de> ::fidl_next::IntoNatural for NodeQueryFilesystemResponse<'de> {
11504 type Natural = crate::natural::NodeQueryFilesystemResponse;
11505 }
11506
11507 pub type NodeUpdateAttributesResponse = ::fidl_next::wire::Unit;
11509
11510 pub type NodeSyncResponse = ::fidl_next::wire::Unit;
11512
11513 #[derive(Clone, Copy, Debug)]
11515 #[repr(transparent)]
11516 pub struct ModeType {
11517 pub(crate) value: ::fidl_next::wire::Uint32,
11518 }
11519
11520 impl ::fidl_next::Constrained for ModeType {
11521 type Constraint = ();
11522
11523 fn validate(
11524 _: ::fidl_next::Slot<'_, Self>,
11525 _: Self::Constraint,
11526 ) -> Result<(), ::fidl_next::ValidationError> {
11527 Ok(())
11528 }
11529 }
11530
11531 unsafe impl ::fidl_next::Wire for ModeType {
11532 type Narrowed<'de> = Self;
11533
11534 #[inline]
11535 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11536 }
11538 }
11539
11540 unsafe impl<___D> ::fidl_next::Decode<___D> for ModeType
11541 where
11542 ___D: ?Sized,
11543 {
11544 fn decode(
11545 slot: ::fidl_next::Slot<'_, Self>,
11546 _: &mut ___D,
11547 _: (),
11548 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11549 ::fidl_next::munge!(let Self { value } = slot);
11550 let set = u32::from(*value);
11551 if set & !crate::natural::ModeType::all().bits() != 0 {
11552 return Err(::fidl_next::DecodeError::InvalidBits {
11553 expected: crate::natural::ModeType::all().bits() as usize,
11554 actual: set as usize,
11555 });
11556 }
11557
11558 Ok(())
11559 }
11560 }
11561
11562 impl ::core::convert::From<crate::natural::ModeType> for ModeType {
11563 fn from(natural: crate::natural::ModeType) -> Self {
11564 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
11565 }
11566 }
11567
11568 impl ::fidl_next::IntoNatural for ModeType {
11569 type Natural = crate::natural::ModeType;
11570 }
11571
11572 pub type Path<'de> = ::fidl_next::wire::String<'de>;
11574
11575 #[derive(Clone, Debug)]
11577 #[repr(C)]
11578 pub struct DirectoryReadDirentsRequest {
11579 pub max_bytes: ::fidl_next::wire::Uint64,
11580 }
11581
11582 static_assertions::const_assert_eq!(std::mem::size_of::<DirectoryReadDirentsRequest>(), 8);
11583 static_assertions::const_assert_eq!(std::mem::align_of::<DirectoryReadDirentsRequest>(), 8);
11584
11585 static_assertions::const_assert_eq!(
11586 std::mem::offset_of!(DirectoryReadDirentsRequest, max_bytes),
11587 0
11588 );
11589
11590 impl ::fidl_next::Constrained for DirectoryReadDirentsRequest {
11591 type Constraint = ();
11592
11593 fn validate(
11594 _: ::fidl_next::Slot<'_, Self>,
11595 _: Self::Constraint,
11596 ) -> Result<(), ::fidl_next::ValidationError> {
11597 Ok(())
11598 }
11599 }
11600
11601 unsafe impl ::fidl_next::Wire for DirectoryReadDirentsRequest {
11602 type Narrowed<'de> = DirectoryReadDirentsRequest;
11603
11604 #[inline]
11605 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11606 ::fidl_next::munge! {
11607 let Self {
11608 max_bytes,
11609
11610 } = &mut *out_;
11611 }
11612
11613 ::fidl_next::Wire::zero_padding(max_bytes);
11614 }
11615 }
11616
11617 unsafe impl<___D> ::fidl_next::Decode<___D> for DirectoryReadDirentsRequest
11618 where
11619 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11620 {
11621 fn decode(
11622 slot_: ::fidl_next::Slot<'_, Self>,
11623 decoder_: &mut ___D,
11624 _: (),
11625 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11626 ::fidl_next::munge! {
11627 let Self {
11628 mut max_bytes,
11629
11630 } = slot_;
11631 }
11632
11633 let _field = max_bytes.as_mut();
11634
11635 ::fidl_next::Decode::decode(max_bytes.as_mut(), decoder_, ())?;
11636
11637 Ok(())
11638 }
11639 }
11640
11641 impl ::fidl_next::IntoNatural for DirectoryReadDirentsRequest {
11642 type Natural = crate::natural::DirectoryReadDirentsRequest;
11643 }
11644
11645 #[derive(Debug)]
11647 #[repr(C)]
11648 pub struct DirectoryReadDirentsResponse<'de> {
11649 pub s: ::fidl_next::wire::fuchsia::StatusResult,
11650
11651 pub dirents: ::fidl_next::wire::Vector<'de, u8>,
11652 }
11653
11654 static_assertions::const_assert_eq!(
11655 std::mem::size_of::<DirectoryReadDirentsResponse<'_>>(),
11656 24
11657 );
11658 static_assertions::const_assert_eq!(
11659 std::mem::align_of::<DirectoryReadDirentsResponse<'_>>(),
11660 8
11661 );
11662
11663 static_assertions::const_assert_eq!(
11664 std::mem::offset_of!(DirectoryReadDirentsResponse<'_>, s),
11665 0
11666 );
11667
11668 static_assertions::const_assert_eq!(
11669 std::mem::offset_of!(DirectoryReadDirentsResponse<'_>, dirents),
11670 8
11671 );
11672
11673 impl ::fidl_next::Constrained for DirectoryReadDirentsResponse<'_> {
11674 type Constraint = ();
11675
11676 fn validate(
11677 _: ::fidl_next::Slot<'_, Self>,
11678 _: Self::Constraint,
11679 ) -> Result<(), ::fidl_next::ValidationError> {
11680 Ok(())
11681 }
11682 }
11683
11684 unsafe impl ::fidl_next::Wire for DirectoryReadDirentsResponse<'static> {
11685 type Narrowed<'de> = DirectoryReadDirentsResponse<'de>;
11686
11687 #[inline]
11688 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11689 ::fidl_next::munge! {
11690 let Self {
11691 s,
11692 dirents,
11693
11694 } = &mut *out_;
11695 }
11696
11697 ::fidl_next::Wire::zero_padding(s);
11698
11699 ::fidl_next::Wire::zero_padding(dirents);
11700
11701 unsafe {
11702 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
11703 }
11704 }
11705 }
11706
11707 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DirectoryReadDirentsResponse<'de>
11708 where
11709 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11710 ___D: ::fidl_next::Decoder<'de>,
11711 {
11712 fn decode(
11713 slot_: ::fidl_next::Slot<'_, Self>,
11714 decoder_: &mut ___D,
11715 _: (),
11716 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11717 if slot_.as_bytes()[4..8] != [0u8; 4] {
11718 return Err(::fidl_next::DecodeError::InvalidPadding);
11719 }
11720
11721 ::fidl_next::munge! {
11722 let Self {
11723 mut s,
11724 mut dirents,
11725
11726 } = slot_;
11727 }
11728
11729 let _field = s.as_mut();
11730
11731 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
11732
11733 let _field = dirents.as_mut();
11734 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
11735 ::fidl_next::Decode::decode(dirents.as_mut(), decoder_, (8192, ()))?;
11736
11737 let dirents = unsafe { dirents.deref_unchecked() };
11738
11739 if dirents.len() > 8192 {
11740 return Err(::fidl_next::DecodeError::VectorTooLong {
11741 size: dirents.len() as u64,
11742 limit: 8192,
11743 });
11744 }
11745
11746 Ok(())
11747 }
11748 }
11749
11750 impl<'de> ::fidl_next::IntoNatural for DirectoryReadDirentsResponse<'de> {
11751 type Natural = crate::natural::DirectoryReadDirentsResponse;
11752 }
11753
11754 #[derive(Clone, Debug)]
11756 #[repr(C)]
11757 pub struct DirectoryRewindResponse {
11758 pub s: ::fidl_next::wire::fuchsia::StatusResult,
11759 }
11760
11761 static_assertions::const_assert_eq!(std::mem::size_of::<DirectoryRewindResponse>(), 4);
11762 static_assertions::const_assert_eq!(std::mem::align_of::<DirectoryRewindResponse>(), 4);
11763
11764 static_assertions::const_assert_eq!(std::mem::offset_of!(DirectoryRewindResponse, s), 0);
11765
11766 impl ::fidl_next::Constrained for DirectoryRewindResponse {
11767 type Constraint = ();
11768
11769 fn validate(
11770 _: ::fidl_next::Slot<'_, Self>,
11771 _: Self::Constraint,
11772 ) -> Result<(), ::fidl_next::ValidationError> {
11773 Ok(())
11774 }
11775 }
11776
11777 unsafe impl ::fidl_next::Wire for DirectoryRewindResponse {
11778 type Narrowed<'de> = DirectoryRewindResponse;
11779
11780 #[inline]
11781 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11782 ::fidl_next::munge! {
11783 let Self {
11784 s,
11785
11786 } = &mut *out_;
11787 }
11788
11789 ::fidl_next::Wire::zero_padding(s);
11790 }
11791 }
11792
11793 unsafe impl<___D> ::fidl_next::Decode<___D> for DirectoryRewindResponse
11794 where
11795 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11796 {
11797 fn decode(
11798 slot_: ::fidl_next::Slot<'_, Self>,
11799 decoder_: &mut ___D,
11800 _: (),
11801 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11802 ::fidl_next::munge! {
11803 let Self {
11804 mut s,
11805
11806 } = slot_;
11807 }
11808
11809 let _field = s.as_mut();
11810
11811 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
11812
11813 Ok(())
11814 }
11815 }
11816
11817 impl ::fidl_next::IntoNatural for DirectoryRewindResponse {
11818 type Natural = crate::natural::DirectoryRewindResponse;
11819 }
11820
11821 pub type Name<'de> = ::fidl_next::wire::String<'de>;
11823
11824 #[derive(Clone, Debug)]
11826 #[repr(C)]
11827 pub struct DirectoryLinkResponse {
11828 pub s: ::fidl_next::wire::fuchsia::StatusResult,
11829 }
11830
11831 static_assertions::const_assert_eq!(std::mem::size_of::<DirectoryLinkResponse>(), 4);
11832 static_assertions::const_assert_eq!(std::mem::align_of::<DirectoryLinkResponse>(), 4);
11833
11834 static_assertions::const_assert_eq!(std::mem::offset_of!(DirectoryLinkResponse, s), 0);
11835
11836 impl ::fidl_next::Constrained for DirectoryLinkResponse {
11837 type Constraint = ();
11838
11839 fn validate(
11840 _: ::fidl_next::Slot<'_, Self>,
11841 _: Self::Constraint,
11842 ) -> Result<(), ::fidl_next::ValidationError> {
11843 Ok(())
11844 }
11845 }
11846
11847 unsafe impl ::fidl_next::Wire for DirectoryLinkResponse {
11848 type Narrowed<'de> = DirectoryLinkResponse;
11849
11850 #[inline]
11851 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11852 ::fidl_next::munge! {
11853 let Self {
11854 s,
11855
11856 } = &mut *out_;
11857 }
11858
11859 ::fidl_next::Wire::zero_padding(s);
11860 }
11861 }
11862
11863 unsafe impl<___D> ::fidl_next::Decode<___D> for DirectoryLinkResponse
11864 where
11865 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11866 {
11867 fn decode(
11868 slot_: ::fidl_next::Slot<'_, Self>,
11869 decoder_: &mut ___D,
11870 _: (),
11871 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11872 ::fidl_next::munge! {
11873 let Self {
11874 mut s,
11875
11876 } = slot_;
11877 }
11878
11879 let _field = s.as_mut();
11880
11881 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
11882
11883 Ok(())
11884 }
11885 }
11886
11887 impl ::fidl_next::IntoNatural for DirectoryLinkResponse {
11888 type Natural = crate::natural::DirectoryLinkResponse;
11889 }
11890
11891 #[derive(Clone, Copy, Debug)]
11893 #[repr(transparent)]
11894 pub struct UnlinkFlags {
11895 pub(crate) value: ::fidl_next::wire::Uint64,
11896 }
11897
11898 impl ::fidl_next::Constrained for UnlinkFlags {
11899 type Constraint = ();
11900
11901 fn validate(
11902 _: ::fidl_next::Slot<'_, Self>,
11903 _: Self::Constraint,
11904 ) -> Result<(), ::fidl_next::ValidationError> {
11905 Ok(())
11906 }
11907 }
11908
11909 unsafe impl ::fidl_next::Wire for UnlinkFlags {
11910 type Narrowed<'de> = Self;
11911
11912 #[inline]
11913 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11914 }
11916 }
11917
11918 unsafe impl<___D> ::fidl_next::Decode<___D> for UnlinkFlags
11919 where
11920 ___D: ?Sized,
11921 {
11922 fn decode(
11923 slot: ::fidl_next::Slot<'_, Self>,
11924 _: &mut ___D,
11925 _: (),
11926 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11927 Ok(())
11928 }
11929 }
11930
11931 impl ::core::convert::From<crate::natural::UnlinkFlags> for UnlinkFlags {
11932 fn from(natural: crate::natural::UnlinkFlags) -> Self {
11933 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
11934 }
11935 }
11936
11937 impl ::fidl_next::IntoNatural for UnlinkFlags {
11938 type Natural = crate::natural::UnlinkFlags;
11939 }
11940
11941 #[repr(C)]
11943 pub struct UnlinkOptions<'de> {
11944 pub(crate) table: ::fidl_next::wire::Table<'de>,
11945 }
11946
11947 impl<'de> Drop for UnlinkOptions<'de> {
11948 fn drop(&mut self) {
11949 let _ = self
11950 .table
11951 .get(1)
11952 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::UnlinkFlags>() });
11953 }
11954 }
11955
11956 impl ::fidl_next::Constrained for UnlinkOptions<'_> {
11957 type Constraint = ();
11958
11959 fn validate(
11960 _: ::fidl_next::Slot<'_, Self>,
11961 _: Self::Constraint,
11962 ) -> Result<(), ::fidl_next::ValidationError> {
11963 Ok(())
11964 }
11965 }
11966
11967 unsafe impl ::fidl_next::Wire for UnlinkOptions<'static> {
11968 type Narrowed<'de> = UnlinkOptions<'de>;
11969
11970 #[inline]
11971 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11972 ::fidl_next::munge!(let Self { table } = out);
11973 ::fidl_next::wire::Table::zero_padding(table);
11974 }
11975 }
11976
11977 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UnlinkOptions<'de>
11978 where
11979 ___D: ::fidl_next::Decoder<'de> + ?Sized,
11980 {
11981 fn decode(
11982 slot: ::fidl_next::Slot<'_, Self>,
11983 decoder: &mut ___D,
11984 _: (),
11985 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11986 ::fidl_next::munge!(let Self { table } = slot);
11987
11988 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11989 match ordinal {
11990 0 => unsafe { ::core::hint::unreachable_unchecked() },
11991
11992 1 => {
11993 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::UnlinkFlags>(
11994 slot.as_mut(),
11995 decoder,
11996 (),
11997 )?;
11998
11999 Ok(())
12000 }
12001
12002 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
12003 }
12004 })
12005 }
12006 }
12007
12008 impl<'de> UnlinkOptions<'de> {
12009 pub fn flags(&self) -> ::core::option::Option<&crate::wire::UnlinkFlags> {
12010 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12011 }
12012
12013 pub fn take_flags(&mut self) -> ::core::option::Option<crate::wire::UnlinkFlags> {
12014 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
12015 }
12016 }
12017
12018 impl<'de> ::core::fmt::Debug for UnlinkOptions<'de> {
12019 fn fmt(
12020 &self,
12021 f: &mut ::core::fmt::Formatter<'_>,
12022 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12023 f.debug_struct("UnlinkOptions").field("flags", &self.flags()).finish()
12024 }
12025 }
12026
12027 impl<'de> ::fidl_next::IntoNatural for UnlinkOptions<'de> {
12028 type Natural = crate::natural::UnlinkOptions;
12029 }
12030
12031 #[derive(Debug)]
12033 #[repr(C)]
12034 pub struct DirectoryUnlinkRequest<'de> {
12035 pub name: ::fidl_next::wire::String<'de>,
12036
12037 pub options: crate::wire::UnlinkOptions<'de>,
12038 }
12039
12040 static_assertions::const_assert_eq!(std::mem::size_of::<DirectoryUnlinkRequest<'_>>(), 32);
12041 static_assertions::const_assert_eq!(std::mem::align_of::<DirectoryUnlinkRequest<'_>>(), 8);
12042
12043 static_assertions::const_assert_eq!(std::mem::offset_of!(DirectoryUnlinkRequest<'_>, name), 0);
12044
12045 static_assertions::const_assert_eq!(
12046 std::mem::offset_of!(DirectoryUnlinkRequest<'_>, options),
12047 16
12048 );
12049
12050 impl ::fidl_next::Constrained for DirectoryUnlinkRequest<'_> {
12051 type Constraint = ();
12052
12053 fn validate(
12054 _: ::fidl_next::Slot<'_, Self>,
12055 _: Self::Constraint,
12056 ) -> Result<(), ::fidl_next::ValidationError> {
12057 Ok(())
12058 }
12059 }
12060
12061 unsafe impl ::fidl_next::Wire for DirectoryUnlinkRequest<'static> {
12062 type Narrowed<'de> = DirectoryUnlinkRequest<'de>;
12063
12064 #[inline]
12065 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12066 ::fidl_next::munge! {
12067 let Self {
12068 name,
12069 options,
12070
12071 } = &mut *out_;
12072 }
12073
12074 ::fidl_next::Wire::zero_padding(name);
12075
12076 ::fidl_next::Wire::zero_padding(options);
12077 }
12078 }
12079
12080 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DirectoryUnlinkRequest<'de>
12081 where
12082 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12083 ___D: ::fidl_next::Decoder<'de>,
12084 {
12085 fn decode(
12086 slot_: ::fidl_next::Slot<'_, Self>,
12087 decoder_: &mut ___D,
12088 _: (),
12089 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12090 ::fidl_next::munge! {
12091 let Self {
12092 mut name,
12093 mut options,
12094
12095 } = slot_;
12096 }
12097
12098 let _field = name.as_mut();
12099 ::fidl_next::Constrained::validate(_field, 255)?;
12100 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 255)?;
12101
12102 let name = unsafe { name.deref_unchecked() };
12103
12104 if name.len() > 255 {
12105 return Err(::fidl_next::DecodeError::VectorTooLong {
12106 size: name.len() as u64,
12107 limit: 255,
12108 });
12109 }
12110
12111 let _field = options.as_mut();
12112
12113 ::fidl_next::Decode::decode(options.as_mut(), decoder_, ())?;
12114
12115 Ok(())
12116 }
12117 }
12118
12119 impl<'de> ::fidl_next::IntoNatural for DirectoryUnlinkRequest<'de> {
12120 type Natural = crate::natural::DirectoryUnlinkRequest;
12121 }
12122
12123 pub type DirectoryUnlinkResponse = ::fidl_next::wire::Unit;
12125
12126 pub type DirectoryRenameResponse = ::fidl_next::wire::Unit;
12128
12129 #[derive(Clone, Copy, Debug)]
12131 #[repr(transparent)]
12132 pub struct WatchMask {
12133 pub(crate) value: ::fidl_next::wire::Uint32,
12134 }
12135
12136 impl ::fidl_next::Constrained for WatchMask {
12137 type Constraint = ();
12138
12139 fn validate(
12140 _: ::fidl_next::Slot<'_, Self>,
12141 _: Self::Constraint,
12142 ) -> Result<(), ::fidl_next::ValidationError> {
12143 Ok(())
12144 }
12145 }
12146
12147 unsafe impl ::fidl_next::Wire for WatchMask {
12148 type Narrowed<'de> = Self;
12149
12150 #[inline]
12151 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
12152 }
12154 }
12155
12156 unsafe impl<___D> ::fidl_next::Decode<___D> for WatchMask
12157 where
12158 ___D: ?Sized,
12159 {
12160 fn decode(
12161 slot: ::fidl_next::Slot<'_, Self>,
12162 _: &mut ___D,
12163 _: (),
12164 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12165 ::fidl_next::munge!(let Self { value } = slot);
12166 let set = u32::from(*value);
12167 if set & !crate::natural::WatchMask::all().bits() != 0 {
12168 return Err(::fidl_next::DecodeError::InvalidBits {
12169 expected: crate::natural::WatchMask::all().bits() as usize,
12170 actual: set as usize,
12171 });
12172 }
12173
12174 Ok(())
12175 }
12176 }
12177
12178 impl ::core::convert::From<crate::natural::WatchMask> for WatchMask {
12179 fn from(natural: crate::natural::WatchMask) -> Self {
12180 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
12181 }
12182 }
12183
12184 impl ::fidl_next::IntoNatural for WatchMask {
12185 type Natural = crate::natural::WatchMask;
12186 }
12187
12188 #[derive(Clone, Debug)]
12190 #[repr(C)]
12191 pub struct DirectoryWatchResponse {
12192 pub s: ::fidl_next::wire::fuchsia::StatusResult,
12193 }
12194
12195 static_assertions::const_assert_eq!(std::mem::size_of::<DirectoryWatchResponse>(), 4);
12196 static_assertions::const_assert_eq!(std::mem::align_of::<DirectoryWatchResponse>(), 4);
12197
12198 static_assertions::const_assert_eq!(std::mem::offset_of!(DirectoryWatchResponse, s), 0);
12199
12200 impl ::fidl_next::Constrained for DirectoryWatchResponse {
12201 type Constraint = ();
12202
12203 fn validate(
12204 _: ::fidl_next::Slot<'_, Self>,
12205 _: Self::Constraint,
12206 ) -> Result<(), ::fidl_next::ValidationError> {
12207 Ok(())
12208 }
12209 }
12210
12211 unsafe impl ::fidl_next::Wire for DirectoryWatchResponse {
12212 type Narrowed<'de> = DirectoryWatchResponse;
12213
12214 #[inline]
12215 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12216 ::fidl_next::munge! {
12217 let Self {
12218 s,
12219
12220 } = &mut *out_;
12221 }
12222
12223 ::fidl_next::Wire::zero_padding(s);
12224 }
12225 }
12226
12227 unsafe impl<___D> ::fidl_next::Decode<___D> for DirectoryWatchResponse
12228 where
12229 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12230 {
12231 fn decode(
12232 slot_: ::fidl_next::Slot<'_, Self>,
12233 decoder_: &mut ___D,
12234 _: (),
12235 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12236 ::fidl_next::munge! {
12237 let Self {
12238 mut s,
12239
12240 } = slot_;
12241 }
12242
12243 let _field = s.as_mut();
12244
12245 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
12246
12247 Ok(())
12248 }
12249 }
12250
12251 impl ::fidl_next::IntoNatural for DirectoryWatchResponse {
12252 type Natural = crate::natural::DirectoryWatchResponse;
12253 }
12254
12255 pub type SymlinkTarget<'de> = ::fidl_next::wire::Vector<'de, u8>;
12257
12258 pub type ExtendedAttributeName<'de> = ::fidl_next::wire::Vector<'de, u8>;
12260
12261 #[derive(Debug)]
12263 #[repr(C)]
12264 pub struct NodeGetExtendedAttributeRequest<'de> {
12265 pub name: ::fidl_next::wire::Vector<'de, u8>,
12266 }
12267
12268 static_assertions::const_assert_eq!(
12269 std::mem::size_of::<NodeGetExtendedAttributeRequest<'_>>(),
12270 16
12271 );
12272 static_assertions::const_assert_eq!(
12273 std::mem::align_of::<NodeGetExtendedAttributeRequest<'_>>(),
12274 8
12275 );
12276
12277 static_assertions::const_assert_eq!(
12278 std::mem::offset_of!(NodeGetExtendedAttributeRequest<'_>, name),
12279 0
12280 );
12281
12282 impl ::fidl_next::Constrained for NodeGetExtendedAttributeRequest<'_> {
12283 type Constraint = ();
12284
12285 fn validate(
12286 _: ::fidl_next::Slot<'_, Self>,
12287 _: Self::Constraint,
12288 ) -> Result<(), ::fidl_next::ValidationError> {
12289 Ok(())
12290 }
12291 }
12292
12293 unsafe impl ::fidl_next::Wire for NodeGetExtendedAttributeRequest<'static> {
12294 type Narrowed<'de> = NodeGetExtendedAttributeRequest<'de>;
12295
12296 #[inline]
12297 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12298 ::fidl_next::munge! {
12299 let Self {
12300 name,
12301
12302 } = &mut *out_;
12303 }
12304
12305 ::fidl_next::Wire::zero_padding(name);
12306 }
12307 }
12308
12309 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeGetExtendedAttributeRequest<'de>
12310 where
12311 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12312 ___D: ::fidl_next::Decoder<'de>,
12313 {
12314 fn decode(
12315 slot_: ::fidl_next::Slot<'_, Self>,
12316 decoder_: &mut ___D,
12317 _: (),
12318 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12319 ::fidl_next::munge! {
12320 let Self {
12321 mut name,
12322
12323 } = slot_;
12324 }
12325
12326 let _field = name.as_mut();
12327 ::fidl_next::Constrained::validate(_field, (255, ()))?;
12328 ::fidl_next::Decode::decode(name.as_mut(), decoder_, (255, ()))?;
12329
12330 let name = unsafe { name.deref_unchecked() };
12331
12332 if name.len() > 255 {
12333 return Err(::fidl_next::DecodeError::VectorTooLong {
12334 size: name.len() as u64,
12335 limit: 255,
12336 });
12337 }
12338
12339 Ok(())
12340 }
12341 }
12342
12343 impl<'de> ::fidl_next::IntoNatural for NodeGetExtendedAttributeRequest<'de> {
12344 type Natural = crate::natural::NodeGetExtendedAttributeRequest;
12345 }
12346
12347 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
12349 #[repr(transparent)]
12350 pub struct SetExtendedAttributeMode {
12351 pub(crate) value: ::fidl_next::wire::Uint32,
12352 }
12353
12354 impl ::fidl_next::Constrained for SetExtendedAttributeMode {
12355 type Constraint = ();
12356
12357 fn validate(
12358 _: ::fidl_next::Slot<'_, Self>,
12359 _: Self::Constraint,
12360 ) -> Result<(), ::fidl_next::ValidationError> {
12361 Ok(())
12362 }
12363 }
12364
12365 unsafe impl ::fidl_next::Wire for SetExtendedAttributeMode {
12366 type Narrowed<'de> = Self;
12367
12368 #[inline]
12369 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
12370 }
12372 }
12373
12374 impl SetExtendedAttributeMode {
12375 pub const SET: SetExtendedAttributeMode =
12376 SetExtendedAttributeMode { value: ::fidl_next::wire::Uint32(1) };
12377
12378 pub const CREATE: SetExtendedAttributeMode =
12379 SetExtendedAttributeMode { value: ::fidl_next::wire::Uint32(2) };
12380
12381 pub const REPLACE: SetExtendedAttributeMode =
12382 SetExtendedAttributeMode { value: ::fidl_next::wire::Uint32(3) };
12383 }
12384
12385 unsafe impl<___D> ::fidl_next::Decode<___D> for SetExtendedAttributeMode
12386 where
12387 ___D: ?Sized,
12388 {
12389 fn decode(
12390 slot: ::fidl_next::Slot<'_, Self>,
12391 _: &mut ___D,
12392 _: (),
12393 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12394 ::fidl_next::munge!(let Self { value } = slot);
12395
12396 match u32::from(*value) {
12397 1 | 2 | 3 => (),
12398 unknown => {
12399 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
12400 }
12401 }
12402
12403 Ok(())
12404 }
12405 }
12406
12407 impl ::core::convert::From<crate::natural::SetExtendedAttributeMode> for SetExtendedAttributeMode {
12408 fn from(natural: crate::natural::SetExtendedAttributeMode) -> Self {
12409 match natural {
12410 crate::natural::SetExtendedAttributeMode::Set => SetExtendedAttributeMode::SET,
12411
12412 crate::natural::SetExtendedAttributeMode::Create => {
12413 SetExtendedAttributeMode::CREATE
12414 }
12415
12416 crate::natural::SetExtendedAttributeMode::Replace => {
12417 SetExtendedAttributeMode::REPLACE
12418 }
12419 }
12420 }
12421 }
12422
12423 impl ::fidl_next::IntoNatural for SetExtendedAttributeMode {
12424 type Natural = crate::natural::SetExtendedAttributeMode;
12425 }
12426
12427 pub type NodeSetExtendedAttributeResponse = ::fidl_next::wire::Unit;
12429
12430 #[derive(Debug)]
12432 #[repr(C)]
12433 pub struct NodeRemoveExtendedAttributeRequest<'de> {
12434 pub name: ::fidl_next::wire::Vector<'de, u8>,
12435 }
12436
12437 static_assertions::const_assert_eq!(
12438 std::mem::size_of::<NodeRemoveExtendedAttributeRequest<'_>>(),
12439 16
12440 );
12441 static_assertions::const_assert_eq!(
12442 std::mem::align_of::<NodeRemoveExtendedAttributeRequest<'_>>(),
12443 8
12444 );
12445
12446 static_assertions::const_assert_eq!(
12447 std::mem::offset_of!(NodeRemoveExtendedAttributeRequest<'_>, name),
12448 0
12449 );
12450
12451 impl ::fidl_next::Constrained for NodeRemoveExtendedAttributeRequest<'_> {
12452 type Constraint = ();
12453
12454 fn validate(
12455 _: ::fidl_next::Slot<'_, Self>,
12456 _: Self::Constraint,
12457 ) -> Result<(), ::fidl_next::ValidationError> {
12458 Ok(())
12459 }
12460 }
12461
12462 unsafe impl ::fidl_next::Wire for NodeRemoveExtendedAttributeRequest<'static> {
12463 type Narrowed<'de> = NodeRemoveExtendedAttributeRequest<'de>;
12464
12465 #[inline]
12466 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12467 ::fidl_next::munge! {
12468 let Self {
12469 name,
12470
12471 } = &mut *out_;
12472 }
12473
12474 ::fidl_next::Wire::zero_padding(name);
12475 }
12476 }
12477
12478 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeRemoveExtendedAttributeRequest<'de>
12479 where
12480 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12481 ___D: ::fidl_next::Decoder<'de>,
12482 {
12483 fn decode(
12484 slot_: ::fidl_next::Slot<'_, Self>,
12485 decoder_: &mut ___D,
12486 _: (),
12487 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12488 ::fidl_next::munge! {
12489 let Self {
12490 mut name,
12491
12492 } = slot_;
12493 }
12494
12495 let _field = name.as_mut();
12496 ::fidl_next::Constrained::validate(_field, (255, ()))?;
12497 ::fidl_next::Decode::decode(name.as_mut(), decoder_, (255, ()))?;
12498
12499 let name = unsafe { name.deref_unchecked() };
12500
12501 if name.len() > 255 {
12502 return Err(::fidl_next::DecodeError::VectorTooLong {
12503 size: name.len() as u64,
12504 limit: 255,
12505 });
12506 }
12507
12508 Ok(())
12509 }
12510 }
12511
12512 impl<'de> ::fidl_next::IntoNatural for NodeRemoveExtendedAttributeRequest<'de> {
12513 type Natural = crate::natural::NodeRemoveExtendedAttributeRequest;
12514 }
12515
12516 pub type NodeRemoveExtendedAttributeResponse = ::fidl_next::wire::Unit;
12518
12519 pub type DirectoryCreateSymlinkResponse = ::fidl_next::wire::Unit;
12521
12522 pub type NodeSetFlagsResponse = ::fidl_next::wire::Unit;
12524
12525 #[derive(Clone, Debug)]
12527 #[repr(C)]
12528 pub struct NodeDeprecatedGetAttrResponse {
12529 pub s: ::fidl_next::wire::fuchsia::StatusResult,
12530
12531 pub attributes: crate::wire::NodeAttributes,
12532 }
12533
12534 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedGetAttrResponse>(), 64);
12535 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedGetAttrResponse>(), 8);
12536
12537 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeDeprecatedGetAttrResponse, s), 0);
12538
12539 static_assertions::const_assert_eq!(
12540 std::mem::offset_of!(NodeDeprecatedGetAttrResponse, attributes),
12541 8
12542 );
12543
12544 impl ::fidl_next::Constrained for NodeDeprecatedGetAttrResponse {
12545 type Constraint = ();
12546
12547 fn validate(
12548 _: ::fidl_next::Slot<'_, Self>,
12549 _: Self::Constraint,
12550 ) -> Result<(), ::fidl_next::ValidationError> {
12551 Ok(())
12552 }
12553 }
12554
12555 unsafe impl ::fidl_next::Wire for NodeDeprecatedGetAttrResponse {
12556 type Narrowed<'de> = NodeDeprecatedGetAttrResponse;
12557
12558 #[inline]
12559 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12560 ::fidl_next::munge! {
12561 let Self {
12562 s,
12563 attributes,
12564
12565 } = &mut *out_;
12566 }
12567
12568 ::fidl_next::Wire::zero_padding(s);
12569
12570 ::fidl_next::Wire::zero_padding(attributes);
12571
12572 unsafe {
12573 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
12574 }
12575 }
12576 }
12577
12578 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedGetAttrResponse
12579 where
12580 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12581 {
12582 fn decode(
12583 slot_: ::fidl_next::Slot<'_, Self>,
12584 decoder_: &mut ___D,
12585 _: (),
12586 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12587 if slot_.as_bytes()[4..8] != [0u8; 4] {
12588 return Err(::fidl_next::DecodeError::InvalidPadding);
12589 }
12590
12591 ::fidl_next::munge! {
12592 let Self {
12593 mut s,
12594 mut attributes,
12595
12596 } = slot_;
12597 }
12598
12599 let _field = s.as_mut();
12600
12601 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
12602
12603 let _field = attributes.as_mut();
12604
12605 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_, ())?;
12606
12607 Ok(())
12608 }
12609 }
12610
12611 impl ::fidl_next::IntoNatural for NodeDeprecatedGetAttrResponse {
12612 type Natural = crate::natural::NodeDeprecatedGetAttrResponse;
12613 }
12614
12615 #[derive(Clone, Debug)]
12617 #[repr(C)]
12618 pub struct NodeDeprecatedSetAttrRequest {
12619 pub flags: crate::wire::NodeAttributeFlags,
12620
12621 pub attributes: crate::wire::NodeAttributes,
12622 }
12623
12624 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedSetAttrRequest>(), 64);
12625 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedSetAttrRequest>(), 8);
12626
12627 static_assertions::const_assert_eq!(
12628 std::mem::offset_of!(NodeDeprecatedSetAttrRequest, flags),
12629 0
12630 );
12631
12632 static_assertions::const_assert_eq!(
12633 std::mem::offset_of!(NodeDeprecatedSetAttrRequest, attributes),
12634 8
12635 );
12636
12637 impl ::fidl_next::Constrained for NodeDeprecatedSetAttrRequest {
12638 type Constraint = ();
12639
12640 fn validate(
12641 _: ::fidl_next::Slot<'_, Self>,
12642 _: Self::Constraint,
12643 ) -> Result<(), ::fidl_next::ValidationError> {
12644 Ok(())
12645 }
12646 }
12647
12648 unsafe impl ::fidl_next::Wire for NodeDeprecatedSetAttrRequest {
12649 type Narrowed<'de> = NodeDeprecatedSetAttrRequest;
12650
12651 #[inline]
12652 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12653 ::fidl_next::munge! {
12654 let Self {
12655 flags,
12656 attributes,
12657
12658 } = &mut *out_;
12659 }
12660
12661 ::fidl_next::Wire::zero_padding(flags);
12662
12663 ::fidl_next::Wire::zero_padding(attributes);
12664
12665 unsafe {
12666 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
12667 }
12668 }
12669 }
12670
12671 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedSetAttrRequest
12672 where
12673 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12674 {
12675 fn decode(
12676 slot_: ::fidl_next::Slot<'_, Self>,
12677 decoder_: &mut ___D,
12678 _: (),
12679 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12680 if slot_.as_bytes()[4..8] != [0u8; 4] {
12681 return Err(::fidl_next::DecodeError::InvalidPadding);
12682 }
12683
12684 ::fidl_next::munge! {
12685 let Self {
12686 mut flags,
12687 mut attributes,
12688
12689 } = slot_;
12690 }
12691
12692 let _field = flags.as_mut();
12693
12694 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
12695
12696 let _field = attributes.as_mut();
12697
12698 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_, ())?;
12699
12700 Ok(())
12701 }
12702 }
12703
12704 impl ::fidl_next::IntoNatural for NodeDeprecatedSetAttrRequest {
12705 type Natural = crate::natural::NodeDeprecatedSetAttrRequest;
12706 }
12707
12708 #[derive(Clone, Debug)]
12710 #[repr(C)]
12711 pub struct NodeDeprecatedSetAttrResponse {
12712 pub s: ::fidl_next::wire::fuchsia::StatusResult,
12713 }
12714
12715 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedSetAttrResponse>(), 4);
12716 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedSetAttrResponse>(), 4);
12717
12718 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeDeprecatedSetAttrResponse, s), 0);
12719
12720 impl ::fidl_next::Constrained for NodeDeprecatedSetAttrResponse {
12721 type Constraint = ();
12722
12723 fn validate(
12724 _: ::fidl_next::Slot<'_, Self>,
12725 _: Self::Constraint,
12726 ) -> Result<(), ::fidl_next::ValidationError> {
12727 Ok(())
12728 }
12729 }
12730
12731 unsafe impl ::fidl_next::Wire for NodeDeprecatedSetAttrResponse {
12732 type Narrowed<'de> = NodeDeprecatedSetAttrResponse;
12733
12734 #[inline]
12735 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12736 ::fidl_next::munge! {
12737 let Self {
12738 s,
12739
12740 } = &mut *out_;
12741 }
12742
12743 ::fidl_next::Wire::zero_padding(s);
12744 }
12745 }
12746
12747 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedSetAttrResponse
12748 where
12749 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12750 {
12751 fn decode(
12752 slot_: ::fidl_next::Slot<'_, Self>,
12753 decoder_: &mut ___D,
12754 _: (),
12755 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12756 ::fidl_next::munge! {
12757 let Self {
12758 mut s,
12759
12760 } = slot_;
12761 }
12762
12763 let _field = s.as_mut();
12764
12765 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
12766
12767 Ok(())
12768 }
12769 }
12770
12771 impl ::fidl_next::IntoNatural for NodeDeprecatedSetAttrResponse {
12772 type Natural = crate::natural::NodeDeprecatedSetAttrResponse;
12773 }
12774
12775 #[derive(Clone, Debug)]
12777 #[repr(C)]
12778 pub struct NodeDeprecatedGetFlagsResponse {
12779 pub s: ::fidl_next::wire::fuchsia::StatusResult,
12780
12781 pub flags: crate::wire::OpenFlags,
12782 }
12783
12784 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedGetFlagsResponse>(), 8);
12785 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedGetFlagsResponse>(), 4);
12786
12787 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeDeprecatedGetFlagsResponse, s), 0);
12788
12789 static_assertions::const_assert_eq!(
12790 std::mem::offset_of!(NodeDeprecatedGetFlagsResponse, flags),
12791 4
12792 );
12793
12794 impl ::fidl_next::Constrained for NodeDeprecatedGetFlagsResponse {
12795 type Constraint = ();
12796
12797 fn validate(
12798 _: ::fidl_next::Slot<'_, Self>,
12799 _: Self::Constraint,
12800 ) -> Result<(), ::fidl_next::ValidationError> {
12801 Ok(())
12802 }
12803 }
12804
12805 unsafe impl ::fidl_next::Wire for NodeDeprecatedGetFlagsResponse {
12806 type Narrowed<'de> = NodeDeprecatedGetFlagsResponse;
12807
12808 #[inline]
12809 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12810 ::fidl_next::munge! {
12811 let Self {
12812 s,
12813 flags,
12814
12815 } = &mut *out_;
12816 }
12817
12818 ::fidl_next::Wire::zero_padding(s);
12819
12820 ::fidl_next::Wire::zero_padding(flags);
12821 }
12822 }
12823
12824 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedGetFlagsResponse
12825 where
12826 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12827 {
12828 fn decode(
12829 slot_: ::fidl_next::Slot<'_, Self>,
12830 decoder_: &mut ___D,
12831 _: (),
12832 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12833 ::fidl_next::munge! {
12834 let Self {
12835 mut s,
12836 mut flags,
12837
12838 } = slot_;
12839 }
12840
12841 let _field = s.as_mut();
12842
12843 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
12844
12845 let _field = flags.as_mut();
12846
12847 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
12848
12849 Ok(())
12850 }
12851 }
12852
12853 impl ::fidl_next::IntoNatural for NodeDeprecatedGetFlagsResponse {
12854 type Natural = crate::natural::NodeDeprecatedGetFlagsResponse;
12855 }
12856
12857 #[derive(Clone, Debug)]
12859 #[repr(C)]
12860 pub struct NodeDeprecatedSetFlagsRequest {
12861 pub flags: crate::wire::OpenFlags,
12862 }
12863
12864 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedSetFlagsRequest>(), 4);
12865 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedSetFlagsRequest>(), 4);
12866
12867 static_assertions::const_assert_eq!(
12868 std::mem::offset_of!(NodeDeprecatedSetFlagsRequest, flags),
12869 0
12870 );
12871
12872 impl ::fidl_next::Constrained for NodeDeprecatedSetFlagsRequest {
12873 type Constraint = ();
12874
12875 fn validate(
12876 _: ::fidl_next::Slot<'_, Self>,
12877 _: Self::Constraint,
12878 ) -> Result<(), ::fidl_next::ValidationError> {
12879 Ok(())
12880 }
12881 }
12882
12883 unsafe impl ::fidl_next::Wire for NodeDeprecatedSetFlagsRequest {
12884 type Narrowed<'de> = NodeDeprecatedSetFlagsRequest;
12885
12886 #[inline]
12887 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12888 ::fidl_next::munge! {
12889 let Self {
12890 flags,
12891
12892 } = &mut *out_;
12893 }
12894
12895 ::fidl_next::Wire::zero_padding(flags);
12896 }
12897 }
12898
12899 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedSetFlagsRequest
12900 where
12901 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12902 {
12903 fn decode(
12904 slot_: ::fidl_next::Slot<'_, Self>,
12905 decoder_: &mut ___D,
12906 _: (),
12907 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12908 ::fidl_next::munge! {
12909 let Self {
12910 mut flags,
12911
12912 } = slot_;
12913 }
12914
12915 let _field = flags.as_mut();
12916
12917 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
12918
12919 Ok(())
12920 }
12921 }
12922
12923 impl ::fidl_next::IntoNatural for NodeDeprecatedSetFlagsRequest {
12924 type Natural = crate::natural::NodeDeprecatedSetFlagsRequest;
12925 }
12926
12927 #[derive(Clone, Debug)]
12929 #[repr(C)]
12930 pub struct NodeDeprecatedSetFlagsResponse {
12931 pub s: ::fidl_next::wire::fuchsia::StatusResult,
12932 }
12933
12934 static_assertions::const_assert_eq!(std::mem::size_of::<NodeDeprecatedSetFlagsResponse>(), 4);
12935 static_assertions::const_assert_eq!(std::mem::align_of::<NodeDeprecatedSetFlagsResponse>(), 4);
12936
12937 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeDeprecatedSetFlagsResponse, s), 0);
12938
12939 impl ::fidl_next::Constrained for NodeDeprecatedSetFlagsResponse {
12940 type Constraint = ();
12941
12942 fn validate(
12943 _: ::fidl_next::Slot<'_, Self>,
12944 _: Self::Constraint,
12945 ) -> Result<(), ::fidl_next::ValidationError> {
12946 Ok(())
12947 }
12948 }
12949
12950 unsafe impl ::fidl_next::Wire for NodeDeprecatedSetFlagsResponse {
12951 type Narrowed<'de> = NodeDeprecatedSetFlagsResponse;
12952
12953 #[inline]
12954 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
12955 ::fidl_next::munge! {
12956 let Self {
12957 s,
12958
12959 } = &mut *out_;
12960 }
12961
12962 ::fidl_next::Wire::zero_padding(s);
12963 }
12964 }
12965
12966 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeDeprecatedSetFlagsResponse
12967 where
12968 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12969 {
12970 fn decode(
12971 slot_: ::fidl_next::Slot<'_, Self>,
12972 decoder_: &mut ___D,
12973 _: (),
12974 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12975 ::fidl_next::munge! {
12976 let Self {
12977 mut s,
12978
12979 } = slot_;
12980 }
12981
12982 let _field = s.as_mut();
12983
12984 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
12985
12986 Ok(())
12987 }
12988 }
12989
12990 impl ::fidl_next::IntoNatural for NodeDeprecatedSetFlagsResponse {
12991 type Natural = crate::natural::NodeDeprecatedSetFlagsResponse;
12992 }
12993
12994 #[derive(Clone, Copy, Debug)]
12996 #[repr(transparent)]
12997 pub struct Flags {
12998 pub(crate) value: ::fidl_next::wire::Uint64,
12999 }
13000
13001 impl ::fidl_next::Constrained for Flags {
13002 type Constraint = ();
13003
13004 fn validate(
13005 _: ::fidl_next::Slot<'_, Self>,
13006 _: Self::Constraint,
13007 ) -> Result<(), ::fidl_next::ValidationError> {
13008 Ok(())
13009 }
13010 }
13011
13012 unsafe impl ::fidl_next::Wire for Flags {
13013 type Narrowed<'de> = Self;
13014
13015 #[inline]
13016 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
13017 }
13019 }
13020
13021 unsafe impl<___D> ::fidl_next::Decode<___D> for Flags
13022 where
13023 ___D: ?Sized,
13024 {
13025 fn decode(
13026 slot: ::fidl_next::Slot<'_, Self>,
13027 _: &mut ___D,
13028 _: (),
13029 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13030 Ok(())
13031 }
13032 }
13033
13034 impl ::core::convert::From<crate::natural::Flags> for Flags {
13035 fn from(natural: crate::natural::Flags) -> Self {
13036 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
13037 }
13038 }
13039
13040 impl ::fidl_next::IntoNatural for Flags {
13041 type Natural = crate::natural::Flags;
13042 }
13043
13044 #[derive(Clone, Debug)]
13046 #[repr(C)]
13047 pub struct NodeGetFlagsResponse {
13048 pub flags: crate::wire::Flags,
13049 }
13050
13051 static_assertions::const_assert_eq!(std::mem::size_of::<NodeGetFlagsResponse>(), 8);
13052 static_assertions::const_assert_eq!(std::mem::align_of::<NodeGetFlagsResponse>(), 8);
13053
13054 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeGetFlagsResponse, flags), 0);
13055
13056 impl ::fidl_next::Constrained for NodeGetFlagsResponse {
13057 type Constraint = ();
13058
13059 fn validate(
13060 _: ::fidl_next::Slot<'_, Self>,
13061 _: Self::Constraint,
13062 ) -> Result<(), ::fidl_next::ValidationError> {
13063 Ok(())
13064 }
13065 }
13066
13067 unsafe impl ::fidl_next::Wire for NodeGetFlagsResponse {
13068 type Narrowed<'de> = NodeGetFlagsResponse;
13069
13070 #[inline]
13071 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
13072 ::fidl_next::munge! {
13073 let Self {
13074 flags,
13075
13076 } = &mut *out_;
13077 }
13078
13079 ::fidl_next::Wire::zero_padding(flags);
13080 }
13081 }
13082
13083 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeGetFlagsResponse
13084 where
13085 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13086 {
13087 fn decode(
13088 slot_: ::fidl_next::Slot<'_, Self>,
13089 decoder_: &mut ___D,
13090 _: (),
13091 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13092 ::fidl_next::munge! {
13093 let Self {
13094 mut flags,
13095
13096 } = slot_;
13097 }
13098
13099 let _field = flags.as_mut();
13100
13101 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
13102
13103 Ok(())
13104 }
13105 }
13106
13107 impl ::fidl_next::IntoNatural for NodeGetFlagsResponse {
13108 type Natural = crate::natural::NodeGetFlagsResponse;
13109 }
13110
13111 #[derive(Clone, Debug)]
13113 #[repr(C)]
13114 pub struct NodeSetFlagsRequest {
13115 pub flags: crate::wire::Flags,
13116 }
13117
13118 static_assertions::const_assert_eq!(std::mem::size_of::<NodeSetFlagsRequest>(), 8);
13119 static_assertions::const_assert_eq!(std::mem::align_of::<NodeSetFlagsRequest>(), 8);
13120
13121 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeSetFlagsRequest, flags), 0);
13122
13123 impl ::fidl_next::Constrained for NodeSetFlagsRequest {
13124 type Constraint = ();
13125
13126 fn validate(
13127 _: ::fidl_next::Slot<'_, Self>,
13128 _: Self::Constraint,
13129 ) -> Result<(), ::fidl_next::ValidationError> {
13130 Ok(())
13131 }
13132 }
13133
13134 unsafe impl ::fidl_next::Wire for NodeSetFlagsRequest {
13135 type Narrowed<'de> = NodeSetFlagsRequest;
13136
13137 #[inline]
13138 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
13139 ::fidl_next::munge! {
13140 let Self {
13141 flags,
13142
13143 } = &mut *out_;
13144 }
13145
13146 ::fidl_next::Wire::zero_padding(flags);
13147 }
13148 }
13149
13150 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeSetFlagsRequest
13151 where
13152 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13153 {
13154 fn decode(
13155 slot_: ::fidl_next::Slot<'_, Self>,
13156 decoder_: &mut ___D,
13157 _: (),
13158 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13159 ::fidl_next::munge! {
13160 let Self {
13161 mut flags,
13162
13163 } = slot_;
13164 }
13165
13166 let _field = flags.as_mut();
13167
13168 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
13169
13170 Ok(())
13171 }
13172 }
13173
13174 impl ::fidl_next::IntoNatural for NodeSetFlagsRequest {
13175 type Natural = crate::natural::NodeSetFlagsRequest;
13176 }
13177
13178 pub type EmptyStruct = ::fidl_next::wire::Unit;
13180
13181 #[repr(transparent)]
13183 pub struct SelinuxContext<'de> {
13184 pub(crate) raw: ::fidl_next::wire::Union,
13185 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
13186 }
13187
13188 impl<'de> Drop for SelinuxContext<'de> {
13189 fn drop(&mut self) {
13190 match self.raw.ordinal() {
13191 1 => {
13192 let _ = unsafe {
13193 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
13194 };
13195 }
13196
13197 2 => {
13198 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::EmptyStruct>() };
13199 }
13200
13201 _ => (),
13202 }
13203 }
13204 }
13205
13206 impl ::fidl_next::Constrained for SelinuxContext<'_> {
13207 type Constraint = ();
13208
13209 fn validate(
13210 _: ::fidl_next::Slot<'_, Self>,
13211 _: Self::Constraint,
13212 ) -> Result<(), ::fidl_next::ValidationError> {
13213 Ok(())
13214 }
13215 }
13216
13217 unsafe impl ::fidl_next::Wire for SelinuxContext<'static> {
13218 type Narrowed<'de> = SelinuxContext<'de>;
13219
13220 #[inline]
13221 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13222 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
13223 ::fidl_next::wire::Union::zero_padding(raw);
13224 }
13225 }
13226
13227 pub mod selinux_context {
13228 pub enum Ref<'de> {
13229 Data(&'de ::fidl_next::wire::Vector<'de, u8>),
13230
13231 UseExtendedAttributes(&'de crate::wire::EmptyStruct),
13232
13233 UnknownOrdinal_(u64),
13234 }
13235
13236 pub enum Value<'de> {
13237 Data(::fidl_next::wire::Vector<'de, u8>),
13238
13239 UseExtendedAttributes(crate::wire::EmptyStruct),
13240
13241 UnknownOrdinal_(u64),
13242 }
13243 }
13244
13245 impl<'de> SelinuxContext<'de> {
13246 pub fn as_ref(&self) -> crate::wire::selinux_context::Ref<'_> {
13247 match self.raw.ordinal() {
13248 1 => crate::wire::selinux_context::Ref::Data(unsafe {
13249 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
13250 }),
13251
13252 2 => crate::wire::selinux_context::Ref::UseExtendedAttributes(unsafe {
13253 self.raw.get().deref_unchecked::<crate::wire::EmptyStruct>()
13254 }),
13255
13256 unknown => crate::wire::selinux_context::Ref::UnknownOrdinal_(unknown),
13257 }
13258 }
13259
13260 pub fn into_inner(self) -> crate::wire::selinux_context::Value<'de> {
13261 let this = ::core::mem::ManuallyDrop::new(self);
13262
13263 match this.raw.ordinal() {
13264 1 => crate::wire::selinux_context::Value::Data(unsafe {
13265 this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
13266 }),
13267
13268 2 => crate::wire::selinux_context::Value::UseExtendedAttributes(unsafe {
13269 this.raw.get().read_unchecked::<crate::wire::EmptyStruct>()
13270 }),
13271
13272 unknown => crate::wire::selinux_context::Value::UnknownOrdinal_(unknown),
13273 }
13274 }
13275 }
13276
13277 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SelinuxContext<'de>
13278 where
13279 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13280 ___D: ::fidl_next::Decoder<'de>,
13281 {
13282 fn decode(
13283 mut slot: ::fidl_next::Slot<'_, Self>,
13284 decoder: &mut ___D,
13285 _: (),
13286 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13287 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
13288 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
13289 1 => {
13290 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
13291 raw,
13292 decoder,
13293 (256, ()),
13294 )?
13295 }
13296
13297 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EmptyStruct>(
13298 raw,
13299 decoder,
13300 (),
13301 )?,
13302
13303 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
13304 }
13305
13306 Ok(())
13307 }
13308 }
13309
13310 impl<'de> ::core::fmt::Debug for SelinuxContext<'de> {
13311 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13312 match self.raw.ordinal() {
13313 1 => unsafe {
13314 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>().fmt(f)
13315 },
13316 2 => unsafe { self.raw.get().deref_unchecked::<crate::wire::EmptyStruct>().fmt(f) },
13317 _ => unsafe { ::core::hint::unreachable_unchecked() },
13318 }
13319 }
13320 }
13321
13322 impl<'de> ::fidl_next::IntoNatural for SelinuxContext<'de> {
13323 type Natural = crate::natural::SelinuxContext;
13324 }
13325
13326 #[derive(Clone, Copy, Debug)]
13328 #[repr(transparent)]
13329 pub struct FscryptPolicyFlags {
13330 pub(crate) value: u8,
13331 }
13332
13333 impl ::fidl_next::Constrained for FscryptPolicyFlags {
13334 type Constraint = ();
13335
13336 fn validate(
13337 _: ::fidl_next::Slot<'_, Self>,
13338 _: Self::Constraint,
13339 ) -> Result<(), ::fidl_next::ValidationError> {
13340 Ok(())
13341 }
13342 }
13343
13344 unsafe impl ::fidl_next::Wire for FscryptPolicyFlags {
13345 type Narrowed<'de> = Self;
13346
13347 #[inline]
13348 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
13349 }
13351 }
13352
13353 unsafe impl<___D> ::fidl_next::Decode<___D> for FscryptPolicyFlags
13354 where
13355 ___D: ?Sized,
13356 {
13357 fn decode(
13358 slot: ::fidl_next::Slot<'_, Self>,
13359 _: &mut ___D,
13360 _: (),
13361 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13362 Ok(())
13363 }
13364 }
13365
13366 impl ::core::convert::From<crate::natural::FscryptPolicyFlags> for FscryptPolicyFlags {
13367 fn from(natural: crate::natural::FscryptPolicyFlags) -> Self {
13368 Self { value: u8::from(natural.bits()) }
13369 }
13370 }
13371
13372 impl ::fidl_next::IntoNatural for FscryptPolicyFlags {
13373 type Natural = crate::natural::FscryptPolicyFlags;
13374 }
13375
13376 #[derive(Clone, Debug)]
13378 #[repr(C)]
13379 pub struct FscryptPolicy {
13380 pub key_identifier: [u8; 16],
13381
13382 pub flags: crate::wire::FscryptPolicyFlags,
13383 }
13384
13385 static_assertions::const_assert_eq!(std::mem::size_of::<FscryptPolicy>(), 17);
13386 static_assertions::const_assert_eq!(std::mem::align_of::<FscryptPolicy>(), 1);
13387
13388 static_assertions::const_assert_eq!(std::mem::offset_of!(FscryptPolicy, key_identifier), 0);
13389
13390 static_assertions::const_assert_eq!(std::mem::offset_of!(FscryptPolicy, flags), 16);
13391
13392 impl ::fidl_next::Constrained for FscryptPolicy {
13393 type Constraint = ();
13394
13395 fn validate(
13396 _: ::fidl_next::Slot<'_, Self>,
13397 _: Self::Constraint,
13398 ) -> Result<(), ::fidl_next::ValidationError> {
13399 Ok(())
13400 }
13401 }
13402
13403 unsafe impl ::fidl_next::Wire for FscryptPolicy {
13404 type Narrowed<'de> = FscryptPolicy;
13405
13406 #[inline]
13407 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
13408 ::fidl_next::munge! {
13409 let Self {
13410 key_identifier,
13411 flags,
13412
13413 } = &mut *out_;
13414 }
13415
13416 ::fidl_next::Wire::zero_padding(key_identifier);
13417
13418 ::fidl_next::Wire::zero_padding(flags);
13419 }
13420 }
13421
13422 unsafe impl<___D> ::fidl_next::Decode<___D> for FscryptPolicy
13423 where
13424 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13425 {
13426 fn decode(
13427 slot_: ::fidl_next::Slot<'_, Self>,
13428 decoder_: &mut ___D,
13429 _: (),
13430 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13431 ::fidl_next::munge! {
13432 let Self {
13433 mut key_identifier,
13434 mut flags,
13435
13436 } = slot_;
13437 }
13438
13439 let _field = key_identifier.as_mut();
13440
13441 ::fidl_next::Decode::decode(key_identifier.as_mut(), decoder_, ())?;
13442
13443 let _field = flags.as_mut();
13444
13445 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
13446
13447 Ok(())
13448 }
13449 }
13450
13451 impl ::fidl_next::IntoNatural for FscryptPolicy {
13452 type Natural = crate::natural::FscryptPolicy;
13453 }
13454
13455 #[repr(C)]
13457 pub struct MutableNodeAttributes<'de> {
13458 pub(crate) table: ::fidl_next::wire::Table<'de>,
13459 }
13460
13461 impl<'de> Drop for MutableNodeAttributes<'de> {
13462 fn drop(&mut self) {
13463 let _ = self
13464 .table
13465 .get(1)
13466 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13467
13468 let _ = self
13469 .table
13470 .get(2)
13471 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13472
13473 let _ = self
13474 .table
13475 .get(3)
13476 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
13477
13478 let _ = self
13479 .table
13480 .get(4)
13481 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
13482
13483 let _ = self
13484 .table
13485 .get(5)
13486 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
13487
13488 let _ = self
13489 .table
13490 .get(6)
13491 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13492
13493 let _ = self
13494 .table
13495 .get(7)
13496 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
13497
13498 let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
13499
13500 let _ = self.table.get(9).map(|envelope| unsafe {
13501 envelope.read_unchecked::<crate::wire::SelinuxContext<'de>>()
13502 });
13503
13504 let _ = self
13505 .table
13506 .get(10)
13507 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::FscryptPolicy>() });
13508 }
13509 }
13510
13511 impl ::fidl_next::Constrained for MutableNodeAttributes<'_> {
13512 type Constraint = ();
13513
13514 fn validate(
13515 _: ::fidl_next::Slot<'_, Self>,
13516 _: Self::Constraint,
13517 ) -> Result<(), ::fidl_next::ValidationError> {
13518 Ok(())
13519 }
13520 }
13521
13522 unsafe impl ::fidl_next::Wire for MutableNodeAttributes<'static> {
13523 type Narrowed<'de> = MutableNodeAttributes<'de>;
13524
13525 #[inline]
13526 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13527 ::fidl_next::munge!(let Self { table } = out);
13528 ::fidl_next::wire::Table::zero_padding(table);
13529 }
13530 }
13531
13532 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MutableNodeAttributes<'de>
13533 where
13534 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13535 {
13536 fn decode(
13537 slot: ::fidl_next::Slot<'_, Self>,
13538 decoder: &mut ___D,
13539 _: (),
13540 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13541 ::fidl_next::munge!(let Self { table } = slot);
13542
13543 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13544 match ordinal {
13545 0 => unsafe { ::core::hint::unreachable_unchecked() },
13546
13547 1 => {
13548 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13549 slot.as_mut(),
13550 decoder,
13551 (),
13552 )?;
13553
13554 Ok(())
13555 }
13556
13557 2 => {
13558 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13559 slot.as_mut(),
13560 decoder,
13561 (),
13562 )?;
13563
13564 Ok(())
13565 }
13566
13567 3 => {
13568 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
13569 slot.as_mut(),
13570 decoder,
13571 (),
13572 )?;
13573
13574 Ok(())
13575 }
13576
13577 4 => {
13578 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
13579 slot.as_mut(),
13580 decoder,
13581 (),
13582 )?;
13583
13584 Ok(())
13585 }
13586
13587 5 => {
13588 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
13589 slot.as_mut(),
13590 decoder,
13591 (),
13592 )?;
13593
13594 Ok(())
13595 }
13596
13597 6 => {
13598 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13599 slot.as_mut(),
13600 decoder,
13601 (),
13602 )?;
13603
13604 Ok(())
13605 }
13606
13607 7 => {
13608 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
13609 slot.as_mut(),
13610 decoder,
13611 (),
13612 )?;
13613
13614 Ok(())
13615 }
13616
13617 8 => {
13618 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
13619 slot.as_mut(),
13620 decoder,
13621 (),
13622 )?;
13623
13624 Ok(())
13625 }
13626
13627 9 => {
13628 ::fidl_next::wire::Envelope::decode_as::<
13629 ___D,
13630 crate::wire::SelinuxContext<'de>,
13631 >(slot.as_mut(), decoder, ())?;
13632
13633 Ok(())
13634 }
13635
13636 10 => {
13637 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::FscryptPolicy>(
13638 slot.as_mut(),
13639 decoder,
13640 (),
13641 )?;
13642
13643 Ok(())
13644 }
13645
13646 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13647 }
13648 })
13649 }
13650 }
13651
13652 impl<'de> MutableNodeAttributes<'de> {
13653 pub fn creation_time(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13654 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13655 }
13656
13657 pub fn take_creation_time(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13658 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13659 }
13660
13661 pub fn modification_time(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13662 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13663 }
13664
13665 pub fn take_modification_time(
13666 &mut self,
13667 ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13668 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13669 }
13670
13671 pub fn mode(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
13672 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13673 }
13674
13675 pub fn take_mode(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
13676 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
13677 }
13678
13679 pub fn uid(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
13680 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13681 }
13682
13683 pub fn take_uid(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
13684 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
13685 }
13686
13687 pub fn gid(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
13688 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13689 }
13690
13691 pub fn take_gid(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
13692 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
13693 }
13694
13695 pub fn rdev(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13696 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
13697 }
13698
13699 pub fn take_rdev(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13700 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
13701 }
13702
13703 pub fn access_time(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
13704 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
13705 }
13706
13707 pub fn take_access_time(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
13708 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
13709 }
13710
13711 pub fn casefold(&self) -> ::core::option::Option<&bool> {
13712 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
13713 }
13714
13715 pub fn take_casefold(&mut self) -> ::core::option::Option<bool> {
13716 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
13717 }
13718
13719 pub fn selinux_context(&self) -> ::core::option::Option<&crate::wire::SelinuxContext<'de>> {
13720 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
13721 }
13722
13723 pub fn take_selinux_context(
13724 &mut self,
13725 ) -> ::core::option::Option<crate::wire::SelinuxContext<'de>> {
13726 unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
13727 }
13728
13729 pub fn encryption_policy(&self) -> ::core::option::Option<&crate::wire::FscryptPolicy> {
13730 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
13731 }
13732
13733 pub fn take_encryption_policy(
13734 &mut self,
13735 ) -> ::core::option::Option<crate::wire::FscryptPolicy> {
13736 unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
13737 }
13738 }
13739
13740 impl<'de> ::core::fmt::Debug for MutableNodeAttributes<'de> {
13741 fn fmt(
13742 &self,
13743 f: &mut ::core::fmt::Formatter<'_>,
13744 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13745 f.debug_struct("MutableNodeAttributes")
13746 .field("creation_time", &self.creation_time())
13747 .field("modification_time", &self.modification_time())
13748 .field("mode", &self.mode())
13749 .field("uid", &self.uid())
13750 .field("gid", &self.gid())
13751 .field("rdev", &self.rdev())
13752 .field("access_time", &self.access_time())
13753 .field("casefold", &self.casefold())
13754 .field("selinux_context", &self.selinux_context())
13755 .field("encryption_policy", &self.encryption_policy())
13756 .finish()
13757 }
13758 }
13759
13760 impl<'de> ::fidl_next::IntoNatural for MutableNodeAttributes<'de> {
13761 type Natural = crate::natural::MutableNodeAttributes;
13762 }
13763
13764 #[derive(Clone, Copy, Debug)]
13766 #[repr(transparent)]
13767 pub struct NodeProtocolKinds {
13768 pub(crate) value: ::fidl_next::wire::Uint64,
13769 }
13770
13771 impl ::fidl_next::Constrained for NodeProtocolKinds {
13772 type Constraint = ();
13773
13774 fn validate(
13775 _: ::fidl_next::Slot<'_, Self>,
13776 _: Self::Constraint,
13777 ) -> Result<(), ::fidl_next::ValidationError> {
13778 Ok(())
13779 }
13780 }
13781
13782 unsafe impl ::fidl_next::Wire for NodeProtocolKinds {
13783 type Narrowed<'de> = Self;
13784
13785 #[inline]
13786 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
13787 }
13789 }
13790
13791 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeProtocolKinds
13792 where
13793 ___D: ?Sized,
13794 {
13795 fn decode(
13796 slot: ::fidl_next::Slot<'_, Self>,
13797 _: &mut ___D,
13798 _: (),
13799 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13800 Ok(())
13801 }
13802 }
13803
13804 impl ::core::convert::From<crate::natural::NodeProtocolKinds> for NodeProtocolKinds {
13805 fn from(natural: crate::natural::NodeProtocolKinds) -> Self {
13806 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
13807 }
13808 }
13809
13810 impl ::fidl_next::IntoNatural for NodeProtocolKinds {
13811 type Natural = crate::natural::NodeProtocolKinds;
13812 }
13813
13814 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
13816 #[repr(transparent)]
13817 pub struct HashAlgorithm {
13818 pub(crate) value: u8,
13819 }
13820
13821 impl ::fidl_next::Constrained for HashAlgorithm {
13822 type Constraint = ();
13823
13824 fn validate(
13825 _: ::fidl_next::Slot<'_, Self>,
13826 _: Self::Constraint,
13827 ) -> Result<(), ::fidl_next::ValidationError> {
13828 Ok(())
13829 }
13830 }
13831
13832 unsafe impl ::fidl_next::Wire for HashAlgorithm {
13833 type Narrowed<'de> = Self;
13834
13835 #[inline]
13836 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
13837 }
13839 }
13840
13841 impl HashAlgorithm {
13842 pub const SHA256: HashAlgorithm = HashAlgorithm { value: 1 };
13843
13844 pub const SHA512: HashAlgorithm = HashAlgorithm { value: 2 };
13845 }
13846
13847 unsafe impl<___D> ::fidl_next::Decode<___D> for HashAlgorithm
13848 where
13849 ___D: ?Sized,
13850 {
13851 fn decode(
13852 slot: ::fidl_next::Slot<'_, Self>,
13853 _: &mut ___D,
13854 _: (),
13855 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13856 Ok(())
13857 }
13858 }
13859
13860 impl ::core::convert::From<crate::natural::HashAlgorithm> for HashAlgorithm {
13861 fn from(natural: crate::natural::HashAlgorithm) -> Self {
13862 match natural {
13863 crate::natural::HashAlgorithm::Sha256 => HashAlgorithm::SHA256,
13864
13865 crate::natural::HashAlgorithm::Sha512 => HashAlgorithm::SHA512,
13866
13867 crate::natural::HashAlgorithm::UnknownOrdinal_(value) => {
13868 HashAlgorithm { value: u8::from(value) }
13869 }
13870 }
13871 }
13872 }
13873
13874 impl ::fidl_next::IntoNatural for HashAlgorithm {
13875 type Natural = crate::natural::HashAlgorithm;
13876 }
13877
13878 #[repr(C)]
13880 pub struct VerificationOptions<'de> {
13881 pub(crate) table: ::fidl_next::wire::Table<'de>,
13882 }
13883
13884 impl<'de> Drop for VerificationOptions<'de> {
13885 fn drop(&mut self) {
13886 let _ = self
13887 .table
13888 .get(1)
13889 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::HashAlgorithm>() });
13890
13891 let _ = self.table.get(2).map(|envelope| unsafe {
13892 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
13893 });
13894 }
13895 }
13896
13897 impl ::fidl_next::Constrained for VerificationOptions<'_> {
13898 type Constraint = ();
13899
13900 fn validate(
13901 _: ::fidl_next::Slot<'_, Self>,
13902 _: Self::Constraint,
13903 ) -> Result<(), ::fidl_next::ValidationError> {
13904 Ok(())
13905 }
13906 }
13907
13908 unsafe impl ::fidl_next::Wire for VerificationOptions<'static> {
13909 type Narrowed<'de> = VerificationOptions<'de>;
13910
13911 #[inline]
13912 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13913 ::fidl_next::munge!(let Self { table } = out);
13914 ::fidl_next::wire::Table::zero_padding(table);
13915 }
13916 }
13917
13918 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for VerificationOptions<'de>
13919 where
13920 ___D: ::fidl_next::Decoder<'de> + ?Sized,
13921 {
13922 fn decode(
13923 slot: ::fidl_next::Slot<'_, Self>,
13924 decoder: &mut ___D,
13925 _: (),
13926 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13927 ::fidl_next::munge!(let Self { table } = slot);
13928
13929 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13930 match ordinal {
13931 0 => unsafe { ::core::hint::unreachable_unchecked() },
13932
13933 1 => {
13934 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::HashAlgorithm>(
13935 slot.as_mut(),
13936 decoder,
13937 (),
13938 )?;
13939
13940 Ok(())
13941 }
13942
13943 2 => {
13944 ::fidl_next::wire::Envelope::decode_as::<
13945 ___D,
13946 ::fidl_next::wire::Vector<'de, u8>,
13947 >(slot.as_mut(), decoder, (32, ()))?;
13948
13949 let value = unsafe {
13950 slot.deref_unchecked()
13951 .deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
13952 };
13953
13954 if value.len() > 32 {
13955 return Err(::fidl_next::DecodeError::VectorTooLong {
13956 size: value.len() as u64,
13957 limit: 32,
13958 });
13959 }
13960
13961 Ok(())
13962 }
13963
13964 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
13965 }
13966 })
13967 }
13968 }
13969
13970 impl<'de> VerificationOptions<'de> {
13971 pub fn hash_algorithm(&self) -> ::core::option::Option<&crate::wire::HashAlgorithm> {
13972 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13973 }
13974
13975 pub fn take_hash_algorithm(
13976 &mut self,
13977 ) -> ::core::option::Option<crate::wire::HashAlgorithm> {
13978 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
13979 }
13980
13981 pub fn salt(&self) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, u8>> {
13982 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13983 }
13984
13985 pub fn take_salt(&mut self) -> ::core::option::Option<::fidl_next::wire::Vector<'de, u8>> {
13986 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
13987 }
13988 }
13989
13990 impl<'de> ::core::fmt::Debug for VerificationOptions<'de> {
13991 fn fmt(
13992 &self,
13993 f: &mut ::core::fmt::Formatter<'_>,
13994 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13995 f.debug_struct("VerificationOptions")
13996 .field("hash_algorithm", &self.hash_algorithm())
13997 .field("salt", &self.salt())
13998 .finish()
13999 }
14000 }
14001
14002 impl<'de> ::fidl_next::IntoNatural for VerificationOptions<'de> {
14003 type Natural = crate::natural::VerificationOptions;
14004 }
14005
14006 #[repr(C)]
14008 pub struct ImmutableNodeAttributes<'de> {
14009 pub(crate) table: ::fidl_next::wire::Table<'de>,
14010 }
14011
14012 impl<'de> Drop for ImmutableNodeAttributes<'de> {
14013 fn drop(&mut self) {
14014 let _ = self.table.get(1).map(|envelope| unsafe {
14015 envelope.read_unchecked::<crate::wire::NodeProtocolKinds>()
14016 });
14017
14018 let _ = self
14019 .table
14020 .get(2)
14021 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Operations>() });
14022
14023 let _ = self
14024 .table
14025 .get(3)
14026 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
14027
14028 let _ = self
14029 .table
14030 .get(4)
14031 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
14032
14033 let _ = self
14034 .table
14035 .get(5)
14036 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
14037
14038 let _ = self
14039 .table
14040 .get(6)
14041 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
14042
14043 let _ = self
14044 .table
14045 .get(7)
14046 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
14047
14048 let _ = self.table.get(8).map(|envelope| unsafe {
14049 envelope.read_unchecked::<crate::wire::VerificationOptions<'de>>()
14050 });
14051
14052 let _ = self.table.get(9).map(|envelope| unsafe {
14053 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
14054 });
14055
14056 let _ = self.table.get(10).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
14057 }
14058 }
14059
14060 impl ::fidl_next::Constrained for ImmutableNodeAttributes<'_> {
14061 type Constraint = ();
14062
14063 fn validate(
14064 _: ::fidl_next::Slot<'_, Self>,
14065 _: Self::Constraint,
14066 ) -> Result<(), ::fidl_next::ValidationError> {
14067 Ok(())
14068 }
14069 }
14070
14071 unsafe impl ::fidl_next::Wire for ImmutableNodeAttributes<'static> {
14072 type Narrowed<'de> = ImmutableNodeAttributes<'de>;
14073
14074 #[inline]
14075 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14076 ::fidl_next::munge!(let Self { table } = out);
14077 ::fidl_next::wire::Table::zero_padding(table);
14078 }
14079 }
14080
14081 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ImmutableNodeAttributes<'de>
14082 where
14083 ___D: ::fidl_next::Decoder<'de> + ?Sized,
14084 {
14085 fn decode(
14086 slot: ::fidl_next::Slot<'_, Self>,
14087 decoder: &mut ___D,
14088 _: (),
14089 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14090 ::fidl_next::munge!(let Self { table } = slot);
14091
14092 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14093 match ordinal {
14094 0 => unsafe { ::core::hint::unreachable_unchecked() },
14095
14096 1 => {
14097 ::fidl_next::wire::Envelope::decode_as::<
14098 ___D,
14099 crate::wire::NodeProtocolKinds,
14100 >(slot.as_mut(), decoder, ())?;
14101
14102 Ok(())
14103 }
14104
14105 2 => {
14106 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Operations>(
14107 slot.as_mut(),
14108 decoder,
14109 (),
14110 )?;
14111
14112 Ok(())
14113 }
14114
14115 3 => {
14116 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
14117 slot.as_mut(),
14118 decoder,
14119 (),
14120 )?;
14121
14122 Ok(())
14123 }
14124
14125 4 => {
14126 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
14127 slot.as_mut(),
14128 decoder,
14129 (),
14130 )?;
14131
14132 Ok(())
14133 }
14134
14135 5 => {
14136 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
14137 slot.as_mut(),
14138 decoder,
14139 (),
14140 )?;
14141
14142 Ok(())
14143 }
14144
14145 6 => {
14146 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
14147 slot.as_mut(),
14148 decoder,
14149 (),
14150 )?;
14151
14152 Ok(())
14153 }
14154
14155 7 => {
14156 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
14157 slot.as_mut(),
14158 decoder,
14159 (),
14160 )?;
14161
14162 Ok(())
14163 }
14164
14165 8 => {
14166 ::fidl_next::wire::Envelope::decode_as::<
14167 ___D,
14168 crate::wire::VerificationOptions<'de>,
14169 >(slot.as_mut(), decoder, ())?;
14170
14171 Ok(())
14172 }
14173
14174 9 => {
14175 ::fidl_next::wire::Envelope::decode_as::<
14176 ___D,
14177 ::fidl_next::wire::Vector<'de, u8>,
14178 >(slot.as_mut(), decoder, (64, ()))?;
14179
14180 let value = unsafe {
14181 slot.deref_unchecked()
14182 .deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
14183 };
14184
14185 if value.len() > 64 {
14186 return Err(::fidl_next::DecodeError::VectorTooLong {
14187 size: value.len() as u64,
14188 limit: 64,
14189 });
14190 }
14191
14192 Ok(())
14193 }
14194
14195 10 => {
14196 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
14197 slot.as_mut(),
14198 decoder,
14199 (),
14200 )?;
14201
14202 Ok(())
14203 }
14204
14205 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
14206 }
14207 })
14208 }
14209 }
14210
14211 impl<'de> ImmutableNodeAttributes<'de> {
14212 pub fn protocols(&self) -> ::core::option::Option<&crate::wire::NodeProtocolKinds> {
14213 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14214 }
14215
14216 pub fn take_protocols(&mut self) -> ::core::option::Option<crate::wire::NodeProtocolKinds> {
14217 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14218 }
14219
14220 pub fn abilities(&self) -> ::core::option::Option<&crate::wire::Operations> {
14221 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14222 }
14223
14224 pub fn take_abilities(&mut self) -> ::core::option::Option<crate::wire::Operations> {
14225 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
14226 }
14227
14228 pub fn content_size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
14229 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14230 }
14231
14232 pub fn take_content_size(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
14233 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
14234 }
14235
14236 pub fn storage_size(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
14237 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14238 }
14239
14240 pub fn take_storage_size(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
14241 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
14242 }
14243
14244 pub fn link_count(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
14245 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14246 }
14247
14248 pub fn take_link_count(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
14249 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
14250 }
14251
14252 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
14253 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14254 }
14255
14256 pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
14257 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
14258 }
14259
14260 pub fn change_time(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
14261 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14262 }
14263
14264 pub fn take_change_time(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
14265 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
14266 }
14267
14268 pub fn options(&self) -> ::core::option::Option<&crate::wire::VerificationOptions<'de>> {
14269 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
14270 }
14271
14272 pub fn take_options(
14273 &mut self,
14274 ) -> ::core::option::Option<crate::wire::VerificationOptions<'de>> {
14275 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
14276 }
14277
14278 pub fn root_hash(&self) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, u8>> {
14279 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
14280 }
14281
14282 pub fn take_root_hash(
14283 &mut self,
14284 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, u8>> {
14285 unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
14286 }
14287
14288 pub fn verity_enabled(&self) -> ::core::option::Option<&bool> {
14289 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
14290 }
14291
14292 pub fn take_verity_enabled(&mut self) -> ::core::option::Option<bool> {
14293 unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
14294 }
14295 }
14296
14297 impl<'de> ::core::fmt::Debug for ImmutableNodeAttributes<'de> {
14298 fn fmt(
14299 &self,
14300 f: &mut ::core::fmt::Formatter<'_>,
14301 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14302 f.debug_struct("ImmutableNodeAttributes")
14303 .field("protocols", &self.protocols())
14304 .field("abilities", &self.abilities())
14305 .field("content_size", &self.content_size())
14306 .field("storage_size", &self.storage_size())
14307 .field("link_count", &self.link_count())
14308 .field("id", &self.id())
14309 .field("change_time", &self.change_time())
14310 .field("options", &self.options())
14311 .field("root_hash", &self.root_hash())
14312 .field("verity_enabled", &self.verity_enabled())
14313 .finish()
14314 }
14315 }
14316
14317 impl<'de> ::fidl_next::IntoNatural for ImmutableNodeAttributes<'de> {
14318 type Natural = crate::natural::ImmutableNodeAttributes;
14319 }
14320
14321 #[derive(Debug)]
14323 #[repr(C)]
14324 pub struct NodeAttributes2<'de> {
14325 pub mutable_attributes: crate::wire::MutableNodeAttributes<'de>,
14326
14327 pub immutable_attributes: crate::wire::ImmutableNodeAttributes<'de>,
14328 }
14329
14330 static_assertions::const_assert_eq!(std::mem::size_of::<NodeAttributes2<'_>>(), 32);
14331 static_assertions::const_assert_eq!(std::mem::align_of::<NodeAttributes2<'_>>(), 8);
14332
14333 static_assertions::const_assert_eq!(
14334 std::mem::offset_of!(NodeAttributes2<'_>, mutable_attributes),
14335 0
14336 );
14337
14338 static_assertions::const_assert_eq!(
14339 std::mem::offset_of!(NodeAttributes2<'_>, immutable_attributes),
14340 16
14341 );
14342
14343 impl ::fidl_next::Constrained for NodeAttributes2<'_> {
14344 type Constraint = ();
14345
14346 fn validate(
14347 _: ::fidl_next::Slot<'_, Self>,
14348 _: Self::Constraint,
14349 ) -> Result<(), ::fidl_next::ValidationError> {
14350 Ok(())
14351 }
14352 }
14353
14354 unsafe impl ::fidl_next::Wire for NodeAttributes2<'static> {
14355 type Narrowed<'de> = NodeAttributes2<'de>;
14356
14357 #[inline]
14358 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
14359 ::fidl_next::munge! {
14360 let Self {
14361 mutable_attributes,
14362 immutable_attributes,
14363
14364 } = &mut *out_;
14365 }
14366
14367 ::fidl_next::Wire::zero_padding(mutable_attributes);
14368
14369 ::fidl_next::Wire::zero_padding(immutable_attributes);
14370 }
14371 }
14372
14373 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeAttributes2<'de>
14374 where
14375 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14376 ___D: ::fidl_next::Decoder<'de>,
14377 {
14378 fn decode(
14379 slot_: ::fidl_next::Slot<'_, Self>,
14380 decoder_: &mut ___D,
14381 _: (),
14382 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14383 ::fidl_next::munge! {
14384 let Self {
14385 mut mutable_attributes,
14386 mut immutable_attributes,
14387
14388 } = slot_;
14389 }
14390
14391 let _field = mutable_attributes.as_mut();
14392
14393 ::fidl_next::Decode::decode(mutable_attributes.as_mut(), decoder_, ())?;
14394
14395 let _field = immutable_attributes.as_mut();
14396
14397 ::fidl_next::Decode::decode(immutable_attributes.as_mut(), decoder_, ())?;
14398
14399 Ok(())
14400 }
14401 }
14402
14403 impl<'de> ::fidl_next::IntoNatural for NodeAttributes2<'de> {
14404 type Natural = crate::natural::NodeAttributes2;
14405 }
14406
14407 #[repr(C)]
14409 pub struct NodeInfo<'de> {
14410 pub(crate) table: ::fidl_next::wire::Table<'de>,
14411 }
14412
14413 impl<'de> Drop for NodeInfo<'de> {
14414 fn drop(&mut self) {
14415 let _ = self.table.get(1).map(|envelope| unsafe {
14416 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
14417 });
14418 }
14419 }
14420
14421 impl ::fidl_next::Constrained for NodeInfo<'_> {
14422 type Constraint = ();
14423
14424 fn validate(
14425 _: ::fidl_next::Slot<'_, Self>,
14426 _: Self::Constraint,
14427 ) -> Result<(), ::fidl_next::ValidationError> {
14428 Ok(())
14429 }
14430 }
14431
14432 unsafe impl ::fidl_next::Wire for NodeInfo<'static> {
14433 type Narrowed<'de> = NodeInfo<'de>;
14434
14435 #[inline]
14436 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14437 ::fidl_next::munge!(let Self { table } = out);
14438 ::fidl_next::wire::Table::zero_padding(table);
14439 }
14440 }
14441
14442 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NodeInfo<'de>
14443 where
14444 ___D: ::fidl_next::Decoder<'de> + ?Sized,
14445 {
14446 fn decode(
14447 slot: ::fidl_next::Slot<'_, Self>,
14448 decoder: &mut ___D,
14449 _: (),
14450 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14451 ::fidl_next::munge!(let Self { table } = slot);
14452
14453 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14454 match ordinal {
14455 0 => unsafe { ::core::hint::unreachable_unchecked() },
14456
14457 1 => {
14458 ::fidl_next::wire::Envelope::decode_as::<
14459 ___D,
14460 crate::wire::NodeAttributes2<'de>,
14461 >(slot.as_mut(), decoder, ())?;
14462
14463 Ok(())
14464 }
14465
14466 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
14467 }
14468 })
14469 }
14470 }
14471
14472 impl<'de> NodeInfo<'de> {
14473 pub fn attributes(&self) -> ::core::option::Option<&crate::wire::NodeAttributes2<'de>> {
14474 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14475 }
14476
14477 pub fn take_attributes(
14478 &mut self,
14479 ) -> ::core::option::Option<crate::wire::NodeAttributes2<'de>> {
14480 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14481 }
14482 }
14483
14484 impl<'de> ::core::fmt::Debug for NodeInfo<'de> {
14485 fn fmt(
14486 &self,
14487 f: &mut ::core::fmt::Formatter<'_>,
14488 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14489 f.debug_struct("NodeInfo").field("attributes", &self.attributes()).finish()
14490 }
14491 }
14492
14493 impl<'de> ::fidl_next::IntoNatural for NodeInfo<'de> {
14494 type Natural = crate::natural::NodeInfo;
14495 }
14496
14497 #[repr(C)]
14499 pub struct DirectoryInfo<'de> {
14500 pub(crate) table: ::fidl_next::wire::Table<'de>,
14501 }
14502
14503 impl<'de> Drop for DirectoryInfo<'de> {
14504 fn drop(&mut self) {
14505 let _ = self.table.get(1).map(|envelope| unsafe {
14506 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
14507 });
14508 }
14509 }
14510
14511 impl ::fidl_next::Constrained for DirectoryInfo<'_> {
14512 type Constraint = ();
14513
14514 fn validate(
14515 _: ::fidl_next::Slot<'_, Self>,
14516 _: Self::Constraint,
14517 ) -> Result<(), ::fidl_next::ValidationError> {
14518 Ok(())
14519 }
14520 }
14521
14522 unsafe impl ::fidl_next::Wire for DirectoryInfo<'static> {
14523 type Narrowed<'de> = DirectoryInfo<'de>;
14524
14525 #[inline]
14526 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14527 ::fidl_next::munge!(let Self { table } = out);
14528 ::fidl_next::wire::Table::zero_padding(table);
14529 }
14530 }
14531
14532 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DirectoryInfo<'de>
14533 where
14534 ___D: ::fidl_next::Decoder<'de> + ?Sized,
14535 {
14536 fn decode(
14537 slot: ::fidl_next::Slot<'_, Self>,
14538 decoder: &mut ___D,
14539 _: (),
14540 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14541 ::fidl_next::munge!(let Self { table } = slot);
14542
14543 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14544 match ordinal {
14545 0 => unsafe { ::core::hint::unreachable_unchecked() },
14546
14547 1 => {
14548 ::fidl_next::wire::Envelope::decode_as::<
14549 ___D,
14550 crate::wire::NodeAttributes2<'de>,
14551 >(slot.as_mut(), decoder, ())?;
14552
14553 Ok(())
14554 }
14555
14556 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
14557 }
14558 })
14559 }
14560 }
14561
14562 impl<'de> DirectoryInfo<'de> {
14563 pub fn attributes(&self) -> ::core::option::Option<&crate::wire::NodeAttributes2<'de>> {
14564 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14565 }
14566
14567 pub fn take_attributes(
14568 &mut self,
14569 ) -> ::core::option::Option<crate::wire::NodeAttributes2<'de>> {
14570 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14571 }
14572 }
14573
14574 impl<'de> ::core::fmt::Debug for DirectoryInfo<'de> {
14575 fn fmt(
14576 &self,
14577 f: &mut ::core::fmt::Formatter<'_>,
14578 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14579 f.debug_struct("DirectoryInfo").field("attributes", &self.attributes()).finish()
14580 }
14581 }
14582
14583 impl<'de> ::fidl_next::IntoNatural for DirectoryInfo<'de> {
14584 type Natural = crate::natural::DirectoryInfo;
14585 }
14586
14587 #[repr(C)]
14589 pub struct SymlinkInfo<'de> {
14590 pub(crate) table: ::fidl_next::wire::Table<'de>,
14591 }
14592
14593 impl<'de> Drop for SymlinkInfo<'de> {
14594 fn drop(&mut self) {
14595 let _ = self.table.get(1).map(|envelope| unsafe {
14596 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
14597 });
14598
14599 let _ = self.table.get(2).map(|envelope| unsafe {
14600 envelope.read_unchecked::<crate::wire::NodeAttributes2<'de>>()
14601 });
14602 }
14603 }
14604
14605 impl ::fidl_next::Constrained for SymlinkInfo<'_> {
14606 type Constraint = ();
14607
14608 fn validate(
14609 _: ::fidl_next::Slot<'_, Self>,
14610 _: Self::Constraint,
14611 ) -> Result<(), ::fidl_next::ValidationError> {
14612 Ok(())
14613 }
14614 }
14615
14616 unsafe impl ::fidl_next::Wire for SymlinkInfo<'static> {
14617 type Narrowed<'de> = SymlinkInfo<'de>;
14618
14619 #[inline]
14620 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14621 ::fidl_next::munge!(let Self { table } = out);
14622 ::fidl_next::wire::Table::zero_padding(table);
14623 }
14624 }
14625
14626 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SymlinkInfo<'de>
14627 where
14628 ___D: ::fidl_next::Decoder<'de> + ?Sized,
14629 {
14630 fn decode(
14631 slot: ::fidl_next::Slot<'_, Self>,
14632 decoder: &mut ___D,
14633 _: (),
14634 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14635 ::fidl_next::munge!(let Self { table } = slot);
14636
14637 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14638 match ordinal {
14639 0 => unsafe { ::core::hint::unreachable_unchecked() },
14640
14641 1 => {
14642 ::fidl_next::wire::Envelope::decode_as::<
14643 ___D,
14644 ::fidl_next::wire::Vector<'de, u8>,
14645 >(slot.as_mut(), decoder, (4095, ()))?;
14646
14647 let value = unsafe {
14648 slot.deref_unchecked()
14649 .deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
14650 };
14651
14652 if value.len() > 4095 {
14653 return Err(::fidl_next::DecodeError::VectorTooLong {
14654 size: value.len() as u64,
14655 limit: 4095,
14656 });
14657 }
14658
14659 Ok(())
14660 }
14661
14662 2 => {
14663 ::fidl_next::wire::Envelope::decode_as::<
14664 ___D,
14665 crate::wire::NodeAttributes2<'de>,
14666 >(slot.as_mut(), decoder, ())?;
14667
14668 Ok(())
14669 }
14670
14671 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
14672 }
14673 })
14674 }
14675 }
14676
14677 impl<'de> SymlinkInfo<'de> {
14678 pub fn target(&self) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, u8>> {
14679 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14680 }
14681
14682 pub fn take_target(
14683 &mut self,
14684 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, u8>> {
14685 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14686 }
14687
14688 pub fn attributes(&self) -> ::core::option::Option<&crate::wire::NodeAttributes2<'de>> {
14689 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14690 }
14691
14692 pub fn take_attributes(
14693 &mut self,
14694 ) -> ::core::option::Option<crate::wire::NodeAttributes2<'de>> {
14695 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
14696 }
14697 }
14698
14699 impl<'de> ::core::fmt::Debug for SymlinkInfo<'de> {
14700 fn fmt(
14701 &self,
14702 f: &mut ::core::fmt::Formatter<'_>,
14703 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14704 f.debug_struct("SymlinkInfo")
14705 .field("target", &self.target())
14706 .field("attributes", &self.attributes())
14707 .finish()
14708 }
14709 }
14710
14711 impl<'de> ::fidl_next::IntoNatural for SymlinkInfo<'de> {
14712 type Natural = crate::natural::SymlinkInfo;
14713 }
14714
14715 #[derive(Clone, Copy, Debug)]
14717 #[repr(transparent)]
14718 pub struct NodeAttributesQuery {
14719 pub(crate) value: ::fidl_next::wire::Uint64,
14720 }
14721
14722 impl ::fidl_next::Constrained for NodeAttributesQuery {
14723 type Constraint = ();
14724
14725 fn validate(
14726 _: ::fidl_next::Slot<'_, Self>,
14727 _: Self::Constraint,
14728 ) -> Result<(), ::fidl_next::ValidationError> {
14729 Ok(())
14730 }
14731 }
14732
14733 unsafe impl ::fidl_next::Wire for NodeAttributesQuery {
14734 type Narrowed<'de> = Self;
14735
14736 #[inline]
14737 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
14738 }
14740 }
14741
14742 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeAttributesQuery
14743 where
14744 ___D: ?Sized,
14745 {
14746 fn decode(
14747 slot: ::fidl_next::Slot<'_, Self>,
14748 _: &mut ___D,
14749 _: (),
14750 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14751 Ok(())
14752 }
14753 }
14754
14755 impl ::core::convert::From<crate::natural::NodeAttributesQuery> for NodeAttributesQuery {
14756 fn from(natural: crate::natural::NodeAttributesQuery) -> Self {
14757 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
14758 }
14759 }
14760
14761 impl ::fidl_next::IntoNatural for NodeAttributesQuery {
14762 type Natural = crate::natural::NodeAttributesQuery;
14763 }
14764
14765 #[derive(Clone, Debug)]
14767 #[repr(C)]
14768 pub struct NodeGetAttributesRequest {
14769 pub query: crate::wire::NodeAttributesQuery,
14770 }
14771
14772 static_assertions::const_assert_eq!(std::mem::size_of::<NodeGetAttributesRequest>(), 8);
14773 static_assertions::const_assert_eq!(std::mem::align_of::<NodeGetAttributesRequest>(), 8);
14774
14775 static_assertions::const_assert_eq!(std::mem::offset_of!(NodeGetAttributesRequest, query), 0);
14776
14777 impl ::fidl_next::Constrained for NodeGetAttributesRequest {
14778 type Constraint = ();
14779
14780 fn validate(
14781 _: ::fidl_next::Slot<'_, Self>,
14782 _: Self::Constraint,
14783 ) -> Result<(), ::fidl_next::ValidationError> {
14784 Ok(())
14785 }
14786 }
14787
14788 unsafe impl ::fidl_next::Wire for NodeGetAttributesRequest {
14789 type Narrowed<'de> = NodeGetAttributesRequest;
14790
14791 #[inline]
14792 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
14793 ::fidl_next::munge! {
14794 let Self {
14795 query,
14796
14797 } = &mut *out_;
14798 }
14799
14800 ::fidl_next::Wire::zero_padding(query);
14801 }
14802 }
14803
14804 unsafe impl<___D> ::fidl_next::Decode<___D> for NodeGetAttributesRequest
14805 where
14806 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14807 {
14808 fn decode(
14809 slot_: ::fidl_next::Slot<'_, Self>,
14810 decoder_: &mut ___D,
14811 _: (),
14812 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14813 ::fidl_next::munge! {
14814 let Self {
14815 mut query,
14816
14817 } = slot_;
14818 }
14819
14820 let _field = query.as_mut();
14821
14822 ::fidl_next::Decode::decode(query.as_mut(), decoder_, ())?;
14823
14824 Ok(())
14825 }
14826 }
14827
14828 impl ::fidl_next::IntoNatural for NodeGetAttributesRequest {
14829 type Natural = crate::natural::NodeGetAttributesRequest;
14830 }
14831
14832 #[repr(C)]
14834 pub struct Options<'de> {
14835 pub(crate) table: ::fidl_next::wire::Table<'de>,
14836 }
14837
14838 impl<'de> Drop for Options<'de> {
14839 fn drop(&mut self) {
14840 let _ = self.table.get(1).map(|envelope| unsafe {
14841 envelope.read_unchecked::<crate::wire::NodeAttributesQuery>()
14842 });
14843
14844 let _ = self.table.get(2).map(|envelope| unsafe {
14845 envelope.read_unchecked::<crate::wire::MutableNodeAttributes<'de>>()
14846 });
14847 }
14848 }
14849
14850 impl ::fidl_next::Constrained for Options<'_> {
14851 type Constraint = ();
14852
14853 fn validate(
14854 _: ::fidl_next::Slot<'_, Self>,
14855 _: Self::Constraint,
14856 ) -> Result<(), ::fidl_next::ValidationError> {
14857 Ok(())
14858 }
14859 }
14860
14861 unsafe impl ::fidl_next::Wire for Options<'static> {
14862 type Narrowed<'de> = Options<'de>;
14863
14864 #[inline]
14865 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14866 ::fidl_next::munge!(let Self { table } = out);
14867 ::fidl_next::wire::Table::zero_padding(table);
14868 }
14869 }
14870
14871 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Options<'de>
14872 where
14873 ___D: ::fidl_next::Decoder<'de> + ?Sized,
14874 {
14875 fn decode(
14876 slot: ::fidl_next::Slot<'_, Self>,
14877 decoder: &mut ___D,
14878 _: (),
14879 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14880 ::fidl_next::munge!(let Self { table } = slot);
14881
14882 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14883 match ordinal {
14884 0 => unsafe { ::core::hint::unreachable_unchecked() },
14885
14886 1 => {
14887 ::fidl_next::wire::Envelope::decode_as::<
14888 ___D,
14889 crate::wire::NodeAttributesQuery,
14890 >(slot.as_mut(), decoder, ())?;
14891
14892 Ok(())
14893 }
14894
14895 2 => {
14896 ::fidl_next::wire::Envelope::decode_as::<
14897 ___D,
14898 crate::wire::MutableNodeAttributes<'de>,
14899 >(slot.as_mut(), decoder, ())?;
14900
14901 Ok(())
14902 }
14903
14904 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
14905 }
14906 })
14907 }
14908 }
14909
14910 impl<'de> Options<'de> {
14911 pub fn attributes(&self) -> ::core::option::Option<&crate::wire::NodeAttributesQuery> {
14912 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14913 }
14914
14915 pub fn take_attributes(
14916 &mut self,
14917 ) -> ::core::option::Option<crate::wire::NodeAttributesQuery> {
14918 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
14919 }
14920
14921 pub fn create_attributes(
14922 &self,
14923 ) -> ::core::option::Option<&crate::wire::MutableNodeAttributes<'de>> {
14924 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14925 }
14926
14927 pub fn take_create_attributes(
14928 &mut self,
14929 ) -> ::core::option::Option<crate::wire::MutableNodeAttributes<'de>> {
14930 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
14931 }
14932 }
14933
14934 impl<'de> ::core::fmt::Debug for Options<'de> {
14935 fn fmt(
14936 &self,
14937 f: &mut ::core::fmt::Formatter<'_>,
14938 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14939 f.debug_struct("Options")
14940 .field("attributes", &self.attributes())
14941 .field("create_attributes", &self.create_attributes())
14942 .finish()
14943 }
14944 }
14945
14946 impl<'de> ::fidl_next::IntoNatural for Options<'de> {
14947 type Natural = crate::natural::Options;
14948 }
14949
14950 pub type DirectoryObject = ::fidl_next::wire::Unit;
14952
14953 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
14955 #[repr(transparent)]
14956 pub struct DirentType {
14957 pub(crate) value: u8,
14958 }
14959
14960 impl ::fidl_next::Constrained for DirentType {
14961 type Constraint = ();
14962
14963 fn validate(
14964 _: ::fidl_next::Slot<'_, Self>,
14965 _: Self::Constraint,
14966 ) -> Result<(), ::fidl_next::ValidationError> {
14967 Ok(())
14968 }
14969 }
14970
14971 unsafe impl ::fidl_next::Wire for DirentType {
14972 type Narrowed<'de> = Self;
14973
14974 #[inline]
14975 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
14976 }
14978 }
14979
14980 impl DirentType {
14981 pub const UNKNOWN: DirentType = DirentType { value: 0 };
14982
14983 pub const DIRECTORY: DirentType = DirentType { value: 4 };
14984
14985 pub const BLOCK_DEVICE: DirentType = DirentType { value: 6 };
14986
14987 pub const FILE: DirentType = DirentType { value: 8 };
14988
14989 pub const SYMLINK: DirentType = DirentType { value: 10 };
14990
14991 pub const SERVICE: DirentType = DirentType { value: 16 };
14992 }
14993
14994 unsafe impl<___D> ::fidl_next::Decode<___D> for DirentType
14995 where
14996 ___D: ?Sized,
14997 {
14998 fn decode(
14999 slot: ::fidl_next::Slot<'_, Self>,
15000 _: &mut ___D,
15001 _: (),
15002 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15003 Ok(())
15004 }
15005 }
15006
15007 impl ::core::convert::From<crate::natural::DirentType> for DirentType {
15008 fn from(natural: crate::natural::DirentType) -> Self {
15009 match natural {
15010 crate::natural::DirentType::Unknown => DirentType::UNKNOWN,
15011
15012 crate::natural::DirentType::Directory => DirentType::DIRECTORY,
15013
15014 crate::natural::DirentType::BlockDevice => DirentType::BLOCK_DEVICE,
15015
15016 crate::natural::DirentType::File => DirentType::FILE,
15017
15018 crate::natural::DirentType::Symlink => DirentType::SYMLINK,
15019
15020 crate::natural::DirentType::Service => DirentType::SERVICE,
15021
15022 crate::natural::DirentType::UnknownOrdinal_(value) => {
15023 DirentType { value: u8::from(value) }
15024 }
15025 }
15026 }
15027 }
15028
15029 impl ::fidl_next::IntoNatural for DirentType {
15030 type Natural = crate::natural::DirentType;
15031 }
15032
15033 #[derive(Debug)]
15035 #[repr(C)]
15036 pub struct ExtendedAttributeIteratorGetNextResponse<'de> {
15037 pub attributes: ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Vector<'de, u8>>,
15038
15039 pub last: bool,
15040 }
15041
15042 static_assertions::const_assert_eq!(
15043 std::mem::size_of::<ExtendedAttributeIteratorGetNextResponse<'_>>(),
15044 24
15045 );
15046 static_assertions::const_assert_eq!(
15047 std::mem::align_of::<ExtendedAttributeIteratorGetNextResponse<'_>>(),
15048 8
15049 );
15050
15051 static_assertions::const_assert_eq!(
15052 std::mem::offset_of!(ExtendedAttributeIteratorGetNextResponse<'_>, attributes),
15053 0
15054 );
15055
15056 static_assertions::const_assert_eq!(
15057 std::mem::offset_of!(ExtendedAttributeIteratorGetNextResponse<'_>, last),
15058 16
15059 );
15060
15061 impl ::fidl_next::Constrained for ExtendedAttributeIteratorGetNextResponse<'_> {
15062 type Constraint = ();
15063
15064 fn validate(
15065 _: ::fidl_next::Slot<'_, Self>,
15066 _: Self::Constraint,
15067 ) -> Result<(), ::fidl_next::ValidationError> {
15068 Ok(())
15069 }
15070 }
15071
15072 unsafe impl ::fidl_next::Wire for ExtendedAttributeIteratorGetNextResponse<'static> {
15073 type Narrowed<'de> = ExtendedAttributeIteratorGetNextResponse<'de>;
15074
15075 #[inline]
15076 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15077 ::fidl_next::munge! {
15078 let Self {
15079 attributes,
15080 last,
15081
15082 } = &mut *out_;
15083 }
15084
15085 ::fidl_next::Wire::zero_padding(attributes);
15086
15087 ::fidl_next::Wire::zero_padding(last);
15088
15089 unsafe {
15090 out_.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
15091 }
15092 }
15093 }
15094
15095 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExtendedAttributeIteratorGetNextResponse<'de>
15096 where
15097 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15098 ___D: ::fidl_next::Decoder<'de>,
15099 {
15100 fn decode(
15101 slot_: ::fidl_next::Slot<'_, Self>,
15102 decoder_: &mut ___D,
15103 _: (),
15104 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15105 if slot_.as_bytes()[17..24] != [0u8; 7] {
15106 return Err(::fidl_next::DecodeError::InvalidPadding);
15107 }
15108
15109 ::fidl_next::munge! {
15110 let Self {
15111 mut attributes,
15112 mut last,
15113
15114 } = slot_;
15115 }
15116
15117 let _field = attributes.as_mut();
15118 ::fidl_next::Constrained::validate(_field, (128, (255, ())))?;
15119 ::fidl_next::Decode::decode(attributes.as_mut(), decoder_, (128, (255, ())))?;
15120
15121 let attributes = unsafe { attributes.deref_unchecked() };
15122
15123 if attributes.len() > 128 {
15124 return Err(::fidl_next::DecodeError::VectorTooLong {
15125 size: attributes.len() as u64,
15126 limit: 128,
15127 });
15128 }
15129
15130 let _field = last.as_mut();
15131
15132 ::fidl_next::Decode::decode(last.as_mut(), decoder_, ())?;
15133
15134 Ok(())
15135 }
15136 }
15137
15138 impl<'de> ::fidl_next::IntoNatural for ExtendedAttributeIteratorGetNextResponse<'de> {
15139 type Natural = crate::natural::ExtendedAttributeIteratorGetNextResponse;
15140 }
15141
15142 #[derive(Clone, Debug)]
15144 #[repr(C)]
15145 pub struct ReadableReadRequest {
15146 pub count: ::fidl_next::wire::Uint64,
15147 }
15148
15149 static_assertions::const_assert_eq!(std::mem::size_of::<ReadableReadRequest>(), 8);
15150 static_assertions::const_assert_eq!(std::mem::align_of::<ReadableReadRequest>(), 8);
15151
15152 static_assertions::const_assert_eq!(std::mem::offset_of!(ReadableReadRequest, count), 0);
15153
15154 impl ::fidl_next::Constrained for ReadableReadRequest {
15155 type Constraint = ();
15156
15157 fn validate(
15158 _: ::fidl_next::Slot<'_, Self>,
15159 _: Self::Constraint,
15160 ) -> Result<(), ::fidl_next::ValidationError> {
15161 Ok(())
15162 }
15163 }
15164
15165 unsafe impl ::fidl_next::Wire for ReadableReadRequest {
15166 type Narrowed<'de> = ReadableReadRequest;
15167
15168 #[inline]
15169 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15170 ::fidl_next::munge! {
15171 let Self {
15172 count,
15173
15174 } = &mut *out_;
15175 }
15176
15177 ::fidl_next::Wire::zero_padding(count);
15178 }
15179 }
15180
15181 unsafe impl<___D> ::fidl_next::Decode<___D> for ReadableReadRequest
15182 where
15183 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15184 {
15185 fn decode(
15186 slot_: ::fidl_next::Slot<'_, Self>,
15187 decoder_: &mut ___D,
15188 _: (),
15189 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15190 ::fidl_next::munge! {
15191 let Self {
15192 mut count,
15193
15194 } = slot_;
15195 }
15196
15197 let _field = count.as_mut();
15198
15199 ::fidl_next::Decode::decode(count.as_mut(), decoder_, ())?;
15200
15201 Ok(())
15202 }
15203 }
15204
15205 impl ::fidl_next::IntoNatural for ReadableReadRequest {
15206 type Natural = crate::natural::ReadableReadRequest;
15207 }
15208
15209 pub type Transfer<'de> = ::fidl_next::wire::Vector<'de, u8>;
15211
15212 #[derive(Debug)]
15214 #[repr(C)]
15215 pub struct ReadableReadResponse<'de> {
15216 pub data: ::fidl_next::wire::Vector<'de, u8>,
15217 }
15218
15219 static_assertions::const_assert_eq!(std::mem::size_of::<ReadableReadResponse<'_>>(), 16);
15220 static_assertions::const_assert_eq!(std::mem::align_of::<ReadableReadResponse<'_>>(), 8);
15221
15222 static_assertions::const_assert_eq!(std::mem::offset_of!(ReadableReadResponse<'_>, data), 0);
15223
15224 impl ::fidl_next::Constrained for ReadableReadResponse<'_> {
15225 type Constraint = ();
15226
15227 fn validate(
15228 _: ::fidl_next::Slot<'_, Self>,
15229 _: Self::Constraint,
15230 ) -> Result<(), ::fidl_next::ValidationError> {
15231 Ok(())
15232 }
15233 }
15234
15235 unsafe impl ::fidl_next::Wire for ReadableReadResponse<'static> {
15236 type Narrowed<'de> = ReadableReadResponse<'de>;
15237
15238 #[inline]
15239 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15240 ::fidl_next::munge! {
15241 let Self {
15242 data,
15243
15244 } = &mut *out_;
15245 }
15246
15247 ::fidl_next::Wire::zero_padding(data);
15248 }
15249 }
15250
15251 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ReadableReadResponse<'de>
15252 where
15253 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15254 ___D: ::fidl_next::Decoder<'de>,
15255 {
15256 fn decode(
15257 slot_: ::fidl_next::Slot<'_, Self>,
15258 decoder_: &mut ___D,
15259 _: (),
15260 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15261 ::fidl_next::munge! {
15262 let Self {
15263 mut data,
15264
15265 } = slot_;
15266 }
15267
15268 let _field = data.as_mut();
15269 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
15270 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (8192, ()))?;
15271
15272 let data = unsafe { data.deref_unchecked() };
15273
15274 if data.len() > 8192 {
15275 return Err(::fidl_next::DecodeError::VectorTooLong {
15276 size: data.len() as u64,
15277 limit: 8192,
15278 });
15279 }
15280
15281 Ok(())
15282 }
15283 }
15284
15285 impl<'de> ::fidl_next::IntoNatural for ReadableReadResponse<'de> {
15286 type Natural = crate::natural::ReadableReadResponse;
15287 }
15288
15289 #[derive(Debug)]
15291 #[repr(C)]
15292 pub struct WritableWriteRequest<'de> {
15293 pub data: ::fidl_next::wire::Vector<'de, u8>,
15294 }
15295
15296 static_assertions::const_assert_eq!(std::mem::size_of::<WritableWriteRequest<'_>>(), 16);
15297 static_assertions::const_assert_eq!(std::mem::align_of::<WritableWriteRequest<'_>>(), 8);
15298
15299 static_assertions::const_assert_eq!(std::mem::offset_of!(WritableWriteRequest<'_>, data), 0);
15300
15301 impl ::fidl_next::Constrained for WritableWriteRequest<'_> {
15302 type Constraint = ();
15303
15304 fn validate(
15305 _: ::fidl_next::Slot<'_, Self>,
15306 _: Self::Constraint,
15307 ) -> Result<(), ::fidl_next::ValidationError> {
15308 Ok(())
15309 }
15310 }
15311
15312 unsafe impl ::fidl_next::Wire for WritableWriteRequest<'static> {
15313 type Narrowed<'de> = WritableWriteRequest<'de>;
15314
15315 #[inline]
15316 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15317 ::fidl_next::munge! {
15318 let Self {
15319 data,
15320
15321 } = &mut *out_;
15322 }
15323
15324 ::fidl_next::Wire::zero_padding(data);
15325 }
15326 }
15327
15328 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for WritableWriteRequest<'de>
15329 where
15330 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15331 ___D: ::fidl_next::Decoder<'de>,
15332 {
15333 fn decode(
15334 slot_: ::fidl_next::Slot<'_, Self>,
15335 decoder_: &mut ___D,
15336 _: (),
15337 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15338 ::fidl_next::munge! {
15339 let Self {
15340 mut data,
15341
15342 } = slot_;
15343 }
15344
15345 let _field = data.as_mut();
15346 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
15347 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (8192, ()))?;
15348
15349 let data = unsafe { data.deref_unchecked() };
15350
15351 if data.len() > 8192 {
15352 return Err(::fidl_next::DecodeError::VectorTooLong {
15353 size: data.len() as u64,
15354 limit: 8192,
15355 });
15356 }
15357
15358 Ok(())
15359 }
15360 }
15361
15362 impl<'de> ::fidl_next::IntoNatural for WritableWriteRequest<'de> {
15363 type Natural = crate::natural::WritableWriteRequest;
15364 }
15365
15366 #[derive(Clone, Debug)]
15368 #[repr(C)]
15369 pub struct WritableWriteResponse {
15370 pub actual_count: ::fidl_next::wire::Uint64,
15371 }
15372
15373 static_assertions::const_assert_eq!(std::mem::size_of::<WritableWriteResponse>(), 8);
15374 static_assertions::const_assert_eq!(std::mem::align_of::<WritableWriteResponse>(), 8);
15375
15376 static_assertions::const_assert_eq!(
15377 std::mem::offset_of!(WritableWriteResponse, actual_count),
15378 0
15379 );
15380
15381 impl ::fidl_next::Constrained for WritableWriteResponse {
15382 type Constraint = ();
15383
15384 fn validate(
15385 _: ::fidl_next::Slot<'_, Self>,
15386 _: Self::Constraint,
15387 ) -> Result<(), ::fidl_next::ValidationError> {
15388 Ok(())
15389 }
15390 }
15391
15392 unsafe impl ::fidl_next::Wire for WritableWriteResponse {
15393 type Narrowed<'de> = WritableWriteResponse;
15394
15395 #[inline]
15396 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15397 ::fidl_next::munge! {
15398 let Self {
15399 actual_count,
15400
15401 } = &mut *out_;
15402 }
15403
15404 ::fidl_next::Wire::zero_padding(actual_count);
15405 }
15406 }
15407
15408 unsafe impl<___D> ::fidl_next::Decode<___D> for WritableWriteResponse
15409 where
15410 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15411 {
15412 fn decode(
15413 slot_: ::fidl_next::Slot<'_, Self>,
15414 decoder_: &mut ___D,
15415 _: (),
15416 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15417 ::fidl_next::munge! {
15418 let Self {
15419 mut actual_count,
15420
15421 } = slot_;
15422 }
15423
15424 let _field = actual_count.as_mut();
15425
15426 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder_, ())?;
15427
15428 Ok(())
15429 }
15430 }
15431
15432 impl ::fidl_next::IntoNatural for WritableWriteResponse {
15433 type Natural = crate::natural::WritableWriteResponse;
15434 }
15435
15436 #[derive(Clone, Debug)]
15438 #[repr(C)]
15439 pub struct FileSeekRequest {
15440 pub origin: crate::wire::SeekOrigin,
15441
15442 pub offset: ::fidl_next::wire::Int64,
15443 }
15444
15445 static_assertions::const_assert_eq!(std::mem::size_of::<FileSeekRequest>(), 16);
15446 static_assertions::const_assert_eq!(std::mem::align_of::<FileSeekRequest>(), 8);
15447
15448 static_assertions::const_assert_eq!(std::mem::offset_of!(FileSeekRequest, origin), 0);
15449
15450 static_assertions::const_assert_eq!(std::mem::offset_of!(FileSeekRequest, offset), 8);
15451
15452 impl ::fidl_next::Constrained for FileSeekRequest {
15453 type Constraint = ();
15454
15455 fn validate(
15456 _: ::fidl_next::Slot<'_, Self>,
15457 _: Self::Constraint,
15458 ) -> Result<(), ::fidl_next::ValidationError> {
15459 Ok(())
15460 }
15461 }
15462
15463 unsafe impl ::fidl_next::Wire for FileSeekRequest {
15464 type Narrowed<'de> = FileSeekRequest;
15465
15466 #[inline]
15467 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15468 ::fidl_next::munge! {
15469 let Self {
15470 origin,
15471 offset,
15472
15473 } = &mut *out_;
15474 }
15475
15476 ::fidl_next::Wire::zero_padding(origin);
15477
15478 ::fidl_next::Wire::zero_padding(offset);
15479
15480 unsafe {
15481 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
15482 }
15483 }
15484 }
15485
15486 unsafe impl<___D> ::fidl_next::Decode<___D> for FileSeekRequest
15487 where
15488 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15489 {
15490 fn decode(
15491 slot_: ::fidl_next::Slot<'_, Self>,
15492 decoder_: &mut ___D,
15493 _: (),
15494 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15495 if slot_.as_bytes()[4..8] != [0u8; 4] {
15496 return Err(::fidl_next::DecodeError::InvalidPadding);
15497 }
15498
15499 ::fidl_next::munge! {
15500 let Self {
15501 mut origin,
15502 mut offset,
15503
15504 } = slot_;
15505 }
15506
15507 let _field = origin.as_mut();
15508
15509 ::fidl_next::Decode::decode(origin.as_mut(), decoder_, ())?;
15510
15511 let _field = offset.as_mut();
15512
15513 ::fidl_next::Decode::decode(offset.as_mut(), decoder_, ())?;
15514
15515 Ok(())
15516 }
15517 }
15518
15519 impl ::fidl_next::IntoNatural for FileSeekRequest {
15520 type Natural = crate::natural::FileSeekRequest;
15521 }
15522
15523 #[derive(Clone, Debug)]
15525 #[repr(C)]
15526 pub struct FileSeekResponse {
15527 pub offset_from_start: ::fidl_next::wire::Uint64,
15528 }
15529
15530 static_assertions::const_assert_eq!(std::mem::size_of::<FileSeekResponse>(), 8);
15531 static_assertions::const_assert_eq!(std::mem::align_of::<FileSeekResponse>(), 8);
15532
15533 static_assertions::const_assert_eq!(
15534 std::mem::offset_of!(FileSeekResponse, offset_from_start),
15535 0
15536 );
15537
15538 impl ::fidl_next::Constrained for FileSeekResponse {
15539 type Constraint = ();
15540
15541 fn validate(
15542 _: ::fidl_next::Slot<'_, Self>,
15543 _: Self::Constraint,
15544 ) -> Result<(), ::fidl_next::ValidationError> {
15545 Ok(())
15546 }
15547 }
15548
15549 unsafe impl ::fidl_next::Wire for FileSeekResponse {
15550 type Narrowed<'de> = FileSeekResponse;
15551
15552 #[inline]
15553 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15554 ::fidl_next::munge! {
15555 let Self {
15556 offset_from_start,
15557
15558 } = &mut *out_;
15559 }
15560
15561 ::fidl_next::Wire::zero_padding(offset_from_start);
15562 }
15563 }
15564
15565 unsafe impl<___D> ::fidl_next::Decode<___D> for FileSeekResponse
15566 where
15567 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15568 {
15569 fn decode(
15570 slot_: ::fidl_next::Slot<'_, Self>,
15571 decoder_: &mut ___D,
15572 _: (),
15573 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15574 ::fidl_next::munge! {
15575 let Self {
15576 mut offset_from_start,
15577
15578 } = slot_;
15579 }
15580
15581 let _field = offset_from_start.as_mut();
15582
15583 ::fidl_next::Decode::decode(offset_from_start.as_mut(), decoder_, ())?;
15584
15585 Ok(())
15586 }
15587 }
15588
15589 impl ::fidl_next::IntoNatural for FileSeekResponse {
15590 type Natural = crate::natural::FileSeekResponse;
15591 }
15592
15593 #[derive(Clone, Debug)]
15595 #[repr(C)]
15596 pub struct FileReadAtRequest {
15597 pub count: ::fidl_next::wire::Uint64,
15598
15599 pub offset: ::fidl_next::wire::Uint64,
15600 }
15601
15602 static_assertions::const_assert_eq!(std::mem::size_of::<FileReadAtRequest>(), 16);
15603 static_assertions::const_assert_eq!(std::mem::align_of::<FileReadAtRequest>(), 8);
15604
15605 static_assertions::const_assert_eq!(std::mem::offset_of!(FileReadAtRequest, count), 0);
15606
15607 static_assertions::const_assert_eq!(std::mem::offset_of!(FileReadAtRequest, offset), 8);
15608
15609 impl ::fidl_next::Constrained for FileReadAtRequest {
15610 type Constraint = ();
15611
15612 fn validate(
15613 _: ::fidl_next::Slot<'_, Self>,
15614 _: Self::Constraint,
15615 ) -> Result<(), ::fidl_next::ValidationError> {
15616 Ok(())
15617 }
15618 }
15619
15620 unsafe impl ::fidl_next::Wire for FileReadAtRequest {
15621 type Narrowed<'de> = FileReadAtRequest;
15622
15623 #[inline]
15624 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15625 ::fidl_next::munge! {
15626 let Self {
15627 count,
15628 offset,
15629
15630 } = &mut *out_;
15631 }
15632
15633 ::fidl_next::Wire::zero_padding(count);
15634
15635 ::fidl_next::Wire::zero_padding(offset);
15636 }
15637 }
15638
15639 unsafe impl<___D> ::fidl_next::Decode<___D> for FileReadAtRequest
15640 where
15641 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15642 {
15643 fn decode(
15644 slot_: ::fidl_next::Slot<'_, Self>,
15645 decoder_: &mut ___D,
15646 _: (),
15647 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15648 ::fidl_next::munge! {
15649 let Self {
15650 mut count,
15651 mut offset,
15652
15653 } = slot_;
15654 }
15655
15656 let _field = count.as_mut();
15657
15658 ::fidl_next::Decode::decode(count.as_mut(), decoder_, ())?;
15659
15660 let _field = offset.as_mut();
15661
15662 ::fidl_next::Decode::decode(offset.as_mut(), decoder_, ())?;
15663
15664 Ok(())
15665 }
15666 }
15667
15668 impl ::fidl_next::IntoNatural for FileReadAtRequest {
15669 type Natural = crate::natural::FileReadAtRequest;
15670 }
15671
15672 #[derive(Debug)]
15674 #[repr(C)]
15675 pub struct FileReadAtResponse<'de> {
15676 pub data: ::fidl_next::wire::Vector<'de, u8>,
15677 }
15678
15679 static_assertions::const_assert_eq!(std::mem::size_of::<FileReadAtResponse<'_>>(), 16);
15680 static_assertions::const_assert_eq!(std::mem::align_of::<FileReadAtResponse<'_>>(), 8);
15681
15682 static_assertions::const_assert_eq!(std::mem::offset_of!(FileReadAtResponse<'_>, data), 0);
15683
15684 impl ::fidl_next::Constrained for FileReadAtResponse<'_> {
15685 type Constraint = ();
15686
15687 fn validate(
15688 _: ::fidl_next::Slot<'_, Self>,
15689 _: Self::Constraint,
15690 ) -> Result<(), ::fidl_next::ValidationError> {
15691 Ok(())
15692 }
15693 }
15694
15695 unsafe impl ::fidl_next::Wire for FileReadAtResponse<'static> {
15696 type Narrowed<'de> = FileReadAtResponse<'de>;
15697
15698 #[inline]
15699 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15700 ::fidl_next::munge! {
15701 let Self {
15702 data,
15703
15704 } = &mut *out_;
15705 }
15706
15707 ::fidl_next::Wire::zero_padding(data);
15708 }
15709 }
15710
15711 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FileReadAtResponse<'de>
15712 where
15713 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15714 ___D: ::fidl_next::Decoder<'de>,
15715 {
15716 fn decode(
15717 slot_: ::fidl_next::Slot<'_, Self>,
15718 decoder_: &mut ___D,
15719 _: (),
15720 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15721 ::fidl_next::munge! {
15722 let Self {
15723 mut data,
15724
15725 } = slot_;
15726 }
15727
15728 let _field = data.as_mut();
15729 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
15730 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (8192, ()))?;
15731
15732 let data = unsafe { data.deref_unchecked() };
15733
15734 if data.len() > 8192 {
15735 return Err(::fidl_next::DecodeError::VectorTooLong {
15736 size: data.len() as u64,
15737 limit: 8192,
15738 });
15739 }
15740
15741 Ok(())
15742 }
15743 }
15744
15745 impl<'de> ::fidl_next::IntoNatural for FileReadAtResponse<'de> {
15746 type Natural = crate::natural::FileReadAtResponse;
15747 }
15748
15749 #[derive(Debug)]
15751 #[repr(C)]
15752 pub struct FileWriteAtRequest<'de> {
15753 pub data: ::fidl_next::wire::Vector<'de, u8>,
15754
15755 pub offset: ::fidl_next::wire::Uint64,
15756 }
15757
15758 static_assertions::const_assert_eq!(std::mem::size_of::<FileWriteAtRequest<'_>>(), 24);
15759 static_assertions::const_assert_eq!(std::mem::align_of::<FileWriteAtRequest<'_>>(), 8);
15760
15761 static_assertions::const_assert_eq!(std::mem::offset_of!(FileWriteAtRequest<'_>, data), 0);
15762
15763 static_assertions::const_assert_eq!(std::mem::offset_of!(FileWriteAtRequest<'_>, offset), 16);
15764
15765 impl ::fidl_next::Constrained for FileWriteAtRequest<'_> {
15766 type Constraint = ();
15767
15768 fn validate(
15769 _: ::fidl_next::Slot<'_, Self>,
15770 _: Self::Constraint,
15771 ) -> Result<(), ::fidl_next::ValidationError> {
15772 Ok(())
15773 }
15774 }
15775
15776 unsafe impl ::fidl_next::Wire for FileWriteAtRequest<'static> {
15777 type Narrowed<'de> = FileWriteAtRequest<'de>;
15778
15779 #[inline]
15780 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15781 ::fidl_next::munge! {
15782 let Self {
15783 data,
15784 offset,
15785
15786 } = &mut *out_;
15787 }
15788
15789 ::fidl_next::Wire::zero_padding(data);
15790
15791 ::fidl_next::Wire::zero_padding(offset);
15792 }
15793 }
15794
15795 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FileWriteAtRequest<'de>
15796 where
15797 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15798 ___D: ::fidl_next::Decoder<'de>,
15799 {
15800 fn decode(
15801 slot_: ::fidl_next::Slot<'_, Self>,
15802 decoder_: &mut ___D,
15803 _: (),
15804 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15805 ::fidl_next::munge! {
15806 let Self {
15807 mut data,
15808 mut offset,
15809
15810 } = slot_;
15811 }
15812
15813 let _field = data.as_mut();
15814 ::fidl_next::Constrained::validate(_field, (8192, ()))?;
15815 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (8192, ()))?;
15816
15817 let data = unsafe { data.deref_unchecked() };
15818
15819 if data.len() > 8192 {
15820 return Err(::fidl_next::DecodeError::VectorTooLong {
15821 size: data.len() as u64,
15822 limit: 8192,
15823 });
15824 }
15825
15826 let _field = offset.as_mut();
15827
15828 ::fidl_next::Decode::decode(offset.as_mut(), decoder_, ())?;
15829
15830 Ok(())
15831 }
15832 }
15833
15834 impl<'de> ::fidl_next::IntoNatural for FileWriteAtRequest<'de> {
15835 type Natural = crate::natural::FileWriteAtRequest;
15836 }
15837
15838 #[derive(Clone, Debug)]
15840 #[repr(C)]
15841 pub struct FileWriteAtResponse {
15842 pub actual_count: ::fidl_next::wire::Uint64,
15843 }
15844
15845 static_assertions::const_assert_eq!(std::mem::size_of::<FileWriteAtResponse>(), 8);
15846 static_assertions::const_assert_eq!(std::mem::align_of::<FileWriteAtResponse>(), 8);
15847
15848 static_assertions::const_assert_eq!(std::mem::offset_of!(FileWriteAtResponse, actual_count), 0);
15849
15850 impl ::fidl_next::Constrained for FileWriteAtResponse {
15851 type Constraint = ();
15852
15853 fn validate(
15854 _: ::fidl_next::Slot<'_, Self>,
15855 _: Self::Constraint,
15856 ) -> Result<(), ::fidl_next::ValidationError> {
15857 Ok(())
15858 }
15859 }
15860
15861 unsafe impl ::fidl_next::Wire for FileWriteAtResponse {
15862 type Narrowed<'de> = FileWriteAtResponse;
15863
15864 #[inline]
15865 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15866 ::fidl_next::munge! {
15867 let Self {
15868 actual_count,
15869
15870 } = &mut *out_;
15871 }
15872
15873 ::fidl_next::Wire::zero_padding(actual_count);
15874 }
15875 }
15876
15877 unsafe impl<___D> ::fidl_next::Decode<___D> for FileWriteAtResponse
15878 where
15879 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15880 {
15881 fn decode(
15882 slot_: ::fidl_next::Slot<'_, Self>,
15883 decoder_: &mut ___D,
15884 _: (),
15885 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15886 ::fidl_next::munge! {
15887 let Self {
15888 mut actual_count,
15889
15890 } = slot_;
15891 }
15892
15893 let _field = actual_count.as_mut();
15894
15895 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder_, ())?;
15896
15897 Ok(())
15898 }
15899 }
15900
15901 impl ::fidl_next::IntoNatural for FileWriteAtResponse {
15902 type Natural = crate::natural::FileWriteAtResponse;
15903 }
15904
15905 #[derive(Clone, Debug)]
15907 #[repr(C)]
15908 pub struct FileResizeRequest {
15909 pub length: ::fidl_next::wire::Uint64,
15910 }
15911
15912 static_assertions::const_assert_eq!(std::mem::size_of::<FileResizeRequest>(), 8);
15913 static_assertions::const_assert_eq!(std::mem::align_of::<FileResizeRequest>(), 8);
15914
15915 static_assertions::const_assert_eq!(std::mem::offset_of!(FileResizeRequest, length), 0);
15916
15917 impl ::fidl_next::Constrained for FileResizeRequest {
15918 type Constraint = ();
15919
15920 fn validate(
15921 _: ::fidl_next::Slot<'_, Self>,
15922 _: Self::Constraint,
15923 ) -> Result<(), ::fidl_next::ValidationError> {
15924 Ok(())
15925 }
15926 }
15927
15928 unsafe impl ::fidl_next::Wire for FileResizeRequest {
15929 type Narrowed<'de> = FileResizeRequest;
15930
15931 #[inline]
15932 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
15933 ::fidl_next::munge! {
15934 let Self {
15935 length,
15936
15937 } = &mut *out_;
15938 }
15939
15940 ::fidl_next::Wire::zero_padding(length);
15941 }
15942 }
15943
15944 unsafe impl<___D> ::fidl_next::Decode<___D> for FileResizeRequest
15945 where
15946 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15947 {
15948 fn decode(
15949 slot_: ::fidl_next::Slot<'_, Self>,
15950 decoder_: &mut ___D,
15951 _: (),
15952 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15953 ::fidl_next::munge! {
15954 let Self {
15955 mut length,
15956
15957 } = slot_;
15958 }
15959
15960 let _field = length.as_mut();
15961
15962 ::fidl_next::Decode::decode(length.as_mut(), decoder_, ())?;
15963
15964 Ok(())
15965 }
15966 }
15967
15968 impl ::fidl_next::IntoNatural for FileResizeRequest {
15969 type Natural = crate::natural::FileResizeRequest;
15970 }
15971
15972 pub type FileResizeResponse = ::fidl_next::wire::Unit;
15974
15975 #[derive(Clone, Copy, Debug)]
15977 #[repr(transparent)]
15978 pub struct VmoFlags {
15979 pub(crate) value: ::fidl_next::wire::Uint32,
15980 }
15981
15982 impl ::fidl_next::Constrained for VmoFlags {
15983 type Constraint = ();
15984
15985 fn validate(
15986 _: ::fidl_next::Slot<'_, Self>,
15987 _: Self::Constraint,
15988 ) -> Result<(), ::fidl_next::ValidationError> {
15989 Ok(())
15990 }
15991 }
15992
15993 unsafe impl ::fidl_next::Wire for VmoFlags {
15994 type Narrowed<'de> = Self;
15995
15996 #[inline]
15997 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
15998 }
16000 }
16001
16002 unsafe impl<___D> ::fidl_next::Decode<___D> for VmoFlags
16003 where
16004 ___D: ?Sized,
16005 {
16006 fn decode(
16007 slot: ::fidl_next::Slot<'_, Self>,
16008 _: &mut ___D,
16009 _: (),
16010 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16011 ::fidl_next::munge!(let Self { value } = slot);
16012 let set = u32::from(*value);
16013 if set & !crate::natural::VmoFlags::all().bits() != 0 {
16014 return Err(::fidl_next::DecodeError::InvalidBits {
16015 expected: crate::natural::VmoFlags::all().bits() as usize,
16016 actual: set as usize,
16017 });
16018 }
16019
16020 Ok(())
16021 }
16022 }
16023
16024 impl ::core::convert::From<crate::natural::VmoFlags> for VmoFlags {
16025 fn from(natural: crate::natural::VmoFlags) -> Self {
16026 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
16027 }
16028 }
16029
16030 impl ::fidl_next::IntoNatural for VmoFlags {
16031 type Natural = crate::natural::VmoFlags;
16032 }
16033
16034 #[derive(Clone, Debug)]
16036 #[repr(C)]
16037 pub struct FileGetBackingMemoryRequest {
16038 pub flags: crate::wire::VmoFlags,
16039 }
16040
16041 static_assertions::const_assert_eq!(std::mem::size_of::<FileGetBackingMemoryRequest>(), 4);
16042 static_assertions::const_assert_eq!(std::mem::align_of::<FileGetBackingMemoryRequest>(), 4);
16043
16044 static_assertions::const_assert_eq!(
16045 std::mem::offset_of!(FileGetBackingMemoryRequest, flags),
16046 0
16047 );
16048
16049 impl ::fidl_next::Constrained for FileGetBackingMemoryRequest {
16050 type Constraint = ();
16051
16052 fn validate(
16053 _: ::fidl_next::Slot<'_, Self>,
16054 _: Self::Constraint,
16055 ) -> Result<(), ::fidl_next::ValidationError> {
16056 Ok(())
16057 }
16058 }
16059
16060 unsafe impl ::fidl_next::Wire for FileGetBackingMemoryRequest {
16061 type Narrowed<'de> = FileGetBackingMemoryRequest;
16062
16063 #[inline]
16064 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
16065 ::fidl_next::munge! {
16066 let Self {
16067 flags,
16068
16069 } = &mut *out_;
16070 }
16071
16072 ::fidl_next::Wire::zero_padding(flags);
16073 }
16074 }
16075
16076 unsafe impl<___D> ::fidl_next::Decode<___D> for FileGetBackingMemoryRequest
16077 where
16078 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16079 {
16080 fn decode(
16081 slot_: ::fidl_next::Slot<'_, Self>,
16082 decoder_: &mut ___D,
16083 _: (),
16084 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16085 ::fidl_next::munge! {
16086 let Self {
16087 mut flags,
16088
16089 } = slot_;
16090 }
16091
16092 let _field = flags.as_mut();
16093
16094 ::fidl_next::Decode::decode(flags.as_mut(), decoder_, ())?;
16095
16096 Ok(())
16097 }
16098 }
16099
16100 impl ::fidl_next::IntoNatural for FileGetBackingMemoryRequest {
16101 type Natural = crate::natural::FileGetBackingMemoryRequest;
16102 }
16103
16104 pub type LinkableLinkIntoResponse = ::fidl_next::wire::Unit;
16106
16107 pub type FileAllocateResponse = ::fidl_next::wire::Unit;
16109
16110 pub type FileEnableVerityResponse = ::fidl_next::wire::Unit;
16112
16113 #[derive(Clone, Copy, Debug)]
16115 #[repr(transparent)]
16116 pub struct FileSignal {
16117 pub(crate) value: ::fidl_next::wire::Uint32,
16118 }
16119
16120 impl ::fidl_next::Constrained for FileSignal {
16121 type Constraint = ();
16122
16123 fn validate(
16124 _: ::fidl_next::Slot<'_, Self>,
16125 _: Self::Constraint,
16126 ) -> Result<(), ::fidl_next::ValidationError> {
16127 Ok(())
16128 }
16129 }
16130
16131 unsafe impl ::fidl_next::Wire for FileSignal {
16132 type Narrowed<'de> = Self;
16133
16134 #[inline]
16135 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
16136 }
16138 }
16139
16140 unsafe impl<___D> ::fidl_next::Decode<___D> for FileSignal
16141 where
16142 ___D: ?Sized,
16143 {
16144 fn decode(
16145 slot: ::fidl_next::Slot<'_, Self>,
16146 _: &mut ___D,
16147 _: (),
16148 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16149 ::fidl_next::munge!(let Self { value } = slot);
16150 let set = u32::from(*value);
16151 if set & !crate::natural::FileSignal::all().bits() != 0 {
16152 return Err(::fidl_next::DecodeError::InvalidBits {
16153 expected: crate::natural::FileSignal::all().bits() as usize,
16154 actual: set as usize,
16155 });
16156 }
16157
16158 Ok(())
16159 }
16160 }
16161
16162 impl ::core::convert::From<crate::natural::FileSignal> for FileSignal {
16163 fn from(natural: crate::natural::FileSignal) -> Self {
16164 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
16165 }
16166 }
16167
16168 impl ::fidl_next::IntoNatural for FileSignal {
16169 type Natural = crate::natural::FileSignal;
16170 }
16171
16172 #[derive(Clone, Debug)]
16174 #[repr(C)]
16175 pub struct FilesystemInfo {
16176 pub total_bytes: ::fidl_next::wire::Uint64,
16177
16178 pub used_bytes: ::fidl_next::wire::Uint64,
16179
16180 pub total_nodes: ::fidl_next::wire::Uint64,
16181
16182 pub used_nodes: ::fidl_next::wire::Uint64,
16183
16184 pub free_shared_pool_bytes: ::fidl_next::wire::Uint64,
16185
16186 pub fs_id: ::fidl_next::wire::Uint64,
16187
16188 pub block_size: ::fidl_next::wire::Uint32,
16189
16190 pub max_filename_size: ::fidl_next::wire::Uint32,
16191
16192 pub fs_type: ::fidl_next::wire::Uint32,
16193
16194 pub padding: ::fidl_next::wire::Uint32,
16195
16196 pub name: [i8; 32],
16197 }
16198
16199 static_assertions::const_assert_eq!(std::mem::size_of::<FilesystemInfo>(), 96);
16200 static_assertions::const_assert_eq!(std::mem::align_of::<FilesystemInfo>(), 8);
16201
16202 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, total_bytes), 0);
16203
16204 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, used_bytes), 8);
16205
16206 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, total_nodes), 16);
16207
16208 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, used_nodes), 24);
16209
16210 static_assertions::const_assert_eq!(
16211 std::mem::offset_of!(FilesystemInfo, free_shared_pool_bytes),
16212 32
16213 );
16214
16215 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, fs_id), 40);
16216
16217 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, block_size), 48);
16218
16219 static_assertions::const_assert_eq!(
16220 std::mem::offset_of!(FilesystemInfo, max_filename_size),
16221 52
16222 );
16223
16224 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, fs_type), 56);
16225
16226 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, padding), 60);
16227
16228 static_assertions::const_assert_eq!(std::mem::offset_of!(FilesystemInfo, name), 64);
16229
16230 impl ::fidl_next::Constrained for FilesystemInfo {
16231 type Constraint = ();
16232
16233 fn validate(
16234 _: ::fidl_next::Slot<'_, Self>,
16235 _: Self::Constraint,
16236 ) -> Result<(), ::fidl_next::ValidationError> {
16237 Ok(())
16238 }
16239 }
16240
16241 unsafe impl ::fidl_next::Wire for FilesystemInfo {
16242 type Narrowed<'de> = FilesystemInfo;
16243
16244 #[inline]
16245 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
16246 ::fidl_next::munge! {
16247 let Self {
16248 total_bytes,
16249 used_bytes,
16250 total_nodes,
16251 used_nodes,
16252 free_shared_pool_bytes,
16253 fs_id,
16254 block_size,
16255 max_filename_size,
16256 fs_type,
16257 padding,
16258 name,
16259
16260 } = &mut *out_;
16261 }
16262
16263 ::fidl_next::Wire::zero_padding(total_bytes);
16264
16265 ::fidl_next::Wire::zero_padding(used_bytes);
16266
16267 ::fidl_next::Wire::zero_padding(total_nodes);
16268
16269 ::fidl_next::Wire::zero_padding(used_nodes);
16270
16271 ::fidl_next::Wire::zero_padding(free_shared_pool_bytes);
16272
16273 ::fidl_next::Wire::zero_padding(fs_id);
16274
16275 ::fidl_next::Wire::zero_padding(block_size);
16276
16277 ::fidl_next::Wire::zero_padding(max_filename_size);
16278
16279 ::fidl_next::Wire::zero_padding(fs_type);
16280
16281 ::fidl_next::Wire::zero_padding(padding);
16282
16283 ::fidl_next::Wire::zero_padding(name);
16284 }
16285 }
16286
16287 unsafe impl<___D> ::fidl_next::Decode<___D> for FilesystemInfo
16288 where
16289 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16290 {
16291 fn decode(
16292 slot_: ::fidl_next::Slot<'_, Self>,
16293 decoder_: &mut ___D,
16294 _: (),
16295 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16296 ::fidl_next::munge! {
16297 let Self {
16298 mut total_bytes,
16299 mut used_bytes,
16300 mut total_nodes,
16301 mut used_nodes,
16302 mut free_shared_pool_bytes,
16303 mut fs_id,
16304 mut block_size,
16305 mut max_filename_size,
16306 mut fs_type,
16307 mut padding,
16308 mut name,
16309
16310 } = slot_;
16311 }
16312
16313 let _field = total_bytes.as_mut();
16314
16315 ::fidl_next::Decode::decode(total_bytes.as_mut(), decoder_, ())?;
16316
16317 let _field = used_bytes.as_mut();
16318
16319 ::fidl_next::Decode::decode(used_bytes.as_mut(), decoder_, ())?;
16320
16321 let _field = total_nodes.as_mut();
16322
16323 ::fidl_next::Decode::decode(total_nodes.as_mut(), decoder_, ())?;
16324
16325 let _field = used_nodes.as_mut();
16326
16327 ::fidl_next::Decode::decode(used_nodes.as_mut(), decoder_, ())?;
16328
16329 let _field = free_shared_pool_bytes.as_mut();
16330
16331 ::fidl_next::Decode::decode(free_shared_pool_bytes.as_mut(), decoder_, ())?;
16332
16333 let _field = fs_id.as_mut();
16334
16335 ::fidl_next::Decode::decode(fs_id.as_mut(), decoder_, ())?;
16336
16337 let _field = block_size.as_mut();
16338
16339 ::fidl_next::Decode::decode(block_size.as_mut(), decoder_, ())?;
16340
16341 let _field = max_filename_size.as_mut();
16342
16343 ::fidl_next::Decode::decode(max_filename_size.as_mut(), decoder_, ())?;
16344
16345 let _field = fs_type.as_mut();
16346
16347 ::fidl_next::Decode::decode(fs_type.as_mut(), decoder_, ())?;
16348
16349 let _field = padding.as_mut();
16350
16351 ::fidl_next::Decode::decode(padding.as_mut(), decoder_, ())?;
16352
16353 let _field = name.as_mut();
16354
16355 ::fidl_next::Decode::decode(name.as_mut(), decoder_, ())?;
16356
16357 Ok(())
16358 }
16359 }
16360
16361 impl ::fidl_next::IntoNatural for FilesystemInfo {
16362 type Natural = crate::natural::FilesystemInfo;
16363 }
16364
16365 pub type Service = ::fidl_next::wire::Unit;
16367
16368 #[derive(Debug)]
16370 #[repr(C)]
16371 pub struct SymlinkObject<'de> {
16372 pub target: ::fidl_next::wire::Vector<'de, u8>,
16373 }
16374
16375 static_assertions::const_assert_eq!(std::mem::size_of::<SymlinkObject<'_>>(), 16);
16376 static_assertions::const_assert_eq!(std::mem::align_of::<SymlinkObject<'_>>(), 8);
16377
16378 static_assertions::const_assert_eq!(std::mem::offset_of!(SymlinkObject<'_>, target), 0);
16379
16380 impl ::fidl_next::Constrained for SymlinkObject<'_> {
16381 type Constraint = ();
16382
16383 fn validate(
16384 _: ::fidl_next::Slot<'_, Self>,
16385 _: Self::Constraint,
16386 ) -> Result<(), ::fidl_next::ValidationError> {
16387 Ok(())
16388 }
16389 }
16390
16391 unsafe impl ::fidl_next::Wire for SymlinkObject<'static> {
16392 type Narrowed<'de> = SymlinkObject<'de>;
16393
16394 #[inline]
16395 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
16396 ::fidl_next::munge! {
16397 let Self {
16398 target,
16399
16400 } = &mut *out_;
16401 }
16402
16403 ::fidl_next::Wire::zero_padding(target);
16404 }
16405 }
16406
16407 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SymlinkObject<'de>
16408 where
16409 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16410 ___D: ::fidl_next::Decoder<'de>,
16411 {
16412 fn decode(
16413 slot_: ::fidl_next::Slot<'_, Self>,
16414 decoder_: &mut ___D,
16415 _: (),
16416 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16417 ::fidl_next::munge! {
16418 let Self {
16419 mut target,
16420
16421 } = slot_;
16422 }
16423
16424 let _field = target.as_mut();
16425 ::fidl_next::Constrained::validate(_field, (4095, ()))?;
16426 ::fidl_next::Decode::decode(target.as_mut(), decoder_, (4095, ()))?;
16427
16428 let target = unsafe { target.deref_unchecked() };
16429
16430 if target.len() > 4095 {
16431 return Err(::fidl_next::DecodeError::VectorTooLong {
16432 size: target.len() as u64,
16433 limit: 4095,
16434 });
16435 }
16436
16437 Ok(())
16438 }
16439 }
16440
16441 impl<'de> ::fidl_next::IntoNatural for SymlinkObject<'de> {
16442 type Natural = crate::natural::SymlinkObject;
16443 }
16444
16445 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
16447 #[repr(transparent)]
16448 pub struct WatchEvent {
16449 pub(crate) value: u8,
16450 }
16451
16452 impl ::fidl_next::Constrained for WatchEvent {
16453 type Constraint = ();
16454
16455 fn validate(
16456 _: ::fidl_next::Slot<'_, Self>,
16457 _: Self::Constraint,
16458 ) -> Result<(), ::fidl_next::ValidationError> {
16459 Ok(())
16460 }
16461 }
16462
16463 unsafe impl ::fidl_next::Wire for WatchEvent {
16464 type Narrowed<'de> = Self;
16465
16466 #[inline]
16467 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
16468 }
16470 }
16471
16472 impl WatchEvent {
16473 pub const DELETED: WatchEvent = WatchEvent { value: 0 };
16474
16475 pub const ADDED: WatchEvent = WatchEvent { value: 1 };
16476
16477 pub const REMOVED: WatchEvent = WatchEvent { value: 2 };
16478
16479 pub const EXISTING: WatchEvent = WatchEvent { value: 3 };
16480
16481 pub const IDLE: WatchEvent = WatchEvent { value: 4 };
16482 }
16483
16484 unsafe impl<___D> ::fidl_next::Decode<___D> for WatchEvent
16485 where
16486 ___D: ?Sized,
16487 {
16488 fn decode(
16489 slot: ::fidl_next::Slot<'_, Self>,
16490 _: &mut ___D,
16491 _: (),
16492 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16493 ::fidl_next::munge!(let Self { value } = slot);
16494
16495 match u8::from(*value) {
16496 0 | 1 | 2 | 3 | 4 => (),
16497 unknown => {
16498 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
16499 }
16500 }
16501
16502 Ok(())
16503 }
16504 }
16505
16506 impl ::core::convert::From<crate::natural::WatchEvent> for WatchEvent {
16507 fn from(natural: crate::natural::WatchEvent) -> Self {
16508 match natural {
16509 crate::natural::WatchEvent::Deleted => WatchEvent::DELETED,
16510
16511 crate::natural::WatchEvent::Added => WatchEvent::ADDED,
16512
16513 crate::natural::WatchEvent::Removed => WatchEvent::REMOVED,
16514
16515 crate::natural::WatchEvent::Existing => WatchEvent::EXISTING,
16516
16517 crate::natural::WatchEvent::Idle => WatchEvent::IDLE,
16518 }
16519 }
16520 }
16521
16522 impl ::fidl_next::IntoNatural for WatchEvent {
16523 type Natural = crate::natural::WatchEvent;
16524 }
16525}
16526
16527pub mod wire_optional {
16528
16529 #[repr(transparent)]
16530 pub struct SelinuxContext<'de> {
16531 pub(crate) raw: ::fidl_next::wire::Union,
16532 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
16533 }
16534
16535 impl ::fidl_next::Constrained for SelinuxContext<'_> {
16536 type Constraint = ();
16537
16538 fn validate(
16539 _: ::fidl_next::Slot<'_, Self>,
16540 _: Self::Constraint,
16541 ) -> Result<(), ::fidl_next::ValidationError> {
16542 Ok(())
16543 }
16544 }
16545
16546 unsafe impl ::fidl_next::Wire for SelinuxContext<'static> {
16547 type Narrowed<'de> = SelinuxContext<'de>;
16548
16549 #[inline]
16550 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16551 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
16552 ::fidl_next::wire::Union::zero_padding(raw);
16553 }
16554 }
16555
16556 impl<'de> SelinuxContext<'de> {
16557 pub fn is_some(&self) -> bool {
16558 self.raw.is_some()
16559 }
16560
16561 pub fn is_none(&self) -> bool {
16562 self.raw.is_none()
16563 }
16564
16565 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SelinuxContext<'de>> {
16566 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
16567 }
16568
16569 pub fn into_option(self) -> ::core::option::Option<crate::wire::SelinuxContext<'de>> {
16570 if self.is_some() {
16571 Some(crate::wire::SelinuxContext {
16572 raw: self.raw,
16573 _phantom: ::core::marker::PhantomData,
16574 })
16575 } else {
16576 None
16577 }
16578 }
16579 }
16580
16581 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SelinuxContext<'de>
16582 where
16583 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16584 ___D: ::fidl_next::Decoder<'de>,
16585 {
16586 fn decode(
16587 mut slot: ::fidl_next::Slot<'_, Self>,
16588 decoder: &mut ___D,
16589 _: (),
16590 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16591 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
16592 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
16593 1 => {
16594 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
16595 raw,
16596 decoder,
16597 (256, ()),
16598 )?
16599 }
16600
16601 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EmptyStruct>(
16602 raw,
16603 decoder,
16604 (),
16605 )?,
16606
16607 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
16608 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
16609 }
16610
16611 Ok(())
16612 }
16613 }
16614
16615 impl<'de> ::core::fmt::Debug for SelinuxContext<'de> {
16616 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16617 self.as_ref().fmt(f)
16618 }
16619 }
16620
16621 impl<'de> ::fidl_next::IntoNatural for SelinuxContext<'de> {
16622 type Natural = ::core::option::Option<crate::natural::SelinuxContext>;
16623 }
16624}
16625
16626pub mod generic {
16627
16628 pub struct AdvisoryLockRange<T0, T1, T2> {
16630 pub origin: T0,
16631
16632 pub offset: T1,
16633
16634 pub length: T2,
16635 }
16636
16637 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::AdvisoryLockRange, ___E>
16638 for AdvisoryLockRange<T0, T1, T2>
16639 where
16640 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16641 T0: ::fidl_next::Encode<crate::wire::SeekOrigin, ___E>,
16642 T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
16643 T2: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
16644 {
16645 #[inline]
16646 fn encode(
16647 self,
16648 encoder_: &mut ___E,
16649 out_: &mut ::core::mem::MaybeUninit<crate::wire::AdvisoryLockRange>,
16650 _: (),
16651 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16652 ::fidl_next::munge! {
16653 let crate::wire::AdvisoryLockRange {
16654 origin,
16655 offset,
16656 length,
16657
16658 } = out_;
16659 }
16660
16661 ::fidl_next::Encode::encode(self.origin, encoder_, origin, ())?;
16662
16663 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
16664
16665 ::fidl_next::Encode::encode(self.length, encoder_, length, ())?;
16666
16667 Ok(())
16668 }
16669 }
16670
16671 pub struct AdvisoryLockingAdvisoryLockRequest<T0> {
16673 pub request: T0,
16674 }
16675
16676 unsafe impl<___E, T0>
16677 ::fidl_next::Encode<crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>, ___E>
16678 for AdvisoryLockingAdvisoryLockRequest<T0>
16679 where
16680 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16681 ___E: ::fidl_next::Encoder,
16682 T0: ::fidl_next::Encode<crate::wire::AdvisoryLockRequest<'static>, ___E>,
16683 {
16684 #[inline]
16685 fn encode(
16686 self,
16687 encoder_: &mut ___E,
16688 out_: &mut ::core::mem::MaybeUninit<
16689 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
16690 >,
16691 _: (),
16692 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16693 ::fidl_next::munge! {
16694 let crate::wire::AdvisoryLockingAdvisoryLockRequest {
16695 request,
16696
16697 } = out_;
16698 }
16699
16700 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
16701
16702 Ok(())
16703 }
16704 }
16705
16706 pub type AdvisoryLockingAdvisoryLockResponse = ();
16708
16709 pub struct NodeAttributes<T0, T1, T2, T3, T4, T5, T6> {
16711 pub mode: T0,
16712
16713 pub id: T1,
16714
16715 pub content_size: T2,
16716
16717 pub storage_size: T3,
16718
16719 pub link_count: T4,
16720
16721 pub creation_time: T5,
16722
16723 pub modification_time: T6,
16724 }
16725
16726 unsafe impl<___E, T0, T1, T2, T3, T4, T5, T6>
16727 ::fidl_next::Encode<crate::wire::NodeAttributes, ___E>
16728 for NodeAttributes<T0, T1, T2, T3, T4, T5, T6>
16729 where
16730 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16731 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
16732 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16733 T2: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16734 T3: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16735 T4: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16736 T5: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16737 T6: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16738 {
16739 #[inline]
16740 fn encode(
16741 self,
16742 encoder_: &mut ___E,
16743 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes>,
16744 _: (),
16745 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16746 ::fidl_next::munge! {
16747 let crate::wire::NodeAttributes {
16748 mode,
16749 id,
16750 content_size,
16751 storage_size,
16752 link_count,
16753 creation_time,
16754 modification_time,
16755
16756 } = out_;
16757 }
16758
16759 ::fidl_next::Encode::encode(self.mode, encoder_, mode, ())?;
16760
16761 ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
16762
16763 ::fidl_next::Encode::encode(self.content_size, encoder_, content_size, ())?;
16764
16765 ::fidl_next::Encode::encode(self.storage_size, encoder_, storage_size, ())?;
16766
16767 ::fidl_next::Encode::encode(self.link_count, encoder_, link_count, ())?;
16768
16769 ::fidl_next::Encode::encode(self.creation_time, encoder_, creation_time, ())?;
16770
16771 ::fidl_next::Encode::encode(self.modification_time, encoder_, modification_time, ())?;
16772
16773 Ok(())
16774 }
16775 }
16776
16777 pub struct NodeQueryFilesystemResponse<T0, T1> {
16779 pub s: T0,
16780
16781 pub info: T1,
16782 }
16783
16784 unsafe impl<___E, T0, T1>
16785 ::fidl_next::Encode<crate::wire::NodeQueryFilesystemResponse<'static>, ___E>
16786 for NodeQueryFilesystemResponse<T0, T1>
16787 where
16788 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16789 ___E: ::fidl_next::Encoder,
16790 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
16791 T1: ::fidl_next::Encode<::fidl_next::wire::Box<'static, crate::wire::FilesystemInfo>, ___E>,
16792 {
16793 #[inline]
16794 fn encode(
16795 self,
16796 encoder_: &mut ___E,
16797 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeQueryFilesystemResponse<'static>>,
16798 _: (),
16799 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16800 ::fidl_next::munge! {
16801 let crate::wire::NodeQueryFilesystemResponse {
16802 s,
16803 info,
16804
16805 } = out_;
16806 }
16807
16808 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
16809
16810 ::fidl_next::Encode::encode(self.info, encoder_, info, ())?;
16811
16812 Ok(())
16813 }
16814 }
16815
16816 pub type NodeUpdateAttributesResponse = ();
16818
16819 pub type NodeSyncResponse = ();
16821
16822 pub struct DirectoryReadDirentsRequest<T0> {
16824 pub max_bytes: T0,
16825 }
16826
16827 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DirectoryReadDirentsRequest, ___E>
16828 for DirectoryReadDirentsRequest<T0>
16829 where
16830 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16831 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
16832 {
16833 #[inline]
16834 fn encode(
16835 self,
16836 encoder_: &mut ___E,
16837 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsRequest>,
16838 _: (),
16839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16840 ::fidl_next::munge! {
16841 let crate::wire::DirectoryReadDirentsRequest {
16842 max_bytes,
16843
16844 } = out_;
16845 }
16846
16847 ::fidl_next::Encode::encode(self.max_bytes, encoder_, max_bytes, ())?;
16848
16849 Ok(())
16850 }
16851 }
16852
16853 pub struct DirectoryReadDirentsResponse<T0, T1> {
16855 pub s: T0,
16856
16857 pub dirents: T1,
16858 }
16859
16860 unsafe impl<___E, T0, T1>
16861 ::fidl_next::Encode<crate::wire::DirectoryReadDirentsResponse<'static>, ___E>
16862 for DirectoryReadDirentsResponse<T0, T1>
16863 where
16864 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16865 ___E: ::fidl_next::Encoder,
16866 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
16867 T1: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
16868 {
16869 #[inline]
16870 fn encode(
16871 self,
16872 encoder_: &mut ___E,
16873 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryReadDirentsResponse<'static>>,
16874 _: (),
16875 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16876 ::fidl_next::munge! {
16877 let crate::wire::DirectoryReadDirentsResponse {
16878 s,
16879 dirents,
16880
16881 } = out_;
16882 }
16883
16884 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
16885
16886 ::fidl_next::Encode::encode(self.dirents, encoder_, dirents, (8192, ()))?;
16887
16888 Ok(())
16889 }
16890 }
16891
16892 pub struct DirectoryRewindResponse<T0> {
16894 pub s: T0,
16895 }
16896
16897 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DirectoryRewindResponse, ___E>
16898 for DirectoryRewindResponse<T0>
16899 where
16900 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16901 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
16902 {
16903 #[inline]
16904 fn encode(
16905 self,
16906 encoder_: &mut ___E,
16907 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryRewindResponse>,
16908 _: (),
16909 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16910 ::fidl_next::munge! {
16911 let crate::wire::DirectoryRewindResponse {
16912 s,
16913
16914 } = out_;
16915 }
16916
16917 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
16918
16919 Ok(())
16920 }
16921 }
16922
16923 pub struct DirectoryLinkResponse<T0> {
16925 pub s: T0,
16926 }
16927
16928 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DirectoryLinkResponse, ___E>
16929 for DirectoryLinkResponse<T0>
16930 where
16931 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16932 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
16933 {
16934 #[inline]
16935 fn encode(
16936 self,
16937 encoder_: &mut ___E,
16938 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryLinkResponse>,
16939 _: (),
16940 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16941 ::fidl_next::munge! {
16942 let crate::wire::DirectoryLinkResponse {
16943 s,
16944
16945 } = out_;
16946 }
16947
16948 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
16949
16950 Ok(())
16951 }
16952 }
16953
16954 pub struct DirectoryUnlinkRequest<T0, T1> {
16956 pub name: T0,
16957
16958 pub options: T1,
16959 }
16960
16961 unsafe impl<___E, T0, T1>
16962 ::fidl_next::Encode<crate::wire::DirectoryUnlinkRequest<'static>, ___E>
16963 for DirectoryUnlinkRequest<T0, T1>
16964 where
16965 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16966 ___E: ::fidl_next::Encoder,
16967 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
16968 T1: ::fidl_next::Encode<crate::wire::UnlinkOptions<'static>, ___E>,
16969 {
16970 #[inline]
16971 fn encode(
16972 self,
16973 encoder_: &mut ___E,
16974 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryUnlinkRequest<'static>>,
16975 _: (),
16976 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16977 ::fidl_next::munge! {
16978 let crate::wire::DirectoryUnlinkRequest {
16979 name,
16980 options,
16981
16982 } = out_;
16983 }
16984
16985 ::fidl_next::Encode::encode(self.name, encoder_, name, 255)?;
16986
16987 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
16988
16989 Ok(())
16990 }
16991 }
16992
16993 pub type DirectoryUnlinkResponse = ();
16995
16996 pub type DirectoryRenameResponse = ();
16998
16999 pub struct DirectoryWatchResponse<T0> {
17001 pub s: T0,
17002 }
17003
17004 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DirectoryWatchResponse, ___E>
17005 for DirectoryWatchResponse<T0>
17006 where
17007 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17008 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
17009 {
17010 #[inline]
17011 fn encode(
17012 self,
17013 encoder_: &mut ___E,
17014 out_: &mut ::core::mem::MaybeUninit<crate::wire::DirectoryWatchResponse>,
17015 _: (),
17016 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17017 ::fidl_next::munge! {
17018 let crate::wire::DirectoryWatchResponse {
17019 s,
17020
17021 } = out_;
17022 }
17023
17024 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
17025
17026 Ok(())
17027 }
17028 }
17029
17030 pub struct NodeGetExtendedAttributeRequest<T0> {
17032 pub name: T0,
17033 }
17034
17035 unsafe impl<___E, T0>
17036 ::fidl_next::Encode<crate::wire::NodeGetExtendedAttributeRequest<'static>, ___E>
17037 for NodeGetExtendedAttributeRequest<T0>
17038 where
17039 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17040 ___E: ::fidl_next::Encoder,
17041 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17042 {
17043 #[inline]
17044 fn encode(
17045 self,
17046 encoder_: &mut ___E,
17047 out_: &mut ::core::mem::MaybeUninit<
17048 crate::wire::NodeGetExtendedAttributeRequest<'static>,
17049 >,
17050 _: (),
17051 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17052 ::fidl_next::munge! {
17053 let crate::wire::NodeGetExtendedAttributeRequest {
17054 name,
17055
17056 } = out_;
17057 }
17058
17059 ::fidl_next::Encode::encode(self.name, encoder_, name, (255, ()))?;
17060
17061 Ok(())
17062 }
17063 }
17064
17065 pub type NodeSetExtendedAttributeResponse = ();
17067
17068 pub struct NodeRemoveExtendedAttributeRequest<T0> {
17070 pub name: T0,
17071 }
17072
17073 unsafe impl<___E, T0>
17074 ::fidl_next::Encode<crate::wire::NodeRemoveExtendedAttributeRequest<'static>, ___E>
17075 for NodeRemoveExtendedAttributeRequest<T0>
17076 where
17077 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17078 ___E: ::fidl_next::Encoder,
17079 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17080 {
17081 #[inline]
17082 fn encode(
17083 self,
17084 encoder_: &mut ___E,
17085 out_: &mut ::core::mem::MaybeUninit<
17086 crate::wire::NodeRemoveExtendedAttributeRequest<'static>,
17087 >,
17088 _: (),
17089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17090 ::fidl_next::munge! {
17091 let crate::wire::NodeRemoveExtendedAttributeRequest {
17092 name,
17093
17094 } = out_;
17095 }
17096
17097 ::fidl_next::Encode::encode(self.name, encoder_, name, (255, ()))?;
17098
17099 Ok(())
17100 }
17101 }
17102
17103 pub type NodeRemoveExtendedAttributeResponse = ();
17105
17106 pub type DirectoryCreateSymlinkResponse = ();
17108
17109 pub type NodeSetFlagsResponse = ();
17111
17112 pub struct NodeDeprecatedGetAttrResponse<T0, T1> {
17114 pub s: T0,
17115
17116 pub attributes: T1,
17117 }
17118
17119 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetAttrResponse, ___E>
17120 for NodeDeprecatedGetAttrResponse<T0, T1>
17121 where
17122 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17123 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
17124 T1: ::fidl_next::Encode<crate::wire::NodeAttributes, ___E>,
17125 {
17126 #[inline]
17127 fn encode(
17128 self,
17129 encoder_: &mut ___E,
17130 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetAttrResponse>,
17131 _: (),
17132 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17133 ::fidl_next::munge! {
17134 let crate::wire::NodeDeprecatedGetAttrResponse {
17135 s,
17136 attributes,
17137
17138 } = out_;
17139 }
17140
17141 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
17142
17143 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, ())?;
17144
17145 Ok(())
17146 }
17147 }
17148
17149 pub struct NodeDeprecatedSetAttrRequest<T0, T1> {
17151 pub flags: T0,
17152
17153 pub attributes: T1,
17154 }
17155
17156 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrRequest, ___E>
17157 for NodeDeprecatedSetAttrRequest<T0, T1>
17158 where
17159 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17160 T0: ::fidl_next::Encode<crate::wire::NodeAttributeFlags, ___E>,
17161 T1: ::fidl_next::Encode<crate::wire::NodeAttributes, ___E>,
17162 {
17163 #[inline]
17164 fn encode(
17165 self,
17166 encoder_: &mut ___E,
17167 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrRequest>,
17168 _: (),
17169 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17170 ::fidl_next::munge! {
17171 let crate::wire::NodeDeprecatedSetAttrRequest {
17172 flags,
17173 attributes,
17174
17175 } = out_;
17176 }
17177
17178 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17179
17180 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, ())?;
17181
17182 Ok(())
17183 }
17184 }
17185
17186 pub struct NodeDeprecatedSetAttrResponse<T0> {
17188 pub s: T0,
17189 }
17190
17191 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetAttrResponse, ___E>
17192 for NodeDeprecatedSetAttrResponse<T0>
17193 where
17194 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17195 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
17196 {
17197 #[inline]
17198 fn encode(
17199 self,
17200 encoder_: &mut ___E,
17201 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetAttrResponse>,
17202 _: (),
17203 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17204 ::fidl_next::munge! {
17205 let crate::wire::NodeDeprecatedSetAttrResponse {
17206 s,
17207
17208 } = out_;
17209 }
17210
17211 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
17212
17213 Ok(())
17214 }
17215 }
17216
17217 pub struct NodeDeprecatedGetFlagsResponse<T0, T1> {
17219 pub s: T0,
17220
17221 pub flags: T1,
17222 }
17223
17224 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NodeDeprecatedGetFlagsResponse, ___E>
17225 for NodeDeprecatedGetFlagsResponse<T0, T1>
17226 where
17227 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17228 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
17229 T1: ::fidl_next::Encode<crate::wire::OpenFlags, ___E>,
17230 {
17231 #[inline]
17232 fn encode(
17233 self,
17234 encoder_: &mut ___E,
17235 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedGetFlagsResponse>,
17236 _: (),
17237 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17238 ::fidl_next::munge! {
17239 let crate::wire::NodeDeprecatedGetFlagsResponse {
17240 s,
17241 flags,
17242
17243 } = out_;
17244 }
17245
17246 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
17247
17248 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17249
17250 Ok(())
17251 }
17252 }
17253
17254 pub struct NodeDeprecatedSetFlagsRequest<T0> {
17256 pub flags: T0,
17257 }
17258
17259 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsRequest, ___E>
17260 for NodeDeprecatedSetFlagsRequest<T0>
17261 where
17262 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17263 T0: ::fidl_next::Encode<crate::wire::OpenFlags, ___E>,
17264 {
17265 #[inline]
17266 fn encode(
17267 self,
17268 encoder_: &mut ___E,
17269 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsRequest>,
17270 _: (),
17271 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17272 ::fidl_next::munge! {
17273 let crate::wire::NodeDeprecatedSetFlagsRequest {
17274 flags,
17275
17276 } = out_;
17277 }
17278
17279 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17280
17281 Ok(())
17282 }
17283 }
17284
17285 pub struct NodeDeprecatedSetFlagsResponse<T0> {
17287 pub s: T0,
17288 }
17289
17290 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeDeprecatedSetFlagsResponse, ___E>
17291 for NodeDeprecatedSetFlagsResponse<T0>
17292 where
17293 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17294 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
17295 {
17296 #[inline]
17297 fn encode(
17298 self,
17299 encoder_: &mut ___E,
17300 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeDeprecatedSetFlagsResponse>,
17301 _: (),
17302 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17303 ::fidl_next::munge! {
17304 let crate::wire::NodeDeprecatedSetFlagsResponse {
17305 s,
17306
17307 } = out_;
17308 }
17309
17310 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
17311
17312 Ok(())
17313 }
17314 }
17315
17316 pub struct NodeGetFlagsResponse<T0> {
17318 pub flags: T0,
17319 }
17320
17321 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeGetFlagsResponse, ___E>
17322 for NodeGetFlagsResponse<T0>
17323 where
17324 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17325 T0: ::fidl_next::Encode<crate::wire::Flags, ___E>,
17326 {
17327 #[inline]
17328 fn encode(
17329 self,
17330 encoder_: &mut ___E,
17331 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetFlagsResponse>,
17332 _: (),
17333 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17334 ::fidl_next::munge! {
17335 let crate::wire::NodeGetFlagsResponse {
17336 flags,
17337
17338 } = out_;
17339 }
17340
17341 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17342
17343 Ok(())
17344 }
17345 }
17346
17347 pub struct NodeSetFlagsRequest<T0> {
17349 pub flags: T0,
17350 }
17351
17352 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeSetFlagsRequest, ___E>
17353 for NodeSetFlagsRequest<T0>
17354 where
17355 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17356 T0: ::fidl_next::Encode<crate::wire::Flags, ___E>,
17357 {
17358 #[inline]
17359 fn encode(
17360 self,
17361 encoder_: &mut ___E,
17362 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeSetFlagsRequest>,
17363 _: (),
17364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17365 ::fidl_next::munge! {
17366 let crate::wire::NodeSetFlagsRequest {
17367 flags,
17368
17369 } = out_;
17370 }
17371
17372 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17373
17374 Ok(())
17375 }
17376 }
17377
17378 pub type EmptyStruct = ();
17380
17381 pub struct FscryptPolicy<T0, T1> {
17383 pub key_identifier: T0,
17384
17385 pub flags: T1,
17386 }
17387
17388 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::FscryptPolicy, ___E>
17389 for FscryptPolicy<T0, T1>
17390 where
17391 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17392 T0: ::fidl_next::Encode<[u8; 16], ___E>,
17393 T1: ::fidl_next::Encode<crate::wire::FscryptPolicyFlags, ___E>,
17394 {
17395 #[inline]
17396 fn encode(
17397 self,
17398 encoder_: &mut ___E,
17399 out_: &mut ::core::mem::MaybeUninit<crate::wire::FscryptPolicy>,
17400 _: (),
17401 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17402 ::fidl_next::munge! {
17403 let crate::wire::FscryptPolicy {
17404 key_identifier,
17405 flags,
17406
17407 } = out_;
17408 }
17409
17410 ::fidl_next::Encode::encode(self.key_identifier, encoder_, key_identifier, ())?;
17411
17412 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17413
17414 Ok(())
17415 }
17416 }
17417
17418 pub struct NodeAttributes2<T0, T1> {
17420 pub mutable_attributes: T0,
17421
17422 pub immutable_attributes: T1,
17423 }
17424
17425 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NodeAttributes2<'static>, ___E>
17426 for NodeAttributes2<T0, T1>
17427 where
17428 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17429 ___E: ::fidl_next::Encoder,
17430 T0: ::fidl_next::Encode<crate::wire::MutableNodeAttributes<'static>, ___E>,
17431 T1: ::fidl_next::Encode<crate::wire::ImmutableNodeAttributes<'static>, ___E>,
17432 {
17433 #[inline]
17434 fn encode(
17435 self,
17436 encoder_: &mut ___E,
17437 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeAttributes2<'static>>,
17438 _: (),
17439 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17440 ::fidl_next::munge! {
17441 let crate::wire::NodeAttributes2 {
17442 mutable_attributes,
17443 immutable_attributes,
17444
17445 } = out_;
17446 }
17447
17448 ::fidl_next::Encode::encode(self.mutable_attributes, encoder_, mutable_attributes, ())?;
17449
17450 ::fidl_next::Encode::encode(
17451 self.immutable_attributes,
17452 encoder_,
17453 immutable_attributes,
17454 (),
17455 )?;
17456
17457 Ok(())
17458 }
17459 }
17460
17461 pub struct NodeGetAttributesRequest<T0> {
17463 pub query: T0,
17464 }
17465
17466 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::NodeGetAttributesRequest, ___E>
17467 for NodeGetAttributesRequest<T0>
17468 where
17469 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17470 T0: ::fidl_next::Encode<crate::wire::NodeAttributesQuery, ___E>,
17471 {
17472 #[inline]
17473 fn encode(
17474 self,
17475 encoder_: &mut ___E,
17476 out_: &mut ::core::mem::MaybeUninit<crate::wire::NodeGetAttributesRequest>,
17477 _: (),
17478 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17479 ::fidl_next::munge! {
17480 let crate::wire::NodeGetAttributesRequest {
17481 query,
17482
17483 } = out_;
17484 }
17485
17486 ::fidl_next::Encode::encode(self.query, encoder_, query, ())?;
17487
17488 Ok(())
17489 }
17490 }
17491
17492 pub type DirectoryObject = ();
17494
17495 pub struct ExtendedAttributeIteratorGetNextResponse<T0, T1> {
17497 pub attributes: T0,
17498
17499 pub last: T1,
17500 }
17501
17502 unsafe impl<___E, T0, T1>
17503 ::fidl_next::Encode<crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>, ___E>
17504 for ExtendedAttributeIteratorGetNextResponse<T0, T1>
17505 where
17506 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17507 ___E: ::fidl_next::Encoder,
17508 T0: ::fidl_next::Encode<
17509 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Vector<'static, u8>>,
17510 ___E,
17511 >,
17512 T1: ::fidl_next::Encode<bool, ___E>,
17513 {
17514 #[inline]
17515 fn encode(
17516 self,
17517 encoder_: &mut ___E,
17518 out_: &mut ::core::mem::MaybeUninit<
17519 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
17520 >,
17521 _: (),
17522 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17523 ::fidl_next::munge! {
17524 let crate::wire::ExtendedAttributeIteratorGetNextResponse {
17525 attributes,
17526 last,
17527
17528 } = out_;
17529 }
17530
17531 ::fidl_next::Encode::encode(self.attributes, encoder_, attributes, (128, (255, ())))?;
17532
17533 ::fidl_next::Encode::encode(self.last, encoder_, last, ())?;
17534
17535 Ok(())
17536 }
17537 }
17538
17539 pub struct ReadableReadRequest<T0> {
17541 pub count: T0,
17542 }
17543
17544 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ReadableReadRequest, ___E>
17545 for ReadableReadRequest<T0>
17546 where
17547 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17548 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17549 {
17550 #[inline]
17551 fn encode(
17552 self,
17553 encoder_: &mut ___E,
17554 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadRequest>,
17555 _: (),
17556 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17557 ::fidl_next::munge! {
17558 let crate::wire::ReadableReadRequest {
17559 count,
17560
17561 } = out_;
17562 }
17563
17564 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
17565
17566 Ok(())
17567 }
17568 }
17569
17570 pub struct ReadableReadResponse<T0> {
17572 pub data: T0,
17573 }
17574
17575 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ReadableReadResponse<'static>, ___E>
17576 for ReadableReadResponse<T0>
17577 where
17578 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17579 ___E: ::fidl_next::Encoder,
17580 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17581 {
17582 #[inline]
17583 fn encode(
17584 self,
17585 encoder_: &mut ___E,
17586 out_: &mut ::core::mem::MaybeUninit<crate::wire::ReadableReadResponse<'static>>,
17587 _: (),
17588 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17589 ::fidl_next::munge! {
17590 let crate::wire::ReadableReadResponse {
17591 data,
17592
17593 } = out_;
17594 }
17595
17596 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
17597
17598 Ok(())
17599 }
17600 }
17601
17602 pub struct WritableWriteRequest<T0> {
17604 pub data: T0,
17605 }
17606
17607 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::WritableWriteRequest<'static>, ___E>
17608 for WritableWriteRequest<T0>
17609 where
17610 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17611 ___E: ::fidl_next::Encoder,
17612 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17613 {
17614 #[inline]
17615 fn encode(
17616 self,
17617 encoder_: &mut ___E,
17618 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteRequest<'static>>,
17619 _: (),
17620 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17621 ::fidl_next::munge! {
17622 let crate::wire::WritableWriteRequest {
17623 data,
17624
17625 } = out_;
17626 }
17627
17628 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
17629
17630 Ok(())
17631 }
17632 }
17633
17634 pub struct WritableWriteResponse<T0> {
17636 pub actual_count: T0,
17637 }
17638
17639 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::WritableWriteResponse, ___E>
17640 for WritableWriteResponse<T0>
17641 where
17642 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17643 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17644 {
17645 #[inline]
17646 fn encode(
17647 self,
17648 encoder_: &mut ___E,
17649 out_: &mut ::core::mem::MaybeUninit<crate::wire::WritableWriteResponse>,
17650 _: (),
17651 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17652 ::fidl_next::munge! {
17653 let crate::wire::WritableWriteResponse {
17654 actual_count,
17655
17656 } = out_;
17657 }
17658
17659 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count, ())?;
17660
17661 Ok(())
17662 }
17663 }
17664
17665 pub struct FileSeekRequest<T0, T1> {
17667 pub origin: T0,
17668
17669 pub offset: T1,
17670 }
17671
17672 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::FileSeekRequest, ___E>
17673 for FileSeekRequest<T0, T1>
17674 where
17675 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17676 T0: ::fidl_next::Encode<crate::wire::SeekOrigin, ___E>,
17677 T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
17678 {
17679 #[inline]
17680 fn encode(
17681 self,
17682 encoder_: &mut ___E,
17683 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekRequest>,
17684 _: (),
17685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17686 ::fidl_next::munge! {
17687 let crate::wire::FileSeekRequest {
17688 origin,
17689 offset,
17690
17691 } = out_;
17692 }
17693
17694 ::fidl_next::Encode::encode(self.origin, encoder_, origin, ())?;
17695
17696 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
17697
17698 Ok(())
17699 }
17700 }
17701
17702 pub struct FileSeekResponse<T0> {
17704 pub offset_from_start: T0,
17705 }
17706
17707 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FileSeekResponse, ___E>
17708 for FileSeekResponse<T0>
17709 where
17710 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17711 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17712 {
17713 #[inline]
17714 fn encode(
17715 self,
17716 encoder_: &mut ___E,
17717 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileSeekResponse>,
17718 _: (),
17719 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17720 ::fidl_next::munge! {
17721 let crate::wire::FileSeekResponse {
17722 offset_from_start,
17723
17724 } = out_;
17725 }
17726
17727 ::fidl_next::Encode::encode(self.offset_from_start, encoder_, offset_from_start, ())?;
17728
17729 Ok(())
17730 }
17731 }
17732
17733 pub struct FileReadAtRequest<T0, T1> {
17735 pub count: T0,
17736
17737 pub offset: T1,
17738 }
17739
17740 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::FileReadAtRequest, ___E>
17741 for FileReadAtRequest<T0, T1>
17742 where
17743 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17744 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17745 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17746 {
17747 #[inline]
17748 fn encode(
17749 self,
17750 encoder_: &mut ___E,
17751 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtRequest>,
17752 _: (),
17753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17754 ::fidl_next::munge! {
17755 let crate::wire::FileReadAtRequest {
17756 count,
17757 offset,
17758
17759 } = out_;
17760 }
17761
17762 ::fidl_next::Encode::encode(self.count, encoder_, count, ())?;
17763
17764 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
17765
17766 Ok(())
17767 }
17768 }
17769
17770 pub struct FileReadAtResponse<T0> {
17772 pub data: T0,
17773 }
17774
17775 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FileReadAtResponse<'static>, ___E>
17776 for FileReadAtResponse<T0>
17777 where
17778 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17779 ___E: ::fidl_next::Encoder,
17780 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17781 {
17782 #[inline]
17783 fn encode(
17784 self,
17785 encoder_: &mut ___E,
17786 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileReadAtResponse<'static>>,
17787 _: (),
17788 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17789 ::fidl_next::munge! {
17790 let crate::wire::FileReadAtResponse {
17791 data,
17792
17793 } = out_;
17794 }
17795
17796 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
17797
17798 Ok(())
17799 }
17800 }
17801
17802 pub struct FileWriteAtRequest<T0, T1> {
17804 pub data: T0,
17805
17806 pub offset: T1,
17807 }
17808
17809 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::FileWriteAtRequest<'static>, ___E>
17810 for FileWriteAtRequest<T0, T1>
17811 where
17812 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17813 ___E: ::fidl_next::Encoder,
17814 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
17815 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17816 {
17817 #[inline]
17818 fn encode(
17819 self,
17820 encoder_: &mut ___E,
17821 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtRequest<'static>>,
17822 _: (),
17823 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17824 ::fidl_next::munge! {
17825 let crate::wire::FileWriteAtRequest {
17826 data,
17827 offset,
17828
17829 } = out_;
17830 }
17831
17832 ::fidl_next::Encode::encode(self.data, encoder_, data, (8192, ()))?;
17833
17834 ::fidl_next::Encode::encode(self.offset, encoder_, offset, ())?;
17835
17836 Ok(())
17837 }
17838 }
17839
17840 pub struct FileWriteAtResponse<T0> {
17842 pub actual_count: T0,
17843 }
17844
17845 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FileWriteAtResponse, ___E>
17846 for FileWriteAtResponse<T0>
17847 where
17848 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17849 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17850 {
17851 #[inline]
17852 fn encode(
17853 self,
17854 encoder_: &mut ___E,
17855 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileWriteAtResponse>,
17856 _: (),
17857 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17858 ::fidl_next::munge! {
17859 let crate::wire::FileWriteAtResponse {
17860 actual_count,
17861
17862 } = out_;
17863 }
17864
17865 ::fidl_next::Encode::encode(self.actual_count, encoder_, actual_count, ())?;
17866
17867 Ok(())
17868 }
17869 }
17870
17871 pub struct FileResizeRequest<T0> {
17873 pub length: T0,
17874 }
17875
17876 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FileResizeRequest, ___E>
17877 for FileResizeRequest<T0>
17878 where
17879 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17880 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17881 {
17882 #[inline]
17883 fn encode(
17884 self,
17885 encoder_: &mut ___E,
17886 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileResizeRequest>,
17887 _: (),
17888 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17889 ::fidl_next::munge! {
17890 let crate::wire::FileResizeRequest {
17891 length,
17892
17893 } = out_;
17894 }
17895
17896 ::fidl_next::Encode::encode(self.length, encoder_, length, ())?;
17897
17898 Ok(())
17899 }
17900 }
17901
17902 pub type FileResizeResponse = ();
17904
17905 pub struct FileGetBackingMemoryRequest<T0> {
17907 pub flags: T0,
17908 }
17909
17910 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FileGetBackingMemoryRequest, ___E>
17911 for FileGetBackingMemoryRequest<T0>
17912 where
17913 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17914 T0: ::fidl_next::Encode<crate::wire::VmoFlags, ___E>,
17915 {
17916 #[inline]
17917 fn encode(
17918 self,
17919 encoder_: &mut ___E,
17920 out_: &mut ::core::mem::MaybeUninit<crate::wire::FileGetBackingMemoryRequest>,
17921 _: (),
17922 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17923 ::fidl_next::munge! {
17924 let crate::wire::FileGetBackingMemoryRequest {
17925 flags,
17926
17927 } = out_;
17928 }
17929
17930 ::fidl_next::Encode::encode(self.flags, encoder_, flags, ())?;
17931
17932 Ok(())
17933 }
17934 }
17935
17936 pub type LinkableLinkIntoResponse = ();
17938
17939 pub type FileAllocateResponse = ();
17941
17942 pub type FileEnableVerityResponse = ();
17944
17945 pub struct FilesystemInfo<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {
17947 pub total_bytes: T0,
17948
17949 pub used_bytes: T1,
17950
17951 pub total_nodes: T2,
17952
17953 pub used_nodes: T3,
17954
17955 pub free_shared_pool_bytes: T4,
17956
17957 pub fs_id: T5,
17958
17959 pub block_size: T6,
17960
17961 pub max_filename_size: T7,
17962
17963 pub fs_type: T8,
17964
17965 pub padding: T9,
17966
17967 pub name: T10,
17968 }
17969
17970 unsafe impl<___E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
17971 ::fidl_next::Encode<crate::wire::FilesystemInfo, ___E>
17972 for FilesystemInfo<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
17973 where
17974 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17975 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17976 T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17977 T2: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17978 T3: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17979 T4: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17980 T5: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
17981 T6: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
17982 T7: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
17983 T8: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
17984 T9: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
17985 T10: ::fidl_next::Encode<[i8; 32], ___E>,
17986 {
17987 #[inline]
17988 fn encode(
17989 self,
17990 encoder_: &mut ___E,
17991 out_: &mut ::core::mem::MaybeUninit<crate::wire::FilesystemInfo>,
17992 _: (),
17993 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17994 ::fidl_next::munge! {
17995 let crate::wire::FilesystemInfo {
17996 total_bytes,
17997 used_bytes,
17998 total_nodes,
17999 used_nodes,
18000 free_shared_pool_bytes,
18001 fs_id,
18002 block_size,
18003 max_filename_size,
18004 fs_type,
18005 padding,
18006 name,
18007
18008 } = out_;
18009 }
18010
18011 ::fidl_next::Encode::encode(self.total_bytes, encoder_, total_bytes, ())?;
18012
18013 ::fidl_next::Encode::encode(self.used_bytes, encoder_, used_bytes, ())?;
18014
18015 ::fidl_next::Encode::encode(self.total_nodes, encoder_, total_nodes, ())?;
18016
18017 ::fidl_next::Encode::encode(self.used_nodes, encoder_, used_nodes, ())?;
18018
18019 ::fidl_next::Encode::encode(
18020 self.free_shared_pool_bytes,
18021 encoder_,
18022 free_shared_pool_bytes,
18023 (),
18024 )?;
18025
18026 ::fidl_next::Encode::encode(self.fs_id, encoder_, fs_id, ())?;
18027
18028 ::fidl_next::Encode::encode(self.block_size, encoder_, block_size, ())?;
18029
18030 ::fidl_next::Encode::encode(self.max_filename_size, encoder_, max_filename_size, ())?;
18031
18032 ::fidl_next::Encode::encode(self.fs_type, encoder_, fs_type, ())?;
18033
18034 ::fidl_next::Encode::encode(self.padding, encoder_, padding, ())?;
18035
18036 ::fidl_next::Encode::encode(self.name, encoder_, name, ())?;
18037
18038 Ok(())
18039 }
18040 }
18041
18042 pub type Service = ();
18044
18045 pub struct SymlinkObject<T0> {
18047 pub target: T0,
18048 }
18049
18050 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SymlinkObject<'static>, ___E>
18051 for SymlinkObject<T0>
18052 where
18053 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18054 ___E: ::fidl_next::Encoder,
18055 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
18056 {
18057 #[inline]
18058 fn encode(
18059 self,
18060 encoder_: &mut ___E,
18061 out_: &mut ::core::mem::MaybeUninit<crate::wire::SymlinkObject<'static>>,
18062 _: (),
18063 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18064 ::fidl_next::munge! {
18065 let crate::wire::SymlinkObject {
18066 target,
18067
18068 } = out_;
18069 }
18070
18071 ::fidl_next::Encode::encode(self.target, encoder_, target, (4095, ()))?;
18072
18073 Ok(())
18074 }
18075 }
18076}
18077
18078pub use self::natural::*;
18079
18080#[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"]
18082#[derive(PartialEq, Debug)]
18083pub struct AdvisoryLocking;
18084
18085#[cfg(target_os = "fuchsia")]
18086impl ::fidl_next::HasTransport for AdvisoryLocking {
18087 type Transport = ::fidl_next::fuchsia::zx::Channel;
18088}
18089
18090pub mod advisory_locking {
18091 pub mod prelude {
18092 pub use crate::{
18093 AdvisoryLocking, AdvisoryLockingClientHandler, AdvisoryLockingLocalClientHandler,
18094 AdvisoryLockingLocalServerHandler, AdvisoryLockingServerHandler, advisory_locking,
18095 };
18096
18097 pub use crate::natural::AdvisoryLockingAdvisoryLockRequest;
18098
18099 pub use crate::natural::AdvisoryLockingAdvisoryLockResponse;
18100 }
18101
18102 pub struct AdvisoryLock;
18103
18104 impl ::fidl_next::Method for AdvisoryLock {
18105 const ORDINAL: u64 = 7992130864415541162;
18106 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
18107 ::fidl_next::protocol::Flexibility::Strict;
18108
18109 type Protocol = crate::AdvisoryLocking;
18110
18111 type Request = crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>;
18112 }
18113
18114 impl ::fidl_next::TwoWayMethod for AdvisoryLock {
18115 type Response = ::fidl_next::wire::Result<
18116 'static,
18117 crate::wire::AdvisoryLockingAdvisoryLockResponse,
18118 ::fidl_next::wire::fuchsia::Status,
18119 >;
18120 }
18121
18122 impl<___R> ::fidl_next::Respond<___R> for AdvisoryLock {
18123 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
18124
18125 fn respond(response: ___R) -> Self::Output {
18126 ::core::result::Result::Ok(response)
18127 }
18128 }
18129
18130 impl<___R> ::fidl_next::RespondErr<___R> for AdvisoryLock {
18131 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
18132
18133 fn respond_err(response: ___R) -> Self::Output {
18134 ::core::result::Result::Err(response)
18135 }
18136 }
18137
18138 mod ___detail {
18139 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::AdvisoryLocking
18140 where
18141 ___T: ::fidl_next::Transport,
18142 {
18143 type Client = AdvisoryLockingClient<___T>;
18144 type Server = AdvisoryLockingServer<___T>;
18145 }
18146
18147 #[repr(transparent)]
18149 pub struct AdvisoryLockingClient<___T: ::fidl_next::Transport> {
18150 #[allow(dead_code)]
18151 client: ::fidl_next::protocol::Client<___T>,
18152 }
18153
18154 impl<___T> AdvisoryLockingClient<___T>
18155 where
18156 ___T: ::fidl_next::Transport,
18157 {
18158 #[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"]
18159 pub fn advisory_lock(
18160 &self,
18161
18162 request: impl ::fidl_next::Encode<
18163 crate::wire::AdvisoryLockRequest<'static>,
18164 <___T as ::fidl_next::Transport>::SendBuffer,
18165 >,
18166 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
18167 where
18168 <___T as ::fidl_next::Transport>::SendBuffer:
18169 ::fidl_next::encoder::InternalHandleEncoder,
18170 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
18171 {
18172 self.advisory_lock_with(crate::generic::AdvisoryLockingAdvisoryLockRequest {
18173 request,
18174 })
18175 }
18176
18177 #[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"]
18178 pub fn advisory_lock_with<___R>(
18179 &self,
18180 request: ___R,
18181 ) -> ::fidl_next::TwoWayFuture<'_, super::AdvisoryLock, ___T>
18182 where
18183 ___R: ::fidl_next::Encode<
18184 crate::wire::AdvisoryLockingAdvisoryLockRequest<'static>,
18185 <___T as ::fidl_next::Transport>::SendBuffer,
18186 >,
18187 {
18188 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
18189 7992130864415541162,
18190 <super::AdvisoryLock as ::fidl_next::Method>::FLEXIBILITY,
18191 request,
18192 ))
18193 }
18194 }
18195
18196 #[repr(transparent)]
18198 pub struct AdvisoryLockingServer<___T: ::fidl_next::Transport> {
18199 server: ::fidl_next::protocol::Server<___T>,
18200 }
18201
18202 impl<___T> AdvisoryLockingServer<___T> where ___T: ::fidl_next::Transport {}
18203 }
18204}
18205
18206#[diagnostic::on_unimplemented(
18207 note = "If {Self} implements the non-local AdvisoryLockingClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
18208)]
18209
18210pub trait AdvisoryLockingLocalClientHandler<
18214 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18215 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18216>
18217{
18218}
18219
18220impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for AdvisoryLocking
18221where
18222 ___H: AdvisoryLockingLocalClientHandler<___T>,
18223 ___T: ::fidl_next::Transport,
18224{
18225 async fn on_event(
18226 handler: &mut ___H,
18227 mut message: ::fidl_next::Message<___T>,
18228 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18229 match *message.header().ordinal {
18230 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18231 }
18232 }
18233}
18234
18235#[diagnostic::on_unimplemented(
18236 note = "If {Self} implements the non-local AdvisoryLockingServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
18237)]
18238
18239pub trait AdvisoryLockingLocalServerHandler<
18243 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18244 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18245>
18246{
18247 #[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"]
18248 fn advisory_lock(
18249 &mut self,
18250
18251 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
18252
18253 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock, ___T>,
18254 ) -> impl ::core::future::Future<Output = ()>;
18255}
18256
18257impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for AdvisoryLocking
18258where
18259 ___H: AdvisoryLockingLocalServerHandler<___T>,
18260 ___T: ::fidl_next::Transport,
18261 for<'de> crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>: ::fidl_next::Decode<
18262 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
18263 Constraint = (),
18264 >,
18265{
18266 async fn on_one_way(
18267 handler: &mut ___H,
18268 mut message: ::fidl_next::Message<___T>,
18269 ) -> ::core::result::Result<
18270 (),
18271 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18272 > {
18273 match *message.header().ordinal {
18274 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18275 }
18276 }
18277
18278 async fn on_two_way(
18279 handler: &mut ___H,
18280 mut message: ::fidl_next::Message<___T>,
18281 responder: ::fidl_next::protocol::Responder<___T>,
18282 ) -> ::core::result::Result<
18283 (),
18284 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18285 > {
18286 match *message.header().ordinal {
18287 7992130864415541162 => {
18288 let responder = ::fidl_next::Responder::from_untyped(responder);
18289
18290 match ::fidl_next::AsDecoderExt::into_decoded(message) {
18291 Ok(decoded) => {
18292 handler
18293 .advisory_lock(::fidl_next::Request::from_decoded(decoded), responder)
18294 .await;
18295 Ok(())
18296 }
18297 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18298 ordinal: 7992130864415541162,
18299 error,
18300 }),
18301 }
18302 }
18303
18304 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18305 }
18306 }
18307}
18308
18309pub trait AdvisoryLockingClientHandler<
18313 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18314 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18315>
18316{
18317}
18318
18319impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for AdvisoryLocking
18320where
18321 ___H: AdvisoryLockingClientHandler<___T> + ::core::marker::Send,
18322 ___T: ::fidl_next::Transport,
18323{
18324 async fn on_event(
18325 handler: &mut ___H,
18326 mut message: ::fidl_next::Message<___T>,
18327 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18328 match *message.header().ordinal {
18329 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18330 }
18331 }
18332}
18333
18334pub trait AdvisoryLockingServerHandler<
18338 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18339 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18340>
18341{
18342 #[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"]
18343 fn advisory_lock(
18344 &mut self,
18345
18346 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
18347
18348 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock, ___T>,
18349 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18350}
18351
18352impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for AdvisoryLocking
18353where
18354 ___H: AdvisoryLockingServerHandler<___T> + ::core::marker::Send,
18355 ___T: ::fidl_next::Transport,
18356 for<'de> crate::wire::AdvisoryLockingAdvisoryLockRequest<'de>: ::fidl_next::Decode<
18357 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
18358 Constraint = (),
18359 >,
18360{
18361 async fn on_one_way(
18362 handler: &mut ___H,
18363 mut message: ::fidl_next::Message<___T>,
18364 ) -> ::core::result::Result<
18365 (),
18366 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18367 > {
18368 match *message.header().ordinal {
18369 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18370 }
18371 }
18372
18373 async fn on_two_way(
18374 handler: &mut ___H,
18375 mut message: ::fidl_next::Message<___T>,
18376 responder: ::fidl_next::protocol::Responder<___T>,
18377 ) -> ::core::result::Result<
18378 (),
18379 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18380 > {
18381 match *message.header().ordinal {
18382 7992130864415541162 => {
18383 let responder = ::fidl_next::Responder::from_untyped(responder);
18384
18385 match ::fidl_next::AsDecoderExt::into_decoded(message) {
18386 Ok(decoded) => {
18387 handler
18388 .advisory_lock(::fidl_next::Request::from_decoded(decoded), responder)
18389 .await;
18390 Ok(())
18391 }
18392 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
18393 ordinal: 7992130864415541162,
18394 error,
18395 }),
18396 }
18397 }
18398
18399 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18400 }
18401 }
18402}
18403
18404impl<___T> AdvisoryLockingClientHandler<___T> for ::fidl_next::IgnoreEvents where
18405 ___T: ::fidl_next::Transport
18406{
18407}
18408
18409impl<___H, ___T> AdvisoryLockingLocalClientHandler<___T> for ::fidl_next::Local<___H>
18410where
18411 ___H: AdvisoryLockingClientHandler<___T>,
18412 ___T: ::fidl_next::Transport,
18413{
18414}
18415
18416impl<___H, ___T> AdvisoryLockingLocalServerHandler<___T> for ::fidl_next::Local<___H>
18417where
18418 ___H: AdvisoryLockingServerHandler<___T>,
18419 ___T: ::fidl_next::Transport,
18420{
18421 async fn advisory_lock(
18422 &mut self,
18423
18424 request: ::fidl_next::Request<advisory_locking::AdvisoryLock, ___T>,
18425
18426 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock, ___T>,
18427 ) {
18428 ___H::advisory_lock(&mut self.0, request, responder).await
18429 }
18430}
18431
18432pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
18433
18434#[doc = " The maximum length, in bytes, of a filesystem path.\n"]
18435pub const MAX_PATH_LENGTH: u64 = 4095 as u64;
18436
18437#[doc = " The maximal buffer size which can be transmitted for buffered operations.\n This capacity is currently set somewhat arbitrarily.\n"]
18438pub const MAX_BUF: u64 = 8192 as u64;
18439
18440#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
18441pub const MAX_NAME_LENGTH: u64 = 255 as u64;
18442
18443#[doc = " The maximum size for an extended attribute name.\n"]
18444pub const MAX_ATTRIBUTE_NAME: u64 = 255 as u64;
18445
18446#[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"]
18447pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768 as u64;
18448
18449#[doc = " The maximum size for passing the SELinux context as an attribute.\n"]
18450pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256 as u64;
18451
18452#[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"]
18454#[derive(PartialEq, Debug)]
18455pub struct DirectoryWatcher;
18456
18457#[cfg(target_os = "fuchsia")]
18458impl ::fidl_next::HasTransport for DirectoryWatcher {
18459 type Transport = ::fidl_next::fuchsia::zx::Channel;
18460}
18461
18462pub mod directory_watcher {
18463 pub mod prelude {
18464 pub use crate::{
18465 DirectoryWatcher, DirectoryWatcherClientHandler, DirectoryWatcherLocalClientHandler,
18466 DirectoryWatcherLocalServerHandler, DirectoryWatcherServerHandler, directory_watcher,
18467 };
18468 }
18469
18470 mod ___detail {
18471 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::DirectoryWatcher
18472 where
18473 ___T: ::fidl_next::Transport,
18474 {
18475 type Client = DirectoryWatcherClient<___T>;
18476 type Server = DirectoryWatcherServer<___T>;
18477 }
18478
18479 #[repr(transparent)]
18481 pub struct DirectoryWatcherClient<___T: ::fidl_next::Transport> {
18482 #[allow(dead_code)]
18483 client: ::fidl_next::protocol::Client<___T>,
18484 }
18485
18486 impl<___T> DirectoryWatcherClient<___T> where ___T: ::fidl_next::Transport {}
18487
18488 #[repr(transparent)]
18490 pub struct DirectoryWatcherServer<___T: ::fidl_next::Transport> {
18491 server: ::fidl_next::protocol::Server<___T>,
18492 }
18493
18494 impl<___T> DirectoryWatcherServer<___T> where ___T: ::fidl_next::Transport {}
18495 }
18496}
18497
18498#[diagnostic::on_unimplemented(
18499 note = "If {Self} implements the non-local DirectoryWatcherClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
18500)]
18501
18502pub trait DirectoryWatcherLocalClientHandler<
18506 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18507 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18508>
18509{
18510}
18511
18512impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for DirectoryWatcher
18513where
18514 ___H: DirectoryWatcherLocalClientHandler<___T>,
18515 ___T: ::fidl_next::Transport,
18516{
18517 async fn on_event(
18518 handler: &mut ___H,
18519 mut message: ::fidl_next::Message<___T>,
18520 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18521 match *message.header().ordinal {
18522 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18523 }
18524 }
18525}
18526
18527#[diagnostic::on_unimplemented(
18528 note = "If {Self} implements the non-local DirectoryWatcherServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
18529)]
18530
18531pub trait DirectoryWatcherLocalServerHandler<
18535 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18536 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18537>
18538{
18539}
18540
18541impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for DirectoryWatcher
18542where
18543 ___H: DirectoryWatcherLocalServerHandler<___T>,
18544 ___T: ::fidl_next::Transport,
18545{
18546 async fn on_one_way(
18547 handler: &mut ___H,
18548 mut message: ::fidl_next::Message<___T>,
18549 ) -> ::core::result::Result<
18550 (),
18551 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18552 > {
18553 match *message.header().ordinal {
18554 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18555 }
18556 }
18557
18558 async fn on_two_way(
18559 handler: &mut ___H,
18560 mut message: ::fidl_next::Message<___T>,
18561 responder: ::fidl_next::protocol::Responder<___T>,
18562 ) -> ::core::result::Result<
18563 (),
18564 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18565 > {
18566 match *message.header().ordinal {
18567 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18568 }
18569 }
18570}
18571
18572pub trait DirectoryWatcherClientHandler<
18576 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18577 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18578>
18579{
18580}
18581
18582impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DirectoryWatcher
18583where
18584 ___H: DirectoryWatcherClientHandler<___T> + ::core::marker::Send,
18585 ___T: ::fidl_next::Transport,
18586{
18587 async fn on_event(
18588 handler: &mut ___H,
18589 mut message: ::fidl_next::Message<___T>,
18590 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18591 match *message.header().ordinal {
18592 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18593 }
18594 }
18595}
18596
18597pub trait DirectoryWatcherServerHandler<
18601 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18602 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18603>
18604{
18605}
18606
18607impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DirectoryWatcher
18608where
18609 ___H: DirectoryWatcherServerHandler<___T> + ::core::marker::Send,
18610 ___T: ::fidl_next::Transport,
18611{
18612 async fn on_one_way(
18613 handler: &mut ___H,
18614 mut message: ::fidl_next::Message<___T>,
18615 ) -> ::core::result::Result<
18616 (),
18617 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18618 > {
18619 match *message.header().ordinal {
18620 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18621 }
18622 }
18623
18624 async fn on_two_way(
18625 handler: &mut ___H,
18626 mut message: ::fidl_next::Message<___T>,
18627 responder: ::fidl_next::protocol::Responder<___T>,
18628 ) -> ::core::result::Result<
18629 (),
18630 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18631 > {
18632 match *message.header().ordinal {
18633 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18634 }
18635 }
18636}
18637
18638impl<___T> DirectoryWatcherClientHandler<___T> for ::fidl_next::IgnoreEvents where
18639 ___T: ::fidl_next::Transport
18640{
18641}
18642
18643impl<___H, ___T> DirectoryWatcherLocalClientHandler<___T> for ::fidl_next::Local<___H>
18644where
18645 ___H: DirectoryWatcherClientHandler<___T>,
18646 ___T: ::fidl_next::Transport,
18647{
18648}
18649
18650impl<___H, ___T> DirectoryWatcherLocalServerHandler<___T> for ::fidl_next::Local<___H>
18651where
18652 ___H: DirectoryWatcherServerHandler<___T>,
18653 ___T: ::fidl_next::Transport,
18654{
18655}
18656
18657#[doc = " The maximum size of a chunk in the ListExtendedAttributes iterator.\n"]
18658pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128 as u64;
18659
18660#[derive(PartialEq, Debug)]
18662pub struct ExtendedAttributeIterator;
18663
18664#[cfg(target_os = "fuchsia")]
18665impl ::fidl_next::HasTransport for ExtendedAttributeIterator {
18666 type Transport = ::fidl_next::fuchsia::zx::Channel;
18667}
18668
18669pub mod extended_attribute_iterator {
18670 pub mod prelude {
18671 pub use crate::{
18672 ExtendedAttributeIterator, ExtendedAttributeIteratorClientHandler,
18673 ExtendedAttributeIteratorLocalClientHandler,
18674 ExtendedAttributeIteratorLocalServerHandler, ExtendedAttributeIteratorServerHandler,
18675 extended_attribute_iterator,
18676 };
18677
18678 pub use crate::natural::ExtendedAttributeIteratorGetNextResponse;
18679 }
18680
18681 pub struct GetNext;
18682
18683 impl ::fidl_next::Method for GetNext {
18684 const ORDINAL: u64 = 268639596268373415;
18685 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
18686 ::fidl_next::protocol::Flexibility::Strict;
18687
18688 type Protocol = crate::ExtendedAttributeIterator;
18689
18690 type Request = ::fidl_next::wire::EmptyMessageBody;
18691 }
18692
18693 impl ::fidl_next::TwoWayMethod for GetNext {
18694 type Response = ::fidl_next::wire::Result<
18695 'static,
18696 crate::wire::ExtendedAttributeIteratorGetNextResponse<'static>,
18697 ::fidl_next::wire::fuchsia::Status,
18698 >;
18699 }
18700
18701 impl<___R> ::fidl_next::Respond<___R> for GetNext {
18702 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
18703
18704 fn respond(response: ___R) -> Self::Output {
18705 ::core::result::Result::Ok(response)
18706 }
18707 }
18708
18709 impl<___R> ::fidl_next::RespondErr<___R> for GetNext {
18710 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
18711
18712 fn respond_err(response: ___R) -> Self::Output {
18713 ::core::result::Result::Err(response)
18714 }
18715 }
18716
18717 mod ___detail {
18718 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ExtendedAttributeIterator
18719 where
18720 ___T: ::fidl_next::Transport,
18721 {
18722 type Client = ExtendedAttributeIteratorClient<___T>;
18723 type Server = ExtendedAttributeIteratorServer<___T>;
18724 }
18725
18726 #[repr(transparent)]
18728 pub struct ExtendedAttributeIteratorClient<___T: ::fidl_next::Transport> {
18729 #[allow(dead_code)]
18730 client: ::fidl_next::protocol::Client<___T>,
18731 }
18732
18733 impl<___T> ExtendedAttributeIteratorClient<___T>
18734 where
18735 ___T: ::fidl_next::Transport,
18736 {
18737 #[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"]
18738 pub fn get_next(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetNext, ___T> {
18739 ::fidl_next::TwoWayFuture::from_untyped(
18740 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
18741 268639596268373415,
18742 <super::GetNext as ::fidl_next::Method>::FLEXIBILITY,
18743 (),
18744 ),
18745 )
18746 }
18747 }
18748
18749 #[repr(transparent)]
18751 pub struct ExtendedAttributeIteratorServer<___T: ::fidl_next::Transport> {
18752 server: ::fidl_next::protocol::Server<___T>,
18753 }
18754
18755 impl<___T> ExtendedAttributeIteratorServer<___T> where ___T: ::fidl_next::Transport {}
18756 }
18757}
18758
18759#[diagnostic::on_unimplemented(
18760 note = "If {Self} implements the non-local ExtendedAttributeIteratorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
18761)]
18762
18763pub trait ExtendedAttributeIteratorLocalClientHandler<
18767 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18768 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18769>
18770{
18771}
18772
18773impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ExtendedAttributeIterator
18774where
18775 ___H: ExtendedAttributeIteratorLocalClientHandler<___T>,
18776 ___T: ::fidl_next::Transport,
18777{
18778 async fn on_event(
18779 handler: &mut ___H,
18780 mut message: ::fidl_next::Message<___T>,
18781 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18782 match *message.header().ordinal {
18783 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18784 }
18785 }
18786}
18787
18788#[diagnostic::on_unimplemented(
18789 note = "If {Self} implements the non-local ExtendedAttributeIteratorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
18790)]
18791
18792pub trait ExtendedAttributeIteratorLocalServerHandler<
18796 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18797 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18798>
18799{
18800 #[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"]
18801 fn get_next(
18802 &mut self,
18803
18804 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext, ___T>,
18805 ) -> impl ::core::future::Future<Output = ()>;
18806}
18807
18808impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ExtendedAttributeIterator
18809where
18810 ___H: ExtendedAttributeIteratorLocalServerHandler<___T>,
18811 ___T: ::fidl_next::Transport,
18812{
18813 async fn on_one_way(
18814 handler: &mut ___H,
18815 mut message: ::fidl_next::Message<___T>,
18816 ) -> ::core::result::Result<
18817 (),
18818 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18819 > {
18820 match *message.header().ordinal {
18821 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18822 }
18823 }
18824
18825 async fn on_two_way(
18826 handler: &mut ___H,
18827 mut message: ::fidl_next::Message<___T>,
18828 responder: ::fidl_next::protocol::Responder<___T>,
18829 ) -> ::core::result::Result<
18830 (),
18831 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18832 > {
18833 match *message.header().ordinal {
18834 268639596268373415 => {
18835 let responder = ::fidl_next::Responder::from_untyped(responder);
18836
18837 handler.get_next(responder).await;
18838 Ok(())
18839 }
18840
18841 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18842 }
18843 }
18844}
18845
18846pub trait ExtendedAttributeIteratorClientHandler<
18850 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18851 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18852>
18853{
18854}
18855
18856impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ExtendedAttributeIterator
18857where
18858 ___H: ExtendedAttributeIteratorClientHandler<___T> + ::core::marker::Send,
18859 ___T: ::fidl_next::Transport,
18860{
18861 async fn on_event(
18862 handler: &mut ___H,
18863 mut message: ::fidl_next::Message<___T>,
18864 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
18865 match *message.header().ordinal {
18866 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18867 }
18868 }
18869}
18870
18871pub trait ExtendedAttributeIteratorServerHandler<
18875 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
18876 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
18877>
18878{
18879 #[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"]
18880 fn get_next(
18881 &mut self,
18882
18883 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext, ___T>,
18884 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
18885}
18886
18887impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ExtendedAttributeIterator
18888where
18889 ___H: ExtendedAttributeIteratorServerHandler<___T> + ::core::marker::Send,
18890 ___T: ::fidl_next::Transport,
18891{
18892 async fn on_one_way(
18893 handler: &mut ___H,
18894 mut message: ::fidl_next::Message<___T>,
18895 ) -> ::core::result::Result<
18896 (),
18897 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18898 > {
18899 match *message.header().ordinal {
18900 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18901 }
18902 }
18903
18904 async fn on_two_way(
18905 handler: &mut ___H,
18906 mut message: ::fidl_next::Message<___T>,
18907 responder: ::fidl_next::protocol::Responder<___T>,
18908 ) -> ::core::result::Result<
18909 (),
18910 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
18911 > {
18912 match *message.header().ordinal {
18913 268639596268373415 => {
18914 let responder = ::fidl_next::Responder::from_untyped(responder);
18915
18916 handler.get_next(responder).await;
18917 Ok(())
18918 }
18919
18920 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
18921 }
18922 }
18923}
18924
18925impl<___T> ExtendedAttributeIteratorClientHandler<___T> for ::fidl_next::IgnoreEvents where
18926 ___T: ::fidl_next::Transport
18927{
18928}
18929
18930impl<___H, ___T> ExtendedAttributeIteratorLocalClientHandler<___T> for ::fidl_next::Local<___H>
18931where
18932 ___H: ExtendedAttributeIteratorClientHandler<___T>,
18933 ___T: ::fidl_next::Transport,
18934{
18935}
18936
18937impl<___H, ___T> ExtendedAttributeIteratorLocalServerHandler<___T> for ::fidl_next::Local<___H>
18938where
18939 ___H: ExtendedAttributeIteratorServerHandler<___T>,
18940 ___T: ::fidl_next::Transport,
18941{
18942 async fn get_next(
18943 &mut self,
18944
18945 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext, ___T>,
18946 ) {
18947 ___H::get_next(&mut self.0, responder).await
18948 }
18949}
18950
18951pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
18952
18953#[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"]
18954pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: crate::natural::Flags =
18955 crate::natural::Flags::FLAG_MUST_CREATE;
18956
18957#[doc = " The maximum I/O size that is allowed for read/write operations using\n byte vectors.\n"]
18958pub const MAX_TRANSFER_SIZE: u64 = 8192 as u64;
18959
18960#[derive(PartialEq, Debug)]
18962pub struct Readable;
18963
18964#[cfg(target_os = "fuchsia")]
18965impl ::fidl_next::HasTransport for Readable {
18966 type Transport = ::fidl_next::fuchsia::zx::Channel;
18967}
18968
18969pub mod readable {
18970 pub mod prelude {
18971 pub use crate::{
18972 Readable, ReadableClientHandler, ReadableLocalClientHandler,
18973 ReadableLocalServerHandler, ReadableServerHandler, readable,
18974 };
18975
18976 pub use crate::natural::ReadableReadRequest;
18977
18978 pub use crate::natural::ReadableReadResponse;
18979 }
18980
18981 pub struct Read;
18982
18983 impl ::fidl_next::Method for Read {
18984 const ORDINAL: u64 = 395825947633028830;
18985 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
18986 ::fidl_next::protocol::Flexibility::Strict;
18987
18988 type Protocol = crate::Readable;
18989
18990 type Request = crate::wire::ReadableReadRequest;
18991 }
18992
18993 impl ::fidl_next::TwoWayMethod for Read {
18994 type Response = ::fidl_next::wire::Result<
18995 'static,
18996 crate::wire::ReadableReadResponse<'static>,
18997 ::fidl_next::wire::fuchsia::Status,
18998 >;
18999 }
19000
19001 impl<___R> ::fidl_next::Respond<___R> for Read {
19002 type Output = ::core::result::Result<
19003 crate::generic::ReadableReadResponse<___R>,
19004 ::fidl_next::never::Never,
19005 >;
19006
19007 fn respond(response: ___R) -> Self::Output {
19008 ::core::result::Result::Ok(crate::generic::ReadableReadResponse { data: response })
19009 }
19010 }
19011
19012 impl<___R> ::fidl_next::RespondErr<___R> for Read {
19013 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
19014
19015 fn respond_err(response: ___R) -> Self::Output {
19016 ::core::result::Result::Err(response)
19017 }
19018 }
19019
19020 mod ___detail {
19021 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Readable
19022 where
19023 ___T: ::fidl_next::Transport,
19024 {
19025 type Client = ReadableClient<___T>;
19026 type Server = ReadableServer<___T>;
19027 }
19028
19029 #[repr(transparent)]
19031 pub struct ReadableClient<___T: ::fidl_next::Transport> {
19032 #[allow(dead_code)]
19033 client: ::fidl_next::protocol::Client<___T>,
19034 }
19035
19036 impl<___T> ReadableClient<___T>
19037 where
19038 ___T: ::fidl_next::Transport,
19039 {
19040 #[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"]
19041 pub fn read(
19042 &self,
19043
19044 count: impl ::fidl_next::Encode<
19045 ::fidl_next::wire::Uint64,
19046 <___T as ::fidl_next::Transport>::SendBuffer,
19047 >,
19048 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
19049 where
19050 <___T as ::fidl_next::Transport>::SendBuffer:
19051 ::fidl_next::encoder::InternalHandleEncoder,
19052 {
19053 self.read_with(crate::generic::ReadableReadRequest { count })
19054 }
19055
19056 #[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"]
19057 pub fn read_with<___R>(
19058 &self,
19059 request: ___R,
19060 ) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T>
19061 where
19062 ___R: ::fidl_next::Encode<
19063 crate::wire::ReadableReadRequest,
19064 <___T as ::fidl_next::Transport>::SendBuffer,
19065 >,
19066 {
19067 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
19068 395825947633028830,
19069 <super::Read as ::fidl_next::Method>::FLEXIBILITY,
19070 request,
19071 ))
19072 }
19073 }
19074
19075 #[repr(transparent)]
19077 pub struct ReadableServer<___T: ::fidl_next::Transport> {
19078 server: ::fidl_next::protocol::Server<___T>,
19079 }
19080
19081 impl<___T> ReadableServer<___T> where ___T: ::fidl_next::Transport {}
19082 }
19083}
19084
19085#[diagnostic::on_unimplemented(
19086 note = "If {Self} implements the non-local ReadableClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
19087)]
19088
19089pub trait ReadableLocalClientHandler<
19093 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19094 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19095>
19096{
19097}
19098
19099impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Readable
19100where
19101 ___H: ReadableLocalClientHandler<___T>,
19102 ___T: ::fidl_next::Transport,
19103{
19104 async fn on_event(
19105 handler: &mut ___H,
19106 mut message: ::fidl_next::Message<___T>,
19107 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
19108 match *message.header().ordinal {
19109 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19110 }
19111 }
19112}
19113
19114#[diagnostic::on_unimplemented(
19115 note = "If {Self} implements the non-local ReadableServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
19116)]
19117
19118pub trait ReadableLocalServerHandler<
19122 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19123 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19124>
19125{
19126 #[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"]
19127 fn read(
19128 &mut self,
19129
19130 request: ::fidl_next::Request<readable::Read, ___T>,
19131
19132 responder: ::fidl_next::Responder<readable::Read, ___T>,
19133 ) -> impl ::core::future::Future<Output = ()>;
19134}
19135
19136impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Readable
19137where
19138 ___H: ReadableLocalServerHandler<___T>,
19139 ___T: ::fidl_next::Transport,
19140 for<'de> crate::wire::ReadableReadRequest: ::fidl_next::Decode<
19141 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
19142 Constraint = (),
19143 >,
19144{
19145 async fn on_one_way(
19146 handler: &mut ___H,
19147 mut message: ::fidl_next::Message<___T>,
19148 ) -> ::core::result::Result<
19149 (),
19150 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19151 > {
19152 match *message.header().ordinal {
19153 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19154 }
19155 }
19156
19157 async fn on_two_way(
19158 handler: &mut ___H,
19159 mut message: ::fidl_next::Message<___T>,
19160 responder: ::fidl_next::protocol::Responder<___T>,
19161 ) -> ::core::result::Result<
19162 (),
19163 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19164 > {
19165 match *message.header().ordinal {
19166 395825947633028830 => {
19167 let responder = ::fidl_next::Responder::from_untyped(responder);
19168
19169 match ::fidl_next::AsDecoderExt::into_decoded(message) {
19170 Ok(decoded) => {
19171 handler.read(::fidl_next::Request::from_decoded(decoded), responder).await;
19172 Ok(())
19173 }
19174 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
19175 ordinal: 395825947633028830,
19176 error,
19177 }),
19178 }
19179 }
19180
19181 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19182 }
19183 }
19184}
19185
19186pub trait ReadableClientHandler<
19190 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19191 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19192>
19193{
19194}
19195
19196impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Readable
19197where
19198 ___H: ReadableClientHandler<___T> + ::core::marker::Send,
19199 ___T: ::fidl_next::Transport,
19200{
19201 async fn on_event(
19202 handler: &mut ___H,
19203 mut message: ::fidl_next::Message<___T>,
19204 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
19205 match *message.header().ordinal {
19206 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19207 }
19208 }
19209}
19210
19211pub trait ReadableServerHandler<
19215 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19216 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19217>
19218{
19219 #[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"]
19220 fn read(
19221 &mut self,
19222
19223 request: ::fidl_next::Request<readable::Read, ___T>,
19224
19225 responder: ::fidl_next::Responder<readable::Read, ___T>,
19226 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19227}
19228
19229impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Readable
19230where
19231 ___H: ReadableServerHandler<___T> + ::core::marker::Send,
19232 ___T: ::fidl_next::Transport,
19233 for<'de> crate::wire::ReadableReadRequest: ::fidl_next::Decode<
19234 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
19235 Constraint = (),
19236 >,
19237{
19238 async fn on_one_way(
19239 handler: &mut ___H,
19240 mut message: ::fidl_next::Message<___T>,
19241 ) -> ::core::result::Result<
19242 (),
19243 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19244 > {
19245 match *message.header().ordinal {
19246 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19247 }
19248 }
19249
19250 async fn on_two_way(
19251 handler: &mut ___H,
19252 mut message: ::fidl_next::Message<___T>,
19253 responder: ::fidl_next::protocol::Responder<___T>,
19254 ) -> ::core::result::Result<
19255 (),
19256 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19257 > {
19258 match *message.header().ordinal {
19259 395825947633028830 => {
19260 let responder = ::fidl_next::Responder::from_untyped(responder);
19261
19262 match ::fidl_next::AsDecoderExt::into_decoded(message) {
19263 Ok(decoded) => {
19264 handler.read(::fidl_next::Request::from_decoded(decoded), responder).await;
19265 Ok(())
19266 }
19267 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
19268 ordinal: 395825947633028830,
19269 error,
19270 }),
19271 }
19272 }
19273
19274 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19275 }
19276 }
19277}
19278
19279impl<___T> ReadableClientHandler<___T> for ::fidl_next::IgnoreEvents where
19280 ___T: ::fidl_next::Transport
19281{
19282}
19283
19284impl<___H, ___T> ReadableLocalClientHandler<___T> for ::fidl_next::Local<___H>
19285where
19286 ___H: ReadableClientHandler<___T>,
19287 ___T: ::fidl_next::Transport,
19288{
19289}
19290
19291impl<___H, ___T> ReadableLocalServerHandler<___T> for ::fidl_next::Local<___H>
19292where
19293 ___H: ReadableServerHandler<___T>,
19294 ___T: ::fidl_next::Transport,
19295{
19296 async fn read(
19297 &mut self,
19298
19299 request: ::fidl_next::Request<readable::Read, ___T>,
19300
19301 responder: ::fidl_next::Responder<readable::Read, ___T>,
19302 ) {
19303 ___H::read(&mut self.0, request, responder).await
19304 }
19305}
19306
19307#[derive(PartialEq, Debug)]
19309pub struct Writable;
19310
19311#[cfg(target_os = "fuchsia")]
19312impl ::fidl_next::HasTransport for Writable {
19313 type Transport = ::fidl_next::fuchsia::zx::Channel;
19314}
19315
19316pub mod writable {
19317 pub mod prelude {
19318 pub use crate::{
19319 Writable, WritableClientHandler, WritableLocalClientHandler,
19320 WritableLocalServerHandler, WritableServerHandler, writable,
19321 };
19322
19323 pub use crate::natural::WritableWriteRequest;
19324
19325 pub use crate::natural::WritableWriteResponse;
19326 }
19327
19328 pub struct Write;
19329
19330 impl ::fidl_next::Method for Write {
19331 const ORDINAL: u64 = 7651971425397809026;
19332 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
19333 ::fidl_next::protocol::Flexibility::Strict;
19334
19335 type Protocol = crate::Writable;
19336
19337 type Request = crate::wire::WritableWriteRequest<'static>;
19338 }
19339
19340 impl ::fidl_next::TwoWayMethod for Write {
19341 type Response = ::fidl_next::wire::Result<
19342 'static,
19343 crate::wire::WritableWriteResponse,
19344 ::fidl_next::wire::fuchsia::Status,
19345 >;
19346 }
19347
19348 impl<___R> ::fidl_next::Respond<___R> for Write {
19349 type Output = ::core::result::Result<
19350 crate::generic::WritableWriteResponse<___R>,
19351 ::fidl_next::never::Never,
19352 >;
19353
19354 fn respond(response: ___R) -> Self::Output {
19355 ::core::result::Result::Ok(crate::generic::WritableWriteResponse {
19356 actual_count: response,
19357 })
19358 }
19359 }
19360
19361 impl<___R> ::fidl_next::RespondErr<___R> for Write {
19362 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
19363
19364 fn respond_err(response: ___R) -> Self::Output {
19365 ::core::result::Result::Err(response)
19366 }
19367 }
19368
19369 mod ___detail {
19370 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Writable
19371 where
19372 ___T: ::fidl_next::Transport,
19373 {
19374 type Client = WritableClient<___T>;
19375 type Server = WritableServer<___T>;
19376 }
19377
19378 #[repr(transparent)]
19380 pub struct WritableClient<___T: ::fidl_next::Transport> {
19381 #[allow(dead_code)]
19382 client: ::fidl_next::protocol::Client<___T>,
19383 }
19384
19385 impl<___T> WritableClient<___T>
19386 where
19387 ___T: ::fidl_next::Transport,
19388 {
19389 #[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"]
19390 pub fn write(
19391 &self,
19392
19393 data: impl ::fidl_next::Encode<
19394 ::fidl_next::wire::Vector<'static, u8>,
19395 <___T as ::fidl_next::Transport>::SendBuffer,
19396 >,
19397 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
19398 where
19399 <___T as ::fidl_next::Transport>::SendBuffer:
19400 ::fidl_next::encoder::InternalHandleEncoder,
19401 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
19402 {
19403 self.write_with(crate::generic::WritableWriteRequest { data })
19404 }
19405
19406 #[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"]
19407 pub fn write_with<___R>(
19408 &self,
19409 request: ___R,
19410 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
19411 where
19412 ___R: ::fidl_next::Encode<
19413 crate::wire::WritableWriteRequest<'static>,
19414 <___T as ::fidl_next::Transport>::SendBuffer,
19415 >,
19416 {
19417 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
19418 7651971425397809026,
19419 <super::Write as ::fidl_next::Method>::FLEXIBILITY,
19420 request,
19421 ))
19422 }
19423 }
19424
19425 #[repr(transparent)]
19427 pub struct WritableServer<___T: ::fidl_next::Transport> {
19428 server: ::fidl_next::protocol::Server<___T>,
19429 }
19430
19431 impl<___T> WritableServer<___T> where ___T: ::fidl_next::Transport {}
19432 }
19433}
19434
19435#[diagnostic::on_unimplemented(
19436 note = "If {Self} implements the non-local WritableClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
19437)]
19438
19439pub trait WritableLocalClientHandler<
19443 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19444 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19445>
19446{
19447}
19448
19449impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Writable
19450where
19451 ___H: WritableLocalClientHandler<___T>,
19452 ___T: ::fidl_next::Transport,
19453{
19454 async fn on_event(
19455 handler: &mut ___H,
19456 mut message: ::fidl_next::Message<___T>,
19457 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
19458 match *message.header().ordinal {
19459 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19460 }
19461 }
19462}
19463
19464#[diagnostic::on_unimplemented(
19465 note = "If {Self} implements the non-local WritableServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
19466)]
19467
19468pub trait WritableLocalServerHandler<
19472 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19473 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19474>
19475{
19476 #[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"]
19477 fn write(
19478 &mut self,
19479
19480 request: ::fidl_next::Request<writable::Write, ___T>,
19481
19482 responder: ::fidl_next::Responder<writable::Write, ___T>,
19483 ) -> impl ::core::future::Future<Output = ()>;
19484}
19485
19486impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Writable
19487where
19488 ___H: WritableLocalServerHandler<___T>,
19489 ___T: ::fidl_next::Transport,
19490 for<'de> crate::wire::WritableWriteRequest<'de>: ::fidl_next::Decode<
19491 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
19492 Constraint = (),
19493 >,
19494{
19495 async fn on_one_way(
19496 handler: &mut ___H,
19497 mut message: ::fidl_next::Message<___T>,
19498 ) -> ::core::result::Result<
19499 (),
19500 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19501 > {
19502 match *message.header().ordinal {
19503 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19504 }
19505 }
19506
19507 async fn on_two_way(
19508 handler: &mut ___H,
19509 mut message: ::fidl_next::Message<___T>,
19510 responder: ::fidl_next::protocol::Responder<___T>,
19511 ) -> ::core::result::Result<
19512 (),
19513 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19514 > {
19515 match *message.header().ordinal {
19516 7651971425397809026 => {
19517 let responder = ::fidl_next::Responder::from_untyped(responder);
19518
19519 match ::fidl_next::AsDecoderExt::into_decoded(message) {
19520 Ok(decoded) => {
19521 handler.write(::fidl_next::Request::from_decoded(decoded), responder).await;
19522 Ok(())
19523 }
19524 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
19525 ordinal: 7651971425397809026,
19526 error,
19527 }),
19528 }
19529 }
19530
19531 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19532 }
19533 }
19534}
19535
19536pub trait WritableClientHandler<
19540 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19541 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19542>
19543{
19544}
19545
19546impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Writable
19547where
19548 ___H: WritableClientHandler<___T> + ::core::marker::Send,
19549 ___T: ::fidl_next::Transport,
19550{
19551 async fn on_event(
19552 handler: &mut ___H,
19553 mut message: ::fidl_next::Message<___T>,
19554 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
19555 match *message.header().ordinal {
19556 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19557 }
19558 }
19559}
19560
19561pub trait WritableServerHandler<
19565 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
19566 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
19567>
19568{
19569 #[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"]
19570 fn write(
19571 &mut self,
19572
19573 request: ::fidl_next::Request<writable::Write, ___T>,
19574
19575 responder: ::fidl_next::Responder<writable::Write, ___T>,
19576 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
19577}
19578
19579impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Writable
19580where
19581 ___H: WritableServerHandler<___T> + ::core::marker::Send,
19582 ___T: ::fidl_next::Transport,
19583 for<'de> crate::wire::WritableWriteRequest<'de>: ::fidl_next::Decode<
19584 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
19585 Constraint = (),
19586 >,
19587{
19588 async fn on_one_way(
19589 handler: &mut ___H,
19590 mut message: ::fidl_next::Message<___T>,
19591 ) -> ::core::result::Result<
19592 (),
19593 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19594 > {
19595 match *message.header().ordinal {
19596 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19597 }
19598 }
19599
19600 async fn on_two_way(
19601 handler: &mut ___H,
19602 mut message: ::fidl_next::Message<___T>,
19603 responder: ::fidl_next::protocol::Responder<___T>,
19604 ) -> ::core::result::Result<
19605 (),
19606 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
19607 > {
19608 match *message.header().ordinal {
19609 7651971425397809026 => {
19610 let responder = ::fidl_next::Responder::from_untyped(responder);
19611
19612 match ::fidl_next::AsDecoderExt::into_decoded(message) {
19613 Ok(decoded) => {
19614 handler.write(::fidl_next::Request::from_decoded(decoded), responder).await;
19615 Ok(())
19616 }
19617 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
19618 ordinal: 7651971425397809026,
19619 error,
19620 }),
19621 }
19622 }
19623
19624 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
19625 }
19626 }
19627}
19628
19629impl<___T> WritableClientHandler<___T> for ::fidl_next::IgnoreEvents where
19630 ___T: ::fidl_next::Transport
19631{
19632}
19633
19634impl<___H, ___T> WritableLocalClientHandler<___T> for ::fidl_next::Local<___H>
19635where
19636 ___H: WritableClientHandler<___T>,
19637 ___T: ::fidl_next::Transport,
19638{
19639}
19640
19641impl<___H, ___T> WritableLocalServerHandler<___T> for ::fidl_next::Local<___H>
19642where
19643 ___H: WritableServerHandler<___T>,
19644 ___T: ::fidl_next::Transport,
19645{
19646 async fn write(
19647 &mut self,
19648
19649 request: ::fidl_next::Request<writable::Write, ___T>,
19650
19651 responder: ::fidl_next::Responder<writable::Write, ___T>,
19652 ) {
19653 ___H::write(&mut self.0, request, responder).await
19654 }
19655}
19656
19657pub const MAX_FS_NAME_BUFFER: u64 = 32 as u64;
19658
19659#[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"]
19660pub const INHERITED_WRITE_PERMISSIONS: crate::natural::Operations =
19661 crate::natural::Operations::from_bits_retain(356);
19662
19663#[doc = " Nodes which do not have ino values should return this value\n from Readdir and GetAttr.\n"]
19664pub const INO_UNKNOWN: u64 = 18446744073709551615 as u64;
19665
19666pub const MASK_KNOWN_PERMISSIONS: crate::natural::Flags =
19667 crate::natural::Flags::from_bits_retain(25087);
19668
19669pub const MASK_KNOWN_PROTOCOLS: crate::natural::Flags =
19670 crate::natural::Flags::from_bits_retain(30069489664);
19671
19672pub const MASK_PERMISSION_FLAGS: u64 = 65535 as u64;
19673
19674pub const MASK_POSIX_FLAGS: u64 = 4294967295 as u64;
19675
19676#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
19677pub const MAX_FILENAME: u64 = 255 as u64;
19678
19679pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
19680
19681#[doc = " Flags used when opening a node reference must fall within this mask.\n"]
19682pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: crate::natural::OpenFlags =
19683 crate::natural::OpenFlags::from_bits_retain(46661632);
19684
19685#[doc = " All known rights.\n"]
19686pub const OPEN_RIGHTS: crate::natural::OpenFlags = crate::natural::OpenFlags::from_bits_retain(11);
19687
19688#[doc = " Set of permissions that are expected when opening a node as executable.\n"]
19689pub const PERM_EXECUTABLE: crate::natural::Flags = crate::natural::Flags::from_bits_retain(201);
19690
19691#[doc = " Set of permissions that are expected when opening a node as readable.\n"]
19692pub const PERM_READABLE: crate::natural::Flags = crate::natural::Flags::from_bits_retain(211);
19693
19694#[doc = " Set of permissions that are expected when opening a node as writable.\n"]
19695pub const PERM_WRITABLE: crate::natural::Flags = crate::natural::Flags::from_bits_retain(485);
19696
19697#[doc = " Alias for directory permission alias rw*\n"]
19698pub const RW_STAR_DIR: crate::natural::Operations =
19699 crate::natural::Operations::from_bits_retain(503);
19700
19701#[doc = " Alias for directory permission alias rx*\n"]
19702pub const RX_STAR_DIR: crate::natural::Operations =
19703 crate::natural::Operations::from_bits_retain(219);
19704
19705#[doc = " Alias for directory permission alias r*\n"]
19706pub const R_STAR_DIR: crate::natural::Operations =
19707 crate::natural::Operations::from_bits_retain(211);
19708
19709#[doc = " The name of the extended attribute accessible via the SELinux context attribute.\n"]
19710pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
19711
19712pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
19713
19714#[doc = " Alias for directory permission alias w*\n"]
19715pub const W_STAR_DIR: crate::natural::Operations =
19716 crate::natural::Operations::from_bits_retain(485);
19717
19718#[doc = " Alias for directory permission alias x*\n"]
19719pub const X_STAR_DIR: crate::natural::Operations =
19720 crate::natural::Operations::from_bits_retain(201);