1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5::fidl_next::bitflags! {
6 #[doc = " The common members definition behind [`Rights`] and [`Abilities`]. Some operations may apply\n only to certain node types (e.g. [`Operations.MODIFY_DIRECTORY`] only applies to directories).\n"]#[derive(
7 Clone,
8 Copy,
9 Debug,
10 PartialEq,
11 Eq,
12 Hash,
13 )]
14 pub struct Operations: u64 {
15 #[doc = " Connecting to a service in a directory.\n"]const CONNECT = 1;
16 #[doc = " Read byte contents of a node or its children.\n"]const READ_BYTES = 2;
17 #[doc = " Writing to the byte contents of a node or its children.\n"]const WRITE_BYTES = 4;
18 #[doc = " Execute the byte contents of a node or its children.\n"]const EXECUTE = 8;
19 #[doc = " Reading the attributes of a node and/or its children.\n"]const GET_ATTRIBUTES = 16;
20 #[doc = " Updating the attributes of a node and/or its children.\n"]const UPDATE_ATTRIBUTES = 32;
21 #[doc = " Reading the list of nodes in a directory.\n"]const ENUMERATE = 64;
22 #[doc = " Opening a node from a directory. Must be specified with [`Rights.ENUMERATE`], as directory\n contents can be probed by opening children.\n"]const TRAVERSE = 128;
23 #[doc = " Modifying the list of nodes in a directory, e.g. creating, renaming, link/unlink, etc...\n Must be specified with [`Rights.ENUMERATE`], as directory contents can be probed via name\n conflicts during node creation.\n"]const MODIFY_DIRECTORY = 256;
24
25 }
26}
27
28impl ::fidl_next::Encodable for Operations {
29 type Encoded = WireOperations;
30}
31
32unsafe impl<___E> ::fidl_next::Encode<___E> for Operations
33where
34 ___E: ?Sized,
35{
36 #[inline]
37 fn encode(
38 self,
39 encoder: &mut ___E,
40 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
41 ) -> Result<(), ::fidl_next::EncodeError> {
42 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
43 }
44}
45
46unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Operations
47where
48 ___E: ?Sized,
49{
50 #[inline]
51 fn encode_ref(
52 &self,
53 _: &mut ___E,
54 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
55 ) -> Result<(), ::fidl_next::EncodeError> {
56 ::fidl_next::munge!(let WireOperations { value } = out);
57 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
58 Ok(())
59 }
60}
61
62impl ::core::convert::From<WireOperations> for Operations {
63 fn from(wire: WireOperations) -> Self {
64 Self::from_bits_retain(u64::from(wire.value))
65 }
66}
67
68impl ::fidl_next::TakeFrom<WireOperations> for Operations {
69 #[inline]
70 fn take_from(from: &WireOperations) -> Self {
71 Self::from(*from)
72 }
73}
74
75#[derive(Clone, Copy, Debug)]
77#[repr(transparent)]
78pub struct WireOperations {
79 value: ::fidl_next::WireU64,
80}
81
82unsafe impl ::fidl_next::ZeroPadding for WireOperations {
83 #[inline]
84 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
85 }
87}
88
89unsafe impl<___D> ::fidl_next::Decode<___D> for WireOperations
90where
91 ___D: ?Sized,
92{
93 fn decode(
94 slot: ::fidl_next::Slot<'_, Self>,
95 _: &mut ___D,
96 ) -> Result<(), ::fidl_next::DecodeError> {
97 ::fidl_next::munge!(let Self { value } = slot);
98 let set = u64::from(*value);
99 if set & !Operations::all().bits() != 0 {
100 return Err(::fidl_next::DecodeError::InvalidBits {
101 expected: Operations::all().bits() as usize,
102 actual: set as usize,
103 });
104 }
105
106 Ok(())
107 }
108}
109
110impl ::core::convert::From<Operations> for WireOperations {
111 fn from(natural: Operations) -> Self {
112 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
113 }
114}
115
116#[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"]
117pub type Abilities = crate::Operations;
118
119pub type WireAbilities = crate::WireOperations;
121
122#[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"]
123#[derive(Clone, Copy, Debug, PartialEq, Eq)]
124#[repr(u32)]
125pub enum SeekOrigin {
126 Start = 0,
127 Current = 1,
128 End = 2,
129}
130
131impl ::fidl_next::Encodable for SeekOrigin {
132 type Encoded = WireSeekOrigin;
133}
134impl ::std::convert::TryFrom<u32> for SeekOrigin {
135 type Error = ::fidl_next::UnknownStrictEnumMemberError;
136 fn try_from(value: u32) -> Result<Self, Self::Error> {
137 match value {
138 0 => Ok(Self::Start),
139 1 => Ok(Self::Current),
140 2 => Ok(Self::End),
141
142 _ => Err(Self::Error::new(value.into())),
143 }
144 }
145}
146
147unsafe impl<___E> ::fidl_next::Encode<___E> for SeekOrigin
148where
149 ___E: ?Sized,
150{
151 #[inline]
152 fn encode(
153 self,
154 encoder: &mut ___E,
155 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
156 ) -> Result<(), ::fidl_next::EncodeError> {
157 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
158 }
159}
160
161unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SeekOrigin
162where
163 ___E: ?Sized,
164{
165 #[inline]
166 fn encode_ref(
167 &self,
168 encoder: &mut ___E,
169 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
170 ) -> Result<(), ::fidl_next::EncodeError> {
171 ::fidl_next::munge!(let WireSeekOrigin { value } = out);
172 let _ = value.write(::fidl_next::WireU32::from(match *self {
173 Self::Start => 0,
174
175 Self::Current => 1,
176
177 Self::End => 2,
178 }));
179
180 Ok(())
181 }
182}
183
184impl ::core::convert::From<WireSeekOrigin> for SeekOrigin {
185 fn from(wire: WireSeekOrigin) -> Self {
186 match u32::from(wire.value) {
187 0 => Self::Start,
188
189 1 => Self::Current,
190
191 2 => Self::End,
192
193 _ => unsafe { ::core::hint::unreachable_unchecked() },
194 }
195 }
196}
197
198impl ::fidl_next::TakeFrom<WireSeekOrigin> for SeekOrigin {
199 #[inline]
200 fn take_from(from: &WireSeekOrigin) -> Self {
201 Self::from(*from)
202 }
203}
204
205#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207#[repr(transparent)]
208pub struct WireSeekOrigin {
209 value: ::fidl_next::WireU32,
210}
211
212unsafe impl ::fidl_next::ZeroPadding for WireSeekOrigin {
213 #[inline]
214 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
215 }
217}
218
219impl WireSeekOrigin {
220 pub const START: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(0) };
221
222 pub const CURRENT: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(1) };
223
224 pub const END: WireSeekOrigin = WireSeekOrigin { value: ::fidl_next::WireU32(2) };
225}
226
227unsafe impl<___D> ::fidl_next::Decode<___D> for WireSeekOrigin
228where
229 ___D: ?Sized,
230{
231 fn decode(
232 slot: ::fidl_next::Slot<'_, Self>,
233 _: &mut ___D,
234 ) -> Result<(), ::fidl_next::DecodeError> {
235 ::fidl_next::munge!(let Self { value } = slot);
236
237 match u32::from(*value) {
238 0 | 1 | 2 => (),
239 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
240 }
241
242 Ok(())
243 }
244}
245
246impl ::core::convert::From<SeekOrigin> for WireSeekOrigin {
247 fn from(natural: SeekOrigin) -> Self {
248 match natural {
249 SeekOrigin::Start => WireSeekOrigin::START,
250
251 SeekOrigin::Current => WireSeekOrigin::CURRENT,
252
253 SeekOrigin::End => WireSeekOrigin::END,
254 }
255 }
256}
257
258#[derive(Clone, Debug)]
259pub struct AdvisoryLockRange {
260 pub origin: crate::SeekOrigin,
261
262 pub offset: i64,
263
264 pub length: i64,
265}
266
267impl ::fidl_next::Encodable for AdvisoryLockRange {
268 type Encoded = WireAdvisoryLockRange;
269}
270
271unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRange
272where
273 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
274{
275 #[inline]
276 fn encode(
277 self,
278 encoder: &mut ___E,
279 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
280 ) -> Result<(), ::fidl_next::EncodeError> {
281 ::fidl_next::munge! {
282 let Self::Encoded {
283 origin,
284 offset,
285 length,
286
287 } = out;
288 }
289
290 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
291
292 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
293
294 ::fidl_next::Encode::encode(self.length, encoder, length)?;
295
296 Ok(())
297 }
298}
299
300unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRange
301where
302 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
303{
304 #[inline]
305 fn encode_ref(
306 &self,
307 encoder: &mut ___E,
308 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
309 ) -> Result<(), ::fidl_next::EncodeError> {
310 ::fidl_next::munge! {
311 let Self::Encoded {
312 origin,
313 offset,
314 length,
315
316 } = out;
317 }
318
319 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder, origin)?;
320
321 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
322
323 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder, length)?;
324
325 Ok(())
326 }
327}
328
329impl ::fidl_next::EncodableOption for Box<AdvisoryLockRange> {
330 type EncodedOption = ::fidl_next::WireBox<WireAdvisoryLockRange>;
331}
332
333unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<AdvisoryLockRange>
334where
335 ___E: ::fidl_next::Encoder + ?Sized,
336 AdvisoryLockRange: ::fidl_next::Encode<___E>,
337{
338 #[inline]
339 fn encode_option(
340 this: Option<Self>,
341 encoder: &mut ___E,
342 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
343 ) -> Result<(), ::fidl_next::EncodeError> {
344 if let Some(inner) = this {
345 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
346 ::fidl_next::WireBox::encode_present(out);
347 } else {
348 ::fidl_next::WireBox::encode_absent(out);
349 }
350
351 Ok(())
352 }
353}
354
355unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<AdvisoryLockRange>
356where
357 ___E: ::fidl_next::Encoder + ?Sized,
358 AdvisoryLockRange: ::fidl_next::EncodeRef<___E>,
359{
360 #[inline]
361 fn encode_option_ref(
362 this: Option<&Self>,
363 encoder: &mut ___E,
364 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
365 ) -> Result<(), ::fidl_next::EncodeError> {
366 if let Some(inner) = this {
367 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
368 ::fidl_next::WireBox::encode_present(out);
369 } else {
370 ::fidl_next::WireBox::encode_absent(out);
371 }
372
373 Ok(())
374 }
375}
376
377impl ::fidl_next::TakeFrom<WireAdvisoryLockRange> for AdvisoryLockRange {
378 #[inline]
379 fn take_from(from: &WireAdvisoryLockRange) -> Self {
380 Self {
381 origin: ::fidl_next::TakeFrom::take_from(&from.origin),
382
383 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
384
385 length: ::fidl_next::TakeFrom::take_from(&from.length),
386 }
387 }
388}
389
390#[derive(Clone, Debug)]
392#[repr(C)]
393pub struct WireAdvisoryLockRange {
394 pub origin: crate::WireSeekOrigin,
395
396 pub offset: ::fidl_next::WireI64,
397
398 pub length: ::fidl_next::WireI64,
399}
400
401unsafe impl ::fidl_next::ZeroPadding for WireAdvisoryLockRange {
402 #[inline]
403 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
404 unsafe {
405 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
406 }
407 }
408}
409
410unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRange
411where
412 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
413{
414 fn decode(
415 slot: ::fidl_next::Slot<'_, Self>,
416 decoder: &mut ___D,
417 ) -> Result<(), ::fidl_next::DecodeError> {
418 ::fidl_next::munge! {
419 let Self {
420 mut origin,
421 mut offset,
422 mut length,
423
424 } = slot;
425 }
426
427 ::fidl_next::Decode::decode(origin.as_mut(), decoder)?;
428
429 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
430
431 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
432
433 Ok(())
434 }
435}
436
437#[derive(Clone, Copy, Debug, PartialEq, Eq)]
438#[repr(u32)]
439pub enum AdvisoryLockType {
440 Read = 1,
441 Write = 2,
442 Unlock = 3,
443}
444
445impl ::fidl_next::Encodable for AdvisoryLockType {
446 type Encoded = WireAdvisoryLockType;
447}
448impl ::std::convert::TryFrom<u32> for AdvisoryLockType {
449 type Error = ::fidl_next::UnknownStrictEnumMemberError;
450 fn try_from(value: u32) -> Result<Self, Self::Error> {
451 match value {
452 1 => Ok(Self::Read),
453 2 => Ok(Self::Write),
454 3 => Ok(Self::Unlock),
455
456 _ => Err(Self::Error::new(value.into())),
457 }
458 }
459}
460
461unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockType
462where
463 ___E: ?Sized,
464{
465 #[inline]
466 fn encode(
467 self,
468 encoder: &mut ___E,
469 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
470 ) -> Result<(), ::fidl_next::EncodeError> {
471 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
472 }
473}
474
475unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockType
476where
477 ___E: ?Sized,
478{
479 #[inline]
480 fn encode_ref(
481 &self,
482 encoder: &mut ___E,
483 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
484 ) -> Result<(), ::fidl_next::EncodeError> {
485 ::fidl_next::munge!(let WireAdvisoryLockType { value } = out);
486 let _ = value.write(::fidl_next::WireU32::from(match *self {
487 Self::Read => 1,
488
489 Self::Write => 2,
490
491 Self::Unlock => 3,
492 }));
493
494 Ok(())
495 }
496}
497
498impl ::core::convert::From<WireAdvisoryLockType> for AdvisoryLockType {
499 fn from(wire: WireAdvisoryLockType) -> Self {
500 match u32::from(wire.value) {
501 1 => Self::Read,
502
503 2 => Self::Write,
504
505 3 => Self::Unlock,
506
507 _ => unsafe { ::core::hint::unreachable_unchecked() },
508 }
509 }
510}
511
512impl ::fidl_next::TakeFrom<WireAdvisoryLockType> for AdvisoryLockType {
513 #[inline]
514 fn take_from(from: &WireAdvisoryLockType) -> Self {
515 Self::from(*from)
516 }
517}
518
519#[derive(Clone, Copy, Debug, PartialEq, Eq)]
521#[repr(transparent)]
522pub struct WireAdvisoryLockType {
523 value: ::fidl_next::WireU32,
524}
525
526unsafe impl ::fidl_next::ZeroPadding for WireAdvisoryLockType {
527 #[inline]
528 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
529 }
531}
532
533impl WireAdvisoryLockType {
534 pub const READ: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(1) };
535
536 pub const WRITE: WireAdvisoryLockType = WireAdvisoryLockType { value: ::fidl_next::WireU32(2) };
537
538 pub const UNLOCK: WireAdvisoryLockType =
539 WireAdvisoryLockType { value: ::fidl_next::WireU32(3) };
540}
541
542unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockType
543where
544 ___D: ?Sized,
545{
546 fn decode(
547 slot: ::fidl_next::Slot<'_, Self>,
548 _: &mut ___D,
549 ) -> Result<(), ::fidl_next::DecodeError> {
550 ::fidl_next::munge!(let Self { value } = slot);
551
552 match u32::from(*value) {
553 1 | 2 | 3 => (),
554 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
555 }
556
557 Ok(())
558 }
559}
560
561impl ::core::convert::From<AdvisoryLockType> for WireAdvisoryLockType {
562 fn from(natural: AdvisoryLockType) -> Self {
563 match natural {
564 AdvisoryLockType::Read => WireAdvisoryLockType::READ,
565
566 AdvisoryLockType::Write => WireAdvisoryLockType::WRITE,
567
568 AdvisoryLockType::Unlock => WireAdvisoryLockType::UNLOCK,
569 }
570 }
571}
572
573#[derive(Clone, Debug, Default)]
574pub struct AdvisoryLockRequest {
575 pub type_: Option<crate::AdvisoryLockType>,
576
577 pub range: Option<crate::AdvisoryLockRange>,
578
579 pub wait: Option<bool>,
580}
581
582impl AdvisoryLockRequest {
583 fn __max_ordinal(&self) -> usize {
584 if self.type_.is_some() {
585 return 1;
586 }
587
588 if self.range.is_some() {
589 return 2;
590 }
591
592 if self.wait.is_some() {
593 return 3;
594 }
595
596 0
597 }
598}
599
600impl ::fidl_next::Encodable for AdvisoryLockRequest {
601 type Encoded = WireAdvisoryLockRequest;
602}
603
604unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockRequest
605where
606 ___E: ::fidl_next::Encoder + ?Sized,
607{
608 #[inline]
609 fn encode(
610 mut self,
611 encoder: &mut ___E,
612 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
613 ) -> Result<(), ::fidl_next::EncodeError> {
614 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
615
616 let max_ord = self.__max_ordinal();
617
618 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
619 ::fidl_next::ZeroPadding::zero_padding(&mut out);
620
621 let mut preallocated =
622 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
623
624 for i in 1..=max_ord {
625 match i {
626 3 => {
627 if let Some(wait) = self.wait.take() {
628 ::fidl_next::WireEnvelope::encode_value(
629 wait,
630 preallocated.encoder,
631 &mut out,
632 )?;
633 } else {
634 ::fidl_next::WireEnvelope::encode_zero(&mut out)
635 }
636 }
637
638 2 => {
639 if let Some(range) = self.range.take() {
640 ::fidl_next::WireEnvelope::encode_value(
641 range,
642 preallocated.encoder,
643 &mut out,
644 )?;
645 } else {
646 ::fidl_next::WireEnvelope::encode_zero(&mut out)
647 }
648 }
649
650 1 => {
651 if let Some(type_) = self.type_.take() {
652 ::fidl_next::WireEnvelope::encode_value(
653 type_,
654 preallocated.encoder,
655 &mut out,
656 )?;
657 } else {
658 ::fidl_next::WireEnvelope::encode_zero(&mut out)
659 }
660 }
661
662 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
663 }
664 unsafe {
665 preallocated.write_next(out.assume_init_ref());
666 }
667 }
668
669 ::fidl_next::WireTable::encode_len(table, max_ord);
670
671 Ok(())
672 }
673}
674
675unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockRequest
676where
677 ___E: ::fidl_next::Encoder + ?Sized,
678{
679 #[inline]
680 fn encode_ref(
681 &self,
682 encoder: &mut ___E,
683 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
684 ) -> Result<(), ::fidl_next::EncodeError> {
685 ::fidl_next::munge!(let WireAdvisoryLockRequest { table } = out);
686
687 let max_ord = self.__max_ordinal();
688
689 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
690 ::fidl_next::ZeroPadding::zero_padding(&mut out);
691
692 let mut preallocated =
693 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
694
695 for i in 1..=max_ord {
696 match i {
697 3 => {
698 if let Some(wait) = &self.wait {
699 ::fidl_next::WireEnvelope::encode_value(
700 wait,
701 preallocated.encoder,
702 &mut out,
703 )?;
704 } else {
705 ::fidl_next::WireEnvelope::encode_zero(&mut out)
706 }
707 }
708
709 2 => {
710 if let Some(range) = &self.range {
711 ::fidl_next::WireEnvelope::encode_value(
712 range,
713 preallocated.encoder,
714 &mut out,
715 )?;
716 } else {
717 ::fidl_next::WireEnvelope::encode_zero(&mut out)
718 }
719 }
720
721 1 => {
722 if let Some(type_) = &self.type_ {
723 ::fidl_next::WireEnvelope::encode_value(
724 type_,
725 preallocated.encoder,
726 &mut out,
727 )?;
728 } else {
729 ::fidl_next::WireEnvelope::encode_zero(&mut out)
730 }
731 }
732
733 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
734 }
735 unsafe {
736 preallocated.write_next(out.assume_init_ref());
737 }
738 }
739
740 ::fidl_next::WireTable::encode_len(table, max_ord);
741
742 Ok(())
743 }
744}
745
746impl ::fidl_next::TakeFrom<WireAdvisoryLockRequest> for AdvisoryLockRequest {
747 #[inline]
748 fn take_from(from: &WireAdvisoryLockRequest) -> Self {
749 Self {
750 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
751
752 range: from.range().map(::fidl_next::TakeFrom::take_from),
753
754 wait: from.wait().map(::fidl_next::TakeFrom::take_from),
755 }
756 }
757}
758
759#[repr(C)]
761pub struct WireAdvisoryLockRequest {
762 table: ::fidl_next::WireTable,
763}
764
765unsafe impl ::fidl_next::ZeroPadding for WireAdvisoryLockRequest {
766 #[inline]
767 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
768 ::fidl_next::munge!(let Self { table } = out);
769 ::fidl_next::WireTable::zero_padding(table);
770 }
771}
772
773unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockRequest
774where
775 ___D: ::fidl_next::Decoder + ?Sized,
776{
777 fn decode(
778 slot: ::fidl_next::Slot<'_, Self>,
779 decoder: &mut ___D,
780 ) -> Result<(), ::fidl_next::DecodeError> {
781 ::fidl_next::munge!(let Self { table } = slot);
782
783 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
784 match ordinal {
785 0 => unsafe { ::core::hint::unreachable_unchecked() },
786
787 1 => {
788 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockType>(
789 slot.as_mut(),
790 decoder,
791 )?;
792
793 Ok(())
794 }
795
796 2 => {
797 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAdvisoryLockRange>(
798 slot.as_mut(),
799 decoder,
800 )?;
801
802 Ok(())
803 }
804
805 3 => {
806 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
807
808 Ok(())
809 }
810
811 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
812 }
813 })
814 }
815}
816
817impl WireAdvisoryLockRequest {
818 pub fn type_(&self) -> Option<&crate::WireAdvisoryLockType> {
819 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
820 }
821
822 pub fn range(&self) -> Option<&crate::WireAdvisoryLockRange> {
823 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
824 }
825
826 pub fn wait(&self) -> Option<&bool> {
827 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
828 }
829}
830
831impl ::core::fmt::Debug for WireAdvisoryLockRequest {
832 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
833 f.debug_struct("AdvisoryLockRequest")
834 .field("type_", &self.type_())
835 .field("range", &self.range())
836 .field("wait", &self.wait())
837 .finish()
838 }
839}
840
841#[derive(Clone, Debug)]
842pub struct AdvisoryLockingAdvisoryLockRequest {
843 pub request: crate::AdvisoryLockRequest,
844}
845
846impl ::fidl_next::Encodable for AdvisoryLockingAdvisoryLockRequest {
847 type Encoded = WireAdvisoryLockingAdvisoryLockRequest;
848}
849
850unsafe impl<___E> ::fidl_next::Encode<___E> for AdvisoryLockingAdvisoryLockRequest
851where
852 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
853
854 ___E: ::fidl_next::Encoder,
855{
856 #[inline]
857 fn encode(
858 self,
859 encoder: &mut ___E,
860 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
861 ) -> Result<(), ::fidl_next::EncodeError> {
862 ::fidl_next::munge! {
863 let Self::Encoded {
864 request,
865
866 } = out;
867 }
868
869 ::fidl_next::Encode::encode(self.request, encoder, request)?;
870
871 Ok(())
872 }
873}
874
875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AdvisoryLockingAdvisoryLockRequest
876where
877 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
878
879 ___E: ::fidl_next::Encoder,
880{
881 #[inline]
882 fn encode_ref(
883 &self,
884 encoder: &mut ___E,
885 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
886 ) -> Result<(), ::fidl_next::EncodeError> {
887 ::fidl_next::munge! {
888 let Self::Encoded {
889 request,
890
891 } = out;
892 }
893
894 ::fidl_next::EncodeRef::encode_ref(&self.request, encoder, request)?;
895
896 Ok(())
897 }
898}
899
900impl ::fidl_next::EncodableOption for Box<AdvisoryLockingAdvisoryLockRequest> {
901 type EncodedOption = ::fidl_next::WireBox<WireAdvisoryLockingAdvisoryLockRequest>;
902}
903
904unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<AdvisoryLockingAdvisoryLockRequest>
905where
906 ___E: ::fidl_next::Encoder + ?Sized,
907 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::Encode<___E>,
908{
909 #[inline]
910 fn encode_option(
911 this: Option<Self>,
912 encoder: &mut ___E,
913 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
914 ) -> Result<(), ::fidl_next::EncodeError> {
915 if let Some(inner) = this {
916 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
917 ::fidl_next::WireBox::encode_present(out);
918 } else {
919 ::fidl_next::WireBox::encode_absent(out);
920 }
921
922 Ok(())
923 }
924}
925
926unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<AdvisoryLockingAdvisoryLockRequest>
927where
928 ___E: ::fidl_next::Encoder + ?Sized,
929 AdvisoryLockingAdvisoryLockRequest: ::fidl_next::EncodeRef<___E>,
930{
931 #[inline]
932 fn encode_option_ref(
933 this: Option<&Self>,
934 encoder: &mut ___E,
935 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
936 ) -> Result<(), ::fidl_next::EncodeError> {
937 if let Some(inner) = this {
938 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
939 ::fidl_next::WireBox::encode_present(out);
940 } else {
941 ::fidl_next::WireBox::encode_absent(out);
942 }
943
944 Ok(())
945 }
946}
947
948impl ::fidl_next::TakeFrom<WireAdvisoryLockingAdvisoryLockRequest>
949 for AdvisoryLockingAdvisoryLockRequest
950{
951 #[inline]
952 fn take_from(from: &WireAdvisoryLockingAdvisoryLockRequest) -> Self {
953 Self { request: ::fidl_next::TakeFrom::take_from(&from.request) }
954 }
955}
956
957#[derive(Debug)]
959#[repr(C)]
960pub struct WireAdvisoryLockingAdvisoryLockRequest {
961 pub request: crate::WireAdvisoryLockRequest,
962}
963
964unsafe impl ::fidl_next::ZeroPadding for WireAdvisoryLockingAdvisoryLockRequest {
965 #[inline]
966 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
967}
968
969unsafe impl<___D> ::fidl_next::Decode<___D> for WireAdvisoryLockingAdvisoryLockRequest
970where
971 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
972
973 ___D: ::fidl_next::Decoder,
974{
975 fn decode(
976 slot: ::fidl_next::Slot<'_, Self>,
977 decoder: &mut ___D,
978 ) -> Result<(), ::fidl_next::DecodeError> {
979 ::fidl_next::munge! {
980 let Self {
981 mut request,
982
983 } = slot;
984 }
985
986 ::fidl_next::Decode::decode(request.as_mut(), decoder)?;
987
988 Ok(())
989 }
990}
991
992pub type AdvisoryLockingAdvisoryLockResponse = ();
993
994pub type WireAdvisoryLockingAdvisoryLockResponse = ();
996
997#[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"]
999#[derive(Debug)]
1000pub struct AdvisoryLocking;
1001
1002pub mod advisory_locking {
1003 pub mod prelude {
1004 pub use crate::{
1005 advisory_locking, AdvisoryLocking, AdvisoryLockingClientHandler,
1006 AdvisoryLockingClientSender, AdvisoryLockingServerHandler, AdvisoryLockingServerSender,
1007 };
1008
1009 pub use crate::AdvisoryLockingAdvisoryLockRequest;
1010
1011 pub use crate::AdvisoryLockingAdvisoryLockResponse;
1012 }
1013
1014 pub struct AdvisoryLock;
1015
1016 impl ::fidl_next::Method for AdvisoryLock {
1017 const ORDINAL: u64 = 7992130864415541162;
1018
1019 type Protocol = crate::AdvisoryLocking;
1020
1021 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest;
1022
1023 type Response = ::fidl_next::WireResult<
1024 crate::WireAdvisoryLockingAdvisoryLockResponse,
1025 ::fidl_next::WireI32,
1026 >;
1027 }
1028}
1029
1030pub trait AdvisoryLockingClientSender {
1032 type Transport: ::fidl_next::Transport;
1033
1034 #[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"]
1035 fn advisory_lock<___R>(
1036 &self,
1037 request: ___R,
1038 ) -> Result<
1039 ::fidl_next::ResponseFuture<'_, Self::Transport, advisory_locking::AdvisoryLock>,
1040 ::fidl_next::EncodeError,
1041 >
1042 where
1043 ___R: ::fidl_next::Encode<
1044 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1045 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
1046 >;
1047}
1048
1049impl<___T> AdvisoryLockingClientSender for ::fidl_next::ClientSender<___T, AdvisoryLocking>
1050where
1051 ___T: ::fidl_next::Transport,
1052{
1053 type Transport = ___T;
1054
1055 #[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"]
1056 fn advisory_lock<___R>(
1057 &self,
1058 request: ___R,
1059 ) -> Result<
1060 ::fidl_next::ResponseFuture<'_, Self::Transport, advisory_locking::AdvisoryLock>,
1061 ::fidl_next::EncodeError,
1062 >
1063 where
1064 ___R: ::fidl_next::Encode<
1065 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1066 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
1067 >,
1068 {
1069 self.as_untyped()
1070 .send_two_way(7992130864415541162, request)
1071 .map(::fidl_next::ResponseFuture::from_untyped)
1072 }
1073}
1074
1075pub trait AdvisoryLockingClientHandler<___T: ::fidl_next::Transport> {}
1079
1080impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for AdvisoryLocking
1081where
1082 ___T: ::fidl_next::Transport,
1083 ___H: AdvisoryLockingClientHandler<___T>,
1084
1085 <advisory_locking::AdvisoryLock as ::fidl_next::Method>::Response:
1086 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1087{
1088 fn on_event(
1089 handler: &mut ___H,
1090 sender: &::fidl_next::ClientSender<___T, Self>,
1091 ordinal: u64,
1092 buffer: ___T::RecvBuffer,
1093 ) {
1094 match ordinal {
1095 ordinal => {
1096 sender.close();
1097 }
1098 }
1099 }
1100}
1101
1102pub trait AdvisoryLockingServerSender {
1104 type Transport: ::fidl_next::Transport;
1105}
1106
1107impl<___T> AdvisoryLockingServerSender for ::fidl_next::ServerSender<___T, AdvisoryLocking>
1108where
1109 ___T: ::fidl_next::Transport,
1110{
1111 type Transport = ___T;
1112}
1113
1114pub trait AdvisoryLockingServerHandler<___T: ::fidl_next::Transport> {
1118 #[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"]
1119 fn advisory_lock(
1120 &mut self,
1121 sender: &::fidl_next::ServerSender<___T, AdvisoryLocking>,
1122
1123 request: ::fidl_next::Request<___T, advisory_locking::AdvisoryLock>,
1124
1125 responder: ::fidl_next::Responder<advisory_locking::AdvisoryLock>,
1126 );
1127}
1128
1129impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for AdvisoryLocking
1130where
1131 ___T: ::fidl_next::Transport,
1132 ___H: AdvisoryLockingServerHandler<___T>,
1133
1134 crate::WireAdvisoryLockingAdvisoryLockRequest:
1135 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1136{
1137 fn on_one_way(
1138 handler: &mut ___H,
1139 sender: &::fidl_next::ServerSender<___T, Self>,
1140 ordinal: u64,
1141 buffer: ___T::RecvBuffer,
1142 ) {
1143 match ordinal {
1144 ordinal => {
1145 sender.close();
1146 }
1147 }
1148 }
1149
1150 fn on_two_way(
1151 handler: &mut ___H,
1152 sender: &::fidl_next::ServerSender<___T, Self>,
1153 ordinal: u64,
1154 buffer: ___T::RecvBuffer,
1155 responder: ::fidl_next::protocol::Responder,
1156 ) {
1157 match ordinal {
1158 7992130864415541162 => {
1159 let responder = ::fidl_next::Responder::from_untyped(responder);
1160
1161 match ::fidl_next::DecoderExt::decode(buffer) {
1162 Ok(decoded) => handler.advisory_lock(sender, decoded, responder),
1163 Err(e) => {
1164 sender.close();
1165 }
1166 }
1167 }
1168
1169 ordinal => {
1170 sender.close();
1171 }
1172 }
1173 }
1174}
1175
1176::fidl_next::bitflags! {
1177 #[derive(
1178 Clone,
1179 Copy,
1180 Debug,
1181 PartialEq,
1182 Eq,
1183 Hash,
1184 )]
1185 pub struct AllocateMode: u32 {
1186 const KEEP_SIZE = 1;
1187 const UNSHARE_RANGE = 2;
1188 const PUNCH_HOLE = 4;
1189 const COLLAPSE_RANGE = 8;
1190 const ZERO_RANGE = 16;
1191 const INSERT_RANGE = 32;
1192 const _ = !0;
1193 }
1194}
1195
1196impl ::fidl_next::Encodable for AllocateMode {
1197 type Encoded = WireAllocateMode;
1198}
1199
1200unsafe impl<___E> ::fidl_next::Encode<___E> for AllocateMode
1201where
1202 ___E: ?Sized,
1203{
1204 #[inline]
1205 fn encode(
1206 self,
1207 encoder: &mut ___E,
1208 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1209 ) -> Result<(), ::fidl_next::EncodeError> {
1210 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1211 }
1212}
1213
1214unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllocateMode
1215where
1216 ___E: ?Sized,
1217{
1218 #[inline]
1219 fn encode_ref(
1220 &self,
1221 _: &mut ___E,
1222 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1223 ) -> Result<(), ::fidl_next::EncodeError> {
1224 ::fidl_next::munge!(let WireAllocateMode { value } = out);
1225 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1226 Ok(())
1227 }
1228}
1229
1230impl ::core::convert::From<WireAllocateMode> for AllocateMode {
1231 fn from(wire: WireAllocateMode) -> Self {
1232 Self::from_bits_retain(u32::from(wire.value))
1233 }
1234}
1235
1236impl ::fidl_next::TakeFrom<WireAllocateMode> for AllocateMode {
1237 #[inline]
1238 fn take_from(from: &WireAllocateMode) -> Self {
1239 Self::from(*from)
1240 }
1241}
1242
1243#[derive(Clone, Copy, Debug)]
1245#[repr(transparent)]
1246pub struct WireAllocateMode {
1247 value: ::fidl_next::WireU32,
1248}
1249
1250unsafe impl ::fidl_next::ZeroPadding for WireAllocateMode {
1251 #[inline]
1252 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1253 }
1255}
1256
1257unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllocateMode
1258where
1259 ___D: ?Sized,
1260{
1261 fn decode(
1262 slot: ::fidl_next::Slot<'_, Self>,
1263 _: &mut ___D,
1264 ) -> Result<(), ::fidl_next::DecodeError> {
1265 Ok(())
1266 }
1267}
1268
1269impl ::core::convert::From<AllocateMode> for WireAllocateMode {
1270 fn from(natural: AllocateMode) -> Self {
1271 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1272 }
1273}
1274
1275#[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"]
1276pub type Rights = crate::Operations;
1277
1278pub type WireRights = crate::WireOperations;
1280
1281#[derive(Debug, Default)]
1282pub struct ConnectionInfo {
1283 pub rights: Option<crate::Operations>,
1284}
1285
1286impl ConnectionInfo {
1287 fn __max_ordinal(&self) -> usize {
1288 if self.rights.is_some() {
1289 return 1;
1290 }
1291
1292 0
1293 }
1294}
1295
1296impl ::fidl_next::Encodable for ConnectionInfo {
1297 type Encoded = WireConnectionInfo;
1298}
1299
1300unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectionInfo
1301where
1302 ___E: ::fidl_next::Encoder + ?Sized,
1303
1304 ___E: ::fidl_next::fuchsia::HandleEncoder,
1305{
1306 #[inline]
1307 fn encode(
1308 mut self,
1309 encoder: &mut ___E,
1310 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1311 ) -> Result<(), ::fidl_next::EncodeError> {
1312 ::fidl_next::munge!(let WireConnectionInfo { table } = out);
1313
1314 let max_ord = self.__max_ordinal();
1315
1316 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1317 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1318
1319 let mut preallocated =
1320 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1321
1322 for i in 1..=max_ord {
1323 match i {
1324 1 => {
1325 if let Some(rights) = self.rights.take() {
1326 ::fidl_next::WireEnvelope::encode_value(
1327 rights,
1328 preallocated.encoder,
1329 &mut out,
1330 )?;
1331 } else {
1332 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1333 }
1334 }
1335
1336 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1337 }
1338 unsafe {
1339 preallocated.write_next(out.assume_init_ref());
1340 }
1341 }
1342
1343 ::fidl_next::WireTable::encode_len(table, max_ord);
1344
1345 Ok(())
1346 }
1347}
1348
1349impl ::fidl_next::TakeFrom<WireConnectionInfo> for ConnectionInfo {
1350 #[inline]
1351 fn take_from(from: &WireConnectionInfo) -> Self {
1352 Self { rights: from.rights().map(::fidl_next::TakeFrom::take_from) }
1353 }
1354}
1355
1356#[repr(C)]
1358pub struct WireConnectionInfo {
1359 table: ::fidl_next::WireTable,
1360}
1361
1362unsafe impl ::fidl_next::ZeroPadding for WireConnectionInfo {
1363 #[inline]
1364 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1365 ::fidl_next::munge!(let Self { table } = out);
1366 ::fidl_next::WireTable::zero_padding(table);
1367 }
1368}
1369
1370unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectionInfo
1371where
1372 ___D: ::fidl_next::Decoder + ?Sized,
1373
1374 ___D: ::fidl_next::fuchsia::HandleDecoder,
1375{
1376 fn decode(
1377 slot: ::fidl_next::Slot<'_, Self>,
1378 decoder: &mut ___D,
1379 ) -> Result<(), ::fidl_next::DecodeError> {
1380 ::fidl_next::munge!(let Self { table } = slot);
1381
1382 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1383 match ordinal {
1384 0 => unsafe { ::core::hint::unreachable_unchecked() },
1385
1386 1 => {
1387 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
1388 slot.as_mut(),
1389 decoder,
1390 )?;
1391
1392 Ok(())
1393 }
1394
1395 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1396 }
1397 })
1398 }
1399}
1400
1401impl WireConnectionInfo {
1402 pub fn rights(&self) -> Option<&crate::WireOperations> {
1403 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1404 }
1405}
1406
1407impl ::core::fmt::Debug for WireConnectionInfo {
1408 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1409 f.debug_struct("ConnectionInfo").field("rights", &self.rights()).finish()
1410 }
1411}
1412
1413#[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"]
1414pub type Id = u64;
1415
1416pub type WireId = ::fidl_next::WireU64;
1418
1419pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
1420
1421::fidl_next::bitflags! {
1422 #[doc = " DEPRECATED - Use Flags instead.\n"]#[derive(
1423 Clone,
1424 Copy,
1425 Debug,
1426 PartialEq,
1427 Eq,
1428 Hash,
1429 )]
1430 pub struct OpenFlags: u32 {
1431 #[doc = " Can read from target object.\n"]const RIGHT_READABLE = 1;
1432 #[doc = " Can write to target object.\n"]const RIGHT_WRITABLE = 2;
1433 #[doc = " Connection can map target object executable.\n"]const RIGHT_EXECUTABLE = 8;
1434 #[doc = " Create the object if it doesn\'t exist.\n"]const CREATE = 65536;
1435 #[doc = " (with Create) Fail if the object already exists.\n"]const CREATE_IF_ABSENT = 131072;
1436 #[doc = " Truncate the object before usage.\n"]const TRUNCATE = 262144;
1437 #[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;
1438 #[doc = " Seek to the end of the object before all writes.\n"]const APPEND = 1048576;
1439 #[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;
1440 #[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;
1441 #[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;
1442 #[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;
1443 #[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;
1444 #[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;
1445 #[doc = " Open the target object as a block device.\n"]const BLOCK_DEVICE = 16777216;
1446
1447 }
1448}
1449
1450impl ::fidl_next::Encodable for OpenFlags {
1451 type Encoded = WireOpenFlags;
1452}
1453
1454unsafe impl<___E> ::fidl_next::Encode<___E> for OpenFlags
1455where
1456 ___E: ?Sized,
1457{
1458 #[inline]
1459 fn encode(
1460 self,
1461 encoder: &mut ___E,
1462 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1463 ) -> Result<(), ::fidl_next::EncodeError> {
1464 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1465 }
1466}
1467
1468unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OpenFlags
1469where
1470 ___E: ?Sized,
1471{
1472 #[inline]
1473 fn encode_ref(
1474 &self,
1475 _: &mut ___E,
1476 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1477 ) -> Result<(), ::fidl_next::EncodeError> {
1478 ::fidl_next::munge!(let WireOpenFlags { value } = out);
1479 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1480 Ok(())
1481 }
1482}
1483
1484impl ::core::convert::From<WireOpenFlags> for OpenFlags {
1485 fn from(wire: WireOpenFlags) -> Self {
1486 Self::from_bits_retain(u32::from(wire.value))
1487 }
1488}
1489
1490impl ::fidl_next::TakeFrom<WireOpenFlags> for OpenFlags {
1491 #[inline]
1492 fn take_from(from: &WireOpenFlags) -> Self {
1493 Self::from(*from)
1494 }
1495}
1496
1497#[derive(Clone, Copy, Debug)]
1499#[repr(transparent)]
1500pub struct WireOpenFlags {
1501 value: ::fidl_next::WireU32,
1502}
1503
1504unsafe impl ::fidl_next::ZeroPadding for WireOpenFlags {
1505 #[inline]
1506 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1507 }
1509}
1510
1511unsafe impl<___D> ::fidl_next::Decode<___D> for WireOpenFlags
1512where
1513 ___D: ?Sized,
1514{
1515 fn decode(
1516 slot: ::fidl_next::Slot<'_, Self>,
1517 _: &mut ___D,
1518 ) -> Result<(), ::fidl_next::DecodeError> {
1519 ::fidl_next::munge!(let Self { value } = slot);
1520 let set = u32::from(*value);
1521 if set & !OpenFlags::all().bits() != 0 {
1522 return Err(::fidl_next::DecodeError::InvalidBits {
1523 expected: OpenFlags::all().bits() as usize,
1524 actual: set as usize,
1525 });
1526 }
1527
1528 Ok(())
1529 }
1530}
1531
1532impl ::core::convert::From<OpenFlags> for WireOpenFlags {
1533 fn from(natural: OpenFlags) -> Self {
1534 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
1535 }
1536}
1537
1538#[doc = " NodeAttributes defines generic information about a filesystem node.\n"]
1539#[derive(Clone, Debug)]
1540pub struct NodeAttributes {
1541 pub mode: u32,
1542
1543 pub id: u64,
1544
1545 pub content_size: u64,
1546
1547 pub storage_size: u64,
1548
1549 pub link_count: u64,
1550
1551 pub creation_time: u64,
1552
1553 pub modification_time: u64,
1554}
1555
1556impl ::fidl_next::Encodable for NodeAttributes {
1557 type Encoded = WireNodeAttributes;
1558}
1559
1560unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes
1561where
1562 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1563{
1564 #[inline]
1565 fn encode(
1566 self,
1567 encoder: &mut ___E,
1568 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1569 ) -> Result<(), ::fidl_next::EncodeError> {
1570 ::fidl_next::munge! {
1571 let Self::Encoded {
1572 mode,
1573 id,
1574 content_size,
1575 storage_size,
1576 link_count,
1577 creation_time,
1578 modification_time,
1579
1580 } = out;
1581 }
1582
1583 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
1584
1585 ::fidl_next::Encode::encode(self.id, encoder, id)?;
1586
1587 ::fidl_next::Encode::encode(self.content_size, encoder, content_size)?;
1588
1589 ::fidl_next::Encode::encode(self.storage_size, encoder, storage_size)?;
1590
1591 ::fidl_next::Encode::encode(self.link_count, encoder, link_count)?;
1592
1593 ::fidl_next::Encode::encode(self.creation_time, encoder, creation_time)?;
1594
1595 ::fidl_next::Encode::encode(self.modification_time, encoder, modification_time)?;
1596
1597 Ok(())
1598 }
1599}
1600
1601unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes
1602where
1603 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1604{
1605 #[inline]
1606 fn encode_ref(
1607 &self,
1608 encoder: &mut ___E,
1609 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1610 ) -> Result<(), ::fidl_next::EncodeError> {
1611 ::fidl_next::munge! {
1612 let Self::Encoded {
1613 mode,
1614 id,
1615 content_size,
1616 storage_size,
1617 link_count,
1618 creation_time,
1619 modification_time,
1620
1621 } = out;
1622 }
1623
1624 ::fidl_next::EncodeRef::encode_ref(&self.mode, encoder, mode)?;
1625
1626 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
1627
1628 ::fidl_next::EncodeRef::encode_ref(&self.content_size, encoder, content_size)?;
1629
1630 ::fidl_next::EncodeRef::encode_ref(&self.storage_size, encoder, storage_size)?;
1631
1632 ::fidl_next::EncodeRef::encode_ref(&self.link_count, encoder, link_count)?;
1633
1634 ::fidl_next::EncodeRef::encode_ref(&self.creation_time, encoder, creation_time)?;
1635
1636 ::fidl_next::EncodeRef::encode_ref(&self.modification_time, encoder, modification_time)?;
1637
1638 Ok(())
1639 }
1640}
1641
1642impl ::fidl_next::EncodableOption for Box<NodeAttributes> {
1643 type EncodedOption = ::fidl_next::WireBox<WireNodeAttributes>;
1644}
1645
1646unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeAttributes>
1647where
1648 ___E: ::fidl_next::Encoder + ?Sized,
1649 NodeAttributes: ::fidl_next::Encode<___E>,
1650{
1651 #[inline]
1652 fn encode_option(
1653 this: Option<Self>,
1654 encoder: &mut ___E,
1655 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1656 ) -> Result<(), ::fidl_next::EncodeError> {
1657 if let Some(inner) = this {
1658 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
1659 ::fidl_next::WireBox::encode_present(out);
1660 } else {
1661 ::fidl_next::WireBox::encode_absent(out);
1662 }
1663
1664 Ok(())
1665 }
1666}
1667
1668unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeAttributes>
1669where
1670 ___E: ::fidl_next::Encoder + ?Sized,
1671 NodeAttributes: ::fidl_next::EncodeRef<___E>,
1672{
1673 #[inline]
1674 fn encode_option_ref(
1675 this: Option<&Self>,
1676 encoder: &mut ___E,
1677 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1678 ) -> Result<(), ::fidl_next::EncodeError> {
1679 if let Some(inner) = this {
1680 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1681 ::fidl_next::WireBox::encode_present(out);
1682 } else {
1683 ::fidl_next::WireBox::encode_absent(out);
1684 }
1685
1686 Ok(())
1687 }
1688}
1689
1690impl ::fidl_next::TakeFrom<WireNodeAttributes> for NodeAttributes {
1691 #[inline]
1692 fn take_from(from: &WireNodeAttributes) -> Self {
1693 Self {
1694 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
1695
1696 id: ::fidl_next::TakeFrom::take_from(&from.id),
1697
1698 content_size: ::fidl_next::TakeFrom::take_from(&from.content_size),
1699
1700 storage_size: ::fidl_next::TakeFrom::take_from(&from.storage_size),
1701
1702 link_count: ::fidl_next::TakeFrom::take_from(&from.link_count),
1703
1704 creation_time: ::fidl_next::TakeFrom::take_from(&from.creation_time),
1705
1706 modification_time: ::fidl_next::TakeFrom::take_from(&from.modification_time),
1707 }
1708 }
1709}
1710
1711#[derive(Clone, Debug)]
1713#[repr(C)]
1714pub struct WireNodeAttributes {
1715 pub mode: ::fidl_next::WireU32,
1716
1717 pub id: ::fidl_next::WireU64,
1718
1719 pub content_size: ::fidl_next::WireU64,
1720
1721 pub storage_size: ::fidl_next::WireU64,
1722
1723 pub link_count: ::fidl_next::WireU64,
1724
1725 pub creation_time: ::fidl_next::WireU64,
1726
1727 pub modification_time: ::fidl_next::WireU64,
1728}
1729
1730unsafe impl ::fidl_next::ZeroPadding for WireNodeAttributes {
1731 #[inline]
1732 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1733 unsafe {
1734 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1735 }
1736 }
1737}
1738
1739unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes
1740where
1741 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1742{
1743 fn decode(
1744 slot: ::fidl_next::Slot<'_, Self>,
1745 decoder: &mut ___D,
1746 ) -> Result<(), ::fidl_next::DecodeError> {
1747 ::fidl_next::munge! {
1748 let Self {
1749 mut mode,
1750 mut id,
1751 mut content_size,
1752 mut storage_size,
1753 mut link_count,
1754 mut creation_time,
1755 mut modification_time,
1756
1757 } = slot;
1758 }
1759
1760 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
1761
1762 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
1763
1764 ::fidl_next::Decode::decode(content_size.as_mut(), decoder)?;
1765
1766 ::fidl_next::Decode::decode(storage_size.as_mut(), decoder)?;
1767
1768 ::fidl_next::Decode::decode(link_count.as_mut(), decoder)?;
1769
1770 ::fidl_next::Decode::decode(creation_time.as_mut(), decoder)?;
1771
1772 ::fidl_next::Decode::decode(modification_time.as_mut(), decoder)?;
1773
1774 Ok(())
1775 }
1776}
1777
1778#[derive(Clone, Debug)]
1779pub struct NodeGetAttrResponse {
1780 pub s: i32,
1781
1782 pub attributes: crate::NodeAttributes,
1783}
1784
1785impl ::fidl_next::Encodable for NodeGetAttrResponse {
1786 type Encoded = WireNodeGetAttrResponse;
1787}
1788
1789unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetAttrResponse
1790where
1791 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1792{
1793 #[inline]
1794 fn encode(
1795 self,
1796 encoder: &mut ___E,
1797 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1798 ) -> Result<(), ::fidl_next::EncodeError> {
1799 ::fidl_next::munge! {
1800 let Self::Encoded {
1801 s,
1802 attributes,
1803
1804 } = out;
1805 }
1806
1807 ::fidl_next::Encode::encode(self.s, encoder, s)?;
1808
1809 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
1810
1811 Ok(())
1812 }
1813}
1814
1815unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetAttrResponse
1816where
1817 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1818{
1819 #[inline]
1820 fn encode_ref(
1821 &self,
1822 encoder: &mut ___E,
1823 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1824 ) -> Result<(), ::fidl_next::EncodeError> {
1825 ::fidl_next::munge! {
1826 let Self::Encoded {
1827 s,
1828 attributes,
1829
1830 } = out;
1831 }
1832
1833 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
1834
1835 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
1836
1837 Ok(())
1838 }
1839}
1840
1841impl ::fidl_next::EncodableOption for Box<NodeGetAttrResponse> {
1842 type EncodedOption = ::fidl_next::WireBox<WireNodeGetAttrResponse>;
1843}
1844
1845unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeGetAttrResponse>
1846where
1847 ___E: ::fidl_next::Encoder + ?Sized,
1848 NodeGetAttrResponse: ::fidl_next::Encode<___E>,
1849{
1850 #[inline]
1851 fn encode_option(
1852 this: Option<Self>,
1853 encoder: &mut ___E,
1854 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1855 ) -> Result<(), ::fidl_next::EncodeError> {
1856 if let Some(inner) = this {
1857 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
1858 ::fidl_next::WireBox::encode_present(out);
1859 } else {
1860 ::fidl_next::WireBox::encode_absent(out);
1861 }
1862
1863 Ok(())
1864 }
1865}
1866
1867unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeGetAttrResponse>
1868where
1869 ___E: ::fidl_next::Encoder + ?Sized,
1870 NodeGetAttrResponse: ::fidl_next::EncodeRef<___E>,
1871{
1872 #[inline]
1873 fn encode_option_ref(
1874 this: Option<&Self>,
1875 encoder: &mut ___E,
1876 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1877 ) -> Result<(), ::fidl_next::EncodeError> {
1878 if let Some(inner) = this {
1879 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1880 ::fidl_next::WireBox::encode_present(out);
1881 } else {
1882 ::fidl_next::WireBox::encode_absent(out);
1883 }
1884
1885 Ok(())
1886 }
1887}
1888
1889impl ::fidl_next::TakeFrom<WireNodeGetAttrResponse> for NodeGetAttrResponse {
1890 #[inline]
1891 fn take_from(from: &WireNodeGetAttrResponse) -> Self {
1892 Self {
1893 s: ::fidl_next::TakeFrom::take_from(&from.s),
1894
1895 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
1896 }
1897 }
1898}
1899
1900#[derive(Clone, Debug)]
1902#[repr(C)]
1903pub struct WireNodeGetAttrResponse {
1904 pub s: ::fidl_next::WireI32,
1905
1906 pub attributes: crate::WireNodeAttributes,
1907}
1908
1909unsafe impl ::fidl_next::ZeroPadding for WireNodeGetAttrResponse {
1910 #[inline]
1911 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1912 unsafe {
1913 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1914 }
1915 }
1916}
1917
1918unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetAttrResponse
1919where
1920 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1921{
1922 fn decode(
1923 slot: ::fidl_next::Slot<'_, Self>,
1924 decoder: &mut ___D,
1925 ) -> Result<(), ::fidl_next::DecodeError> {
1926 ::fidl_next::munge! {
1927 let Self {
1928 mut s,
1929 mut attributes,
1930
1931 } = slot;
1932 }
1933
1934 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
1935
1936 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
1937
1938 Ok(())
1939 }
1940}
1941
1942::fidl_next::bitflags! {
1943 #[doc = " The fields of \'attributes\' which are used to update the Node are indicated\n by the \'flags\' argument.\n"]#[derive(
1944 Clone,
1945 Copy,
1946 Debug,
1947 PartialEq,
1948 Eq,
1949 Hash,
1950 )]
1951 pub struct NodeAttributeFlags: u32 {
1952 const CREATION_TIME = 1;
1953 const MODIFICATION_TIME = 2;
1954
1955 }
1956}
1957
1958impl ::fidl_next::Encodable for NodeAttributeFlags {
1959 type Encoded = WireNodeAttributeFlags;
1960}
1961
1962unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributeFlags
1963where
1964 ___E: ?Sized,
1965{
1966 #[inline]
1967 fn encode(
1968 self,
1969 encoder: &mut ___E,
1970 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1971 ) -> Result<(), ::fidl_next::EncodeError> {
1972 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
1973 }
1974}
1975
1976unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributeFlags
1977where
1978 ___E: ?Sized,
1979{
1980 #[inline]
1981 fn encode_ref(
1982 &self,
1983 _: &mut ___E,
1984 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1985 ) -> Result<(), ::fidl_next::EncodeError> {
1986 ::fidl_next::munge!(let WireNodeAttributeFlags { value } = out);
1987 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
1988 Ok(())
1989 }
1990}
1991
1992impl ::core::convert::From<WireNodeAttributeFlags> for NodeAttributeFlags {
1993 fn from(wire: WireNodeAttributeFlags) -> Self {
1994 Self::from_bits_retain(u32::from(wire.value))
1995 }
1996}
1997
1998impl ::fidl_next::TakeFrom<WireNodeAttributeFlags> for NodeAttributeFlags {
1999 #[inline]
2000 fn take_from(from: &WireNodeAttributeFlags) -> Self {
2001 Self::from(*from)
2002 }
2003}
2004
2005#[derive(Clone, Copy, Debug)]
2007#[repr(transparent)]
2008pub struct WireNodeAttributeFlags {
2009 value: ::fidl_next::WireU32,
2010}
2011
2012unsafe impl ::fidl_next::ZeroPadding for WireNodeAttributeFlags {
2013 #[inline]
2014 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2015 }
2017}
2018
2019unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributeFlags
2020where
2021 ___D: ?Sized,
2022{
2023 fn decode(
2024 slot: ::fidl_next::Slot<'_, Self>,
2025 _: &mut ___D,
2026 ) -> Result<(), ::fidl_next::DecodeError> {
2027 ::fidl_next::munge!(let Self { value } = slot);
2028 let set = u32::from(*value);
2029 if set & !NodeAttributeFlags::all().bits() != 0 {
2030 return Err(::fidl_next::DecodeError::InvalidBits {
2031 expected: NodeAttributeFlags::all().bits() as usize,
2032 actual: set as usize,
2033 });
2034 }
2035
2036 Ok(())
2037 }
2038}
2039
2040impl ::core::convert::From<NodeAttributeFlags> for WireNodeAttributeFlags {
2041 fn from(natural: NodeAttributeFlags) -> Self {
2042 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2043 }
2044}
2045
2046#[derive(Clone, Debug)]
2047pub struct NodeSetAttrRequest {
2048 pub flags: crate::NodeAttributeFlags,
2049
2050 pub attributes: crate::NodeAttributes,
2051}
2052
2053impl ::fidl_next::Encodable for NodeSetAttrRequest {
2054 type Encoded = WireNodeSetAttrRequest;
2055}
2056
2057unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetAttrRequest
2058where
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<Self::Encoded>,
2066 ) -> Result<(), ::fidl_next::EncodeError> {
2067 ::fidl_next::munge! {
2068 let Self::Encoded {
2069 flags,
2070 attributes,
2071
2072 } = out;
2073 }
2074
2075 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
2076
2077 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
2078
2079 Ok(())
2080 }
2081}
2082
2083unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetAttrRequest
2084where
2085 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2086{
2087 #[inline]
2088 fn encode_ref(
2089 &self,
2090 encoder: &mut ___E,
2091 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2092 ) -> Result<(), ::fidl_next::EncodeError> {
2093 ::fidl_next::munge! {
2094 let Self::Encoded {
2095 flags,
2096 attributes,
2097
2098 } = out;
2099 }
2100
2101 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
2102
2103 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
2104
2105 Ok(())
2106 }
2107}
2108
2109impl ::fidl_next::EncodableOption for Box<NodeSetAttrRequest> {
2110 type EncodedOption = ::fidl_next::WireBox<WireNodeSetAttrRequest>;
2111}
2112
2113unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeSetAttrRequest>
2114where
2115 ___E: ::fidl_next::Encoder + ?Sized,
2116 NodeSetAttrRequest: ::fidl_next::Encode<___E>,
2117{
2118 #[inline]
2119 fn encode_option(
2120 this: Option<Self>,
2121 encoder: &mut ___E,
2122 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2123 ) -> Result<(), ::fidl_next::EncodeError> {
2124 if let Some(inner) = this {
2125 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2126 ::fidl_next::WireBox::encode_present(out);
2127 } else {
2128 ::fidl_next::WireBox::encode_absent(out);
2129 }
2130
2131 Ok(())
2132 }
2133}
2134
2135unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeSetAttrRequest>
2136where
2137 ___E: ::fidl_next::Encoder + ?Sized,
2138 NodeSetAttrRequest: ::fidl_next::EncodeRef<___E>,
2139{
2140 #[inline]
2141 fn encode_option_ref(
2142 this: Option<&Self>,
2143 encoder: &mut ___E,
2144 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2145 ) -> Result<(), ::fidl_next::EncodeError> {
2146 if let Some(inner) = this {
2147 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2148 ::fidl_next::WireBox::encode_present(out);
2149 } else {
2150 ::fidl_next::WireBox::encode_absent(out);
2151 }
2152
2153 Ok(())
2154 }
2155}
2156
2157impl ::fidl_next::TakeFrom<WireNodeSetAttrRequest> for NodeSetAttrRequest {
2158 #[inline]
2159 fn take_from(from: &WireNodeSetAttrRequest) -> Self {
2160 Self {
2161 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
2162
2163 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
2164 }
2165 }
2166}
2167
2168#[derive(Clone, Debug)]
2170#[repr(C)]
2171pub struct WireNodeSetAttrRequest {
2172 pub flags: crate::WireNodeAttributeFlags,
2173
2174 pub attributes: crate::WireNodeAttributes,
2175}
2176
2177unsafe impl ::fidl_next::ZeroPadding for WireNodeSetAttrRequest {
2178 #[inline]
2179 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2180 unsafe {
2181 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2182 }
2183 }
2184}
2185
2186unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetAttrRequest
2187where
2188 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2189{
2190 fn decode(
2191 slot: ::fidl_next::Slot<'_, Self>,
2192 decoder: &mut ___D,
2193 ) -> Result<(), ::fidl_next::DecodeError> {
2194 ::fidl_next::munge! {
2195 let Self {
2196 mut flags,
2197 mut attributes,
2198
2199 } = slot;
2200 }
2201
2202 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
2203
2204 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
2205
2206 Ok(())
2207 }
2208}
2209
2210#[derive(Clone, Debug)]
2211#[repr(C)]
2212pub struct NodeSetAttrResponse {
2213 pub s: i32,
2214}
2215
2216impl ::fidl_next::Encodable for NodeSetAttrResponse {
2217 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2218 ::fidl_next::CopyOptimization::enable_if(
2219 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2220 )
2221 };
2222
2223 type Encoded = WireNodeSetAttrResponse;
2224}
2225
2226unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetAttrResponse
2227where
2228 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2229{
2230 #[inline]
2231 fn encode(
2232 self,
2233 encoder: &mut ___E,
2234 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2235 ) -> Result<(), ::fidl_next::EncodeError> {
2236 ::fidl_next::munge! {
2237 let Self::Encoded {
2238 s,
2239
2240 } = out;
2241 }
2242
2243 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2244
2245 Ok(())
2246 }
2247}
2248
2249unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetAttrResponse
2250where
2251 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2252{
2253 #[inline]
2254 fn encode_ref(
2255 &self,
2256 encoder: &mut ___E,
2257 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2258 ) -> Result<(), ::fidl_next::EncodeError> {
2259 ::fidl_next::munge! {
2260 let Self::Encoded {
2261 s,
2262
2263 } = out;
2264 }
2265
2266 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2267
2268 Ok(())
2269 }
2270}
2271
2272impl ::fidl_next::EncodableOption for Box<NodeSetAttrResponse> {
2273 type EncodedOption = ::fidl_next::WireBox<WireNodeSetAttrResponse>;
2274}
2275
2276unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeSetAttrResponse>
2277where
2278 ___E: ::fidl_next::Encoder + ?Sized,
2279 NodeSetAttrResponse: ::fidl_next::Encode<___E>,
2280{
2281 #[inline]
2282 fn encode_option(
2283 this: Option<Self>,
2284 encoder: &mut ___E,
2285 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2286 ) -> Result<(), ::fidl_next::EncodeError> {
2287 if let Some(inner) = this {
2288 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2289 ::fidl_next::WireBox::encode_present(out);
2290 } else {
2291 ::fidl_next::WireBox::encode_absent(out);
2292 }
2293
2294 Ok(())
2295 }
2296}
2297
2298unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeSetAttrResponse>
2299where
2300 ___E: ::fidl_next::Encoder + ?Sized,
2301 NodeSetAttrResponse: ::fidl_next::EncodeRef<___E>,
2302{
2303 #[inline]
2304 fn encode_option_ref(
2305 this: Option<&Self>,
2306 encoder: &mut ___E,
2307 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2308 ) -> Result<(), ::fidl_next::EncodeError> {
2309 if let Some(inner) = this {
2310 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2311 ::fidl_next::WireBox::encode_present(out);
2312 } else {
2313 ::fidl_next::WireBox::encode_absent(out);
2314 }
2315
2316 Ok(())
2317 }
2318}
2319
2320impl ::fidl_next::TakeFrom<WireNodeSetAttrResponse> for NodeSetAttrResponse {
2321 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2322 ::fidl_next::CopyOptimization::enable_if(
2323 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2324 )
2325 };
2326
2327 #[inline]
2328 fn take_from(from: &WireNodeSetAttrResponse) -> Self {
2329 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
2330 }
2331}
2332
2333#[derive(Clone, Debug)]
2335#[repr(C)]
2336pub struct WireNodeSetAttrResponse {
2337 pub s: ::fidl_next::WireI32,
2338}
2339
2340unsafe impl ::fidl_next::ZeroPadding for WireNodeSetAttrResponse {
2341 #[inline]
2342 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2343}
2344
2345unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetAttrResponse
2346where
2347 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2348{
2349 fn decode(
2350 slot: ::fidl_next::Slot<'_, Self>,
2351 decoder: &mut ___D,
2352 ) -> Result<(), ::fidl_next::DecodeError> {
2353 ::fidl_next::munge! {
2354 let Self {
2355 mut s,
2356
2357 } = slot;
2358 }
2359
2360 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2361
2362 Ok(())
2363 }
2364}
2365
2366#[derive(Clone, Debug)]
2367pub struct NodeQueryFilesystemResponse {
2368 pub s: i32,
2369
2370 pub info: Option<Box<crate::FilesystemInfo>>,
2371}
2372
2373impl ::fidl_next::Encodable for NodeQueryFilesystemResponse {
2374 type Encoded = WireNodeQueryFilesystemResponse;
2375}
2376
2377unsafe impl<___E> ::fidl_next::Encode<___E> for NodeQueryFilesystemResponse
2378where
2379 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2380
2381 ___E: ::fidl_next::Encoder,
2382{
2383 #[inline]
2384 fn encode(
2385 self,
2386 encoder: &mut ___E,
2387 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2388 ) -> Result<(), ::fidl_next::EncodeError> {
2389 ::fidl_next::munge! {
2390 let Self::Encoded {
2391 s,
2392 info,
2393
2394 } = out;
2395 }
2396
2397 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2398
2399 ::fidl_next::Encode::encode(self.info, encoder, info)?;
2400
2401 Ok(())
2402 }
2403}
2404
2405unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeQueryFilesystemResponse
2406where
2407 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2408
2409 ___E: ::fidl_next::Encoder,
2410{
2411 #[inline]
2412 fn encode_ref(
2413 &self,
2414 encoder: &mut ___E,
2415 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2416 ) -> Result<(), ::fidl_next::EncodeError> {
2417 ::fidl_next::munge! {
2418 let Self::Encoded {
2419 s,
2420 info,
2421
2422 } = out;
2423 }
2424
2425 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2426
2427 ::fidl_next::EncodeRef::encode_ref(&self.info, encoder, info)?;
2428
2429 Ok(())
2430 }
2431}
2432
2433impl ::fidl_next::EncodableOption for Box<NodeQueryFilesystemResponse> {
2434 type EncodedOption = ::fidl_next::WireBox<WireNodeQueryFilesystemResponse>;
2435}
2436
2437unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeQueryFilesystemResponse>
2438where
2439 ___E: ::fidl_next::Encoder + ?Sized,
2440 NodeQueryFilesystemResponse: ::fidl_next::Encode<___E>,
2441{
2442 #[inline]
2443 fn encode_option(
2444 this: Option<Self>,
2445 encoder: &mut ___E,
2446 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2447 ) -> Result<(), ::fidl_next::EncodeError> {
2448 if let Some(inner) = this {
2449 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2450 ::fidl_next::WireBox::encode_present(out);
2451 } else {
2452 ::fidl_next::WireBox::encode_absent(out);
2453 }
2454
2455 Ok(())
2456 }
2457}
2458
2459unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeQueryFilesystemResponse>
2460where
2461 ___E: ::fidl_next::Encoder + ?Sized,
2462 NodeQueryFilesystemResponse: ::fidl_next::EncodeRef<___E>,
2463{
2464 #[inline]
2465 fn encode_option_ref(
2466 this: Option<&Self>,
2467 encoder: &mut ___E,
2468 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2469 ) -> Result<(), ::fidl_next::EncodeError> {
2470 if let Some(inner) = this {
2471 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2472 ::fidl_next::WireBox::encode_present(out);
2473 } else {
2474 ::fidl_next::WireBox::encode_absent(out);
2475 }
2476
2477 Ok(())
2478 }
2479}
2480
2481impl ::fidl_next::TakeFrom<WireNodeQueryFilesystemResponse> for NodeQueryFilesystemResponse {
2482 #[inline]
2483 fn take_from(from: &WireNodeQueryFilesystemResponse) -> Self {
2484 Self {
2485 s: ::fidl_next::TakeFrom::take_from(&from.s),
2486
2487 info: ::fidl_next::TakeFrom::take_from(&from.info),
2488 }
2489 }
2490}
2491
2492#[derive(Debug)]
2494#[repr(C)]
2495pub struct WireNodeQueryFilesystemResponse {
2496 pub s: ::fidl_next::WireI32,
2497
2498 pub info: ::fidl_next::WireBox<crate::WireFilesystemInfo>,
2499}
2500
2501unsafe impl ::fidl_next::ZeroPadding for WireNodeQueryFilesystemResponse {
2502 #[inline]
2503 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2504 unsafe {
2505 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2506 }
2507 }
2508}
2509
2510unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeQueryFilesystemResponse
2511where
2512 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2513
2514 ___D: ::fidl_next::Decoder,
2515{
2516 fn decode(
2517 slot: ::fidl_next::Slot<'_, Self>,
2518 decoder: &mut ___D,
2519 ) -> Result<(), ::fidl_next::DecodeError> {
2520 ::fidl_next::munge! {
2521 let Self {
2522 mut s,
2523 mut info,
2524
2525 } = slot;
2526 }
2527
2528 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2529
2530 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
2531
2532 Ok(())
2533 }
2534}
2535
2536pub type NodeUpdateAttributesResponse = ();
2537
2538pub type WireNodeUpdateAttributesResponse = ();
2540
2541pub type NodeSyncResponse = ();
2542
2543pub type WireNodeSyncResponse = ();
2545
2546::fidl_next::bitflags! {
2547 #[derive(
2548 Clone,
2549 Copy,
2550 Debug,
2551 PartialEq,
2552 Eq,
2553 Hash,
2554 )]
2555 pub struct ModeType: u32 {
2556 const DO_NOT_USE = 2147483648;
2557
2558 }
2559}
2560
2561impl ::fidl_next::Encodable for ModeType {
2562 type Encoded = WireModeType;
2563}
2564
2565unsafe impl<___E> ::fidl_next::Encode<___E> for ModeType
2566where
2567 ___E: ?Sized,
2568{
2569 #[inline]
2570 fn encode(
2571 self,
2572 encoder: &mut ___E,
2573 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2574 ) -> Result<(), ::fidl_next::EncodeError> {
2575 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2576 }
2577}
2578
2579unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ModeType
2580where
2581 ___E: ?Sized,
2582{
2583 #[inline]
2584 fn encode_ref(
2585 &self,
2586 _: &mut ___E,
2587 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2588 ) -> Result<(), ::fidl_next::EncodeError> {
2589 ::fidl_next::munge!(let WireModeType { value } = out);
2590 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
2591 Ok(())
2592 }
2593}
2594
2595impl ::core::convert::From<WireModeType> for ModeType {
2596 fn from(wire: WireModeType) -> Self {
2597 Self::from_bits_retain(u32::from(wire.value))
2598 }
2599}
2600
2601impl ::fidl_next::TakeFrom<WireModeType> for ModeType {
2602 #[inline]
2603 fn take_from(from: &WireModeType) -> Self {
2604 Self::from(*from)
2605 }
2606}
2607
2608#[derive(Clone, Copy, Debug)]
2610#[repr(transparent)]
2611pub struct WireModeType {
2612 value: ::fidl_next::WireU32,
2613}
2614
2615unsafe impl ::fidl_next::ZeroPadding for WireModeType {
2616 #[inline]
2617 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2618 }
2620}
2621
2622unsafe impl<___D> ::fidl_next::Decode<___D> for WireModeType
2623where
2624 ___D: ?Sized,
2625{
2626 fn decode(
2627 slot: ::fidl_next::Slot<'_, Self>,
2628 _: &mut ___D,
2629 ) -> Result<(), ::fidl_next::DecodeError> {
2630 ::fidl_next::munge!(let Self { value } = slot);
2631 let set = u32::from(*value);
2632 if set & !ModeType::all().bits() != 0 {
2633 return Err(::fidl_next::DecodeError::InvalidBits {
2634 expected: ModeType::all().bits() as usize,
2635 actual: set as usize,
2636 });
2637 }
2638
2639 Ok(())
2640 }
2641}
2642
2643impl ::core::convert::From<ModeType> for WireModeType {
2644 fn from(natural: ModeType) -> Self {
2645 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
2646 }
2647}
2648
2649#[doc = " The maximum length, in bytes, of a filesystem path.\n"]
2650pub const MAX_PATH_LENGTH: u64 = 4095;
2651
2652#[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"]
2653pub type Path = String;
2654
2655pub type WirePath = ::fidl_next::WireString;
2657
2658#[derive(Clone, Debug)]
2659#[repr(C)]
2660pub struct DirectoryReadDirentsRequest {
2661 pub max_bytes: u64,
2662}
2663
2664impl ::fidl_next::Encodable for DirectoryReadDirentsRequest {
2665 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2666 ::fidl_next::CopyOptimization::enable_if(
2667 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2668 )
2669 };
2670
2671 type Encoded = WireDirectoryReadDirentsRequest;
2672}
2673
2674unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsRequest
2675where
2676 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2677{
2678 #[inline]
2679 fn encode(
2680 self,
2681 encoder: &mut ___E,
2682 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2683 ) -> Result<(), ::fidl_next::EncodeError> {
2684 ::fidl_next::munge! {
2685 let Self::Encoded {
2686 max_bytes,
2687
2688 } = out;
2689 }
2690
2691 ::fidl_next::Encode::encode(self.max_bytes, encoder, max_bytes)?;
2692
2693 Ok(())
2694 }
2695}
2696
2697unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsRequest
2698where
2699 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2700{
2701 #[inline]
2702 fn encode_ref(
2703 &self,
2704 encoder: &mut ___E,
2705 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2706 ) -> Result<(), ::fidl_next::EncodeError> {
2707 ::fidl_next::munge! {
2708 let Self::Encoded {
2709 max_bytes,
2710
2711 } = out;
2712 }
2713
2714 ::fidl_next::EncodeRef::encode_ref(&self.max_bytes, encoder, max_bytes)?;
2715
2716 Ok(())
2717 }
2718}
2719
2720impl ::fidl_next::EncodableOption for Box<DirectoryReadDirentsRequest> {
2721 type EncodedOption = ::fidl_next::WireBox<WireDirectoryReadDirentsRequest>;
2722}
2723
2724unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryReadDirentsRequest>
2725where
2726 ___E: ::fidl_next::Encoder + ?Sized,
2727 DirectoryReadDirentsRequest: ::fidl_next::Encode<___E>,
2728{
2729 #[inline]
2730 fn encode_option(
2731 this: Option<Self>,
2732 encoder: &mut ___E,
2733 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2734 ) -> Result<(), ::fidl_next::EncodeError> {
2735 if let Some(inner) = this {
2736 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2737 ::fidl_next::WireBox::encode_present(out);
2738 } else {
2739 ::fidl_next::WireBox::encode_absent(out);
2740 }
2741
2742 Ok(())
2743 }
2744}
2745
2746unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryReadDirentsRequest>
2747where
2748 ___E: ::fidl_next::Encoder + ?Sized,
2749 DirectoryReadDirentsRequest: ::fidl_next::EncodeRef<___E>,
2750{
2751 #[inline]
2752 fn encode_option_ref(
2753 this: Option<&Self>,
2754 encoder: &mut ___E,
2755 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2756 ) -> Result<(), ::fidl_next::EncodeError> {
2757 if let Some(inner) = this {
2758 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2759 ::fidl_next::WireBox::encode_present(out);
2760 } else {
2761 ::fidl_next::WireBox::encode_absent(out);
2762 }
2763
2764 Ok(())
2765 }
2766}
2767
2768impl ::fidl_next::TakeFrom<WireDirectoryReadDirentsRequest> for DirectoryReadDirentsRequest {
2769 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
2770 ::fidl_next::CopyOptimization::enable_if(
2771 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2772 )
2773 };
2774
2775 #[inline]
2776 fn take_from(from: &WireDirectoryReadDirentsRequest) -> Self {
2777 Self { max_bytes: ::fidl_next::TakeFrom::take_from(&from.max_bytes) }
2778 }
2779}
2780
2781#[derive(Clone, Debug)]
2783#[repr(C)]
2784pub struct WireDirectoryReadDirentsRequest {
2785 pub max_bytes: ::fidl_next::WireU64,
2786}
2787
2788unsafe impl ::fidl_next::ZeroPadding for WireDirectoryReadDirentsRequest {
2789 #[inline]
2790 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2791}
2792
2793unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsRequest
2794where
2795 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2796{
2797 fn decode(
2798 slot: ::fidl_next::Slot<'_, Self>,
2799 decoder: &mut ___D,
2800 ) -> Result<(), ::fidl_next::DecodeError> {
2801 ::fidl_next::munge! {
2802 let Self {
2803 mut max_bytes,
2804
2805 } = slot;
2806 }
2807
2808 ::fidl_next::Decode::decode(max_bytes.as_mut(), decoder)?;
2809
2810 Ok(())
2811 }
2812}
2813
2814#[doc = " The maximal buffer size which can be transmitted for buffered operations.\n This capacity is currently set somewhat arbitrarily.\n"]
2815pub const MAX_BUF: u64 = 8192;
2816
2817#[derive(Clone, Debug)]
2818pub struct DirectoryReadDirentsResponse {
2819 pub s: i32,
2820
2821 pub dirents: Vec<u8>,
2822}
2823
2824impl ::fidl_next::Encodable for DirectoryReadDirentsResponse {
2825 type Encoded = WireDirectoryReadDirentsResponse;
2826}
2827
2828unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadDirentsResponse
2829where
2830 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2831
2832 ___E: ::fidl_next::Encoder,
2833{
2834 #[inline]
2835 fn encode(
2836 self,
2837 encoder: &mut ___E,
2838 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2839 ) -> Result<(), ::fidl_next::EncodeError> {
2840 ::fidl_next::munge! {
2841 let Self::Encoded {
2842 s,
2843 dirents,
2844
2845 } = out;
2846 }
2847
2848 ::fidl_next::Encode::encode(self.s, encoder, s)?;
2849
2850 ::fidl_next::Encode::encode(self.dirents, encoder, dirents)?;
2851
2852 Ok(())
2853 }
2854}
2855
2856unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryReadDirentsResponse
2857where
2858 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2859
2860 ___E: ::fidl_next::Encoder,
2861{
2862 #[inline]
2863 fn encode_ref(
2864 &self,
2865 encoder: &mut ___E,
2866 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2867 ) -> Result<(), ::fidl_next::EncodeError> {
2868 ::fidl_next::munge! {
2869 let Self::Encoded {
2870 s,
2871 dirents,
2872
2873 } = out;
2874 }
2875
2876 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
2877
2878 ::fidl_next::EncodeRef::encode_ref(&self.dirents, encoder, dirents)?;
2879
2880 Ok(())
2881 }
2882}
2883
2884impl ::fidl_next::EncodableOption for Box<DirectoryReadDirentsResponse> {
2885 type EncodedOption = ::fidl_next::WireBox<WireDirectoryReadDirentsResponse>;
2886}
2887
2888unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryReadDirentsResponse>
2889where
2890 ___E: ::fidl_next::Encoder + ?Sized,
2891 DirectoryReadDirentsResponse: ::fidl_next::Encode<___E>,
2892{
2893 #[inline]
2894 fn encode_option(
2895 this: Option<Self>,
2896 encoder: &mut ___E,
2897 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2898 ) -> Result<(), ::fidl_next::EncodeError> {
2899 if let Some(inner) = this {
2900 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
2901 ::fidl_next::WireBox::encode_present(out);
2902 } else {
2903 ::fidl_next::WireBox::encode_absent(out);
2904 }
2905
2906 Ok(())
2907 }
2908}
2909
2910unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryReadDirentsResponse>
2911where
2912 ___E: ::fidl_next::Encoder + ?Sized,
2913 DirectoryReadDirentsResponse: ::fidl_next::EncodeRef<___E>,
2914{
2915 #[inline]
2916 fn encode_option_ref(
2917 this: Option<&Self>,
2918 encoder: &mut ___E,
2919 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2920 ) -> Result<(), ::fidl_next::EncodeError> {
2921 if let Some(inner) = this {
2922 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2923 ::fidl_next::WireBox::encode_present(out);
2924 } else {
2925 ::fidl_next::WireBox::encode_absent(out);
2926 }
2927
2928 Ok(())
2929 }
2930}
2931
2932impl ::fidl_next::TakeFrom<WireDirectoryReadDirentsResponse> for DirectoryReadDirentsResponse {
2933 #[inline]
2934 fn take_from(from: &WireDirectoryReadDirentsResponse) -> Self {
2935 Self {
2936 s: ::fidl_next::TakeFrom::take_from(&from.s),
2937
2938 dirents: ::fidl_next::TakeFrom::take_from(&from.dirents),
2939 }
2940 }
2941}
2942
2943#[derive(Debug)]
2945#[repr(C)]
2946pub struct WireDirectoryReadDirentsResponse {
2947 pub s: ::fidl_next::WireI32,
2948
2949 pub dirents: ::fidl_next::WireVector<u8>,
2950}
2951
2952unsafe impl ::fidl_next::ZeroPadding for WireDirectoryReadDirentsResponse {
2953 #[inline]
2954 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2955 unsafe {
2956 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2957 }
2958 }
2959}
2960
2961unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadDirentsResponse
2962where
2963 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2964
2965 ___D: ::fidl_next::Decoder,
2966{
2967 fn decode(
2968 slot: ::fidl_next::Slot<'_, Self>,
2969 decoder: &mut ___D,
2970 ) -> Result<(), ::fidl_next::DecodeError> {
2971 ::fidl_next::munge! {
2972 let Self {
2973 mut s,
2974 mut dirents,
2975
2976 } = slot;
2977 }
2978
2979 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
2980
2981 ::fidl_next::Decode::decode(dirents.as_mut(), decoder)?;
2982
2983 let dirents = unsafe { dirents.deref_unchecked() };
2984
2985 if dirents.len() > 8192 {
2986 return Err(::fidl_next::DecodeError::VectorTooLong {
2987 size: dirents.len() as u64,
2988 limit: 8192,
2989 });
2990 }
2991
2992 Ok(())
2993 }
2994}
2995
2996#[derive(Clone, Debug)]
2997#[repr(C)]
2998pub struct DirectoryRewindResponse {
2999 pub s: i32,
3000}
3001
3002impl ::fidl_next::Encodable for DirectoryRewindResponse {
3003 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3004 ::fidl_next::CopyOptimization::enable_if(
3005 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3006 )
3007 };
3008
3009 type Encoded = WireDirectoryRewindResponse;
3010}
3011
3012unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRewindResponse
3013where
3014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3015{
3016 #[inline]
3017 fn encode(
3018 self,
3019 encoder: &mut ___E,
3020 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3021 ) -> Result<(), ::fidl_next::EncodeError> {
3022 ::fidl_next::munge! {
3023 let Self::Encoded {
3024 s,
3025
3026 } = out;
3027 }
3028
3029 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3030
3031 Ok(())
3032 }
3033}
3034
3035unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryRewindResponse
3036where
3037 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3038{
3039 #[inline]
3040 fn encode_ref(
3041 &self,
3042 encoder: &mut ___E,
3043 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3044 ) -> Result<(), ::fidl_next::EncodeError> {
3045 ::fidl_next::munge! {
3046 let Self::Encoded {
3047 s,
3048
3049 } = out;
3050 }
3051
3052 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
3053
3054 Ok(())
3055 }
3056}
3057
3058impl ::fidl_next::EncodableOption for Box<DirectoryRewindResponse> {
3059 type EncodedOption = ::fidl_next::WireBox<WireDirectoryRewindResponse>;
3060}
3061
3062unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryRewindResponse>
3063where
3064 ___E: ::fidl_next::Encoder + ?Sized,
3065 DirectoryRewindResponse: ::fidl_next::Encode<___E>,
3066{
3067 #[inline]
3068 fn encode_option(
3069 this: Option<Self>,
3070 encoder: &mut ___E,
3071 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3072 ) -> Result<(), ::fidl_next::EncodeError> {
3073 if let Some(inner) = this {
3074 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
3075 ::fidl_next::WireBox::encode_present(out);
3076 } else {
3077 ::fidl_next::WireBox::encode_absent(out);
3078 }
3079
3080 Ok(())
3081 }
3082}
3083
3084unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryRewindResponse>
3085where
3086 ___E: ::fidl_next::Encoder + ?Sized,
3087 DirectoryRewindResponse: ::fidl_next::EncodeRef<___E>,
3088{
3089 #[inline]
3090 fn encode_option_ref(
3091 this: Option<&Self>,
3092 encoder: &mut ___E,
3093 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3094 ) -> Result<(), ::fidl_next::EncodeError> {
3095 if let Some(inner) = this {
3096 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3097 ::fidl_next::WireBox::encode_present(out);
3098 } else {
3099 ::fidl_next::WireBox::encode_absent(out);
3100 }
3101
3102 Ok(())
3103 }
3104}
3105
3106impl ::fidl_next::TakeFrom<WireDirectoryRewindResponse> for DirectoryRewindResponse {
3107 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3108 ::fidl_next::CopyOptimization::enable_if(
3109 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3110 )
3111 };
3112
3113 #[inline]
3114 fn take_from(from: &WireDirectoryRewindResponse) -> Self {
3115 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
3116 }
3117}
3118
3119#[derive(Clone, Debug)]
3121#[repr(C)]
3122pub struct WireDirectoryRewindResponse {
3123 pub s: ::fidl_next::WireI32,
3124}
3125
3126unsafe impl ::fidl_next::ZeroPadding for WireDirectoryRewindResponse {
3127 #[inline]
3128 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3129}
3130
3131unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRewindResponse
3132where
3133 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3134{
3135 fn decode(
3136 slot: ::fidl_next::Slot<'_, Self>,
3137 decoder: &mut ___D,
3138 ) -> Result<(), ::fidl_next::DecodeError> {
3139 ::fidl_next::munge! {
3140 let Self {
3141 mut s,
3142
3143 } = slot;
3144 }
3145
3146 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3147
3148 Ok(())
3149 }
3150}
3151
3152#[derive(Debug)]
3153#[repr(C)]
3154pub struct DirectoryGetTokenResponse {
3155 pub s: i32,
3156
3157 pub token: Option<::fidl_next::fuchsia::zx::Handle>,
3158}
3159
3160impl ::fidl_next::Encodable for DirectoryGetTokenResponse {
3161 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3162 ::fidl_next::CopyOptimization::enable_if(
3163 true
3164
3165 && <
3166 i32 as ::fidl_next::Encodable
3167 >::COPY_OPTIMIZATION.is_enabled()
3168
3169 && <
3170 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
3171 >::COPY_OPTIMIZATION.is_enabled()
3172
3173 )
3174 };
3175
3176 type Encoded = WireDirectoryGetTokenResponse;
3177}
3178
3179unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryGetTokenResponse
3180where
3181 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3182
3183 ___E: ::fidl_next::fuchsia::HandleEncoder,
3184{
3185 #[inline]
3186 fn encode(
3187 self,
3188 encoder: &mut ___E,
3189 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3190 ) -> Result<(), ::fidl_next::EncodeError> {
3191 ::fidl_next::munge! {
3192 let Self::Encoded {
3193 s,
3194 token,
3195
3196 } = out;
3197 }
3198
3199 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3200
3201 ::fidl_next::Encode::encode(self.token, encoder, token)?;
3202
3203 Ok(())
3204 }
3205}
3206
3207impl ::fidl_next::EncodableOption for Box<DirectoryGetTokenResponse> {
3208 type EncodedOption = ::fidl_next::WireBox<WireDirectoryGetTokenResponse>;
3209}
3210
3211unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryGetTokenResponse>
3212where
3213 ___E: ::fidl_next::Encoder + ?Sized,
3214 DirectoryGetTokenResponse: ::fidl_next::Encode<___E>,
3215{
3216 #[inline]
3217 fn encode_option(
3218 this: Option<Self>,
3219 encoder: &mut ___E,
3220 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3221 ) -> Result<(), ::fidl_next::EncodeError> {
3222 if let Some(inner) = this {
3223 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
3224 ::fidl_next::WireBox::encode_present(out);
3225 } else {
3226 ::fidl_next::WireBox::encode_absent(out);
3227 }
3228
3229 Ok(())
3230 }
3231}
3232
3233impl ::fidl_next::TakeFrom<WireDirectoryGetTokenResponse> for DirectoryGetTokenResponse {
3234 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3235 ::fidl_next::CopyOptimization::enable_if(
3236 true
3237
3238 && <
3239 i32 as ::fidl_next::Encodable
3240 >::COPY_OPTIMIZATION.is_enabled()
3241
3242 && <
3243 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
3244 >::COPY_OPTIMIZATION.is_enabled()
3245
3246 )
3247 };
3248
3249 #[inline]
3250 fn take_from(from: &WireDirectoryGetTokenResponse) -> Self {
3251 Self {
3252 s: ::fidl_next::TakeFrom::take_from(&from.s),
3253
3254 token: ::fidl_next::TakeFrom::take_from(&from.token),
3255 }
3256 }
3257}
3258
3259#[derive(Debug)]
3261#[repr(C)]
3262pub struct WireDirectoryGetTokenResponse {
3263 pub s: ::fidl_next::WireI32,
3264
3265 pub token: ::fidl_next::fuchsia::WireOptionalHandle,
3266}
3267
3268unsafe impl ::fidl_next::ZeroPadding for WireDirectoryGetTokenResponse {
3269 #[inline]
3270 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3271}
3272
3273unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryGetTokenResponse
3274where
3275 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3276
3277 ___D: ::fidl_next::fuchsia::HandleDecoder,
3278{
3279 fn decode(
3280 slot: ::fidl_next::Slot<'_, Self>,
3281 decoder: &mut ___D,
3282 ) -> Result<(), ::fidl_next::DecodeError> {
3283 ::fidl_next::munge! {
3284 let Self {
3285 mut s,
3286 mut token,
3287
3288 } = slot;
3289 }
3290
3291 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3292
3293 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
3294
3295 Ok(())
3296 }
3297}
3298
3299#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
3300pub const MAX_NAME_LENGTH: u64 = 255;
3301
3302#[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"]
3303pub type Name = String;
3304
3305pub type WireName = ::fidl_next::WireString;
3307
3308#[derive(Debug)]
3309pub struct DirectoryLinkRequest {
3310 pub src: String,
3311
3312 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
3313
3314 pub dst: String,
3315}
3316
3317impl ::fidl_next::Encodable for DirectoryLinkRequest {
3318 type Encoded = WireDirectoryLinkRequest;
3319}
3320
3321unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkRequest
3322where
3323 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3324
3325 ___E: ::fidl_next::Encoder,
3326
3327 ___E: ::fidl_next::fuchsia::HandleEncoder,
3328{
3329 #[inline]
3330 fn encode(
3331 self,
3332 encoder: &mut ___E,
3333 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3334 ) -> Result<(), ::fidl_next::EncodeError> {
3335 ::fidl_next::munge! {
3336 let Self::Encoded {
3337 src,
3338 dst_parent_token,
3339 dst,
3340
3341 } = out;
3342 }
3343
3344 ::fidl_next::Encode::encode(self.src, encoder, src)?;
3345
3346 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
3347
3348 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
3349
3350 Ok(())
3351 }
3352}
3353
3354impl ::fidl_next::EncodableOption for Box<DirectoryLinkRequest> {
3355 type EncodedOption = ::fidl_next::WireBox<WireDirectoryLinkRequest>;
3356}
3357
3358unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryLinkRequest>
3359where
3360 ___E: ::fidl_next::Encoder + ?Sized,
3361 DirectoryLinkRequest: ::fidl_next::Encode<___E>,
3362{
3363 #[inline]
3364 fn encode_option(
3365 this: Option<Self>,
3366 encoder: &mut ___E,
3367 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3368 ) -> Result<(), ::fidl_next::EncodeError> {
3369 if let Some(inner) = this {
3370 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
3371 ::fidl_next::WireBox::encode_present(out);
3372 } else {
3373 ::fidl_next::WireBox::encode_absent(out);
3374 }
3375
3376 Ok(())
3377 }
3378}
3379
3380impl ::fidl_next::TakeFrom<WireDirectoryLinkRequest> for DirectoryLinkRequest {
3381 #[inline]
3382 fn take_from(from: &WireDirectoryLinkRequest) -> Self {
3383 Self {
3384 src: ::fidl_next::TakeFrom::take_from(&from.src),
3385
3386 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
3387
3388 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
3389 }
3390 }
3391}
3392
3393#[derive(Debug)]
3395#[repr(C)]
3396pub struct WireDirectoryLinkRequest {
3397 pub src: ::fidl_next::WireString,
3398
3399 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
3400
3401 pub dst: ::fidl_next::WireString,
3402}
3403
3404unsafe impl ::fidl_next::ZeroPadding for WireDirectoryLinkRequest {
3405 #[inline]
3406 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3407 unsafe {
3408 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
3409 }
3410 }
3411}
3412
3413unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkRequest
3414where
3415 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3416
3417 ___D: ::fidl_next::Decoder,
3418
3419 ___D: ::fidl_next::fuchsia::HandleDecoder,
3420{
3421 fn decode(
3422 slot: ::fidl_next::Slot<'_, Self>,
3423 decoder: &mut ___D,
3424 ) -> Result<(), ::fidl_next::DecodeError> {
3425 ::fidl_next::munge! {
3426 let Self {
3427 mut src,
3428 mut dst_parent_token,
3429 mut dst,
3430
3431 } = slot;
3432 }
3433
3434 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
3435
3436 let src = unsafe { src.deref_unchecked() };
3437
3438 if src.len() > 255 {
3439 return Err(::fidl_next::DecodeError::VectorTooLong {
3440 size: src.len() as u64,
3441 limit: 255,
3442 });
3443 }
3444
3445 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
3446
3447 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
3448
3449 let dst = unsafe { dst.deref_unchecked() };
3450
3451 if dst.len() > 255 {
3452 return Err(::fidl_next::DecodeError::VectorTooLong {
3453 size: dst.len() as u64,
3454 limit: 255,
3455 });
3456 }
3457
3458 Ok(())
3459 }
3460}
3461
3462#[derive(Clone, Debug)]
3463#[repr(C)]
3464pub struct DirectoryLinkResponse {
3465 pub s: i32,
3466}
3467
3468impl ::fidl_next::Encodable for DirectoryLinkResponse {
3469 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3470 ::fidl_next::CopyOptimization::enable_if(
3471 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3472 )
3473 };
3474
3475 type Encoded = WireDirectoryLinkResponse;
3476}
3477
3478unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryLinkResponse
3479where
3480 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3481{
3482 #[inline]
3483 fn encode(
3484 self,
3485 encoder: &mut ___E,
3486 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3487 ) -> Result<(), ::fidl_next::EncodeError> {
3488 ::fidl_next::munge! {
3489 let Self::Encoded {
3490 s,
3491
3492 } = out;
3493 }
3494
3495 ::fidl_next::Encode::encode(self.s, encoder, s)?;
3496
3497 Ok(())
3498 }
3499}
3500
3501unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryLinkResponse
3502where
3503 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3504{
3505 #[inline]
3506 fn encode_ref(
3507 &self,
3508 encoder: &mut ___E,
3509 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3510 ) -> Result<(), ::fidl_next::EncodeError> {
3511 ::fidl_next::munge! {
3512 let Self::Encoded {
3513 s,
3514
3515 } = out;
3516 }
3517
3518 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
3519
3520 Ok(())
3521 }
3522}
3523
3524impl ::fidl_next::EncodableOption for Box<DirectoryLinkResponse> {
3525 type EncodedOption = ::fidl_next::WireBox<WireDirectoryLinkResponse>;
3526}
3527
3528unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryLinkResponse>
3529where
3530 ___E: ::fidl_next::Encoder + ?Sized,
3531 DirectoryLinkResponse: ::fidl_next::Encode<___E>,
3532{
3533 #[inline]
3534 fn encode_option(
3535 this: Option<Self>,
3536 encoder: &mut ___E,
3537 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3538 ) -> Result<(), ::fidl_next::EncodeError> {
3539 if let Some(inner) = this {
3540 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
3541 ::fidl_next::WireBox::encode_present(out);
3542 } else {
3543 ::fidl_next::WireBox::encode_absent(out);
3544 }
3545
3546 Ok(())
3547 }
3548}
3549
3550unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryLinkResponse>
3551where
3552 ___E: ::fidl_next::Encoder + ?Sized,
3553 DirectoryLinkResponse: ::fidl_next::EncodeRef<___E>,
3554{
3555 #[inline]
3556 fn encode_option_ref(
3557 this: Option<&Self>,
3558 encoder: &mut ___E,
3559 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3560 ) -> Result<(), ::fidl_next::EncodeError> {
3561 if let Some(inner) = this {
3562 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3563 ::fidl_next::WireBox::encode_present(out);
3564 } else {
3565 ::fidl_next::WireBox::encode_absent(out);
3566 }
3567
3568 Ok(())
3569 }
3570}
3571
3572impl ::fidl_next::TakeFrom<WireDirectoryLinkResponse> for DirectoryLinkResponse {
3573 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
3574 ::fidl_next::CopyOptimization::enable_if(
3575 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3576 )
3577 };
3578
3579 #[inline]
3580 fn take_from(from: &WireDirectoryLinkResponse) -> Self {
3581 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
3582 }
3583}
3584
3585#[derive(Clone, Debug)]
3587#[repr(C)]
3588pub struct WireDirectoryLinkResponse {
3589 pub s: ::fidl_next::WireI32,
3590}
3591
3592unsafe impl ::fidl_next::ZeroPadding for WireDirectoryLinkResponse {
3593 #[inline]
3594 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3595}
3596
3597unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryLinkResponse
3598where
3599 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3600{
3601 fn decode(
3602 slot: ::fidl_next::Slot<'_, Self>,
3603 decoder: &mut ___D,
3604 ) -> Result<(), ::fidl_next::DecodeError> {
3605 ::fidl_next::munge! {
3606 let Self {
3607 mut s,
3608
3609 } = slot;
3610 }
3611
3612 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
3613
3614 Ok(())
3615 }
3616}
3617
3618::fidl_next::bitflags! {
3619 #[derive(
3620 Clone,
3621 Copy,
3622 Debug,
3623 PartialEq,
3624 Eq,
3625 Hash,
3626 )]
3627 pub struct UnlinkFlags: u64 {
3628 #[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;
3629 const _ = !0;
3630 }
3631}
3632
3633impl ::fidl_next::Encodable for UnlinkFlags {
3634 type Encoded = WireUnlinkFlags;
3635}
3636
3637unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkFlags
3638where
3639 ___E: ?Sized,
3640{
3641 #[inline]
3642 fn encode(
3643 self,
3644 encoder: &mut ___E,
3645 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3646 ) -> Result<(), ::fidl_next::EncodeError> {
3647 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
3648 }
3649}
3650
3651unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkFlags
3652where
3653 ___E: ?Sized,
3654{
3655 #[inline]
3656 fn encode_ref(
3657 &self,
3658 _: &mut ___E,
3659 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3660 ) -> Result<(), ::fidl_next::EncodeError> {
3661 ::fidl_next::munge!(let WireUnlinkFlags { value } = out);
3662 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
3663 Ok(())
3664 }
3665}
3666
3667impl ::core::convert::From<WireUnlinkFlags> for UnlinkFlags {
3668 fn from(wire: WireUnlinkFlags) -> Self {
3669 Self::from_bits_retain(u64::from(wire.value))
3670 }
3671}
3672
3673impl ::fidl_next::TakeFrom<WireUnlinkFlags> for UnlinkFlags {
3674 #[inline]
3675 fn take_from(from: &WireUnlinkFlags) -> Self {
3676 Self::from(*from)
3677 }
3678}
3679
3680#[derive(Clone, Copy, Debug)]
3682#[repr(transparent)]
3683pub struct WireUnlinkFlags {
3684 value: ::fidl_next::WireU64,
3685}
3686
3687unsafe impl ::fidl_next::ZeroPadding for WireUnlinkFlags {
3688 #[inline]
3689 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3690 }
3692}
3693
3694unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkFlags
3695where
3696 ___D: ?Sized,
3697{
3698 fn decode(
3699 slot: ::fidl_next::Slot<'_, Self>,
3700 _: &mut ___D,
3701 ) -> Result<(), ::fidl_next::DecodeError> {
3702 Ok(())
3703 }
3704}
3705
3706impl ::core::convert::From<UnlinkFlags> for WireUnlinkFlags {
3707 fn from(natural: UnlinkFlags) -> Self {
3708 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
3709 }
3710}
3711
3712#[derive(Clone, Debug, Default)]
3713pub struct UnlinkOptions {
3714 pub flags: Option<crate::UnlinkFlags>,
3715}
3716
3717impl UnlinkOptions {
3718 fn __max_ordinal(&self) -> usize {
3719 if self.flags.is_some() {
3720 return 1;
3721 }
3722
3723 0
3724 }
3725}
3726
3727impl ::fidl_next::Encodable for UnlinkOptions {
3728 type Encoded = WireUnlinkOptions;
3729}
3730
3731unsafe impl<___E> ::fidl_next::Encode<___E> for UnlinkOptions
3732where
3733 ___E: ::fidl_next::Encoder + ?Sized,
3734{
3735 #[inline]
3736 fn encode(
3737 mut self,
3738 encoder: &mut ___E,
3739 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3740 ) -> Result<(), ::fidl_next::EncodeError> {
3741 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3742
3743 let max_ord = self.__max_ordinal();
3744
3745 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3746 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3747
3748 let mut preallocated =
3749 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3750
3751 for i in 1..=max_ord {
3752 match i {
3753 1 => {
3754 if let Some(flags) = self.flags.take() {
3755 ::fidl_next::WireEnvelope::encode_value(
3756 flags,
3757 preallocated.encoder,
3758 &mut out,
3759 )?;
3760 } else {
3761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3762 }
3763 }
3764
3765 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3766 }
3767 unsafe {
3768 preallocated.write_next(out.assume_init_ref());
3769 }
3770 }
3771
3772 ::fidl_next::WireTable::encode_len(table, max_ord);
3773
3774 Ok(())
3775 }
3776}
3777
3778unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnlinkOptions
3779where
3780 ___E: ::fidl_next::Encoder + ?Sized,
3781{
3782 #[inline]
3783 fn encode_ref(
3784 &self,
3785 encoder: &mut ___E,
3786 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3787 ) -> Result<(), ::fidl_next::EncodeError> {
3788 ::fidl_next::munge!(let WireUnlinkOptions { table } = out);
3789
3790 let max_ord = self.__max_ordinal();
3791
3792 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3793 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3794
3795 let mut preallocated =
3796 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3797
3798 for i in 1..=max_ord {
3799 match i {
3800 1 => {
3801 if let Some(flags) = &self.flags {
3802 ::fidl_next::WireEnvelope::encode_value(
3803 flags,
3804 preallocated.encoder,
3805 &mut out,
3806 )?;
3807 } else {
3808 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3809 }
3810 }
3811
3812 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3813 }
3814 unsafe {
3815 preallocated.write_next(out.assume_init_ref());
3816 }
3817 }
3818
3819 ::fidl_next::WireTable::encode_len(table, max_ord);
3820
3821 Ok(())
3822 }
3823}
3824
3825impl ::fidl_next::TakeFrom<WireUnlinkOptions> for UnlinkOptions {
3826 #[inline]
3827 fn take_from(from: &WireUnlinkOptions) -> Self {
3828 Self { flags: from.flags().map(::fidl_next::TakeFrom::take_from) }
3829 }
3830}
3831
3832#[repr(C)]
3834pub struct WireUnlinkOptions {
3835 table: ::fidl_next::WireTable,
3836}
3837
3838unsafe impl ::fidl_next::ZeroPadding for WireUnlinkOptions {
3839 #[inline]
3840 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3841 ::fidl_next::munge!(let Self { table } = out);
3842 ::fidl_next::WireTable::zero_padding(table);
3843 }
3844}
3845
3846unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnlinkOptions
3847where
3848 ___D: ::fidl_next::Decoder + ?Sized,
3849{
3850 fn decode(
3851 slot: ::fidl_next::Slot<'_, Self>,
3852 decoder: &mut ___D,
3853 ) -> Result<(), ::fidl_next::DecodeError> {
3854 ::fidl_next::munge!(let Self { table } = slot);
3855
3856 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3857 match ordinal {
3858 0 => unsafe { ::core::hint::unreachable_unchecked() },
3859
3860 1 => {
3861 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireUnlinkFlags>(
3862 slot.as_mut(),
3863 decoder,
3864 )?;
3865
3866 Ok(())
3867 }
3868
3869 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3870 }
3871 })
3872 }
3873}
3874
3875impl WireUnlinkOptions {
3876 pub fn flags(&self) -> Option<&crate::WireUnlinkFlags> {
3877 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3878 }
3879}
3880
3881impl ::core::fmt::Debug for WireUnlinkOptions {
3882 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3883 f.debug_struct("UnlinkOptions").field("flags", &self.flags()).finish()
3884 }
3885}
3886
3887#[derive(Clone, Debug)]
3888pub struct DirectoryUnlinkRequest {
3889 pub name: String,
3890
3891 pub options: crate::UnlinkOptions,
3892}
3893
3894impl ::fidl_next::Encodable for DirectoryUnlinkRequest {
3895 type Encoded = WireDirectoryUnlinkRequest;
3896}
3897
3898unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryUnlinkRequest
3899where
3900 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3901
3902 ___E: ::fidl_next::Encoder,
3903{
3904 #[inline]
3905 fn encode(
3906 self,
3907 encoder: &mut ___E,
3908 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3909 ) -> Result<(), ::fidl_next::EncodeError> {
3910 ::fidl_next::munge! {
3911 let Self::Encoded {
3912 name,
3913 options,
3914
3915 } = out;
3916 }
3917
3918 ::fidl_next::Encode::encode(self.name, encoder, name)?;
3919
3920 ::fidl_next::Encode::encode(self.options, encoder, options)?;
3921
3922 Ok(())
3923 }
3924}
3925
3926unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryUnlinkRequest
3927where
3928 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3929
3930 ___E: ::fidl_next::Encoder,
3931{
3932 #[inline]
3933 fn encode_ref(
3934 &self,
3935 encoder: &mut ___E,
3936 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3937 ) -> Result<(), ::fidl_next::EncodeError> {
3938 ::fidl_next::munge! {
3939 let Self::Encoded {
3940 name,
3941 options,
3942
3943 } = out;
3944 }
3945
3946 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
3947
3948 ::fidl_next::EncodeRef::encode_ref(&self.options, encoder, options)?;
3949
3950 Ok(())
3951 }
3952}
3953
3954impl ::fidl_next::EncodableOption for Box<DirectoryUnlinkRequest> {
3955 type EncodedOption = ::fidl_next::WireBox<WireDirectoryUnlinkRequest>;
3956}
3957
3958unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryUnlinkRequest>
3959where
3960 ___E: ::fidl_next::Encoder + ?Sized,
3961 DirectoryUnlinkRequest: ::fidl_next::Encode<___E>,
3962{
3963 #[inline]
3964 fn encode_option(
3965 this: Option<Self>,
3966 encoder: &mut ___E,
3967 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3968 ) -> Result<(), ::fidl_next::EncodeError> {
3969 if let Some(inner) = this {
3970 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
3971 ::fidl_next::WireBox::encode_present(out);
3972 } else {
3973 ::fidl_next::WireBox::encode_absent(out);
3974 }
3975
3976 Ok(())
3977 }
3978}
3979
3980unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryUnlinkRequest>
3981where
3982 ___E: ::fidl_next::Encoder + ?Sized,
3983 DirectoryUnlinkRequest: ::fidl_next::EncodeRef<___E>,
3984{
3985 #[inline]
3986 fn encode_option_ref(
3987 this: Option<&Self>,
3988 encoder: &mut ___E,
3989 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3990 ) -> Result<(), ::fidl_next::EncodeError> {
3991 if let Some(inner) = this {
3992 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3993 ::fidl_next::WireBox::encode_present(out);
3994 } else {
3995 ::fidl_next::WireBox::encode_absent(out);
3996 }
3997
3998 Ok(())
3999 }
4000}
4001
4002impl ::fidl_next::TakeFrom<WireDirectoryUnlinkRequest> for DirectoryUnlinkRequest {
4003 #[inline]
4004 fn take_from(from: &WireDirectoryUnlinkRequest) -> Self {
4005 Self {
4006 name: ::fidl_next::TakeFrom::take_from(&from.name),
4007
4008 options: ::fidl_next::TakeFrom::take_from(&from.options),
4009 }
4010 }
4011}
4012
4013#[derive(Debug)]
4015#[repr(C)]
4016pub struct WireDirectoryUnlinkRequest {
4017 pub name: ::fidl_next::WireString,
4018
4019 pub options: crate::WireUnlinkOptions,
4020}
4021
4022unsafe impl ::fidl_next::ZeroPadding for WireDirectoryUnlinkRequest {
4023 #[inline]
4024 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4025}
4026
4027unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryUnlinkRequest
4028where
4029 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4030
4031 ___D: ::fidl_next::Decoder,
4032{
4033 fn decode(
4034 slot: ::fidl_next::Slot<'_, Self>,
4035 decoder: &mut ___D,
4036 ) -> Result<(), ::fidl_next::DecodeError> {
4037 ::fidl_next::munge! {
4038 let Self {
4039 mut name,
4040 mut options,
4041
4042 } = slot;
4043 }
4044
4045 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
4046
4047 let name = unsafe { name.deref_unchecked() };
4048
4049 if name.len() > 255 {
4050 return Err(::fidl_next::DecodeError::VectorTooLong {
4051 size: name.len() as u64,
4052 limit: 255,
4053 });
4054 }
4055
4056 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
4057
4058 Ok(())
4059 }
4060}
4061
4062pub type DirectoryUnlinkResponse = ();
4063
4064pub type WireDirectoryUnlinkResponse = ();
4066
4067#[doc = " The type to identify a connection to a node.\n It represents a capability: a reference to a node with associated rights.\n"]
4068pub type Token = ::fidl_next::fuchsia::zx::Handle;
4069
4070pub type WireToken = ::fidl_next::fuchsia::WireHandle;
4072
4073#[derive(Debug)]
4074pub struct DirectoryRenameRequest {
4075 pub src: String,
4076
4077 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
4078
4079 pub dst: String,
4080}
4081
4082impl ::fidl_next::Encodable for DirectoryRenameRequest {
4083 type Encoded = WireDirectoryRenameRequest;
4084}
4085
4086unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRenameRequest
4087where
4088 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4089
4090 ___E: ::fidl_next::Encoder,
4091
4092 ___E: ::fidl_next::fuchsia::HandleEncoder,
4093{
4094 #[inline]
4095 fn encode(
4096 self,
4097 encoder: &mut ___E,
4098 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4099 ) -> Result<(), ::fidl_next::EncodeError> {
4100 ::fidl_next::munge! {
4101 let Self::Encoded {
4102 src,
4103 dst_parent_token,
4104 dst,
4105
4106 } = out;
4107 }
4108
4109 ::fidl_next::Encode::encode(self.src, encoder, src)?;
4110
4111 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
4112
4113 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
4114
4115 Ok(())
4116 }
4117}
4118
4119impl ::fidl_next::EncodableOption for Box<DirectoryRenameRequest> {
4120 type EncodedOption = ::fidl_next::WireBox<WireDirectoryRenameRequest>;
4121}
4122
4123unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryRenameRequest>
4124where
4125 ___E: ::fidl_next::Encoder + ?Sized,
4126 DirectoryRenameRequest: ::fidl_next::Encode<___E>,
4127{
4128 #[inline]
4129 fn encode_option(
4130 this: Option<Self>,
4131 encoder: &mut ___E,
4132 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4133 ) -> Result<(), ::fidl_next::EncodeError> {
4134 if let Some(inner) = this {
4135 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4136 ::fidl_next::WireBox::encode_present(out);
4137 } else {
4138 ::fidl_next::WireBox::encode_absent(out);
4139 }
4140
4141 Ok(())
4142 }
4143}
4144
4145impl ::fidl_next::TakeFrom<WireDirectoryRenameRequest> for DirectoryRenameRequest {
4146 #[inline]
4147 fn take_from(from: &WireDirectoryRenameRequest) -> Self {
4148 Self {
4149 src: ::fidl_next::TakeFrom::take_from(&from.src),
4150
4151 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
4152
4153 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
4154 }
4155 }
4156}
4157
4158#[derive(Debug)]
4160#[repr(C)]
4161pub struct WireDirectoryRenameRequest {
4162 pub src: ::fidl_next::WireString,
4163
4164 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
4165
4166 pub dst: ::fidl_next::WireString,
4167}
4168
4169unsafe impl ::fidl_next::ZeroPadding for WireDirectoryRenameRequest {
4170 #[inline]
4171 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4172 unsafe {
4173 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
4174 }
4175 }
4176}
4177
4178unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRenameRequest
4179where
4180 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4181
4182 ___D: ::fidl_next::Decoder,
4183
4184 ___D: ::fidl_next::fuchsia::HandleDecoder,
4185{
4186 fn decode(
4187 slot: ::fidl_next::Slot<'_, Self>,
4188 decoder: &mut ___D,
4189 ) -> Result<(), ::fidl_next::DecodeError> {
4190 ::fidl_next::munge! {
4191 let Self {
4192 mut src,
4193 mut dst_parent_token,
4194 mut dst,
4195
4196 } = slot;
4197 }
4198
4199 ::fidl_next::Decode::decode(src.as_mut(), decoder)?;
4200
4201 let src = unsafe { src.deref_unchecked() };
4202
4203 if src.len() > 255 {
4204 return Err(::fidl_next::DecodeError::VectorTooLong {
4205 size: src.len() as u64,
4206 limit: 255,
4207 });
4208 }
4209
4210 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
4211
4212 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
4213
4214 let dst = unsafe { dst.deref_unchecked() };
4215
4216 if dst.len() > 255 {
4217 return Err(::fidl_next::DecodeError::VectorTooLong {
4218 size: dst.len() as u64,
4219 limit: 255,
4220 });
4221 }
4222
4223 Ok(())
4224 }
4225}
4226
4227pub type DirectoryRenameResponse = ();
4228
4229pub type WireDirectoryRenameResponse = ();
4231
4232::fidl_next::bitflags! {
4233 #[derive(
4234 Clone,
4235 Copy,
4236 Debug,
4237 PartialEq,
4238 Eq,
4239 Hash,
4240 )]
4241 pub struct WatchMask: u32 {
4242 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.\n"]const DELETED = 1;
4243 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.\n"]const ADDED = 2;
4244 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.\n"]const REMOVED = 4;
4245 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.\n"]const EXISTING = 8;
4246 #[doc = " Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.\n"]const IDLE = 16;
4247
4248 }
4249}
4250
4251impl ::fidl_next::Encodable for WatchMask {
4252 type Encoded = WireWatchMask;
4253}
4254
4255unsafe impl<___E> ::fidl_next::Encode<___E> for WatchMask
4256where
4257 ___E: ?Sized,
4258{
4259 #[inline]
4260 fn encode(
4261 self,
4262 encoder: &mut ___E,
4263 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4264 ) -> Result<(), ::fidl_next::EncodeError> {
4265 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
4266 }
4267}
4268
4269unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchMask
4270where
4271 ___E: ?Sized,
4272{
4273 #[inline]
4274 fn encode_ref(
4275 &self,
4276 _: &mut ___E,
4277 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4278 ) -> Result<(), ::fidl_next::EncodeError> {
4279 ::fidl_next::munge!(let WireWatchMask { value } = out);
4280 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
4281 Ok(())
4282 }
4283}
4284
4285impl ::core::convert::From<WireWatchMask> for WatchMask {
4286 fn from(wire: WireWatchMask) -> Self {
4287 Self::from_bits_retain(u32::from(wire.value))
4288 }
4289}
4290
4291impl ::fidl_next::TakeFrom<WireWatchMask> for WatchMask {
4292 #[inline]
4293 fn take_from(from: &WireWatchMask) -> Self {
4294 Self::from(*from)
4295 }
4296}
4297
4298#[derive(Clone, Copy, Debug)]
4300#[repr(transparent)]
4301pub struct WireWatchMask {
4302 value: ::fidl_next::WireU32,
4303}
4304
4305unsafe impl ::fidl_next::ZeroPadding for WireWatchMask {
4306 #[inline]
4307 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4308 }
4310}
4311
4312unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchMask
4313where
4314 ___D: ?Sized,
4315{
4316 fn decode(
4317 slot: ::fidl_next::Slot<'_, Self>,
4318 _: &mut ___D,
4319 ) -> Result<(), ::fidl_next::DecodeError> {
4320 ::fidl_next::munge!(let Self { value } = slot);
4321 let set = u32::from(*value);
4322 if set & !WatchMask::all().bits() != 0 {
4323 return Err(::fidl_next::DecodeError::InvalidBits {
4324 expected: WatchMask::all().bits() as usize,
4325 actual: set as usize,
4326 });
4327 }
4328
4329 Ok(())
4330 }
4331}
4332
4333impl ::core::convert::From<WatchMask> for WireWatchMask {
4334 fn from(natural: WatchMask) -> Self {
4335 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
4336 }
4337}
4338
4339#[derive(Debug)]
4340#[repr(C)]
4341pub struct DirectoryWatchRequest {
4342 pub mask: crate::WatchMask,
4343
4344 pub options: u32,
4345
4346 pub watcher: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::DirectoryWatcher>,
4347}
4348
4349impl ::fidl_next::Encodable for DirectoryWatchRequest {
4350 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4351 ::fidl_next::CopyOptimization::enable_if(
4352 true && <crate::WatchMask as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4353 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4354 && <::fidl_next::ServerEnd<
4355 ::fidl_next::fuchsia::zx::Channel,
4356 crate::DirectoryWatcher,
4357 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4358 .is_enabled(),
4359 )
4360 };
4361
4362 type Encoded = WireDirectoryWatchRequest;
4363}
4364
4365unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchRequest
4366where
4367 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4368
4369 ___E: ::fidl_next::fuchsia::HandleEncoder,
4370{
4371 #[inline]
4372 fn encode(
4373 self,
4374 encoder: &mut ___E,
4375 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4376 ) -> Result<(), ::fidl_next::EncodeError> {
4377 ::fidl_next::munge! {
4378 let Self::Encoded {
4379 mask,
4380 options,
4381 watcher,
4382
4383 } = out;
4384 }
4385
4386 ::fidl_next::Encode::encode(self.mask, encoder, mask)?;
4387
4388 ::fidl_next::Encode::encode(self.options, encoder, options)?;
4389
4390 ::fidl_next::Encode::encode(self.watcher, encoder, watcher)?;
4391
4392 Ok(())
4393 }
4394}
4395
4396impl ::fidl_next::EncodableOption for Box<DirectoryWatchRequest> {
4397 type EncodedOption = ::fidl_next::WireBox<WireDirectoryWatchRequest>;
4398}
4399
4400unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryWatchRequest>
4401where
4402 ___E: ::fidl_next::Encoder + ?Sized,
4403 DirectoryWatchRequest: ::fidl_next::Encode<___E>,
4404{
4405 #[inline]
4406 fn encode_option(
4407 this: Option<Self>,
4408 encoder: &mut ___E,
4409 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4410 ) -> Result<(), ::fidl_next::EncodeError> {
4411 if let Some(inner) = this {
4412 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4413 ::fidl_next::WireBox::encode_present(out);
4414 } else {
4415 ::fidl_next::WireBox::encode_absent(out);
4416 }
4417
4418 Ok(())
4419 }
4420}
4421
4422impl ::fidl_next::TakeFrom<WireDirectoryWatchRequest> for DirectoryWatchRequest {
4423 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4424 ::fidl_next::CopyOptimization::enable_if(
4425 true && <crate::WatchMask as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4426 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4427 && <::fidl_next::ServerEnd<
4428 ::fidl_next::fuchsia::zx::Channel,
4429 crate::DirectoryWatcher,
4430 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4431 .is_enabled(),
4432 )
4433 };
4434
4435 #[inline]
4436 fn take_from(from: &WireDirectoryWatchRequest) -> Self {
4437 Self {
4438 mask: ::fidl_next::TakeFrom::take_from(&from.mask),
4439
4440 options: ::fidl_next::TakeFrom::take_from(&from.options),
4441
4442 watcher: ::fidl_next::TakeFrom::take_from(&from.watcher),
4443 }
4444 }
4445}
4446
4447#[derive(Debug)]
4449#[repr(C)]
4450pub struct WireDirectoryWatchRequest {
4451 pub mask: crate::WireWatchMask,
4452
4453 pub options: ::fidl_next::WireU32,
4454
4455 pub watcher: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::DirectoryWatcher>,
4456}
4457
4458unsafe impl ::fidl_next::ZeroPadding for WireDirectoryWatchRequest {
4459 #[inline]
4460 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4461}
4462
4463unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchRequest
4464where
4465 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4466
4467 ___D: ::fidl_next::fuchsia::HandleDecoder,
4468{
4469 fn decode(
4470 slot: ::fidl_next::Slot<'_, Self>,
4471 decoder: &mut ___D,
4472 ) -> Result<(), ::fidl_next::DecodeError> {
4473 ::fidl_next::munge! {
4474 let Self {
4475 mut mask,
4476 mut options,
4477 mut watcher,
4478
4479 } = slot;
4480 }
4481
4482 ::fidl_next::Decode::decode(mask.as_mut(), decoder)?;
4483
4484 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
4485
4486 ::fidl_next::Decode::decode(watcher.as_mut(), decoder)?;
4487
4488 Ok(())
4489 }
4490}
4491
4492#[derive(Clone, Debug)]
4493#[repr(C)]
4494pub struct DirectoryWatchResponse {
4495 pub s: i32,
4496}
4497
4498impl ::fidl_next::Encodable for DirectoryWatchResponse {
4499 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4500 ::fidl_next::CopyOptimization::enable_if(
4501 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4502 )
4503 };
4504
4505 type Encoded = WireDirectoryWatchResponse;
4506}
4507
4508unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryWatchResponse
4509where
4510 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4511{
4512 #[inline]
4513 fn encode(
4514 self,
4515 encoder: &mut ___E,
4516 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4517 ) -> Result<(), ::fidl_next::EncodeError> {
4518 ::fidl_next::munge! {
4519 let Self::Encoded {
4520 s,
4521
4522 } = out;
4523 }
4524
4525 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4526
4527 Ok(())
4528 }
4529}
4530
4531unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryWatchResponse
4532where
4533 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4534{
4535 #[inline]
4536 fn encode_ref(
4537 &self,
4538 encoder: &mut ___E,
4539 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4540 ) -> Result<(), ::fidl_next::EncodeError> {
4541 ::fidl_next::munge! {
4542 let Self::Encoded {
4543 s,
4544
4545 } = out;
4546 }
4547
4548 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
4549
4550 Ok(())
4551 }
4552}
4553
4554impl ::fidl_next::EncodableOption for Box<DirectoryWatchResponse> {
4555 type EncodedOption = ::fidl_next::WireBox<WireDirectoryWatchResponse>;
4556}
4557
4558unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryWatchResponse>
4559where
4560 ___E: ::fidl_next::Encoder + ?Sized,
4561 DirectoryWatchResponse: ::fidl_next::Encode<___E>,
4562{
4563 #[inline]
4564 fn encode_option(
4565 this: Option<Self>,
4566 encoder: &mut ___E,
4567 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4568 ) -> Result<(), ::fidl_next::EncodeError> {
4569 if let Some(inner) = this {
4570 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4571 ::fidl_next::WireBox::encode_present(out);
4572 } else {
4573 ::fidl_next::WireBox::encode_absent(out);
4574 }
4575
4576 Ok(())
4577 }
4578}
4579
4580unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryWatchResponse>
4581where
4582 ___E: ::fidl_next::Encoder + ?Sized,
4583 DirectoryWatchResponse: ::fidl_next::EncodeRef<___E>,
4584{
4585 #[inline]
4586 fn encode_option_ref(
4587 this: Option<&Self>,
4588 encoder: &mut ___E,
4589 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4590 ) -> Result<(), ::fidl_next::EncodeError> {
4591 if let Some(inner) = this {
4592 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4593 ::fidl_next::WireBox::encode_present(out);
4594 } else {
4595 ::fidl_next::WireBox::encode_absent(out);
4596 }
4597
4598 Ok(())
4599 }
4600}
4601
4602impl ::fidl_next::TakeFrom<WireDirectoryWatchResponse> for DirectoryWatchResponse {
4603 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4604 ::fidl_next::CopyOptimization::enable_if(
4605 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4606 )
4607 };
4608
4609 #[inline]
4610 fn take_from(from: &WireDirectoryWatchResponse) -> Self {
4611 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
4612 }
4613}
4614
4615#[derive(Clone, Debug)]
4617#[repr(C)]
4618pub struct WireDirectoryWatchResponse {
4619 pub s: ::fidl_next::WireI32,
4620}
4621
4622unsafe impl ::fidl_next::ZeroPadding for WireDirectoryWatchResponse {
4623 #[inline]
4624 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4625}
4626
4627unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryWatchResponse
4628where
4629 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4630{
4631 fn decode(
4632 slot: ::fidl_next::Slot<'_, Self>,
4633 decoder: &mut ___D,
4634 ) -> Result<(), ::fidl_next::DecodeError> {
4635 ::fidl_next::munge! {
4636 let Self {
4637 mut s,
4638
4639 } = slot;
4640 }
4641
4642 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4643
4644 Ok(())
4645 }
4646}
4647
4648#[derive(Debug)]
4649pub struct NodeOnOpenRequest {
4650 pub s: i32,
4651
4652 pub info: Option<Box<crate::NodeInfoDeprecated>>,
4653}
4654
4655impl ::fidl_next::Encodable for NodeOnOpenRequest {
4656 type Encoded = WireNodeOnOpenRequest;
4657}
4658
4659unsafe impl<___E> ::fidl_next::Encode<___E> for NodeOnOpenRequest
4660where
4661 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4662
4663 ___E: ::fidl_next::Encoder,
4664
4665 ___E: ::fidl_next::fuchsia::HandleEncoder,
4666{
4667 #[inline]
4668 fn encode(
4669 self,
4670 encoder: &mut ___E,
4671 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4672 ) -> Result<(), ::fidl_next::EncodeError> {
4673 ::fidl_next::munge! {
4674 let Self::Encoded {
4675 s,
4676 info,
4677
4678 } = out;
4679 }
4680
4681 ::fidl_next::Encode::encode(self.s, encoder, s)?;
4682
4683 ::fidl_next::Encode::encode(self.info, encoder, info)?;
4684
4685 Ok(())
4686 }
4687}
4688
4689impl ::fidl_next::EncodableOption for Box<NodeOnOpenRequest> {
4690 type EncodedOption = ::fidl_next::WireBox<WireNodeOnOpenRequest>;
4691}
4692
4693unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeOnOpenRequest>
4694where
4695 ___E: ::fidl_next::Encoder + ?Sized,
4696 NodeOnOpenRequest: ::fidl_next::Encode<___E>,
4697{
4698 #[inline]
4699 fn encode_option(
4700 this: Option<Self>,
4701 encoder: &mut ___E,
4702 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4703 ) -> Result<(), ::fidl_next::EncodeError> {
4704 if let Some(inner) = this {
4705 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4706 ::fidl_next::WireBox::encode_present(out);
4707 } else {
4708 ::fidl_next::WireBox::encode_absent(out);
4709 }
4710
4711 Ok(())
4712 }
4713}
4714
4715impl ::fidl_next::TakeFrom<WireNodeOnOpenRequest> for NodeOnOpenRequest {
4716 #[inline]
4717 fn take_from(from: &WireNodeOnOpenRequest) -> Self {
4718 Self {
4719 s: ::fidl_next::TakeFrom::take_from(&from.s),
4720
4721 info: ::fidl_next::TakeFrom::take_from(&from.info),
4722 }
4723 }
4724}
4725
4726#[derive(Debug)]
4728#[repr(C)]
4729pub struct WireNodeOnOpenRequest {
4730 pub s: ::fidl_next::WireI32,
4731
4732 pub info: crate::WireOptionalNodeInfoDeprecated,
4733}
4734
4735unsafe impl ::fidl_next::ZeroPadding for WireNodeOnOpenRequest {
4736 #[inline]
4737 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4738 unsafe {
4739 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
4740 }
4741 }
4742}
4743
4744unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeOnOpenRequest
4745where
4746 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4747
4748 ___D: ::fidl_next::Decoder,
4749
4750 ___D: ::fidl_next::fuchsia::HandleDecoder,
4751{
4752 fn decode(
4753 slot: ::fidl_next::Slot<'_, Self>,
4754 decoder: &mut ___D,
4755 ) -> Result<(), ::fidl_next::DecodeError> {
4756 ::fidl_next::munge! {
4757 let Self {
4758 mut s,
4759 mut info,
4760
4761 } = slot;
4762 }
4763
4764 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
4765
4766 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
4767
4768 Ok(())
4769 }
4770}
4771
4772pub type SymlinkTarget = Vec<u8>;
4773
4774pub type WireSymlinkTarget = ::fidl_next::WireVector<u8>;
4776
4777#[derive(Debug)]
4778#[repr(C)]
4779pub struct NodeListExtendedAttributesRequest {
4780 pub iterator:
4781 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ExtendedAttributeIterator>,
4782}
4783
4784impl ::fidl_next::Encodable for NodeListExtendedAttributesRequest {
4785 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4786 ::fidl_next::CopyOptimization::enable_if(
4787 true && <::fidl_next::ServerEnd<
4788 ::fidl_next::fuchsia::zx::Channel,
4789 crate::ExtendedAttributeIterator,
4790 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4791 .is_enabled(),
4792 )
4793 };
4794
4795 type Encoded = WireNodeListExtendedAttributesRequest;
4796}
4797
4798unsafe impl<___E> ::fidl_next::Encode<___E> for NodeListExtendedAttributesRequest
4799where
4800 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4801
4802 ___E: ::fidl_next::fuchsia::HandleEncoder,
4803{
4804 #[inline]
4805 fn encode(
4806 self,
4807 encoder: &mut ___E,
4808 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4809 ) -> Result<(), ::fidl_next::EncodeError> {
4810 ::fidl_next::munge! {
4811 let Self::Encoded {
4812 iterator,
4813
4814 } = out;
4815 }
4816
4817 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
4818
4819 Ok(())
4820 }
4821}
4822
4823impl ::fidl_next::EncodableOption for Box<NodeListExtendedAttributesRequest> {
4824 type EncodedOption = ::fidl_next::WireBox<WireNodeListExtendedAttributesRequest>;
4825}
4826
4827unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeListExtendedAttributesRequest>
4828where
4829 ___E: ::fidl_next::Encoder + ?Sized,
4830 NodeListExtendedAttributesRequest: ::fidl_next::Encode<___E>,
4831{
4832 #[inline]
4833 fn encode_option(
4834 this: Option<Self>,
4835 encoder: &mut ___E,
4836 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4837 ) -> Result<(), ::fidl_next::EncodeError> {
4838 if let Some(inner) = this {
4839 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4840 ::fidl_next::WireBox::encode_present(out);
4841 } else {
4842 ::fidl_next::WireBox::encode_absent(out);
4843 }
4844
4845 Ok(())
4846 }
4847}
4848
4849impl ::fidl_next::TakeFrom<WireNodeListExtendedAttributesRequest>
4850 for NodeListExtendedAttributesRequest
4851{
4852 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
4853 ::fidl_next::CopyOptimization::enable_if(
4854 true && <::fidl_next::ServerEnd<
4855 ::fidl_next::fuchsia::zx::Channel,
4856 crate::ExtendedAttributeIterator,
4857 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
4858 .is_enabled(),
4859 )
4860 };
4861
4862 #[inline]
4863 fn take_from(from: &WireNodeListExtendedAttributesRequest) -> Self {
4864 Self { iterator: ::fidl_next::TakeFrom::take_from(&from.iterator) }
4865 }
4866}
4867
4868#[derive(Debug)]
4870#[repr(C)]
4871pub struct WireNodeListExtendedAttributesRequest {
4872 pub iterator:
4873 ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ExtendedAttributeIterator>,
4874}
4875
4876unsafe impl ::fidl_next::ZeroPadding for WireNodeListExtendedAttributesRequest {
4877 #[inline]
4878 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4879}
4880
4881unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeListExtendedAttributesRequest
4882where
4883 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4884
4885 ___D: ::fidl_next::fuchsia::HandleDecoder,
4886{
4887 fn decode(
4888 slot: ::fidl_next::Slot<'_, Self>,
4889 decoder: &mut ___D,
4890 ) -> Result<(), ::fidl_next::DecodeError> {
4891 ::fidl_next::munge! {
4892 let Self {
4893 mut iterator,
4894
4895 } = slot;
4896 }
4897
4898 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
4899
4900 Ok(())
4901 }
4902}
4903
4904#[doc = " The maximum size for an extended attribute name.\n"]
4905pub const MAX_ATTRIBUTE_NAME: u64 = 255;
4906
4907#[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"]
4908pub type ExtendedAttributeName = Vec<u8>;
4909
4910pub type WireExtendedAttributeName = ::fidl_next::WireVector<u8>;
4912
4913#[derive(Clone, Debug)]
4914pub struct NodeGetExtendedAttributeRequest {
4915 pub name: Vec<u8>,
4916}
4917
4918impl ::fidl_next::Encodable for NodeGetExtendedAttributeRequest {
4919 type Encoded = WireNodeGetExtendedAttributeRequest;
4920}
4921
4922unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetExtendedAttributeRequest
4923where
4924 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4925
4926 ___E: ::fidl_next::Encoder,
4927{
4928 #[inline]
4929 fn encode(
4930 self,
4931 encoder: &mut ___E,
4932 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4933 ) -> Result<(), ::fidl_next::EncodeError> {
4934 ::fidl_next::munge! {
4935 let Self::Encoded {
4936 name,
4937
4938 } = out;
4939 }
4940
4941 ::fidl_next::Encode::encode(self.name, encoder, name)?;
4942
4943 Ok(())
4944 }
4945}
4946
4947unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetExtendedAttributeRequest
4948where
4949 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4950
4951 ___E: ::fidl_next::Encoder,
4952{
4953 #[inline]
4954 fn encode_ref(
4955 &self,
4956 encoder: &mut ___E,
4957 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4958 ) -> Result<(), ::fidl_next::EncodeError> {
4959 ::fidl_next::munge! {
4960 let Self::Encoded {
4961 name,
4962
4963 } = out;
4964 }
4965
4966 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
4967
4968 Ok(())
4969 }
4970}
4971
4972impl ::fidl_next::EncodableOption for Box<NodeGetExtendedAttributeRequest> {
4973 type EncodedOption = ::fidl_next::WireBox<WireNodeGetExtendedAttributeRequest>;
4974}
4975
4976unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeGetExtendedAttributeRequest>
4977where
4978 ___E: ::fidl_next::Encoder + ?Sized,
4979 NodeGetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
4980{
4981 #[inline]
4982 fn encode_option(
4983 this: Option<Self>,
4984 encoder: &mut ___E,
4985 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4986 ) -> Result<(), ::fidl_next::EncodeError> {
4987 if let Some(inner) = this {
4988 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
4989 ::fidl_next::WireBox::encode_present(out);
4990 } else {
4991 ::fidl_next::WireBox::encode_absent(out);
4992 }
4993
4994 Ok(())
4995 }
4996}
4997
4998unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeGetExtendedAttributeRequest>
4999where
5000 ___E: ::fidl_next::Encoder + ?Sized,
5001 NodeGetExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
5002{
5003 #[inline]
5004 fn encode_option_ref(
5005 this: Option<&Self>,
5006 encoder: &mut ___E,
5007 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5008 ) -> Result<(), ::fidl_next::EncodeError> {
5009 if let Some(inner) = this {
5010 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5011 ::fidl_next::WireBox::encode_present(out);
5012 } else {
5013 ::fidl_next::WireBox::encode_absent(out);
5014 }
5015
5016 Ok(())
5017 }
5018}
5019
5020impl ::fidl_next::TakeFrom<WireNodeGetExtendedAttributeRequest>
5021 for NodeGetExtendedAttributeRequest
5022{
5023 #[inline]
5024 fn take_from(from: &WireNodeGetExtendedAttributeRequest) -> Self {
5025 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
5026 }
5027}
5028
5029#[derive(Debug)]
5031#[repr(C)]
5032pub struct WireNodeGetExtendedAttributeRequest {
5033 pub name: ::fidl_next::WireVector<u8>,
5034}
5035
5036unsafe impl ::fidl_next::ZeroPadding for WireNodeGetExtendedAttributeRequest {
5037 #[inline]
5038 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5039}
5040
5041unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetExtendedAttributeRequest
5042where
5043 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5044
5045 ___D: ::fidl_next::Decoder,
5046{
5047 fn decode(
5048 slot: ::fidl_next::Slot<'_, Self>,
5049 decoder: &mut ___D,
5050 ) -> Result<(), ::fidl_next::DecodeError> {
5051 ::fidl_next::munge! {
5052 let Self {
5053 mut name,
5054
5055 } = slot;
5056 }
5057
5058 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5059
5060 let name = unsafe { name.deref_unchecked() };
5061
5062 if name.len() > 255 {
5063 return Err(::fidl_next::DecodeError::VectorTooLong {
5064 size: name.len() as u64,
5065 limit: 255,
5066 });
5067 }
5068
5069 Ok(())
5070 }
5071}
5072
5073#[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"]
5074pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768;
5075
5076#[doc = " The value type for an extended attribute. If the value is less than 32768\n bytes, then it is included inline. Values larger than this size are written\n into a vmo buffer.\n"]
5077#[derive(Debug)]
5078pub enum ExtendedAttributeValue {
5079 Bytes(Vec<u8>),
5080
5081 Buffer(::fidl_next::fuchsia::zx::Handle),
5082
5083 UnknownOrdinal_(u64),
5084}
5085
5086impl ::fidl_next::Encodable for ExtendedAttributeValue {
5087 type Encoded = WireExtendedAttributeValue;
5088}
5089
5090unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeValue
5091where
5092 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5093
5094 ___E: ::fidl_next::Encoder,
5095
5096 ___E: ::fidl_next::fuchsia::HandleEncoder,
5097{
5098 #[inline]
5099 fn encode(
5100 self,
5101 encoder: &mut ___E,
5102 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5103 ) -> Result<(), ::fidl_next::EncodeError> {
5104 ::fidl_next::munge!(let WireExtendedAttributeValue { raw } = out);
5105
5106 match self {
5107 Self::Bytes(value) => {
5108 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
5109 }
5110
5111 Self::Buffer(value) => ::fidl_next::RawWireUnion::encode_as::<
5112 ___E,
5113 ::fidl_next::fuchsia::zx::Handle,
5114 >(value, 2, encoder, raw)?,
5115
5116 Self::UnknownOrdinal_(ordinal) => {
5117 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
5118 }
5119 }
5120
5121 Ok(())
5122 }
5123}
5124
5125impl ::fidl_next::EncodableOption for Box<ExtendedAttributeValue> {
5126 type EncodedOption = WireOptionalExtendedAttributeValue;
5127}
5128
5129unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ExtendedAttributeValue>
5130where
5131 ___E: ?Sized,
5132 ExtendedAttributeValue: ::fidl_next::Encode<___E>,
5133{
5134 #[inline]
5135 fn encode_option(
5136 this: Option<Self>,
5137 encoder: &mut ___E,
5138 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5139 ) -> Result<(), ::fidl_next::EncodeError> {
5140 ::fidl_next::munge!(let WireOptionalExtendedAttributeValue { raw } = &mut *out);
5141
5142 if let Some(inner) = this {
5143 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5144 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
5145 } else {
5146 ::fidl_next::RawWireUnion::encode_absent(raw);
5147 }
5148
5149 Ok(())
5150 }
5151}
5152
5153impl ::fidl_next::TakeFrom<WireExtendedAttributeValue> for ExtendedAttributeValue {
5154 #[inline]
5155 fn take_from(from: &WireExtendedAttributeValue) -> Self {
5156 match from.raw.ordinal() {
5157 1 => Self::Bytes(::fidl_next::TakeFrom::take_from(unsafe {
5158 from.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
5159 })),
5160
5161 2 => Self::Buffer(::fidl_next::TakeFrom::take_from(unsafe {
5162 from.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
5163 })),
5164
5165 _ => unsafe { ::core::hint::unreachable_unchecked() },
5166 }
5167 }
5168}
5169
5170impl ::fidl_next::TakeFrom<WireOptionalExtendedAttributeValue>
5171 for Option<Box<ExtendedAttributeValue>>
5172{
5173 #[inline]
5174 fn take_from(from: &WireOptionalExtendedAttributeValue) -> Self {
5175 if let Some(inner) = from.as_ref() {
5176 Some(::fidl_next::TakeFrom::take_from(inner))
5177 } else {
5178 None
5179 }
5180 }
5181}
5182
5183#[repr(transparent)]
5185pub struct WireExtendedAttributeValue {
5186 raw: ::fidl_next::RawWireUnion,
5187}
5188
5189unsafe impl ::fidl_next::ZeroPadding for WireExtendedAttributeValue {
5190 #[inline]
5191 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5192 ::fidl_next::munge!(let Self { raw } = out);
5193 ::fidl_next::RawWireUnion::zero_padding(raw);
5194 }
5195}
5196
5197pub mod extended_attribute_value {
5198 pub enum Ref<'union> {
5199 Bytes(&'union ::fidl_next::WireVector<u8>),
5200
5201 Buffer(&'union ::fidl_next::fuchsia::WireHandle),
5202
5203 UnknownOrdinal_(u64),
5204 }
5205}
5206
5207impl WireExtendedAttributeValue {
5208 pub fn as_ref(&self) -> crate::extended_attribute_value::Ref<'_> {
5209 match self.raw.ordinal() {
5210 1 => crate::extended_attribute_value::Ref::Bytes(unsafe {
5211 self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
5212 }),
5213
5214 2 => crate::extended_attribute_value::Ref::Buffer(unsafe {
5215 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
5216 }),
5217
5218 unknown => crate::extended_attribute_value::Ref::UnknownOrdinal_(unknown),
5219 }
5220 }
5221}
5222
5223unsafe impl<___D> ::fidl_next::Decode<___D> for WireExtendedAttributeValue
5224where
5225 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5226
5227 ___D: ::fidl_next::Decoder,
5228
5229 ___D: ::fidl_next::fuchsia::HandleDecoder,
5230{
5231 fn decode(
5232 mut slot: ::fidl_next::Slot<'_, Self>,
5233 decoder: &mut ___D,
5234 ) -> Result<(), ::fidl_next::DecodeError> {
5235 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5236 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5237 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
5238 raw, decoder,
5239 )?,
5240
5241 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5242 raw, decoder,
5243 )?,
5244
5245 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5246 }
5247
5248 Ok(())
5249 }
5250}
5251
5252impl ::core::fmt::Debug for WireExtendedAttributeValue {
5253 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5254 match self.raw.ordinal() {
5255 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>().fmt(f) },
5256 2 => unsafe {
5257 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
5258 },
5259 _ => unsafe { ::core::hint::unreachable_unchecked() },
5260 }
5261 }
5262}
5263
5264#[repr(transparent)]
5265pub struct WireOptionalExtendedAttributeValue {
5266 raw: ::fidl_next::RawWireUnion,
5267}
5268
5269unsafe impl ::fidl_next::ZeroPadding for WireOptionalExtendedAttributeValue {
5270 #[inline]
5271 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5272 ::fidl_next::munge!(let Self { raw } = out);
5273 ::fidl_next::RawWireUnion::zero_padding(raw);
5274 }
5275}
5276
5277impl WireOptionalExtendedAttributeValue {
5278 pub fn is_some(&self) -> bool {
5279 self.raw.is_some()
5280 }
5281
5282 pub fn is_none(&self) -> bool {
5283 self.raw.is_none()
5284 }
5285
5286 pub fn as_ref(&self) -> Option<&WireExtendedAttributeValue> {
5287 if self.is_some() {
5288 Some(unsafe { &*(self as *const Self).cast() })
5289 } else {
5290 None
5291 }
5292 }
5293}
5294
5295unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExtendedAttributeValue
5296where
5297 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5298
5299 ___D: ::fidl_next::Decoder,
5300
5301 ___D: ::fidl_next::fuchsia::HandleDecoder,
5302{
5303 fn decode(
5304 mut slot: ::fidl_next::Slot<'_, Self>,
5305 decoder: &mut ___D,
5306 ) -> Result<(), ::fidl_next::DecodeError> {
5307 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5308 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5309 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
5310 raw, decoder,
5311 )?,
5312
5313 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
5314 raw, decoder,
5315 )?,
5316
5317 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5318 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5319 }
5320
5321 Ok(())
5322 }
5323}
5324
5325impl ::core::fmt::Debug for WireOptionalExtendedAttributeValue {
5326 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5327 self.as_ref().fmt(f)
5328 }
5329}
5330
5331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5332#[repr(u32)]
5333pub enum SetExtendedAttributeMode {
5334 Set = 1,
5335 Create = 2,
5336 Replace = 3,
5337}
5338
5339impl ::fidl_next::Encodable for SetExtendedAttributeMode {
5340 type Encoded = WireSetExtendedAttributeMode;
5341}
5342impl ::std::convert::TryFrom<u32> for SetExtendedAttributeMode {
5343 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5344 fn try_from(value: u32) -> Result<Self, Self::Error> {
5345 match value {
5346 1 => Ok(Self::Set),
5347 2 => Ok(Self::Create),
5348 3 => Ok(Self::Replace),
5349
5350 _ => Err(Self::Error::new(value.into())),
5351 }
5352 }
5353}
5354
5355unsafe impl<___E> ::fidl_next::Encode<___E> for SetExtendedAttributeMode
5356where
5357 ___E: ?Sized,
5358{
5359 #[inline]
5360 fn encode(
5361 self,
5362 encoder: &mut ___E,
5363 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5364 ) -> Result<(), ::fidl_next::EncodeError> {
5365 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5366 }
5367}
5368
5369unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SetExtendedAttributeMode
5370where
5371 ___E: ?Sized,
5372{
5373 #[inline]
5374 fn encode_ref(
5375 &self,
5376 encoder: &mut ___E,
5377 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5378 ) -> Result<(), ::fidl_next::EncodeError> {
5379 ::fidl_next::munge!(let WireSetExtendedAttributeMode { value } = out);
5380 let _ = value.write(::fidl_next::WireU32::from(match *self {
5381 Self::Set => 1,
5382
5383 Self::Create => 2,
5384
5385 Self::Replace => 3,
5386 }));
5387
5388 Ok(())
5389 }
5390}
5391
5392impl ::core::convert::From<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5393 fn from(wire: WireSetExtendedAttributeMode) -> Self {
5394 match u32::from(wire.value) {
5395 1 => Self::Set,
5396
5397 2 => Self::Create,
5398
5399 3 => Self::Replace,
5400
5401 _ => unsafe { ::core::hint::unreachable_unchecked() },
5402 }
5403 }
5404}
5405
5406impl ::fidl_next::TakeFrom<WireSetExtendedAttributeMode> for SetExtendedAttributeMode {
5407 #[inline]
5408 fn take_from(from: &WireSetExtendedAttributeMode) -> Self {
5409 Self::from(*from)
5410 }
5411}
5412
5413#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5415#[repr(transparent)]
5416pub struct WireSetExtendedAttributeMode {
5417 value: ::fidl_next::WireU32,
5418}
5419
5420unsafe impl ::fidl_next::ZeroPadding for WireSetExtendedAttributeMode {
5421 #[inline]
5422 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5423 }
5425}
5426
5427impl WireSetExtendedAttributeMode {
5428 pub const SET: WireSetExtendedAttributeMode =
5429 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(1) };
5430
5431 pub const CREATE: WireSetExtendedAttributeMode =
5432 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(2) };
5433
5434 pub const REPLACE: WireSetExtendedAttributeMode =
5435 WireSetExtendedAttributeMode { value: ::fidl_next::WireU32(3) };
5436}
5437
5438unsafe impl<___D> ::fidl_next::Decode<___D> for WireSetExtendedAttributeMode
5439where
5440 ___D: ?Sized,
5441{
5442 fn decode(
5443 slot: ::fidl_next::Slot<'_, Self>,
5444 _: &mut ___D,
5445 ) -> Result<(), ::fidl_next::DecodeError> {
5446 ::fidl_next::munge!(let Self { value } = slot);
5447
5448 match u32::from(*value) {
5449 1 | 2 | 3 => (),
5450 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
5451 }
5452
5453 Ok(())
5454 }
5455}
5456
5457impl ::core::convert::From<SetExtendedAttributeMode> for WireSetExtendedAttributeMode {
5458 fn from(natural: SetExtendedAttributeMode) -> Self {
5459 match natural {
5460 SetExtendedAttributeMode::Set => WireSetExtendedAttributeMode::SET,
5461
5462 SetExtendedAttributeMode::Create => WireSetExtendedAttributeMode::CREATE,
5463
5464 SetExtendedAttributeMode::Replace => WireSetExtendedAttributeMode::REPLACE,
5465 }
5466 }
5467}
5468
5469#[derive(Debug)]
5470pub struct NodeSetExtendedAttributeRequest {
5471 pub name: Vec<u8>,
5472
5473 pub value: crate::ExtendedAttributeValue,
5474
5475 pub mode: crate::SetExtendedAttributeMode,
5476}
5477
5478impl ::fidl_next::Encodable for NodeSetExtendedAttributeRequest {
5479 type Encoded = WireNodeSetExtendedAttributeRequest;
5480}
5481
5482unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetExtendedAttributeRequest
5483where
5484 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5485
5486 ___E: ::fidl_next::Encoder,
5487
5488 ___E: ::fidl_next::fuchsia::HandleEncoder,
5489{
5490 #[inline]
5491 fn encode(
5492 self,
5493 encoder: &mut ___E,
5494 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5495 ) -> Result<(), ::fidl_next::EncodeError> {
5496 ::fidl_next::munge! {
5497 let Self::Encoded {
5498 name,
5499 value,
5500 mode,
5501
5502 } = out;
5503 }
5504
5505 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5506
5507 ::fidl_next::Encode::encode(self.value, encoder, value)?;
5508
5509 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
5510
5511 Ok(())
5512 }
5513}
5514
5515impl ::fidl_next::EncodableOption for Box<NodeSetExtendedAttributeRequest> {
5516 type EncodedOption = ::fidl_next::WireBox<WireNodeSetExtendedAttributeRequest>;
5517}
5518
5519unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeSetExtendedAttributeRequest>
5520where
5521 ___E: ::fidl_next::Encoder + ?Sized,
5522 NodeSetExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5523{
5524 #[inline]
5525 fn encode_option(
5526 this: Option<Self>,
5527 encoder: &mut ___E,
5528 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5529 ) -> Result<(), ::fidl_next::EncodeError> {
5530 if let Some(inner) = this {
5531 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
5532 ::fidl_next::WireBox::encode_present(out);
5533 } else {
5534 ::fidl_next::WireBox::encode_absent(out);
5535 }
5536
5537 Ok(())
5538 }
5539}
5540
5541impl ::fidl_next::TakeFrom<WireNodeSetExtendedAttributeRequest>
5542 for NodeSetExtendedAttributeRequest
5543{
5544 #[inline]
5545 fn take_from(from: &WireNodeSetExtendedAttributeRequest) -> Self {
5546 Self {
5547 name: ::fidl_next::TakeFrom::take_from(&from.name),
5548
5549 value: ::fidl_next::TakeFrom::take_from(&from.value),
5550
5551 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
5552 }
5553 }
5554}
5555
5556#[derive(Debug)]
5558#[repr(C)]
5559pub struct WireNodeSetExtendedAttributeRequest {
5560 pub name: ::fidl_next::WireVector<u8>,
5561
5562 pub value: crate::WireExtendedAttributeValue,
5563
5564 pub mode: crate::WireSetExtendedAttributeMode,
5565}
5566
5567unsafe impl ::fidl_next::ZeroPadding for WireNodeSetExtendedAttributeRequest {
5568 #[inline]
5569 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5570 unsafe {
5571 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
5572 }
5573 }
5574}
5575
5576unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetExtendedAttributeRequest
5577where
5578 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5579
5580 ___D: ::fidl_next::Decoder,
5581
5582 ___D: ::fidl_next::fuchsia::HandleDecoder,
5583{
5584 fn decode(
5585 slot: ::fidl_next::Slot<'_, Self>,
5586 decoder: &mut ___D,
5587 ) -> Result<(), ::fidl_next::DecodeError> {
5588 ::fidl_next::munge! {
5589 let Self {
5590 mut name,
5591 mut value,
5592 mut mode,
5593
5594 } = slot;
5595 }
5596
5597 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5598
5599 let name = unsafe { name.deref_unchecked() };
5600
5601 if name.len() > 255 {
5602 return Err(::fidl_next::DecodeError::VectorTooLong {
5603 size: name.len() as u64,
5604 limit: 255,
5605 });
5606 }
5607
5608 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
5609
5610 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
5611
5612 Ok(())
5613 }
5614}
5615
5616pub type NodeSetExtendedAttributeResponse = ();
5617
5618pub type WireNodeSetExtendedAttributeResponse = ();
5620
5621#[derive(Clone, Debug)]
5622pub struct NodeRemoveExtendedAttributeRequest {
5623 pub name: Vec<u8>,
5624}
5625
5626impl ::fidl_next::Encodable for NodeRemoveExtendedAttributeRequest {
5627 type Encoded = WireNodeRemoveExtendedAttributeRequest;
5628}
5629
5630unsafe impl<___E> ::fidl_next::Encode<___E> for NodeRemoveExtendedAttributeRequest
5631where
5632 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5633
5634 ___E: ::fidl_next::Encoder,
5635{
5636 #[inline]
5637 fn encode(
5638 self,
5639 encoder: &mut ___E,
5640 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5641 ) -> Result<(), ::fidl_next::EncodeError> {
5642 ::fidl_next::munge! {
5643 let Self::Encoded {
5644 name,
5645
5646 } = out;
5647 }
5648
5649 ::fidl_next::Encode::encode(self.name, encoder, name)?;
5650
5651 Ok(())
5652 }
5653}
5654
5655unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeRemoveExtendedAttributeRequest
5656where
5657 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5658
5659 ___E: ::fidl_next::Encoder,
5660{
5661 #[inline]
5662 fn encode_ref(
5663 &self,
5664 encoder: &mut ___E,
5665 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5666 ) -> Result<(), ::fidl_next::EncodeError> {
5667 ::fidl_next::munge! {
5668 let Self::Encoded {
5669 name,
5670
5671 } = out;
5672 }
5673
5674 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
5675
5676 Ok(())
5677 }
5678}
5679
5680impl ::fidl_next::EncodableOption for Box<NodeRemoveExtendedAttributeRequest> {
5681 type EncodedOption = ::fidl_next::WireBox<WireNodeRemoveExtendedAttributeRequest>;
5682}
5683
5684unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeRemoveExtendedAttributeRequest>
5685where
5686 ___E: ::fidl_next::Encoder + ?Sized,
5687 NodeRemoveExtendedAttributeRequest: ::fidl_next::Encode<___E>,
5688{
5689 #[inline]
5690 fn encode_option(
5691 this: Option<Self>,
5692 encoder: &mut ___E,
5693 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5694 ) -> Result<(), ::fidl_next::EncodeError> {
5695 if let Some(inner) = this {
5696 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
5697 ::fidl_next::WireBox::encode_present(out);
5698 } else {
5699 ::fidl_next::WireBox::encode_absent(out);
5700 }
5701
5702 Ok(())
5703 }
5704}
5705
5706unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeRemoveExtendedAttributeRequest>
5707where
5708 ___E: ::fidl_next::Encoder + ?Sized,
5709 NodeRemoveExtendedAttributeRequest: ::fidl_next::EncodeRef<___E>,
5710{
5711 #[inline]
5712 fn encode_option_ref(
5713 this: Option<&Self>,
5714 encoder: &mut ___E,
5715 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5716 ) -> Result<(), ::fidl_next::EncodeError> {
5717 if let Some(inner) = this {
5718 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5719 ::fidl_next::WireBox::encode_present(out);
5720 } else {
5721 ::fidl_next::WireBox::encode_absent(out);
5722 }
5723
5724 Ok(())
5725 }
5726}
5727
5728impl ::fidl_next::TakeFrom<WireNodeRemoveExtendedAttributeRequest>
5729 for NodeRemoveExtendedAttributeRequest
5730{
5731 #[inline]
5732 fn take_from(from: &WireNodeRemoveExtendedAttributeRequest) -> Self {
5733 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
5734 }
5735}
5736
5737#[derive(Debug)]
5739#[repr(C)]
5740pub struct WireNodeRemoveExtendedAttributeRequest {
5741 pub name: ::fidl_next::WireVector<u8>,
5742}
5743
5744unsafe impl ::fidl_next::ZeroPadding for WireNodeRemoveExtendedAttributeRequest {
5745 #[inline]
5746 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5747}
5748
5749unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeRemoveExtendedAttributeRequest
5750where
5751 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5752
5753 ___D: ::fidl_next::Decoder,
5754{
5755 fn decode(
5756 slot: ::fidl_next::Slot<'_, Self>,
5757 decoder: &mut ___D,
5758 ) -> Result<(), ::fidl_next::DecodeError> {
5759 ::fidl_next::munge! {
5760 let Self {
5761 mut name,
5762
5763 } = slot;
5764 }
5765
5766 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
5767
5768 let name = unsafe { name.deref_unchecked() };
5769
5770 if name.len() > 255 {
5771 return Err(::fidl_next::DecodeError::VectorTooLong {
5772 size: name.len() as u64,
5773 limit: 255,
5774 });
5775 }
5776
5777 Ok(())
5778 }
5779}
5780
5781pub type NodeRemoveExtendedAttributeResponse = ();
5782
5783pub type WireNodeRemoveExtendedAttributeResponse = ();
5785
5786pub type DirectoryCreateSymlinkResponse = ();
5787
5788pub type WireDirectoryCreateSymlinkResponse = ();
5790
5791pub type NodeSetFlagsResponse = ();
5792
5793pub type WireNodeSetFlagsResponse = ();
5795
5796#[derive(Debug)]
5797#[repr(C)]
5798pub struct NodeDeprecatedCloneRequest {
5799 pub flags: crate::OpenFlags,
5800
5801 pub object: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Node>,
5802}
5803
5804impl ::fidl_next::Encodable for NodeDeprecatedCloneRequest {
5805 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
5806 ::fidl_next::CopyOptimization::enable_if(
5807 true
5808
5809 && <
5810 crate::OpenFlags as ::fidl_next::Encodable
5811 >::COPY_OPTIMIZATION.is_enabled()
5812
5813 && <
5814 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Node,
5815 > as ::fidl_next::Encodable
5816 >::COPY_OPTIMIZATION.is_enabled()
5817
5818 )
5819 };
5820
5821 type Encoded = WireNodeDeprecatedCloneRequest;
5822}
5823
5824unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedCloneRequest
5825where
5826 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5827
5828 ___E: ::fidl_next::fuchsia::HandleEncoder,
5829{
5830 #[inline]
5831 fn encode(
5832 self,
5833 encoder: &mut ___E,
5834 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5835 ) -> Result<(), ::fidl_next::EncodeError> {
5836 ::fidl_next::munge! {
5837 let Self::Encoded {
5838 flags,
5839 object,
5840
5841 } = out;
5842 }
5843
5844 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
5845
5846 ::fidl_next::Encode::encode(self.object, encoder, object)?;
5847
5848 Ok(())
5849 }
5850}
5851
5852impl ::fidl_next::EncodableOption for Box<NodeDeprecatedCloneRequest> {
5853 type EncodedOption = ::fidl_next::WireBox<WireNodeDeprecatedCloneRequest>;
5854}
5855
5856unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeDeprecatedCloneRequest>
5857where
5858 ___E: ::fidl_next::Encoder + ?Sized,
5859 NodeDeprecatedCloneRequest: ::fidl_next::Encode<___E>,
5860{
5861 #[inline]
5862 fn encode_option(
5863 this: Option<Self>,
5864 encoder: &mut ___E,
5865 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5866 ) -> Result<(), ::fidl_next::EncodeError> {
5867 if let Some(inner) = this {
5868 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
5869 ::fidl_next::WireBox::encode_present(out);
5870 } else {
5871 ::fidl_next::WireBox::encode_absent(out);
5872 }
5873
5874 Ok(())
5875 }
5876}
5877
5878impl ::fidl_next::TakeFrom<WireNodeDeprecatedCloneRequest> for NodeDeprecatedCloneRequest {
5879 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
5880 ::fidl_next::CopyOptimization::enable_if(
5881 true
5882
5883 && <
5884 crate::OpenFlags as ::fidl_next::Encodable
5885 >::COPY_OPTIMIZATION.is_enabled()
5886
5887 && <
5888 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Node,
5889 > as ::fidl_next::Encodable
5890 >::COPY_OPTIMIZATION.is_enabled()
5891
5892 )
5893 };
5894
5895 #[inline]
5896 fn take_from(from: &WireNodeDeprecatedCloneRequest) -> Self {
5897 Self {
5898 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
5899
5900 object: ::fidl_next::TakeFrom::take_from(&from.object),
5901 }
5902 }
5903}
5904
5905#[derive(Debug)]
5907#[repr(C)]
5908pub struct WireNodeDeprecatedCloneRequest {
5909 pub flags: crate::WireOpenFlags,
5910
5911 pub object: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Node>,
5912}
5913
5914unsafe impl ::fidl_next::ZeroPadding for WireNodeDeprecatedCloneRequest {
5915 #[inline]
5916 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5917}
5918
5919unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedCloneRequest
5920where
5921 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5922
5923 ___D: ::fidl_next::fuchsia::HandleDecoder,
5924{
5925 fn decode(
5926 slot: ::fidl_next::Slot<'_, Self>,
5927 decoder: &mut ___D,
5928 ) -> Result<(), ::fidl_next::DecodeError> {
5929 ::fidl_next::munge! {
5930 let Self {
5931 mut flags,
5932 mut object,
5933
5934 } = slot;
5935 }
5936
5937 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
5938
5939 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
5940
5941 Ok(())
5942 }
5943}
5944
5945#[derive(Clone, Debug)]
5946#[repr(C)]
5947pub struct NodeDeprecatedGetFlagsResponse {
5948 pub s: i32,
5949
5950 pub flags: crate::OpenFlags,
5951}
5952
5953impl ::fidl_next::Encodable for NodeDeprecatedGetFlagsResponse {
5954 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
5955 ::fidl_next::CopyOptimization::enable_if(
5956 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
5957 && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
5958 )
5959 };
5960
5961 type Encoded = WireNodeDeprecatedGetFlagsResponse;
5962}
5963
5964unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedGetFlagsResponse
5965where
5966 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5967{
5968 #[inline]
5969 fn encode(
5970 self,
5971 encoder: &mut ___E,
5972 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5973 ) -> Result<(), ::fidl_next::EncodeError> {
5974 ::fidl_next::munge! {
5975 let Self::Encoded {
5976 s,
5977 flags,
5978
5979 } = out;
5980 }
5981
5982 ::fidl_next::Encode::encode(self.s, encoder, s)?;
5983
5984 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
5985
5986 Ok(())
5987 }
5988}
5989
5990unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedGetFlagsResponse
5991where
5992 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5993{
5994 #[inline]
5995 fn encode_ref(
5996 &self,
5997 encoder: &mut ___E,
5998 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5999 ) -> Result<(), ::fidl_next::EncodeError> {
6000 ::fidl_next::munge! {
6001 let Self::Encoded {
6002 s,
6003 flags,
6004
6005 } = out;
6006 }
6007
6008 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6009
6010 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6011
6012 Ok(())
6013 }
6014}
6015
6016impl ::fidl_next::EncodableOption for Box<NodeDeprecatedGetFlagsResponse> {
6017 type EncodedOption = ::fidl_next::WireBox<WireNodeDeprecatedGetFlagsResponse>;
6018}
6019
6020unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeDeprecatedGetFlagsResponse>
6021where
6022 ___E: ::fidl_next::Encoder + ?Sized,
6023 NodeDeprecatedGetFlagsResponse: ::fidl_next::Encode<___E>,
6024{
6025 #[inline]
6026 fn encode_option(
6027 this: Option<Self>,
6028 encoder: &mut ___E,
6029 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6030 ) -> Result<(), ::fidl_next::EncodeError> {
6031 if let Some(inner) = this {
6032 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6033 ::fidl_next::WireBox::encode_present(out);
6034 } else {
6035 ::fidl_next::WireBox::encode_absent(out);
6036 }
6037
6038 Ok(())
6039 }
6040}
6041
6042unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeDeprecatedGetFlagsResponse>
6043where
6044 ___E: ::fidl_next::Encoder + ?Sized,
6045 NodeDeprecatedGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6046{
6047 #[inline]
6048 fn encode_option_ref(
6049 this: Option<&Self>,
6050 encoder: &mut ___E,
6051 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6052 ) -> Result<(), ::fidl_next::EncodeError> {
6053 if let Some(inner) = this {
6054 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6055 ::fidl_next::WireBox::encode_present(out);
6056 } else {
6057 ::fidl_next::WireBox::encode_absent(out);
6058 }
6059
6060 Ok(())
6061 }
6062}
6063
6064impl ::fidl_next::TakeFrom<WireNodeDeprecatedGetFlagsResponse> for NodeDeprecatedGetFlagsResponse {
6065 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6066 ::fidl_next::CopyOptimization::enable_if(
6067 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
6068 && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6069 )
6070 };
6071
6072 #[inline]
6073 fn take_from(from: &WireNodeDeprecatedGetFlagsResponse) -> Self {
6074 Self {
6075 s: ::fidl_next::TakeFrom::take_from(&from.s),
6076
6077 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
6078 }
6079 }
6080}
6081
6082#[derive(Clone, Debug)]
6084#[repr(C)]
6085pub struct WireNodeDeprecatedGetFlagsResponse {
6086 pub s: ::fidl_next::WireI32,
6087
6088 pub flags: crate::WireOpenFlags,
6089}
6090
6091unsafe impl ::fidl_next::ZeroPadding for WireNodeDeprecatedGetFlagsResponse {
6092 #[inline]
6093 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6094}
6095
6096unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedGetFlagsResponse
6097where
6098 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6099{
6100 fn decode(
6101 slot: ::fidl_next::Slot<'_, Self>,
6102 decoder: &mut ___D,
6103 ) -> Result<(), ::fidl_next::DecodeError> {
6104 ::fidl_next::munge! {
6105 let Self {
6106 mut s,
6107 mut flags,
6108
6109 } = slot;
6110 }
6111
6112 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6113
6114 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6115
6116 Ok(())
6117 }
6118}
6119
6120#[derive(Clone, Debug)]
6121#[repr(C)]
6122pub struct NodeDeprecatedSetFlagsRequest {
6123 pub flags: crate::OpenFlags,
6124}
6125
6126impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsRequest {
6127 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6128 ::fidl_next::CopyOptimization::enable_if(
6129 true && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6130 )
6131 };
6132
6133 type Encoded = WireNodeDeprecatedSetFlagsRequest;
6134}
6135
6136unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsRequest
6137where
6138 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6139{
6140 #[inline]
6141 fn encode(
6142 self,
6143 encoder: &mut ___E,
6144 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6145 ) -> Result<(), ::fidl_next::EncodeError> {
6146 ::fidl_next::munge! {
6147 let Self::Encoded {
6148 flags,
6149
6150 } = out;
6151 }
6152
6153 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6154
6155 Ok(())
6156 }
6157}
6158
6159unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsRequest
6160where
6161 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6162{
6163 #[inline]
6164 fn encode_ref(
6165 &self,
6166 encoder: &mut ___E,
6167 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6168 ) -> Result<(), ::fidl_next::EncodeError> {
6169 ::fidl_next::munge! {
6170 let Self::Encoded {
6171 flags,
6172
6173 } = out;
6174 }
6175
6176 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6177
6178 Ok(())
6179 }
6180}
6181
6182impl ::fidl_next::EncodableOption for Box<NodeDeprecatedSetFlagsRequest> {
6183 type EncodedOption = ::fidl_next::WireBox<WireNodeDeprecatedSetFlagsRequest>;
6184}
6185
6186unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeDeprecatedSetFlagsRequest>
6187where
6188 ___E: ::fidl_next::Encoder + ?Sized,
6189 NodeDeprecatedSetFlagsRequest: ::fidl_next::Encode<___E>,
6190{
6191 #[inline]
6192 fn encode_option(
6193 this: Option<Self>,
6194 encoder: &mut ___E,
6195 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6196 ) -> Result<(), ::fidl_next::EncodeError> {
6197 if let Some(inner) = this {
6198 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6199 ::fidl_next::WireBox::encode_present(out);
6200 } else {
6201 ::fidl_next::WireBox::encode_absent(out);
6202 }
6203
6204 Ok(())
6205 }
6206}
6207
6208unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeDeprecatedSetFlagsRequest>
6209where
6210 ___E: ::fidl_next::Encoder + ?Sized,
6211 NodeDeprecatedSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
6212{
6213 #[inline]
6214 fn encode_option_ref(
6215 this: Option<&Self>,
6216 encoder: &mut ___E,
6217 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6218 ) -> Result<(), ::fidl_next::EncodeError> {
6219 if let Some(inner) = this {
6220 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6221 ::fidl_next::WireBox::encode_present(out);
6222 } else {
6223 ::fidl_next::WireBox::encode_absent(out);
6224 }
6225
6226 Ok(())
6227 }
6228}
6229
6230impl ::fidl_next::TakeFrom<WireNodeDeprecatedSetFlagsRequest> for NodeDeprecatedSetFlagsRequest {
6231 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6232 ::fidl_next::CopyOptimization::enable_if(
6233 true && <crate::OpenFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6234 )
6235 };
6236
6237 #[inline]
6238 fn take_from(from: &WireNodeDeprecatedSetFlagsRequest) -> Self {
6239 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
6240 }
6241}
6242
6243#[derive(Clone, Debug)]
6245#[repr(C)]
6246pub struct WireNodeDeprecatedSetFlagsRequest {
6247 pub flags: crate::WireOpenFlags,
6248}
6249
6250unsafe impl ::fidl_next::ZeroPadding for WireNodeDeprecatedSetFlagsRequest {
6251 #[inline]
6252 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6253}
6254
6255unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsRequest
6256where
6257 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6258{
6259 fn decode(
6260 slot: ::fidl_next::Slot<'_, Self>,
6261 decoder: &mut ___D,
6262 ) -> Result<(), ::fidl_next::DecodeError> {
6263 ::fidl_next::munge! {
6264 let Self {
6265 mut flags,
6266
6267 } = slot;
6268 }
6269
6270 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6271
6272 Ok(())
6273 }
6274}
6275
6276#[derive(Clone, Debug)]
6277#[repr(C)]
6278pub struct NodeDeprecatedSetFlagsResponse {
6279 pub s: i32,
6280}
6281
6282impl ::fidl_next::Encodable for NodeDeprecatedSetFlagsResponse {
6283 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6284 ::fidl_next::CopyOptimization::enable_if(
6285 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6286 )
6287 };
6288
6289 type Encoded = WireNodeDeprecatedSetFlagsResponse;
6290}
6291
6292unsafe impl<___E> ::fidl_next::Encode<___E> for NodeDeprecatedSetFlagsResponse
6293where
6294 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6295{
6296 #[inline]
6297 fn encode(
6298 self,
6299 encoder: &mut ___E,
6300 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6301 ) -> Result<(), ::fidl_next::EncodeError> {
6302 ::fidl_next::munge! {
6303 let Self::Encoded {
6304 s,
6305
6306 } = out;
6307 }
6308
6309 ::fidl_next::Encode::encode(self.s, encoder, s)?;
6310
6311 Ok(())
6312 }
6313}
6314
6315unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeDeprecatedSetFlagsResponse
6316where
6317 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6318{
6319 #[inline]
6320 fn encode_ref(
6321 &self,
6322 encoder: &mut ___E,
6323 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6324 ) -> Result<(), ::fidl_next::EncodeError> {
6325 ::fidl_next::munge! {
6326 let Self::Encoded {
6327 s,
6328
6329 } = out;
6330 }
6331
6332 ::fidl_next::EncodeRef::encode_ref(&self.s, encoder, s)?;
6333
6334 Ok(())
6335 }
6336}
6337
6338impl ::fidl_next::EncodableOption for Box<NodeDeprecatedSetFlagsResponse> {
6339 type EncodedOption = ::fidl_next::WireBox<WireNodeDeprecatedSetFlagsResponse>;
6340}
6341
6342unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeDeprecatedSetFlagsResponse>
6343where
6344 ___E: ::fidl_next::Encoder + ?Sized,
6345 NodeDeprecatedSetFlagsResponse: ::fidl_next::Encode<___E>,
6346{
6347 #[inline]
6348 fn encode_option(
6349 this: Option<Self>,
6350 encoder: &mut ___E,
6351 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6352 ) -> Result<(), ::fidl_next::EncodeError> {
6353 if let Some(inner) = this {
6354 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6355 ::fidl_next::WireBox::encode_present(out);
6356 } else {
6357 ::fidl_next::WireBox::encode_absent(out);
6358 }
6359
6360 Ok(())
6361 }
6362}
6363
6364unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeDeprecatedSetFlagsResponse>
6365where
6366 ___E: ::fidl_next::Encoder + ?Sized,
6367 NodeDeprecatedSetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6368{
6369 #[inline]
6370 fn encode_option_ref(
6371 this: Option<&Self>,
6372 encoder: &mut ___E,
6373 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6374 ) -> Result<(), ::fidl_next::EncodeError> {
6375 if let Some(inner) = this {
6376 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6377 ::fidl_next::WireBox::encode_present(out);
6378 } else {
6379 ::fidl_next::WireBox::encode_absent(out);
6380 }
6381
6382 Ok(())
6383 }
6384}
6385
6386impl ::fidl_next::TakeFrom<WireNodeDeprecatedSetFlagsResponse> for NodeDeprecatedSetFlagsResponse {
6387 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6388 ::fidl_next::CopyOptimization::enable_if(
6389 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6390 )
6391 };
6392
6393 #[inline]
6394 fn take_from(from: &WireNodeDeprecatedSetFlagsResponse) -> Self {
6395 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
6396 }
6397}
6398
6399#[derive(Clone, Debug)]
6401#[repr(C)]
6402pub struct WireNodeDeprecatedSetFlagsResponse {
6403 pub s: ::fidl_next::WireI32,
6404}
6405
6406unsafe impl ::fidl_next::ZeroPadding for WireNodeDeprecatedSetFlagsResponse {
6407 #[inline]
6408 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6409}
6410
6411unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeDeprecatedSetFlagsResponse
6412where
6413 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6414{
6415 fn decode(
6416 slot: ::fidl_next::Slot<'_, Self>,
6417 decoder: &mut ___D,
6418 ) -> Result<(), ::fidl_next::DecodeError> {
6419 ::fidl_next::munge! {
6420 let Self {
6421 mut s,
6422
6423 } = slot;
6424 }
6425
6426 ::fidl_next::Decode::decode(s.as_mut(), decoder)?;
6427
6428 Ok(())
6429 }
6430}
6431
6432::fidl_next::bitflags! {
6433 #[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(
6434 Clone,
6435 Copy,
6436 Debug,
6437 PartialEq,
6438 Eq,
6439 Hash,
6440 )]
6441 pub struct Flags: u64 {
6442 #[doc = " Allows opening child nodes with [`PROTOCOL_SERVICE`].\n"]const PERM_CONNECT = 1;
6443 #[doc = " Read byte contents of a file.\n"]const PERM_READ_BYTES = 2;
6444 #[doc = " Write byte contents to a file.\n"]const PERM_WRITE_BYTES = 4;
6445 #[doc = " Execute byte contents of a file.\n"]const PERM_EXECUTE = 8;
6446 #[doc = " Get/query attributes of a node.\n"]const PERM_GET_ATTRIBUTES = 16;
6447 #[doc = " Set/update attributes of a node.\n"]const PERM_UPDATE_ATTRIBUTES = 32;
6448 #[doc = " Enumerate (list) directory entries.\n"]const PERM_ENUMERATE = 64;
6449 #[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;
6450 #[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;
6451 #[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;
6452 #[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;
6453 #[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;
6454 #[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;
6455 #[doc = " Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.\n"]const PROTOCOL_DIRECTORY = 524288;
6456 #[doc = " Caller accepts [`fuchsia.io/File`] protocol.\n"]const PROTOCOL_FILE = 8589934592;
6457 #[doc = " Caller accepts [`fuchsia.io/Symlink`] protocol.\n"]const PROTOCOL_SYMLINK = 17179869184;
6458 #[doc = " Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.\n"]const FLAG_SEND_REPRESENTATION = 1099511627776;
6459 #[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;
6460 #[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;
6461 #[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;
6462 #[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;
6463 #[doc = " Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.\n"]const FILE_TRUNCATE = 262144;
6464 const _ = !0;
6465 }
6466}
6467
6468impl ::fidl_next::Encodable for Flags {
6469 type Encoded = WireFlags;
6470}
6471
6472unsafe impl<___E> ::fidl_next::Encode<___E> for Flags
6473where
6474 ___E: ?Sized,
6475{
6476 #[inline]
6477 fn encode(
6478 self,
6479 encoder: &mut ___E,
6480 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6481 ) -> Result<(), ::fidl_next::EncodeError> {
6482 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
6483 }
6484}
6485
6486unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Flags
6487where
6488 ___E: ?Sized,
6489{
6490 #[inline]
6491 fn encode_ref(
6492 &self,
6493 _: &mut ___E,
6494 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6495 ) -> Result<(), ::fidl_next::EncodeError> {
6496 ::fidl_next::munge!(let WireFlags { value } = out);
6497 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
6498 Ok(())
6499 }
6500}
6501
6502impl ::core::convert::From<WireFlags> for Flags {
6503 fn from(wire: WireFlags) -> Self {
6504 Self::from_bits_retain(u64::from(wire.value))
6505 }
6506}
6507
6508impl ::fidl_next::TakeFrom<WireFlags> for Flags {
6509 #[inline]
6510 fn take_from(from: &WireFlags) -> Self {
6511 Self::from(*from)
6512 }
6513}
6514
6515#[derive(Clone, Copy, Debug)]
6517#[repr(transparent)]
6518pub struct WireFlags {
6519 value: ::fidl_next::WireU64,
6520}
6521
6522unsafe impl ::fidl_next::ZeroPadding for WireFlags {
6523 #[inline]
6524 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6525 }
6527}
6528
6529unsafe impl<___D> ::fidl_next::Decode<___D> for WireFlags
6530where
6531 ___D: ?Sized,
6532{
6533 fn decode(
6534 slot: ::fidl_next::Slot<'_, Self>,
6535 _: &mut ___D,
6536 ) -> Result<(), ::fidl_next::DecodeError> {
6537 Ok(())
6538 }
6539}
6540
6541impl ::core::convert::From<Flags> for WireFlags {
6542 fn from(natural: Flags) -> Self {
6543 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
6544 }
6545}
6546
6547#[derive(Clone, Debug)]
6548#[repr(C)]
6549pub struct NodeGetFlagsResponse {
6550 pub flags: crate::Flags,
6551}
6552
6553impl ::fidl_next::Encodable for NodeGetFlagsResponse {
6554 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6555 ::fidl_next::CopyOptimization::enable_if(
6556 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6557 )
6558 };
6559
6560 type Encoded = WireNodeGetFlagsResponse;
6561}
6562
6563unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetFlagsResponse
6564where
6565 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6566{
6567 #[inline]
6568 fn encode(
6569 self,
6570 encoder: &mut ___E,
6571 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6572 ) -> Result<(), ::fidl_next::EncodeError> {
6573 ::fidl_next::munge! {
6574 let Self::Encoded {
6575 flags,
6576
6577 } = out;
6578 }
6579
6580 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6581
6582 Ok(())
6583 }
6584}
6585
6586unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetFlagsResponse
6587where
6588 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6589{
6590 #[inline]
6591 fn encode_ref(
6592 &self,
6593 encoder: &mut ___E,
6594 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6595 ) -> Result<(), ::fidl_next::EncodeError> {
6596 ::fidl_next::munge! {
6597 let Self::Encoded {
6598 flags,
6599
6600 } = out;
6601 }
6602
6603 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6604
6605 Ok(())
6606 }
6607}
6608
6609impl ::fidl_next::EncodableOption for Box<NodeGetFlagsResponse> {
6610 type EncodedOption = ::fidl_next::WireBox<WireNodeGetFlagsResponse>;
6611}
6612
6613unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeGetFlagsResponse>
6614where
6615 ___E: ::fidl_next::Encoder + ?Sized,
6616 NodeGetFlagsResponse: ::fidl_next::Encode<___E>,
6617{
6618 #[inline]
6619 fn encode_option(
6620 this: Option<Self>,
6621 encoder: &mut ___E,
6622 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6623 ) -> Result<(), ::fidl_next::EncodeError> {
6624 if let Some(inner) = this {
6625 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6626 ::fidl_next::WireBox::encode_present(out);
6627 } else {
6628 ::fidl_next::WireBox::encode_absent(out);
6629 }
6630
6631 Ok(())
6632 }
6633}
6634
6635unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeGetFlagsResponse>
6636where
6637 ___E: ::fidl_next::Encoder + ?Sized,
6638 NodeGetFlagsResponse: ::fidl_next::EncodeRef<___E>,
6639{
6640 #[inline]
6641 fn encode_option_ref(
6642 this: Option<&Self>,
6643 encoder: &mut ___E,
6644 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6645 ) -> Result<(), ::fidl_next::EncodeError> {
6646 if let Some(inner) = this {
6647 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6648 ::fidl_next::WireBox::encode_present(out);
6649 } else {
6650 ::fidl_next::WireBox::encode_absent(out);
6651 }
6652
6653 Ok(())
6654 }
6655}
6656
6657impl ::fidl_next::TakeFrom<WireNodeGetFlagsResponse> for NodeGetFlagsResponse {
6658 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6659 ::fidl_next::CopyOptimization::enable_if(
6660 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6661 )
6662 };
6663
6664 #[inline]
6665 fn take_from(from: &WireNodeGetFlagsResponse) -> Self {
6666 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
6667 }
6668}
6669
6670#[derive(Clone, Debug)]
6672#[repr(C)]
6673pub struct WireNodeGetFlagsResponse {
6674 pub flags: crate::WireFlags,
6675}
6676
6677unsafe impl ::fidl_next::ZeroPadding for WireNodeGetFlagsResponse {
6678 #[inline]
6679 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6680}
6681
6682unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetFlagsResponse
6683where
6684 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6685{
6686 fn decode(
6687 slot: ::fidl_next::Slot<'_, Self>,
6688 decoder: &mut ___D,
6689 ) -> Result<(), ::fidl_next::DecodeError> {
6690 ::fidl_next::munge! {
6691 let Self {
6692 mut flags,
6693
6694 } = slot;
6695 }
6696
6697 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6698
6699 Ok(())
6700 }
6701}
6702
6703#[derive(Clone, Debug)]
6704#[repr(C)]
6705pub struct NodeSetFlagsRequest {
6706 pub flags: crate::Flags,
6707}
6708
6709impl ::fidl_next::Encodable for NodeSetFlagsRequest {
6710 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6711 ::fidl_next::CopyOptimization::enable_if(
6712 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6713 )
6714 };
6715
6716 type Encoded = WireNodeSetFlagsRequest;
6717}
6718
6719unsafe impl<___E> ::fidl_next::Encode<___E> for NodeSetFlagsRequest
6720where
6721 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6722{
6723 #[inline]
6724 fn encode(
6725 self,
6726 encoder: &mut ___E,
6727 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6728 ) -> Result<(), ::fidl_next::EncodeError> {
6729 ::fidl_next::munge! {
6730 let Self::Encoded {
6731 flags,
6732
6733 } = out;
6734 }
6735
6736 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
6737
6738 Ok(())
6739 }
6740}
6741
6742unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeSetFlagsRequest
6743where
6744 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6745{
6746 #[inline]
6747 fn encode_ref(
6748 &self,
6749 encoder: &mut ___E,
6750 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6751 ) -> Result<(), ::fidl_next::EncodeError> {
6752 ::fidl_next::munge! {
6753 let Self::Encoded {
6754 flags,
6755
6756 } = out;
6757 }
6758
6759 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
6760
6761 Ok(())
6762 }
6763}
6764
6765impl ::fidl_next::EncodableOption for Box<NodeSetFlagsRequest> {
6766 type EncodedOption = ::fidl_next::WireBox<WireNodeSetFlagsRequest>;
6767}
6768
6769unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeSetFlagsRequest>
6770where
6771 ___E: ::fidl_next::Encoder + ?Sized,
6772 NodeSetFlagsRequest: ::fidl_next::Encode<___E>,
6773{
6774 #[inline]
6775 fn encode_option(
6776 this: Option<Self>,
6777 encoder: &mut ___E,
6778 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6779 ) -> Result<(), ::fidl_next::EncodeError> {
6780 if let Some(inner) = this {
6781 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6782 ::fidl_next::WireBox::encode_present(out);
6783 } else {
6784 ::fidl_next::WireBox::encode_absent(out);
6785 }
6786
6787 Ok(())
6788 }
6789}
6790
6791unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeSetFlagsRequest>
6792where
6793 ___E: ::fidl_next::Encoder + ?Sized,
6794 NodeSetFlagsRequest: ::fidl_next::EncodeRef<___E>,
6795{
6796 #[inline]
6797 fn encode_option_ref(
6798 this: Option<&Self>,
6799 encoder: &mut ___E,
6800 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6801 ) -> Result<(), ::fidl_next::EncodeError> {
6802 if let Some(inner) = this {
6803 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6804 ::fidl_next::WireBox::encode_present(out);
6805 } else {
6806 ::fidl_next::WireBox::encode_absent(out);
6807 }
6808
6809 Ok(())
6810 }
6811}
6812
6813impl ::fidl_next::TakeFrom<WireNodeSetFlagsRequest> for NodeSetFlagsRequest {
6814 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
6815 ::fidl_next::CopyOptimization::enable_if(
6816 true && <crate::Flags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
6817 )
6818 };
6819
6820 #[inline]
6821 fn take_from(from: &WireNodeSetFlagsRequest) -> Self {
6822 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
6823 }
6824}
6825
6826#[derive(Clone, Debug)]
6828#[repr(C)]
6829pub struct WireNodeSetFlagsRequest {
6830 pub flags: crate::WireFlags,
6831}
6832
6833unsafe impl ::fidl_next::ZeroPadding for WireNodeSetFlagsRequest {
6834 #[inline]
6835 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6836}
6837
6838unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeSetFlagsRequest
6839where
6840 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6841{
6842 fn decode(
6843 slot: ::fidl_next::Slot<'_, Self>,
6844 decoder: &mut ___D,
6845 ) -> Result<(), ::fidl_next::DecodeError> {
6846 ::fidl_next::munge! {
6847 let Self {
6848 mut flags,
6849
6850 } = slot;
6851 }
6852
6853 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
6854
6855 Ok(())
6856 }
6857}
6858
6859#[doc = " The maximum size for passing the SELinux context as an attribute.\n"]
6860pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256;
6861
6862#[doc = " Used in places where empty structs are needed, such as empty union members, to avoid creating\n new struct types.\n"]
6863#[derive(Clone, Debug)]
6864#[repr(C)]
6865pub struct EmptyStruct {}
6866
6867impl ::fidl_next::Encodable for EmptyStruct {
6868 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
6869 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
6870
6871 type Encoded = WireEmptyStruct;
6872}
6873
6874unsafe impl<___E> ::fidl_next::Encode<___E> for EmptyStruct
6875where
6876 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6877{
6878 #[inline]
6879 fn encode(
6880 self,
6881 encoder: &mut ___E,
6882 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6883 ) -> Result<(), ::fidl_next::EncodeError> {
6884 ::fidl_next::munge! {
6885 let Self::Encoded {
6886
6887 } = out;
6888 }
6889
6890 Ok(())
6891 }
6892}
6893
6894unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EmptyStruct
6895where
6896 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6897{
6898 #[inline]
6899 fn encode_ref(
6900 &self,
6901 encoder: &mut ___E,
6902 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6903 ) -> Result<(), ::fidl_next::EncodeError> {
6904 ::fidl_next::munge! {
6905 let Self::Encoded {
6906
6907 } = out;
6908 }
6909
6910 Ok(())
6911 }
6912}
6913
6914impl ::fidl_next::EncodableOption for Box<EmptyStruct> {
6915 type EncodedOption = ::fidl_next::WireBox<WireEmptyStruct>;
6916}
6917
6918unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<EmptyStruct>
6919where
6920 ___E: ::fidl_next::Encoder + ?Sized,
6921 EmptyStruct: ::fidl_next::Encode<___E>,
6922{
6923 #[inline]
6924 fn encode_option(
6925 this: Option<Self>,
6926 encoder: &mut ___E,
6927 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6928 ) -> Result<(), ::fidl_next::EncodeError> {
6929 if let Some(inner) = this {
6930 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
6931 ::fidl_next::WireBox::encode_present(out);
6932 } else {
6933 ::fidl_next::WireBox::encode_absent(out);
6934 }
6935
6936 Ok(())
6937 }
6938}
6939
6940unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<EmptyStruct>
6941where
6942 ___E: ::fidl_next::Encoder + ?Sized,
6943 EmptyStruct: ::fidl_next::EncodeRef<___E>,
6944{
6945 #[inline]
6946 fn encode_option_ref(
6947 this: Option<&Self>,
6948 encoder: &mut ___E,
6949 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6950 ) -> Result<(), ::fidl_next::EncodeError> {
6951 if let Some(inner) = this {
6952 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6953 ::fidl_next::WireBox::encode_present(out);
6954 } else {
6955 ::fidl_next::WireBox::encode_absent(out);
6956 }
6957
6958 Ok(())
6959 }
6960}
6961
6962impl ::fidl_next::TakeFrom<WireEmptyStruct> for EmptyStruct {
6963 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
6964 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
6965
6966 #[inline]
6967 fn take_from(from: &WireEmptyStruct) -> Self {
6968 Self {}
6969 }
6970}
6971
6972#[derive(Clone, Debug)]
6974#[repr(C)]
6975pub struct WireEmptyStruct {}
6976
6977unsafe impl ::fidl_next::ZeroPadding for WireEmptyStruct {
6978 #[inline]
6979 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6980}
6981
6982unsafe impl<___D> ::fidl_next::Decode<___D> for WireEmptyStruct
6983where
6984 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6985{
6986 fn decode(
6987 slot: ::fidl_next::Slot<'_, Self>,
6988 decoder: &mut ___D,
6989 ) -> Result<(), ::fidl_next::DecodeError> {
6990 ::fidl_next::munge! {
6991 let Self {
6992
6993 } = slot;
6994 }
6995
6996 Ok(())
6997 }
6998}
6999
7000#[derive(Clone, Debug)]
7001pub enum SelinuxContext {
7002 Data(Vec<u8>),
7003
7004 UseExtendedAttributes(crate::EmptyStruct),
7005
7006 UnknownOrdinal_(u64),
7007}
7008
7009impl ::fidl_next::Encodable for SelinuxContext {
7010 type Encoded = WireSelinuxContext;
7011}
7012
7013unsafe impl<___E> ::fidl_next::Encode<___E> for SelinuxContext
7014where
7015 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7016
7017 ___E: ::fidl_next::Encoder,
7018{
7019 #[inline]
7020 fn encode(
7021 self,
7022 encoder: &mut ___E,
7023 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7024 ) -> Result<(), ::fidl_next::EncodeError> {
7025 ::fidl_next::munge!(let WireSelinuxContext { raw } = out);
7026
7027 match self {
7028 Self::Data(value) => {
7029 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
7030 }
7031
7032 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7033 ___E,
7034 crate::EmptyStruct,
7035 >(value, 2, encoder, raw)?,
7036
7037 Self::UnknownOrdinal_(ordinal) => {
7038 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
7039 }
7040 }
7041
7042 Ok(())
7043 }
7044}
7045
7046unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelinuxContext
7047where
7048 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7049
7050 ___E: ::fidl_next::Encoder,
7051{
7052 #[inline]
7053 fn encode_ref(
7054 &self,
7055 encoder: &mut ___E,
7056 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7057 ) -> Result<(), ::fidl_next::EncodeError> {
7058 ::fidl_next::munge!(let WireSelinuxContext { raw } = out);
7059
7060 match self {
7061 Self::Data(value) => {
7062 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 1, encoder, raw)?
7063 }
7064
7065 Self::UseExtendedAttributes(value) => ::fidl_next::RawWireUnion::encode_as::<
7066 ___E,
7067 &crate::EmptyStruct,
7068 >(value, 2, encoder, raw)?,
7069
7070 Self::UnknownOrdinal_(ordinal) => {
7071 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
7072 }
7073 }
7074
7075 Ok(())
7076 }
7077}
7078
7079impl ::fidl_next::EncodableOption for Box<SelinuxContext> {
7080 type EncodedOption = WireOptionalSelinuxContext;
7081}
7082
7083unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<SelinuxContext>
7084where
7085 ___E: ?Sized,
7086 SelinuxContext: ::fidl_next::Encode<___E>,
7087{
7088 #[inline]
7089 fn encode_option(
7090 this: Option<Self>,
7091 encoder: &mut ___E,
7092 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7093 ) -> Result<(), ::fidl_next::EncodeError> {
7094 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw } = &mut *out);
7095
7096 if let Some(inner) = this {
7097 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7098 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7099 } else {
7100 ::fidl_next::RawWireUnion::encode_absent(raw);
7101 }
7102
7103 Ok(())
7104 }
7105}
7106
7107unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<SelinuxContext>
7108where
7109 ___E: ?Sized,
7110 SelinuxContext: ::fidl_next::EncodeRef<___E>,
7111{
7112 #[inline]
7113 fn encode_option_ref(
7114 this: Option<&Self>,
7115 encoder: &mut ___E,
7116 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7117 ) -> Result<(), ::fidl_next::EncodeError> {
7118 ::fidl_next::munge!(let WireOptionalSelinuxContext { raw } = &mut *out);
7119
7120 if let Some(inner) = this {
7121 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7122 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7123 } else {
7124 ::fidl_next::RawWireUnion::encode_absent(raw);
7125 }
7126
7127 Ok(())
7128 }
7129}
7130
7131impl ::fidl_next::TakeFrom<WireSelinuxContext> for SelinuxContext {
7132 #[inline]
7133 fn take_from(from: &WireSelinuxContext) -> Self {
7134 match from.raw.ordinal() {
7135 1 => Self::Data(::fidl_next::TakeFrom::take_from(unsafe {
7136 from.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
7137 })),
7138
7139 2 => Self::UseExtendedAttributes(::fidl_next::TakeFrom::take_from(unsafe {
7140 from.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7141 })),
7142
7143 _ => unsafe { ::core::hint::unreachable_unchecked() },
7144 }
7145 }
7146}
7147
7148impl ::fidl_next::TakeFrom<WireOptionalSelinuxContext> for Option<Box<SelinuxContext>> {
7149 #[inline]
7150 fn take_from(from: &WireOptionalSelinuxContext) -> Self {
7151 if let Some(inner) = from.as_ref() {
7152 Some(::fidl_next::TakeFrom::take_from(inner))
7153 } else {
7154 None
7155 }
7156 }
7157}
7158
7159#[repr(transparent)]
7161pub struct WireSelinuxContext {
7162 raw: ::fidl_next::RawWireUnion,
7163}
7164
7165unsafe impl ::fidl_next::ZeroPadding for WireSelinuxContext {
7166 #[inline]
7167 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7168 ::fidl_next::munge!(let Self { raw } = out);
7169 ::fidl_next::RawWireUnion::zero_padding(raw);
7170 }
7171}
7172
7173pub mod selinux_context {
7174 pub enum Ref<'union> {
7175 Data(&'union ::fidl_next::WireVector<u8>),
7176
7177 UseExtendedAttributes(&'union crate::WireEmptyStruct),
7178
7179 UnknownOrdinal_(u64),
7180 }
7181}
7182
7183impl WireSelinuxContext {
7184 pub fn as_ref(&self) -> crate::selinux_context::Ref<'_> {
7185 match self.raw.ordinal() {
7186 1 => crate::selinux_context::Ref::Data(unsafe {
7187 self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
7188 }),
7189
7190 2 => crate::selinux_context::Ref::UseExtendedAttributes(unsafe {
7191 self.raw.get().deref_unchecked::<crate::WireEmptyStruct>()
7192 }),
7193
7194 unknown => crate::selinux_context::Ref::UnknownOrdinal_(unknown),
7195 }
7196 }
7197}
7198
7199unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelinuxContext
7200where
7201 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7202
7203 ___D: ::fidl_next::Decoder,
7204{
7205 fn decode(
7206 mut slot: ::fidl_next::Slot<'_, Self>,
7207 decoder: &mut ___D,
7208 ) -> Result<(), ::fidl_next::DecodeError> {
7209 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7210 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7211 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
7212 raw, decoder,
7213 )?,
7214
7215 2 => {
7216 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7217 }
7218
7219 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7220 }
7221
7222 Ok(())
7223 }
7224}
7225
7226impl ::core::fmt::Debug for WireSelinuxContext {
7227 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7228 match self.raw.ordinal() {
7229 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>().fmt(f) },
7230 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireEmptyStruct>().fmt(f) },
7231 _ => unsafe { ::core::hint::unreachable_unchecked() },
7232 }
7233 }
7234}
7235
7236#[repr(transparent)]
7237pub struct WireOptionalSelinuxContext {
7238 raw: ::fidl_next::RawWireUnion,
7239}
7240
7241unsafe impl ::fidl_next::ZeroPadding for WireOptionalSelinuxContext {
7242 #[inline]
7243 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7244 ::fidl_next::munge!(let Self { raw } = out);
7245 ::fidl_next::RawWireUnion::zero_padding(raw);
7246 }
7247}
7248
7249impl WireOptionalSelinuxContext {
7250 pub fn is_some(&self) -> bool {
7251 self.raw.is_some()
7252 }
7253
7254 pub fn is_none(&self) -> bool {
7255 self.raw.is_none()
7256 }
7257
7258 pub fn as_ref(&self) -> Option<&WireSelinuxContext> {
7259 if self.is_some() {
7260 Some(unsafe { &*(self as *const Self).cast() })
7261 } else {
7262 None
7263 }
7264 }
7265}
7266
7267unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalSelinuxContext
7268where
7269 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7270
7271 ___D: ::fidl_next::Decoder,
7272{
7273 fn decode(
7274 mut slot: ::fidl_next::Slot<'_, Self>,
7275 decoder: &mut ___D,
7276 ) -> Result<(), ::fidl_next::DecodeError> {
7277 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7278 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7279 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
7280 raw, decoder,
7281 )?,
7282
7283 2 => {
7284 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEmptyStruct>(raw, decoder)?
7285 }
7286
7287 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7288 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7289 }
7290
7291 Ok(())
7292 }
7293}
7294
7295impl ::core::fmt::Debug for WireOptionalSelinuxContext {
7296 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7297 self.as_ref().fmt(f)
7298 }
7299}
7300
7301#[derive(Clone, Debug, Default)]
7302pub struct MutableNodeAttributes {
7303 pub creation_time: Option<u64>,
7304
7305 pub modification_time: Option<u64>,
7306
7307 pub mode: Option<u32>,
7308
7309 pub uid: Option<u32>,
7310
7311 pub gid: Option<u32>,
7312
7313 pub rdev: Option<u64>,
7314
7315 pub access_time: Option<u64>,
7316
7317 pub casefold: Option<bool>,
7318
7319 pub selinux_context: Option<crate::SelinuxContext>,
7320
7321 pub wrapping_key_id: Option<[u8; 16]>,
7322}
7323
7324impl MutableNodeAttributes {
7325 fn __max_ordinal(&self) -> usize {
7326 if self.creation_time.is_some() {
7327 return 1;
7328 }
7329
7330 if self.modification_time.is_some() {
7331 return 2;
7332 }
7333
7334 if self.mode.is_some() {
7335 return 3;
7336 }
7337
7338 if self.uid.is_some() {
7339 return 4;
7340 }
7341
7342 if self.gid.is_some() {
7343 return 5;
7344 }
7345
7346 if self.rdev.is_some() {
7347 return 6;
7348 }
7349
7350 if self.access_time.is_some() {
7351 return 7;
7352 }
7353
7354 if self.casefold.is_some() {
7355 return 8;
7356 }
7357
7358 if self.selinux_context.is_some() {
7359 return 9;
7360 }
7361
7362 if self.wrapping_key_id.is_some() {
7363 return 10;
7364 }
7365
7366 0
7367 }
7368}
7369
7370impl ::fidl_next::Encodable for MutableNodeAttributes {
7371 type Encoded = WireMutableNodeAttributes;
7372}
7373
7374unsafe impl<___E> ::fidl_next::Encode<___E> for MutableNodeAttributes
7375where
7376 ___E: ::fidl_next::Encoder + ?Sized,
7377{
7378 #[inline]
7379 fn encode(
7380 mut self,
7381 encoder: &mut ___E,
7382 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7383 ) -> Result<(), ::fidl_next::EncodeError> {
7384 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
7385
7386 let max_ord = self.__max_ordinal();
7387
7388 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7389 ::fidl_next::ZeroPadding::zero_padding(&mut out);
7390
7391 let mut preallocated =
7392 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7393
7394 for i in 1..=max_ord {
7395 match i {
7396 10 => {
7397 if let Some(wrapping_key_id) = self.wrapping_key_id.take() {
7398 ::fidl_next::WireEnvelope::encode_value(
7399 wrapping_key_id,
7400 preallocated.encoder,
7401 &mut out,
7402 )?;
7403 } else {
7404 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7405 }
7406 }
7407
7408 9 => {
7409 if let Some(selinux_context) = self.selinux_context.take() {
7410 ::fidl_next::WireEnvelope::encode_value(
7411 selinux_context,
7412 preallocated.encoder,
7413 &mut out,
7414 )?;
7415 } else {
7416 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7417 }
7418 }
7419
7420 8 => {
7421 if let Some(casefold) = self.casefold.take() {
7422 ::fidl_next::WireEnvelope::encode_value(
7423 casefold,
7424 preallocated.encoder,
7425 &mut out,
7426 )?;
7427 } else {
7428 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7429 }
7430 }
7431
7432 7 => {
7433 if let Some(access_time) = self.access_time.take() {
7434 ::fidl_next::WireEnvelope::encode_value(
7435 access_time,
7436 preallocated.encoder,
7437 &mut out,
7438 )?;
7439 } else {
7440 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7441 }
7442 }
7443
7444 6 => {
7445 if let Some(rdev) = self.rdev.take() {
7446 ::fidl_next::WireEnvelope::encode_value(
7447 rdev,
7448 preallocated.encoder,
7449 &mut out,
7450 )?;
7451 } else {
7452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7453 }
7454 }
7455
7456 5 => {
7457 if let Some(gid) = self.gid.take() {
7458 ::fidl_next::WireEnvelope::encode_value(
7459 gid,
7460 preallocated.encoder,
7461 &mut out,
7462 )?;
7463 } else {
7464 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7465 }
7466 }
7467
7468 4 => {
7469 if let Some(uid) = self.uid.take() {
7470 ::fidl_next::WireEnvelope::encode_value(
7471 uid,
7472 preallocated.encoder,
7473 &mut out,
7474 )?;
7475 } else {
7476 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7477 }
7478 }
7479
7480 3 => {
7481 if let Some(mode) = self.mode.take() {
7482 ::fidl_next::WireEnvelope::encode_value(
7483 mode,
7484 preallocated.encoder,
7485 &mut out,
7486 )?;
7487 } else {
7488 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7489 }
7490 }
7491
7492 2 => {
7493 if let Some(modification_time) = self.modification_time.take() {
7494 ::fidl_next::WireEnvelope::encode_value(
7495 modification_time,
7496 preallocated.encoder,
7497 &mut out,
7498 )?;
7499 } else {
7500 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7501 }
7502 }
7503
7504 1 => {
7505 if let Some(creation_time) = self.creation_time.take() {
7506 ::fidl_next::WireEnvelope::encode_value(
7507 creation_time,
7508 preallocated.encoder,
7509 &mut out,
7510 )?;
7511 } else {
7512 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7513 }
7514 }
7515
7516 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7517 }
7518 unsafe {
7519 preallocated.write_next(out.assume_init_ref());
7520 }
7521 }
7522
7523 ::fidl_next::WireTable::encode_len(table, max_ord);
7524
7525 Ok(())
7526 }
7527}
7528
7529unsafe impl<___E> ::fidl_next::EncodeRef<___E> for MutableNodeAttributes
7530where
7531 ___E: ::fidl_next::Encoder + ?Sized,
7532{
7533 #[inline]
7534 fn encode_ref(
7535 &self,
7536 encoder: &mut ___E,
7537 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7538 ) -> Result<(), ::fidl_next::EncodeError> {
7539 ::fidl_next::munge!(let WireMutableNodeAttributes { table } = out);
7540
7541 let max_ord = self.__max_ordinal();
7542
7543 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7544 ::fidl_next::ZeroPadding::zero_padding(&mut out);
7545
7546 let mut preallocated =
7547 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7548
7549 for i in 1..=max_ord {
7550 match i {
7551 10 => {
7552 if let Some(wrapping_key_id) = &self.wrapping_key_id {
7553 ::fidl_next::WireEnvelope::encode_value(
7554 wrapping_key_id,
7555 preallocated.encoder,
7556 &mut out,
7557 )?;
7558 } else {
7559 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7560 }
7561 }
7562
7563 9 => {
7564 if let Some(selinux_context) = &self.selinux_context {
7565 ::fidl_next::WireEnvelope::encode_value(
7566 selinux_context,
7567 preallocated.encoder,
7568 &mut out,
7569 )?;
7570 } else {
7571 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7572 }
7573 }
7574
7575 8 => {
7576 if let Some(casefold) = &self.casefold {
7577 ::fidl_next::WireEnvelope::encode_value(
7578 casefold,
7579 preallocated.encoder,
7580 &mut out,
7581 )?;
7582 } else {
7583 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7584 }
7585 }
7586
7587 7 => {
7588 if let Some(access_time) = &self.access_time {
7589 ::fidl_next::WireEnvelope::encode_value(
7590 access_time,
7591 preallocated.encoder,
7592 &mut out,
7593 )?;
7594 } else {
7595 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7596 }
7597 }
7598
7599 6 => {
7600 if let Some(rdev) = &self.rdev {
7601 ::fidl_next::WireEnvelope::encode_value(
7602 rdev,
7603 preallocated.encoder,
7604 &mut out,
7605 )?;
7606 } else {
7607 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7608 }
7609 }
7610
7611 5 => {
7612 if let Some(gid) = &self.gid {
7613 ::fidl_next::WireEnvelope::encode_value(
7614 gid,
7615 preallocated.encoder,
7616 &mut out,
7617 )?;
7618 } else {
7619 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7620 }
7621 }
7622
7623 4 => {
7624 if let Some(uid) = &self.uid {
7625 ::fidl_next::WireEnvelope::encode_value(
7626 uid,
7627 preallocated.encoder,
7628 &mut out,
7629 )?;
7630 } else {
7631 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7632 }
7633 }
7634
7635 3 => {
7636 if let Some(mode) = &self.mode {
7637 ::fidl_next::WireEnvelope::encode_value(
7638 mode,
7639 preallocated.encoder,
7640 &mut out,
7641 )?;
7642 } else {
7643 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7644 }
7645 }
7646
7647 2 => {
7648 if let Some(modification_time) = &self.modification_time {
7649 ::fidl_next::WireEnvelope::encode_value(
7650 modification_time,
7651 preallocated.encoder,
7652 &mut out,
7653 )?;
7654 } else {
7655 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7656 }
7657 }
7658
7659 1 => {
7660 if let Some(creation_time) = &self.creation_time {
7661 ::fidl_next::WireEnvelope::encode_value(
7662 creation_time,
7663 preallocated.encoder,
7664 &mut out,
7665 )?;
7666 } else {
7667 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7668 }
7669 }
7670
7671 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7672 }
7673 unsafe {
7674 preallocated.write_next(out.assume_init_ref());
7675 }
7676 }
7677
7678 ::fidl_next::WireTable::encode_len(table, max_ord);
7679
7680 Ok(())
7681 }
7682}
7683
7684impl ::fidl_next::TakeFrom<WireMutableNodeAttributes> for MutableNodeAttributes {
7685 #[inline]
7686 fn take_from(from: &WireMutableNodeAttributes) -> Self {
7687 Self {
7688 creation_time: from.creation_time().map(::fidl_next::TakeFrom::take_from),
7689
7690 modification_time: from.modification_time().map(::fidl_next::TakeFrom::take_from),
7691
7692 mode: from.mode().map(::fidl_next::TakeFrom::take_from),
7693
7694 uid: from.uid().map(::fidl_next::TakeFrom::take_from),
7695
7696 gid: from.gid().map(::fidl_next::TakeFrom::take_from),
7697
7698 rdev: from.rdev().map(::fidl_next::TakeFrom::take_from),
7699
7700 access_time: from.access_time().map(::fidl_next::TakeFrom::take_from),
7701
7702 casefold: from.casefold().map(::fidl_next::TakeFrom::take_from),
7703
7704 selinux_context: from.selinux_context().map(::fidl_next::TakeFrom::take_from),
7705
7706 wrapping_key_id: from.wrapping_key_id().map(::fidl_next::TakeFrom::take_from),
7707 }
7708 }
7709}
7710
7711#[repr(C)]
7713pub struct WireMutableNodeAttributes {
7714 table: ::fidl_next::WireTable,
7715}
7716
7717unsafe impl ::fidl_next::ZeroPadding for WireMutableNodeAttributes {
7718 #[inline]
7719 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7720 ::fidl_next::munge!(let Self { table } = out);
7721 ::fidl_next::WireTable::zero_padding(table);
7722 }
7723}
7724
7725unsafe impl<___D> ::fidl_next::Decode<___D> for WireMutableNodeAttributes
7726where
7727 ___D: ::fidl_next::Decoder + ?Sized,
7728{
7729 fn decode(
7730 slot: ::fidl_next::Slot<'_, Self>,
7731 decoder: &mut ___D,
7732 ) -> Result<(), ::fidl_next::DecodeError> {
7733 ::fidl_next::munge!(let Self { table } = slot);
7734
7735 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7736 match ordinal {
7737 0 => unsafe { ::core::hint::unreachable_unchecked() },
7738
7739 1 => {
7740 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7741 slot.as_mut(),
7742 decoder,
7743 )?;
7744
7745 Ok(())
7746 }
7747
7748 2 => {
7749 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7750 slot.as_mut(),
7751 decoder,
7752 )?;
7753
7754 Ok(())
7755 }
7756
7757 3 => {
7758 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
7759 slot.as_mut(),
7760 decoder,
7761 )?;
7762
7763 Ok(())
7764 }
7765
7766 4 => {
7767 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
7768 slot.as_mut(),
7769 decoder,
7770 )?;
7771
7772 Ok(())
7773 }
7774
7775 5 => {
7776 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
7777 slot.as_mut(),
7778 decoder,
7779 )?;
7780
7781 Ok(())
7782 }
7783
7784 6 => {
7785 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7786 slot.as_mut(),
7787 decoder,
7788 )?;
7789
7790 Ok(())
7791 }
7792
7793 7 => {
7794 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
7795 slot.as_mut(),
7796 decoder,
7797 )?;
7798
7799 Ok(())
7800 }
7801
7802 8 => {
7803 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
7804
7805 Ok(())
7806 }
7807
7808 9 => {
7809 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireSelinuxContext>(
7810 slot.as_mut(),
7811 decoder,
7812 )?;
7813
7814 Ok(())
7815 }
7816
7817 10 => {
7818 ::fidl_next::WireEnvelope::decode_as::<___D, [u8; 16]>(slot.as_mut(), decoder)?;
7819
7820 Ok(())
7821 }
7822
7823 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7824 }
7825 })
7826 }
7827}
7828
7829impl WireMutableNodeAttributes {
7830 pub fn creation_time(&self) -> Option<&::fidl_next::WireU64> {
7831 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7832 }
7833
7834 pub fn modification_time(&self) -> Option<&::fidl_next::WireU64> {
7835 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7836 }
7837
7838 pub fn mode(&self) -> Option<&::fidl_next::WireU32> {
7839 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7840 }
7841
7842 pub fn uid(&self) -> Option<&::fidl_next::WireU32> {
7843 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
7844 }
7845
7846 pub fn gid(&self) -> Option<&::fidl_next::WireU32> {
7847 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
7848 }
7849
7850 pub fn rdev(&self) -> Option<&::fidl_next::WireU64> {
7851 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
7852 }
7853
7854 pub fn access_time(&self) -> Option<&::fidl_next::WireU64> {
7855 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
7856 }
7857
7858 pub fn casefold(&self) -> Option<&bool> {
7859 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
7860 }
7861
7862 pub fn selinux_context(&self) -> Option<&crate::WireSelinuxContext> {
7863 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
7864 }
7865
7866 pub fn wrapping_key_id(&self) -> Option<&[u8; 16]> {
7867 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
7868 }
7869}
7870
7871impl ::core::fmt::Debug for WireMutableNodeAttributes {
7872 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7873 f.debug_struct("MutableNodeAttributes")
7874 .field("creation_time", &self.creation_time())
7875 .field("modification_time", &self.modification_time())
7876 .field("mode", &self.mode())
7877 .field("uid", &self.uid())
7878 .field("gid", &self.gid())
7879 .field("rdev", &self.rdev())
7880 .field("access_time", &self.access_time())
7881 .field("casefold", &self.casefold())
7882 .field("selinux_context", &self.selinux_context())
7883 .field("wrapping_key_id", &self.wrapping_key_id())
7884 .finish()
7885 }
7886}
7887
7888::fidl_next::bitflags! {
7889 #[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(
7890 Clone,
7891 Copy,
7892 Debug,
7893 PartialEq,
7894 Eq,
7895 Hash,
7896 )]
7897 pub struct NodeProtocolKinds: u64 {
7898 #[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;
7899 #[doc = " The directory representation of a node.\n\n The connection will speak the [`Directory`] protocol.\n"]const DIRECTORY = 2;
7900 #[doc = " The file representation of a node.\n\n The connection will speak the [`File`] protocol.\n"]const FILE = 4;
7901 #[doc = " The symlink representation of a node.\n\n The connection will speak the [`Symlink`] protocol.\n"]const SYMLINK = 8;
7902 const _ = !0;
7903 }
7904}
7905
7906impl ::fidl_next::Encodable for NodeProtocolKinds {
7907 type Encoded = WireNodeProtocolKinds;
7908}
7909
7910unsafe impl<___E> ::fidl_next::Encode<___E> for NodeProtocolKinds
7911where
7912 ___E: ?Sized,
7913{
7914 #[inline]
7915 fn encode(
7916 self,
7917 encoder: &mut ___E,
7918 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7919 ) -> Result<(), ::fidl_next::EncodeError> {
7920 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
7921 }
7922}
7923
7924unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeProtocolKinds
7925where
7926 ___E: ?Sized,
7927{
7928 #[inline]
7929 fn encode_ref(
7930 &self,
7931 _: &mut ___E,
7932 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7933 ) -> Result<(), ::fidl_next::EncodeError> {
7934 ::fidl_next::munge!(let WireNodeProtocolKinds { value } = out);
7935 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
7936 Ok(())
7937 }
7938}
7939
7940impl ::core::convert::From<WireNodeProtocolKinds> for NodeProtocolKinds {
7941 fn from(wire: WireNodeProtocolKinds) -> Self {
7942 Self::from_bits_retain(u64::from(wire.value))
7943 }
7944}
7945
7946impl ::fidl_next::TakeFrom<WireNodeProtocolKinds> for NodeProtocolKinds {
7947 #[inline]
7948 fn take_from(from: &WireNodeProtocolKinds) -> Self {
7949 Self::from(*from)
7950 }
7951}
7952
7953#[derive(Clone, Copy, Debug)]
7955#[repr(transparent)]
7956pub struct WireNodeProtocolKinds {
7957 value: ::fidl_next::WireU64,
7958}
7959
7960unsafe impl ::fidl_next::ZeroPadding for WireNodeProtocolKinds {
7961 #[inline]
7962 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7963 }
7965}
7966
7967unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeProtocolKinds
7968where
7969 ___D: ?Sized,
7970{
7971 fn decode(
7972 slot: ::fidl_next::Slot<'_, Self>,
7973 _: &mut ___D,
7974 ) -> Result<(), ::fidl_next::DecodeError> {
7975 Ok(())
7976 }
7977}
7978
7979impl ::core::convert::From<NodeProtocolKinds> for WireNodeProtocolKinds {
7980 fn from(natural: NodeProtocolKinds) -> Self {
7981 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
7982 }
7983}
7984
7985#[doc = " Denotes which hash algorithm is used to build the merkle tree for\n fsverity-enabled files.\n"]
7986#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7987#[repr(u8)]
7988pub enum HashAlgorithm {
7989 Sha256 = 1,
7990 Sha512 = 2,
7991 UnknownOrdinal_(u8),
7992}
7993
7994impl ::fidl_next::Encodable for HashAlgorithm {
7995 type Encoded = WireHashAlgorithm;
7996}
7997impl ::std::convert::From<u8> for HashAlgorithm {
7998 fn from(value: u8) -> Self {
7999 match value {
8000 1 => Self::Sha256,
8001 2 => Self::Sha512,
8002
8003 _ => Self::UnknownOrdinal_(value),
8004 }
8005 }
8006}
8007
8008unsafe impl<___E> ::fidl_next::Encode<___E> for HashAlgorithm
8009where
8010 ___E: ?Sized,
8011{
8012 #[inline]
8013 fn encode(
8014 self,
8015 encoder: &mut ___E,
8016 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8017 ) -> Result<(), ::fidl_next::EncodeError> {
8018 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8019 }
8020}
8021
8022unsafe impl<___E> ::fidl_next::EncodeRef<___E> for HashAlgorithm
8023where
8024 ___E: ?Sized,
8025{
8026 #[inline]
8027 fn encode_ref(
8028 &self,
8029 encoder: &mut ___E,
8030 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8031 ) -> Result<(), ::fidl_next::EncodeError> {
8032 ::fidl_next::munge!(let WireHashAlgorithm { value } = out);
8033 let _ = value.write(u8::from(match *self {
8034 Self::Sha256 => 1,
8035
8036 Self::Sha512 => 2,
8037
8038 Self::UnknownOrdinal_(value) => value,
8039 }));
8040
8041 Ok(())
8042 }
8043}
8044
8045impl ::core::convert::From<WireHashAlgorithm> for HashAlgorithm {
8046 fn from(wire: WireHashAlgorithm) -> Self {
8047 match u8::from(wire.value) {
8048 1 => Self::Sha256,
8049
8050 2 => Self::Sha512,
8051
8052 value => Self::UnknownOrdinal_(value),
8053 }
8054 }
8055}
8056
8057impl ::fidl_next::TakeFrom<WireHashAlgorithm> for HashAlgorithm {
8058 #[inline]
8059 fn take_from(from: &WireHashAlgorithm) -> Self {
8060 Self::from(*from)
8061 }
8062}
8063
8064#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8066#[repr(transparent)]
8067pub struct WireHashAlgorithm {
8068 value: u8,
8069}
8070
8071unsafe impl ::fidl_next::ZeroPadding for WireHashAlgorithm {
8072 #[inline]
8073 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8074 }
8076}
8077
8078impl WireHashAlgorithm {
8079 pub const SHA256: WireHashAlgorithm = WireHashAlgorithm { value: 1 };
8080
8081 pub const SHA512: WireHashAlgorithm = WireHashAlgorithm { value: 2 };
8082}
8083
8084unsafe impl<___D> ::fidl_next::Decode<___D> for WireHashAlgorithm
8085where
8086 ___D: ?Sized,
8087{
8088 fn decode(
8089 slot: ::fidl_next::Slot<'_, Self>,
8090 _: &mut ___D,
8091 ) -> Result<(), ::fidl_next::DecodeError> {
8092 Ok(())
8093 }
8094}
8095
8096impl ::core::convert::From<HashAlgorithm> for WireHashAlgorithm {
8097 fn from(natural: HashAlgorithm) -> Self {
8098 match natural {
8099 HashAlgorithm::Sha256 => WireHashAlgorithm::SHA256,
8100
8101 HashAlgorithm::Sha512 => WireHashAlgorithm::SHA512,
8102
8103 HashAlgorithm::UnknownOrdinal_(value) => WireHashAlgorithm { value: u8::from(value) },
8104 }
8105 }
8106}
8107
8108#[doc = " Set of options used to enable verity on a file.\n"]
8109#[derive(Clone, Debug, Default)]
8110pub struct VerificationOptions {
8111 pub hash_algorithm: Option<crate::HashAlgorithm>,
8112
8113 pub salt: Option<Vec<u8>>,
8114}
8115
8116impl VerificationOptions {
8117 fn __max_ordinal(&self) -> usize {
8118 if self.hash_algorithm.is_some() {
8119 return 1;
8120 }
8121
8122 if self.salt.is_some() {
8123 return 2;
8124 }
8125
8126 0
8127 }
8128}
8129
8130impl ::fidl_next::Encodable for VerificationOptions {
8131 type Encoded = WireVerificationOptions;
8132}
8133
8134unsafe impl<___E> ::fidl_next::Encode<___E> for VerificationOptions
8135where
8136 ___E: ::fidl_next::Encoder + ?Sized,
8137{
8138 #[inline]
8139 fn encode(
8140 mut self,
8141 encoder: &mut ___E,
8142 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8143 ) -> Result<(), ::fidl_next::EncodeError> {
8144 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
8145
8146 let max_ord = self.__max_ordinal();
8147
8148 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8149 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8150
8151 let mut preallocated =
8152 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8153
8154 for i in 1..=max_ord {
8155 match i {
8156 2 => {
8157 if let Some(salt) = self.salt.take() {
8158 ::fidl_next::WireEnvelope::encode_value(
8159 salt,
8160 preallocated.encoder,
8161 &mut out,
8162 )?;
8163 } else {
8164 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8165 }
8166 }
8167
8168 1 => {
8169 if let Some(hash_algorithm) = self.hash_algorithm.take() {
8170 ::fidl_next::WireEnvelope::encode_value(
8171 hash_algorithm,
8172 preallocated.encoder,
8173 &mut out,
8174 )?;
8175 } else {
8176 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8177 }
8178 }
8179
8180 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8181 }
8182 unsafe {
8183 preallocated.write_next(out.assume_init_ref());
8184 }
8185 }
8186
8187 ::fidl_next::WireTable::encode_len(table, max_ord);
8188
8189 Ok(())
8190 }
8191}
8192
8193unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VerificationOptions
8194where
8195 ___E: ::fidl_next::Encoder + ?Sized,
8196{
8197 #[inline]
8198 fn encode_ref(
8199 &self,
8200 encoder: &mut ___E,
8201 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8202 ) -> Result<(), ::fidl_next::EncodeError> {
8203 ::fidl_next::munge!(let WireVerificationOptions { table } = out);
8204
8205 let max_ord = self.__max_ordinal();
8206
8207 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8208 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8209
8210 let mut preallocated =
8211 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8212
8213 for i in 1..=max_ord {
8214 match i {
8215 2 => {
8216 if let Some(salt) = &self.salt {
8217 ::fidl_next::WireEnvelope::encode_value(
8218 salt,
8219 preallocated.encoder,
8220 &mut out,
8221 )?;
8222 } else {
8223 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8224 }
8225 }
8226
8227 1 => {
8228 if let Some(hash_algorithm) = &self.hash_algorithm {
8229 ::fidl_next::WireEnvelope::encode_value(
8230 hash_algorithm,
8231 preallocated.encoder,
8232 &mut out,
8233 )?;
8234 } else {
8235 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8236 }
8237 }
8238
8239 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8240 }
8241 unsafe {
8242 preallocated.write_next(out.assume_init_ref());
8243 }
8244 }
8245
8246 ::fidl_next::WireTable::encode_len(table, max_ord);
8247
8248 Ok(())
8249 }
8250}
8251
8252impl ::fidl_next::TakeFrom<WireVerificationOptions> for VerificationOptions {
8253 #[inline]
8254 fn take_from(from: &WireVerificationOptions) -> Self {
8255 Self {
8256 hash_algorithm: from.hash_algorithm().map(::fidl_next::TakeFrom::take_from),
8257
8258 salt: from.salt().map(::fidl_next::TakeFrom::take_from),
8259 }
8260 }
8261}
8262
8263#[repr(C)]
8265pub struct WireVerificationOptions {
8266 table: ::fidl_next::WireTable,
8267}
8268
8269unsafe impl ::fidl_next::ZeroPadding for WireVerificationOptions {
8270 #[inline]
8271 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8272 ::fidl_next::munge!(let Self { table } = out);
8273 ::fidl_next::WireTable::zero_padding(table);
8274 }
8275}
8276
8277unsafe impl<___D> ::fidl_next::Decode<___D> for WireVerificationOptions
8278where
8279 ___D: ::fidl_next::Decoder + ?Sized,
8280{
8281 fn decode(
8282 slot: ::fidl_next::Slot<'_, Self>,
8283 decoder: &mut ___D,
8284 ) -> Result<(), ::fidl_next::DecodeError> {
8285 ::fidl_next::munge!(let Self { table } = slot);
8286
8287 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8288 match ordinal {
8289 0 => unsafe { ::core::hint::unreachable_unchecked() },
8290
8291 1 => {
8292 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireHashAlgorithm>(
8293 slot.as_mut(),
8294 decoder,
8295 )?;
8296
8297 Ok(())
8298 }
8299
8300 2 => {
8301 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireVector<u8>>(
8302 slot.as_mut(),
8303 decoder,
8304 )?;
8305
8306 let salt = unsafe {
8307 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<u8>>()
8308 };
8309
8310 if salt.len() > 32 {
8311 return Err(::fidl_next::DecodeError::VectorTooLong {
8312 size: salt.len() as u64,
8313 limit: 32,
8314 });
8315 }
8316
8317 Ok(())
8318 }
8319
8320 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8321 }
8322 })
8323 }
8324}
8325
8326impl WireVerificationOptions {
8327 pub fn hash_algorithm(&self) -> Option<&crate::WireHashAlgorithm> {
8328 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8329 }
8330
8331 pub fn salt(&self) -> Option<&::fidl_next::WireVector<u8>> {
8332 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8333 }
8334}
8335
8336impl ::core::fmt::Debug for WireVerificationOptions {
8337 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8338 f.debug_struct("VerificationOptions")
8339 .field("hash_algorithm", &self.hash_algorithm())
8340 .field("salt", &self.salt())
8341 .finish()
8342 }
8343}
8344
8345#[derive(Clone, Debug, Default)]
8346pub struct ImmutableNodeAttributes {
8347 pub protocols: Option<crate::NodeProtocolKinds>,
8348
8349 pub abilities: Option<crate::Operations>,
8350
8351 pub content_size: Option<u64>,
8352
8353 pub storage_size: Option<u64>,
8354
8355 pub link_count: Option<u64>,
8356
8357 pub id: Option<u64>,
8358
8359 pub change_time: Option<u64>,
8360
8361 pub options: Option<crate::VerificationOptions>,
8362
8363 pub root_hash: Option<Vec<u8>>,
8364
8365 pub verity_enabled: Option<bool>,
8366}
8367
8368impl ImmutableNodeAttributes {
8369 fn __max_ordinal(&self) -> usize {
8370 if self.protocols.is_some() {
8371 return 1;
8372 }
8373
8374 if self.abilities.is_some() {
8375 return 2;
8376 }
8377
8378 if self.content_size.is_some() {
8379 return 3;
8380 }
8381
8382 if self.storage_size.is_some() {
8383 return 4;
8384 }
8385
8386 if self.link_count.is_some() {
8387 return 5;
8388 }
8389
8390 if self.id.is_some() {
8391 return 6;
8392 }
8393
8394 if self.change_time.is_some() {
8395 return 7;
8396 }
8397
8398 if self.options.is_some() {
8399 return 8;
8400 }
8401
8402 if self.root_hash.is_some() {
8403 return 9;
8404 }
8405
8406 if self.verity_enabled.is_some() {
8407 return 10;
8408 }
8409
8410 0
8411 }
8412}
8413
8414impl ::fidl_next::Encodable for ImmutableNodeAttributes {
8415 type Encoded = WireImmutableNodeAttributes;
8416}
8417
8418unsafe impl<___E> ::fidl_next::Encode<___E> for ImmutableNodeAttributes
8419where
8420 ___E: ::fidl_next::Encoder + ?Sized,
8421{
8422 #[inline]
8423 fn encode(
8424 mut self,
8425 encoder: &mut ___E,
8426 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8427 ) -> Result<(), ::fidl_next::EncodeError> {
8428 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
8429
8430 let max_ord = self.__max_ordinal();
8431
8432 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8433 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8434
8435 let mut preallocated =
8436 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8437
8438 for i in 1..=max_ord {
8439 match i {
8440 10 => {
8441 if let Some(verity_enabled) = self.verity_enabled.take() {
8442 ::fidl_next::WireEnvelope::encode_value(
8443 verity_enabled,
8444 preallocated.encoder,
8445 &mut out,
8446 )?;
8447 } else {
8448 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8449 }
8450 }
8451
8452 9 => {
8453 if let Some(root_hash) = self.root_hash.take() {
8454 ::fidl_next::WireEnvelope::encode_value(
8455 root_hash,
8456 preallocated.encoder,
8457 &mut out,
8458 )?;
8459 } else {
8460 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8461 }
8462 }
8463
8464 8 => {
8465 if let Some(options) = self.options.take() {
8466 ::fidl_next::WireEnvelope::encode_value(
8467 options,
8468 preallocated.encoder,
8469 &mut out,
8470 )?;
8471 } else {
8472 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8473 }
8474 }
8475
8476 7 => {
8477 if let Some(change_time) = self.change_time.take() {
8478 ::fidl_next::WireEnvelope::encode_value(
8479 change_time,
8480 preallocated.encoder,
8481 &mut out,
8482 )?;
8483 } else {
8484 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8485 }
8486 }
8487
8488 6 => {
8489 if let Some(id) = self.id.take() {
8490 ::fidl_next::WireEnvelope::encode_value(
8491 id,
8492 preallocated.encoder,
8493 &mut out,
8494 )?;
8495 } else {
8496 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8497 }
8498 }
8499
8500 5 => {
8501 if let Some(link_count) = self.link_count.take() {
8502 ::fidl_next::WireEnvelope::encode_value(
8503 link_count,
8504 preallocated.encoder,
8505 &mut out,
8506 )?;
8507 } else {
8508 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8509 }
8510 }
8511
8512 4 => {
8513 if let Some(storage_size) = self.storage_size.take() {
8514 ::fidl_next::WireEnvelope::encode_value(
8515 storage_size,
8516 preallocated.encoder,
8517 &mut out,
8518 )?;
8519 } else {
8520 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8521 }
8522 }
8523
8524 3 => {
8525 if let Some(content_size) = self.content_size.take() {
8526 ::fidl_next::WireEnvelope::encode_value(
8527 content_size,
8528 preallocated.encoder,
8529 &mut out,
8530 )?;
8531 } else {
8532 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8533 }
8534 }
8535
8536 2 => {
8537 if let Some(abilities) = self.abilities.take() {
8538 ::fidl_next::WireEnvelope::encode_value(
8539 abilities,
8540 preallocated.encoder,
8541 &mut out,
8542 )?;
8543 } else {
8544 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8545 }
8546 }
8547
8548 1 => {
8549 if let Some(protocols) = self.protocols.take() {
8550 ::fidl_next::WireEnvelope::encode_value(
8551 protocols,
8552 preallocated.encoder,
8553 &mut out,
8554 )?;
8555 } else {
8556 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8557 }
8558 }
8559
8560 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8561 }
8562 unsafe {
8563 preallocated.write_next(out.assume_init_ref());
8564 }
8565 }
8566
8567 ::fidl_next::WireTable::encode_len(table, max_ord);
8568
8569 Ok(())
8570 }
8571}
8572
8573unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ImmutableNodeAttributes
8574where
8575 ___E: ::fidl_next::Encoder + ?Sized,
8576{
8577 #[inline]
8578 fn encode_ref(
8579 &self,
8580 encoder: &mut ___E,
8581 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8582 ) -> Result<(), ::fidl_next::EncodeError> {
8583 ::fidl_next::munge!(let WireImmutableNodeAttributes { table } = out);
8584
8585 let max_ord = self.__max_ordinal();
8586
8587 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8588 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8589
8590 let mut preallocated =
8591 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8592
8593 for i in 1..=max_ord {
8594 match i {
8595 10 => {
8596 if let Some(verity_enabled) = &self.verity_enabled {
8597 ::fidl_next::WireEnvelope::encode_value(
8598 verity_enabled,
8599 preallocated.encoder,
8600 &mut out,
8601 )?;
8602 } else {
8603 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8604 }
8605 }
8606
8607 9 => {
8608 if let Some(root_hash) = &self.root_hash {
8609 ::fidl_next::WireEnvelope::encode_value(
8610 root_hash,
8611 preallocated.encoder,
8612 &mut out,
8613 )?;
8614 } else {
8615 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8616 }
8617 }
8618
8619 8 => {
8620 if let Some(options) = &self.options {
8621 ::fidl_next::WireEnvelope::encode_value(
8622 options,
8623 preallocated.encoder,
8624 &mut out,
8625 )?;
8626 } else {
8627 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8628 }
8629 }
8630
8631 7 => {
8632 if let Some(change_time) = &self.change_time {
8633 ::fidl_next::WireEnvelope::encode_value(
8634 change_time,
8635 preallocated.encoder,
8636 &mut out,
8637 )?;
8638 } else {
8639 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8640 }
8641 }
8642
8643 6 => {
8644 if let Some(id) = &self.id {
8645 ::fidl_next::WireEnvelope::encode_value(
8646 id,
8647 preallocated.encoder,
8648 &mut out,
8649 )?;
8650 } else {
8651 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8652 }
8653 }
8654
8655 5 => {
8656 if let Some(link_count) = &self.link_count {
8657 ::fidl_next::WireEnvelope::encode_value(
8658 link_count,
8659 preallocated.encoder,
8660 &mut out,
8661 )?;
8662 } else {
8663 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8664 }
8665 }
8666
8667 4 => {
8668 if let Some(storage_size) = &self.storage_size {
8669 ::fidl_next::WireEnvelope::encode_value(
8670 storage_size,
8671 preallocated.encoder,
8672 &mut out,
8673 )?;
8674 } else {
8675 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8676 }
8677 }
8678
8679 3 => {
8680 if let Some(content_size) = &self.content_size {
8681 ::fidl_next::WireEnvelope::encode_value(
8682 content_size,
8683 preallocated.encoder,
8684 &mut out,
8685 )?;
8686 } else {
8687 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8688 }
8689 }
8690
8691 2 => {
8692 if let Some(abilities) = &self.abilities {
8693 ::fidl_next::WireEnvelope::encode_value(
8694 abilities,
8695 preallocated.encoder,
8696 &mut out,
8697 )?;
8698 } else {
8699 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8700 }
8701 }
8702
8703 1 => {
8704 if let Some(protocols) = &self.protocols {
8705 ::fidl_next::WireEnvelope::encode_value(
8706 protocols,
8707 preallocated.encoder,
8708 &mut out,
8709 )?;
8710 } else {
8711 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8712 }
8713 }
8714
8715 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8716 }
8717 unsafe {
8718 preallocated.write_next(out.assume_init_ref());
8719 }
8720 }
8721
8722 ::fidl_next::WireTable::encode_len(table, max_ord);
8723
8724 Ok(())
8725 }
8726}
8727
8728impl ::fidl_next::TakeFrom<WireImmutableNodeAttributes> for ImmutableNodeAttributes {
8729 #[inline]
8730 fn take_from(from: &WireImmutableNodeAttributes) -> Self {
8731 Self {
8732 protocols: from.protocols().map(::fidl_next::TakeFrom::take_from),
8733
8734 abilities: from.abilities().map(::fidl_next::TakeFrom::take_from),
8735
8736 content_size: from.content_size().map(::fidl_next::TakeFrom::take_from),
8737
8738 storage_size: from.storage_size().map(::fidl_next::TakeFrom::take_from),
8739
8740 link_count: from.link_count().map(::fidl_next::TakeFrom::take_from),
8741
8742 id: from.id().map(::fidl_next::TakeFrom::take_from),
8743
8744 change_time: from.change_time().map(::fidl_next::TakeFrom::take_from),
8745
8746 options: from.options().map(::fidl_next::TakeFrom::take_from),
8747
8748 root_hash: from.root_hash().map(::fidl_next::TakeFrom::take_from),
8749
8750 verity_enabled: from.verity_enabled().map(::fidl_next::TakeFrom::take_from),
8751 }
8752 }
8753}
8754
8755#[repr(C)]
8757pub struct WireImmutableNodeAttributes {
8758 table: ::fidl_next::WireTable,
8759}
8760
8761unsafe impl ::fidl_next::ZeroPadding for WireImmutableNodeAttributes {
8762 #[inline]
8763 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8764 ::fidl_next::munge!(let Self { table } = out);
8765 ::fidl_next::WireTable::zero_padding(table);
8766 }
8767}
8768
8769unsafe impl<___D> ::fidl_next::Decode<___D> for WireImmutableNodeAttributes
8770where
8771 ___D: ::fidl_next::Decoder + ?Sized,
8772{
8773 fn decode(
8774 slot: ::fidl_next::Slot<'_, Self>,
8775 decoder: &mut ___D,
8776 ) -> Result<(), ::fidl_next::DecodeError> {
8777 ::fidl_next::munge!(let Self { table } = slot);
8778
8779 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8780 match ordinal {
8781 0 => unsafe { ::core::hint::unreachable_unchecked() },
8782
8783 1 => {
8784 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeProtocolKinds>(
8785 slot.as_mut(),
8786 decoder,
8787 )?;
8788
8789 Ok(())
8790 }
8791
8792 2 => {
8793 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOperations>(
8794 slot.as_mut(),
8795 decoder,
8796 )?;
8797
8798 Ok(())
8799 }
8800
8801 3 => {
8802 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8803 slot.as_mut(),
8804 decoder,
8805 )?;
8806
8807 Ok(())
8808 }
8809
8810 4 => {
8811 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8812 slot.as_mut(),
8813 decoder,
8814 )?;
8815
8816 Ok(())
8817 }
8818
8819 5 => {
8820 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8821 slot.as_mut(),
8822 decoder,
8823 )?;
8824
8825 Ok(())
8826 }
8827
8828 6 => {
8829 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8830 slot.as_mut(),
8831 decoder,
8832 )?;
8833
8834 Ok(())
8835 }
8836
8837 7 => {
8838 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
8839 slot.as_mut(),
8840 decoder,
8841 )?;
8842
8843 Ok(())
8844 }
8845
8846 8 => {
8847 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireVerificationOptions>(
8848 slot.as_mut(),
8849 decoder,
8850 )?;
8851
8852 Ok(())
8853 }
8854
8855 9 => {
8856 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireVector<u8>>(
8857 slot.as_mut(),
8858 decoder,
8859 )?;
8860
8861 let root_hash = unsafe {
8862 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<u8>>()
8863 };
8864
8865 if root_hash.len() > 64 {
8866 return Err(::fidl_next::DecodeError::VectorTooLong {
8867 size: root_hash.len() as u64,
8868 limit: 64,
8869 });
8870 }
8871
8872 Ok(())
8873 }
8874
8875 10 => {
8876 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
8877
8878 Ok(())
8879 }
8880
8881 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8882 }
8883 })
8884 }
8885}
8886
8887impl WireImmutableNodeAttributes {
8888 pub fn protocols(&self) -> Option<&crate::WireNodeProtocolKinds> {
8889 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8890 }
8891
8892 pub fn abilities(&self) -> Option<&crate::WireOperations> {
8893 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8894 }
8895
8896 pub fn content_size(&self) -> Option<&::fidl_next::WireU64> {
8897 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8898 }
8899
8900 pub fn storage_size(&self) -> Option<&::fidl_next::WireU64> {
8901 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8902 }
8903
8904 pub fn link_count(&self) -> Option<&::fidl_next::WireU64> {
8905 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8906 }
8907
8908 pub fn id(&self) -> Option<&::fidl_next::WireU64> {
8909 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8910 }
8911
8912 pub fn change_time(&self) -> Option<&::fidl_next::WireU64> {
8913 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
8914 }
8915
8916 pub fn options(&self) -> Option<&crate::WireVerificationOptions> {
8917 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
8918 }
8919
8920 pub fn root_hash(&self) -> Option<&::fidl_next::WireVector<u8>> {
8921 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
8922 }
8923
8924 pub fn verity_enabled(&self) -> Option<&bool> {
8925 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
8926 }
8927}
8928
8929impl ::core::fmt::Debug for WireImmutableNodeAttributes {
8930 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8931 f.debug_struct("ImmutableNodeAttributes")
8932 .field("protocols", &self.protocols())
8933 .field("abilities", &self.abilities())
8934 .field("content_size", &self.content_size())
8935 .field("storage_size", &self.storage_size())
8936 .field("link_count", &self.link_count())
8937 .field("id", &self.id())
8938 .field("change_time", &self.change_time())
8939 .field("options", &self.options())
8940 .field("root_hash", &self.root_hash())
8941 .field("verity_enabled", &self.verity_enabled())
8942 .finish()
8943 }
8944}
8945
8946#[derive(Clone, Debug)]
8947pub struct NodeAttributes2 {
8948 pub mutable_attributes: crate::MutableNodeAttributes,
8949
8950 pub immutable_attributes: crate::ImmutableNodeAttributes,
8951}
8952
8953impl ::fidl_next::Encodable for NodeAttributes2 {
8954 type Encoded = WireNodeAttributes2;
8955}
8956
8957unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributes2
8958where
8959 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8960
8961 ___E: ::fidl_next::Encoder,
8962{
8963 #[inline]
8964 fn encode(
8965 self,
8966 encoder: &mut ___E,
8967 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8968 ) -> Result<(), ::fidl_next::EncodeError> {
8969 ::fidl_next::munge! {
8970 let Self::Encoded {
8971 mutable_attributes,
8972 immutable_attributes,
8973
8974 } = out;
8975 }
8976
8977 ::fidl_next::Encode::encode(self.mutable_attributes, encoder, mutable_attributes)?;
8978
8979 ::fidl_next::Encode::encode(self.immutable_attributes, encoder, immutable_attributes)?;
8980
8981 Ok(())
8982 }
8983}
8984
8985unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributes2
8986where
8987 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8988
8989 ___E: ::fidl_next::Encoder,
8990{
8991 #[inline]
8992 fn encode_ref(
8993 &self,
8994 encoder: &mut ___E,
8995 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8996 ) -> Result<(), ::fidl_next::EncodeError> {
8997 ::fidl_next::munge! {
8998 let Self::Encoded {
8999 mutable_attributes,
9000 immutable_attributes,
9001
9002 } = out;
9003 }
9004
9005 ::fidl_next::EncodeRef::encode_ref(&self.mutable_attributes, encoder, mutable_attributes)?;
9006
9007 ::fidl_next::EncodeRef::encode_ref(
9008 &self.immutable_attributes,
9009 encoder,
9010 immutable_attributes,
9011 )?;
9012
9013 Ok(())
9014 }
9015}
9016
9017impl ::fidl_next::EncodableOption for Box<NodeAttributes2> {
9018 type EncodedOption = ::fidl_next::WireBox<WireNodeAttributes2>;
9019}
9020
9021unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeAttributes2>
9022where
9023 ___E: ::fidl_next::Encoder + ?Sized,
9024 NodeAttributes2: ::fidl_next::Encode<___E>,
9025{
9026 #[inline]
9027 fn encode_option(
9028 this: Option<Self>,
9029 encoder: &mut ___E,
9030 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9031 ) -> Result<(), ::fidl_next::EncodeError> {
9032 if let Some(inner) = this {
9033 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
9034 ::fidl_next::WireBox::encode_present(out);
9035 } else {
9036 ::fidl_next::WireBox::encode_absent(out);
9037 }
9038
9039 Ok(())
9040 }
9041}
9042
9043unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeAttributes2>
9044where
9045 ___E: ::fidl_next::Encoder + ?Sized,
9046 NodeAttributes2: ::fidl_next::EncodeRef<___E>,
9047{
9048 #[inline]
9049 fn encode_option_ref(
9050 this: Option<&Self>,
9051 encoder: &mut ___E,
9052 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9053 ) -> Result<(), ::fidl_next::EncodeError> {
9054 if let Some(inner) = this {
9055 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9056 ::fidl_next::WireBox::encode_present(out);
9057 } else {
9058 ::fidl_next::WireBox::encode_absent(out);
9059 }
9060
9061 Ok(())
9062 }
9063}
9064
9065impl ::fidl_next::TakeFrom<WireNodeAttributes2> for NodeAttributes2 {
9066 #[inline]
9067 fn take_from(from: &WireNodeAttributes2) -> Self {
9068 Self {
9069 mutable_attributes: ::fidl_next::TakeFrom::take_from(&from.mutable_attributes),
9070
9071 immutable_attributes: ::fidl_next::TakeFrom::take_from(&from.immutable_attributes),
9072 }
9073 }
9074}
9075
9076#[derive(Debug)]
9078#[repr(C)]
9079pub struct WireNodeAttributes2 {
9080 pub mutable_attributes: crate::WireMutableNodeAttributes,
9081
9082 pub immutable_attributes: crate::WireImmutableNodeAttributes,
9083}
9084
9085unsafe impl ::fidl_next::ZeroPadding for WireNodeAttributes2 {
9086 #[inline]
9087 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
9088}
9089
9090unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributes2
9091where
9092 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9093
9094 ___D: ::fidl_next::Decoder,
9095{
9096 fn decode(
9097 slot: ::fidl_next::Slot<'_, Self>,
9098 decoder: &mut ___D,
9099 ) -> Result<(), ::fidl_next::DecodeError> {
9100 ::fidl_next::munge! {
9101 let Self {
9102 mut mutable_attributes,
9103 mut immutable_attributes,
9104
9105 } = slot;
9106 }
9107
9108 ::fidl_next::Decode::decode(mutable_attributes.as_mut(), decoder)?;
9109
9110 ::fidl_next::Decode::decode(immutable_attributes.as_mut(), decoder)?;
9111
9112 Ok(())
9113 }
9114}
9115
9116#[doc = " Information that describes the target node.\n"]
9117#[derive(Clone, Debug, Default)]
9118pub struct NodeInfo {
9119 pub attributes: Option<crate::NodeAttributes2>,
9120}
9121
9122impl NodeInfo {
9123 fn __max_ordinal(&self) -> usize {
9124 if self.attributes.is_some() {
9125 return 1;
9126 }
9127
9128 0
9129 }
9130}
9131
9132impl ::fidl_next::Encodable for NodeInfo {
9133 type Encoded = WireNodeInfo;
9134}
9135
9136unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfo
9137where
9138 ___E: ::fidl_next::Encoder + ?Sized,
9139{
9140 #[inline]
9141 fn encode(
9142 mut self,
9143 encoder: &mut ___E,
9144 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9145 ) -> Result<(), ::fidl_next::EncodeError> {
9146 ::fidl_next::munge!(let WireNodeInfo { table } = out);
9147
9148 let max_ord = self.__max_ordinal();
9149
9150 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9151 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9152
9153 let mut preallocated =
9154 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9155
9156 for i in 1..=max_ord {
9157 match i {
9158 1 => {
9159 if let Some(attributes) = self.attributes.take() {
9160 ::fidl_next::WireEnvelope::encode_value(
9161 attributes,
9162 preallocated.encoder,
9163 &mut out,
9164 )?;
9165 } else {
9166 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9167 }
9168 }
9169
9170 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9171 }
9172 unsafe {
9173 preallocated.write_next(out.assume_init_ref());
9174 }
9175 }
9176
9177 ::fidl_next::WireTable::encode_len(table, max_ord);
9178
9179 Ok(())
9180 }
9181}
9182
9183unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeInfo
9184where
9185 ___E: ::fidl_next::Encoder + ?Sized,
9186{
9187 #[inline]
9188 fn encode_ref(
9189 &self,
9190 encoder: &mut ___E,
9191 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9192 ) -> Result<(), ::fidl_next::EncodeError> {
9193 ::fidl_next::munge!(let WireNodeInfo { table } = out);
9194
9195 let max_ord = self.__max_ordinal();
9196
9197 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9198 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9199
9200 let mut preallocated =
9201 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9202
9203 for i in 1..=max_ord {
9204 match i {
9205 1 => {
9206 if let Some(attributes) = &self.attributes {
9207 ::fidl_next::WireEnvelope::encode_value(
9208 attributes,
9209 preallocated.encoder,
9210 &mut out,
9211 )?;
9212 } else {
9213 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9214 }
9215 }
9216
9217 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9218 }
9219 unsafe {
9220 preallocated.write_next(out.assume_init_ref());
9221 }
9222 }
9223
9224 ::fidl_next::WireTable::encode_len(table, max_ord);
9225
9226 Ok(())
9227 }
9228}
9229
9230impl ::fidl_next::TakeFrom<WireNodeInfo> for NodeInfo {
9231 #[inline]
9232 fn take_from(from: &WireNodeInfo) -> Self {
9233 Self { attributes: from.attributes().map(::fidl_next::TakeFrom::take_from) }
9234 }
9235}
9236
9237#[repr(C)]
9239pub struct WireNodeInfo {
9240 table: ::fidl_next::WireTable,
9241}
9242
9243unsafe impl ::fidl_next::ZeroPadding for WireNodeInfo {
9244 #[inline]
9245 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9246 ::fidl_next::munge!(let Self { table } = out);
9247 ::fidl_next::WireTable::zero_padding(table);
9248 }
9249}
9250
9251unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfo
9252where
9253 ___D: ::fidl_next::Decoder + ?Sized,
9254{
9255 fn decode(
9256 slot: ::fidl_next::Slot<'_, Self>,
9257 decoder: &mut ___D,
9258 ) -> Result<(), ::fidl_next::DecodeError> {
9259 ::fidl_next::munge!(let Self { table } = slot);
9260
9261 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9262 match ordinal {
9263 0 => unsafe { ::core::hint::unreachable_unchecked() },
9264
9265 1 => {
9266 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributes2>(
9267 slot.as_mut(),
9268 decoder,
9269 )?;
9270
9271 Ok(())
9272 }
9273
9274 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9275 }
9276 })
9277 }
9278}
9279
9280impl WireNodeInfo {
9281 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2> {
9282 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9283 }
9284}
9285
9286impl ::core::fmt::Debug for WireNodeInfo {
9287 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9288 f.debug_struct("NodeInfo").field("attributes", &self.attributes()).finish()
9289 }
9290}
9291
9292#[derive(Clone, Debug, Default)]
9293pub struct DirectoryInfo {
9294 pub attributes: Option<crate::NodeAttributes2>,
9295}
9296
9297impl DirectoryInfo {
9298 fn __max_ordinal(&self) -> usize {
9299 if self.attributes.is_some() {
9300 return 1;
9301 }
9302
9303 0
9304 }
9305}
9306
9307impl ::fidl_next::Encodable for DirectoryInfo {
9308 type Encoded = WireDirectoryInfo;
9309}
9310
9311unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryInfo
9312where
9313 ___E: ::fidl_next::Encoder + ?Sized,
9314{
9315 #[inline]
9316 fn encode(
9317 mut self,
9318 encoder: &mut ___E,
9319 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9320 ) -> Result<(), ::fidl_next::EncodeError> {
9321 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
9322
9323 let max_ord = self.__max_ordinal();
9324
9325 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9326 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9327
9328 let mut preallocated =
9329 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9330
9331 for i in 1..=max_ord {
9332 match i {
9333 1 => {
9334 if let Some(attributes) = self.attributes.take() {
9335 ::fidl_next::WireEnvelope::encode_value(
9336 attributes,
9337 preallocated.encoder,
9338 &mut out,
9339 )?;
9340 } else {
9341 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9342 }
9343 }
9344
9345 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9346 }
9347 unsafe {
9348 preallocated.write_next(out.assume_init_ref());
9349 }
9350 }
9351
9352 ::fidl_next::WireTable::encode_len(table, max_ord);
9353
9354 Ok(())
9355 }
9356}
9357
9358unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryInfo
9359where
9360 ___E: ::fidl_next::Encoder + ?Sized,
9361{
9362 #[inline]
9363 fn encode_ref(
9364 &self,
9365 encoder: &mut ___E,
9366 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9367 ) -> Result<(), ::fidl_next::EncodeError> {
9368 ::fidl_next::munge!(let WireDirectoryInfo { table } = out);
9369
9370 let max_ord = self.__max_ordinal();
9371
9372 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9373 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9374
9375 let mut preallocated =
9376 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9377
9378 for i in 1..=max_ord {
9379 match i {
9380 1 => {
9381 if let Some(attributes) = &self.attributes {
9382 ::fidl_next::WireEnvelope::encode_value(
9383 attributes,
9384 preallocated.encoder,
9385 &mut out,
9386 )?;
9387 } else {
9388 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9389 }
9390 }
9391
9392 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9393 }
9394 unsafe {
9395 preallocated.write_next(out.assume_init_ref());
9396 }
9397 }
9398
9399 ::fidl_next::WireTable::encode_len(table, max_ord);
9400
9401 Ok(())
9402 }
9403}
9404
9405impl ::fidl_next::TakeFrom<WireDirectoryInfo> for DirectoryInfo {
9406 #[inline]
9407 fn take_from(from: &WireDirectoryInfo) -> Self {
9408 Self { attributes: from.attributes().map(::fidl_next::TakeFrom::take_from) }
9409 }
9410}
9411
9412#[repr(C)]
9414pub struct WireDirectoryInfo {
9415 table: ::fidl_next::WireTable,
9416}
9417
9418unsafe impl ::fidl_next::ZeroPadding for WireDirectoryInfo {
9419 #[inline]
9420 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9421 ::fidl_next::munge!(let Self { table } = out);
9422 ::fidl_next::WireTable::zero_padding(table);
9423 }
9424}
9425
9426unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryInfo
9427where
9428 ___D: ::fidl_next::Decoder + ?Sized,
9429{
9430 fn decode(
9431 slot: ::fidl_next::Slot<'_, Self>,
9432 decoder: &mut ___D,
9433 ) -> Result<(), ::fidl_next::DecodeError> {
9434 ::fidl_next::munge!(let Self { table } = slot);
9435
9436 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9437 match ordinal {
9438 0 => unsafe { ::core::hint::unreachable_unchecked() },
9439
9440 1 => {
9441 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributes2>(
9442 slot.as_mut(),
9443 decoder,
9444 )?;
9445
9446 Ok(())
9447 }
9448
9449 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9450 }
9451 })
9452 }
9453}
9454
9455impl WireDirectoryInfo {
9456 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2> {
9457 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9458 }
9459}
9460
9461impl ::core::fmt::Debug for WireDirectoryInfo {
9462 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9463 f.debug_struct("DirectoryInfo").field("attributes", &self.attributes()).finish()
9464 }
9465}
9466
9467#[doc = " Auxiliary data for the file representation of a node.\n"]
9468#[derive(Debug, Default)]
9469pub struct FileInfo {
9470 pub is_append: Option<bool>,
9471
9472 pub observer: Option<::fidl_next::fuchsia::zx::Handle>,
9473
9474 pub stream: Option<::fidl_next::fuchsia::zx::Handle>,
9475
9476 pub attributes: Option<crate::NodeAttributes2>,
9477}
9478
9479impl FileInfo {
9480 fn __max_ordinal(&self) -> usize {
9481 if self.is_append.is_some() {
9482 return 1;
9483 }
9484
9485 if self.observer.is_some() {
9486 return 2;
9487 }
9488
9489 if self.stream.is_some() {
9490 return 3;
9491 }
9492
9493 if self.attributes.is_some() {
9494 return 4;
9495 }
9496
9497 0
9498 }
9499}
9500
9501impl ::fidl_next::Encodable for FileInfo {
9502 type Encoded = WireFileInfo;
9503}
9504
9505unsafe impl<___E> ::fidl_next::Encode<___E> for FileInfo
9506where
9507 ___E: ::fidl_next::Encoder + ?Sized,
9508
9509 ___E: ::fidl_next::fuchsia::HandleEncoder,
9510{
9511 #[inline]
9512 fn encode(
9513 mut self,
9514 encoder: &mut ___E,
9515 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9516 ) -> Result<(), ::fidl_next::EncodeError> {
9517 ::fidl_next::munge!(let WireFileInfo { table } = out);
9518
9519 let max_ord = self.__max_ordinal();
9520
9521 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9522 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9523
9524 let mut preallocated =
9525 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9526
9527 for i in 1..=max_ord {
9528 match i {
9529 4 => {
9530 if let Some(attributes) = self.attributes.take() {
9531 ::fidl_next::WireEnvelope::encode_value(
9532 attributes,
9533 preallocated.encoder,
9534 &mut out,
9535 )?;
9536 } else {
9537 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9538 }
9539 }
9540
9541 3 => {
9542 if let Some(stream) = self.stream.take() {
9543 ::fidl_next::WireEnvelope::encode_value(
9544 stream,
9545 preallocated.encoder,
9546 &mut out,
9547 )?;
9548 } else {
9549 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9550 }
9551 }
9552
9553 2 => {
9554 if let Some(observer) = self.observer.take() {
9555 ::fidl_next::WireEnvelope::encode_value(
9556 observer,
9557 preallocated.encoder,
9558 &mut out,
9559 )?;
9560 } else {
9561 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9562 }
9563 }
9564
9565 1 => {
9566 if let Some(is_append) = self.is_append.take() {
9567 ::fidl_next::WireEnvelope::encode_value(
9568 is_append,
9569 preallocated.encoder,
9570 &mut out,
9571 )?;
9572 } else {
9573 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9574 }
9575 }
9576
9577 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9578 }
9579 unsafe {
9580 preallocated.write_next(out.assume_init_ref());
9581 }
9582 }
9583
9584 ::fidl_next::WireTable::encode_len(table, max_ord);
9585
9586 Ok(())
9587 }
9588}
9589
9590impl ::fidl_next::TakeFrom<WireFileInfo> for FileInfo {
9591 #[inline]
9592 fn take_from(from: &WireFileInfo) -> Self {
9593 Self {
9594 is_append: from.is_append().map(::fidl_next::TakeFrom::take_from),
9595
9596 observer: from.observer().map(::fidl_next::TakeFrom::take_from),
9597
9598 stream: from.stream().map(::fidl_next::TakeFrom::take_from),
9599
9600 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
9601 }
9602 }
9603}
9604
9605#[repr(C)]
9607pub struct WireFileInfo {
9608 table: ::fidl_next::WireTable,
9609}
9610
9611unsafe impl ::fidl_next::ZeroPadding for WireFileInfo {
9612 #[inline]
9613 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9614 ::fidl_next::munge!(let Self { table } = out);
9615 ::fidl_next::WireTable::zero_padding(table);
9616 }
9617}
9618
9619unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileInfo
9620where
9621 ___D: ::fidl_next::Decoder + ?Sized,
9622
9623 ___D: ::fidl_next::fuchsia::HandleDecoder,
9624{
9625 fn decode(
9626 slot: ::fidl_next::Slot<'_, Self>,
9627 decoder: &mut ___D,
9628 ) -> Result<(), ::fidl_next::DecodeError> {
9629 ::fidl_next::munge!(let Self { table } = slot);
9630
9631 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9632 match ordinal {
9633 0 => unsafe { ::core::hint::unreachable_unchecked() },
9634
9635 1 => {
9636 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9637
9638 Ok(())
9639 }
9640
9641 2 => {
9642 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
9643 slot.as_mut(),
9644 decoder,
9645 )?;
9646
9647 Ok(())
9648 }
9649
9650 3 => {
9651 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
9652 slot.as_mut(),
9653 decoder,
9654 )?;
9655
9656 Ok(())
9657 }
9658
9659 4 => {
9660 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributes2>(
9661 slot.as_mut(),
9662 decoder,
9663 )?;
9664
9665 Ok(())
9666 }
9667
9668 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9669 }
9670 })
9671 }
9672}
9673
9674impl WireFileInfo {
9675 pub fn is_append(&self) -> Option<&bool> {
9676 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9677 }
9678
9679 pub fn observer(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
9680 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9681 }
9682
9683 pub fn stream(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
9684 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9685 }
9686
9687 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2> {
9688 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9689 }
9690}
9691
9692impl ::core::fmt::Debug for WireFileInfo {
9693 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9694 f.debug_struct("FileInfo")
9695 .field("is_append", &self.is_append())
9696 .field("observer", &self.observer())
9697 .field("stream", &self.stream())
9698 .field("attributes", &self.attributes())
9699 .finish()
9700 }
9701}
9702
9703#[derive(Clone, Debug, Default)]
9704pub struct SymlinkInfo {
9705 pub target: Option<Vec<u8>>,
9706
9707 pub attributes: Option<crate::NodeAttributes2>,
9708}
9709
9710impl SymlinkInfo {
9711 fn __max_ordinal(&self) -> usize {
9712 if self.target.is_some() {
9713 return 1;
9714 }
9715
9716 if self.attributes.is_some() {
9717 return 2;
9718 }
9719
9720 0
9721 }
9722}
9723
9724impl ::fidl_next::Encodable for SymlinkInfo {
9725 type Encoded = WireSymlinkInfo;
9726}
9727
9728unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkInfo
9729where
9730 ___E: ::fidl_next::Encoder + ?Sized,
9731{
9732 #[inline]
9733 fn encode(
9734 mut self,
9735 encoder: &mut ___E,
9736 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9737 ) -> Result<(), ::fidl_next::EncodeError> {
9738 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
9739
9740 let max_ord = self.__max_ordinal();
9741
9742 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9743 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9744
9745 let mut preallocated =
9746 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9747
9748 for i in 1..=max_ord {
9749 match i {
9750 2 => {
9751 if let Some(attributes) = self.attributes.take() {
9752 ::fidl_next::WireEnvelope::encode_value(
9753 attributes,
9754 preallocated.encoder,
9755 &mut out,
9756 )?;
9757 } else {
9758 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9759 }
9760 }
9761
9762 1 => {
9763 if let Some(target) = self.target.take() {
9764 ::fidl_next::WireEnvelope::encode_value(
9765 target,
9766 preallocated.encoder,
9767 &mut out,
9768 )?;
9769 } else {
9770 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9771 }
9772 }
9773
9774 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9775 }
9776 unsafe {
9777 preallocated.write_next(out.assume_init_ref());
9778 }
9779 }
9780
9781 ::fidl_next::WireTable::encode_len(table, max_ord);
9782
9783 Ok(())
9784 }
9785}
9786
9787unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkInfo
9788where
9789 ___E: ::fidl_next::Encoder + ?Sized,
9790{
9791 #[inline]
9792 fn encode_ref(
9793 &self,
9794 encoder: &mut ___E,
9795 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9796 ) -> Result<(), ::fidl_next::EncodeError> {
9797 ::fidl_next::munge!(let WireSymlinkInfo { table } = out);
9798
9799 let max_ord = self.__max_ordinal();
9800
9801 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9802 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9803
9804 let mut preallocated =
9805 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9806
9807 for i in 1..=max_ord {
9808 match i {
9809 2 => {
9810 if let Some(attributes) = &self.attributes {
9811 ::fidl_next::WireEnvelope::encode_value(
9812 attributes,
9813 preallocated.encoder,
9814 &mut out,
9815 )?;
9816 } else {
9817 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9818 }
9819 }
9820
9821 1 => {
9822 if let Some(target) = &self.target {
9823 ::fidl_next::WireEnvelope::encode_value(
9824 target,
9825 preallocated.encoder,
9826 &mut out,
9827 )?;
9828 } else {
9829 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9830 }
9831 }
9832
9833 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9834 }
9835 unsafe {
9836 preallocated.write_next(out.assume_init_ref());
9837 }
9838 }
9839
9840 ::fidl_next::WireTable::encode_len(table, max_ord);
9841
9842 Ok(())
9843 }
9844}
9845
9846impl ::fidl_next::TakeFrom<WireSymlinkInfo> for SymlinkInfo {
9847 #[inline]
9848 fn take_from(from: &WireSymlinkInfo) -> Self {
9849 Self {
9850 target: from.target().map(::fidl_next::TakeFrom::take_from),
9851
9852 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
9853 }
9854 }
9855}
9856
9857#[repr(C)]
9859pub struct WireSymlinkInfo {
9860 table: ::fidl_next::WireTable,
9861}
9862
9863unsafe impl ::fidl_next::ZeroPadding for WireSymlinkInfo {
9864 #[inline]
9865 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9866 ::fidl_next::munge!(let Self { table } = out);
9867 ::fidl_next::WireTable::zero_padding(table);
9868 }
9869}
9870
9871unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkInfo
9872where
9873 ___D: ::fidl_next::Decoder + ?Sized,
9874{
9875 fn decode(
9876 slot: ::fidl_next::Slot<'_, Self>,
9877 decoder: &mut ___D,
9878 ) -> Result<(), ::fidl_next::DecodeError> {
9879 ::fidl_next::munge!(let Self { table } = slot);
9880
9881 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9882 match ordinal {
9883 0 => unsafe { ::core::hint::unreachable_unchecked() },
9884
9885 1 => {
9886 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireVector<u8>>(
9887 slot.as_mut(),
9888 decoder,
9889 )?;
9890
9891 let target = unsafe {
9892 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<u8>>()
9893 };
9894
9895 if target.len() > 4095 {
9896 return Err(::fidl_next::DecodeError::VectorTooLong {
9897 size: target.len() as u64,
9898 limit: 4095,
9899 });
9900 }
9901
9902 Ok(())
9903 }
9904
9905 2 => {
9906 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributes2>(
9907 slot.as_mut(),
9908 decoder,
9909 )?;
9910
9911 Ok(())
9912 }
9913
9914 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9915 }
9916 })
9917 }
9918}
9919
9920impl WireSymlinkInfo {
9921 pub fn target(&self) -> Option<&::fidl_next::WireVector<u8>> {
9922 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9923 }
9924
9925 pub fn attributes(&self) -> Option<&crate::WireNodeAttributes2> {
9926 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9927 }
9928}
9929
9930impl ::core::fmt::Debug for WireSymlinkInfo {
9931 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9932 f.debug_struct("SymlinkInfo")
9933 .field("target", &self.target())
9934 .field("attributes", &self.attributes())
9935 .finish()
9936 }
9937}
9938
9939#[derive(Debug)]
9940pub enum Representation {
9941 Node(crate::NodeInfo),
9942
9943 Directory(crate::DirectoryInfo),
9944
9945 File(crate::FileInfo),
9946
9947 Symlink(crate::SymlinkInfo),
9948
9949 UnknownOrdinal_(u64),
9950}
9951
9952impl ::fidl_next::Encodable for Representation {
9953 type Encoded = WireRepresentation;
9954}
9955
9956unsafe impl<___E> ::fidl_next::Encode<___E> for Representation
9957where
9958 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9959
9960 ___E: ::fidl_next::Encoder,
9961
9962 ___E: ::fidl_next::fuchsia::HandleEncoder,
9963{
9964 #[inline]
9965 fn encode(
9966 self,
9967 encoder: &mut ___E,
9968 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9969 ) -> Result<(), ::fidl_next::EncodeError> {
9970 ::fidl_next::munge!(let WireRepresentation { raw } = out);
9971
9972 match self {
9973 Self::Node(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::NodeInfo>(
9974 value, 1, encoder, raw,
9975 )?,
9976
9977 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
9978 ___E,
9979 crate::DirectoryInfo,
9980 >(value, 2, encoder, raw)?,
9981
9982 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileInfo>(
9983 value, 3, encoder, raw,
9984 )?,
9985
9986 Self::Symlink(value) => {
9987 ::fidl_next::RawWireUnion::encode_as::<___E, crate::SymlinkInfo>(
9988 value, 4, encoder, raw,
9989 )?
9990 }
9991
9992 Self::UnknownOrdinal_(ordinal) => {
9993 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
9994 }
9995 }
9996
9997 Ok(())
9998 }
9999}
10000
10001impl ::fidl_next::EncodableOption for Box<Representation> {
10002 type EncodedOption = WireOptionalRepresentation;
10003}
10004
10005unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Representation>
10006where
10007 ___E: ?Sized,
10008 Representation: ::fidl_next::Encode<___E>,
10009{
10010 #[inline]
10011 fn encode_option(
10012 this: Option<Self>,
10013 encoder: &mut ___E,
10014 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10015 ) -> Result<(), ::fidl_next::EncodeError> {
10016 ::fidl_next::munge!(let WireOptionalRepresentation { raw } = &mut *out);
10017
10018 if let Some(inner) = this {
10019 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10020 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
10021 } else {
10022 ::fidl_next::RawWireUnion::encode_absent(raw);
10023 }
10024
10025 Ok(())
10026 }
10027}
10028
10029impl ::fidl_next::TakeFrom<WireRepresentation> for Representation {
10030 #[inline]
10031 fn take_from(from: &WireRepresentation) -> Self {
10032 match from.raw.ordinal() {
10033 1 => Self::Node(::fidl_next::TakeFrom::take_from(unsafe {
10034 from.raw.get().deref_unchecked::<crate::WireNodeInfo>()
10035 })),
10036
10037 2 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
10038 from.raw.get().deref_unchecked::<crate::WireDirectoryInfo>()
10039 })),
10040
10041 3 => Self::File(::fidl_next::TakeFrom::take_from(unsafe {
10042 from.raw.get().deref_unchecked::<crate::WireFileInfo>()
10043 })),
10044
10045 4 => Self::Symlink(::fidl_next::TakeFrom::take_from(unsafe {
10046 from.raw.get().deref_unchecked::<crate::WireSymlinkInfo>()
10047 })),
10048
10049 _ => unsafe { ::core::hint::unreachable_unchecked() },
10050 }
10051 }
10052}
10053
10054impl ::fidl_next::TakeFrom<WireOptionalRepresentation> for Option<Box<Representation>> {
10055 #[inline]
10056 fn take_from(from: &WireOptionalRepresentation) -> Self {
10057 if let Some(inner) = from.as_ref() {
10058 Some(::fidl_next::TakeFrom::take_from(inner))
10059 } else {
10060 None
10061 }
10062 }
10063}
10064
10065#[repr(transparent)]
10067pub struct WireRepresentation {
10068 raw: ::fidl_next::RawWireUnion,
10069}
10070
10071unsafe impl ::fidl_next::ZeroPadding for WireRepresentation {
10072 #[inline]
10073 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10074 ::fidl_next::munge!(let Self { raw } = out);
10075 ::fidl_next::RawWireUnion::zero_padding(raw);
10076 }
10077}
10078
10079pub mod representation {
10080 pub enum Ref<'union> {
10081 Node(&'union crate::WireNodeInfo),
10082
10083 Directory(&'union crate::WireDirectoryInfo),
10084
10085 File(&'union crate::WireFileInfo),
10086
10087 Symlink(&'union crate::WireSymlinkInfo),
10088
10089 UnknownOrdinal_(u64),
10090 }
10091}
10092
10093impl WireRepresentation {
10094 pub fn as_ref(&self) -> crate::representation::Ref<'_> {
10095 match self.raw.ordinal() {
10096 1 => crate::representation::Ref::Node(unsafe {
10097 self.raw.get().deref_unchecked::<crate::WireNodeInfo>()
10098 }),
10099
10100 2 => crate::representation::Ref::Directory(unsafe {
10101 self.raw.get().deref_unchecked::<crate::WireDirectoryInfo>()
10102 }),
10103
10104 3 => crate::representation::Ref::File(unsafe {
10105 self.raw.get().deref_unchecked::<crate::WireFileInfo>()
10106 }),
10107
10108 4 => crate::representation::Ref::Symlink(unsafe {
10109 self.raw.get().deref_unchecked::<crate::WireSymlinkInfo>()
10110 }),
10111
10112 unknown => crate::representation::Ref::UnknownOrdinal_(unknown),
10113 }
10114 }
10115}
10116
10117unsafe impl<___D> ::fidl_next::Decode<___D> for WireRepresentation
10118where
10119 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10120
10121 ___D: ::fidl_next::Decoder,
10122
10123 ___D: ::fidl_next::fuchsia::HandleDecoder,
10124{
10125 fn decode(
10126 mut slot: ::fidl_next::Slot<'_, Self>,
10127 decoder: &mut ___D,
10128 ) -> Result<(), ::fidl_next::DecodeError> {
10129 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
10130 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10131 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo>(raw, decoder)?,
10132
10133 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo>(
10134 raw, decoder,
10135 )?,
10136
10137 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo>(raw, decoder)?,
10138
10139 4 => {
10140 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo>(raw, decoder)?
10141 }
10142
10143 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
10144 }
10145
10146 Ok(())
10147 }
10148}
10149
10150impl ::core::fmt::Debug for WireRepresentation {
10151 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10152 match self.raw.ordinal() {
10153 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireNodeInfo>().fmt(f) },
10154 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryInfo>().fmt(f) },
10155 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileInfo>().fmt(f) },
10156 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkInfo>().fmt(f) },
10157 _ => unsafe { ::core::hint::unreachable_unchecked() },
10158 }
10159 }
10160}
10161
10162#[repr(transparent)]
10163pub struct WireOptionalRepresentation {
10164 raw: ::fidl_next::RawWireUnion,
10165}
10166
10167unsafe impl ::fidl_next::ZeroPadding for WireOptionalRepresentation {
10168 #[inline]
10169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10170 ::fidl_next::munge!(let Self { raw } = out);
10171 ::fidl_next::RawWireUnion::zero_padding(raw);
10172 }
10173}
10174
10175impl WireOptionalRepresentation {
10176 pub fn is_some(&self) -> bool {
10177 self.raw.is_some()
10178 }
10179
10180 pub fn is_none(&self) -> bool {
10181 self.raw.is_none()
10182 }
10183
10184 pub fn as_ref(&self) -> Option<&WireRepresentation> {
10185 if self.is_some() {
10186 Some(unsafe { &*(self as *const Self).cast() })
10187 } else {
10188 None
10189 }
10190 }
10191}
10192
10193unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRepresentation
10194where
10195 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10196
10197 ___D: ::fidl_next::Decoder,
10198
10199 ___D: ::fidl_next::fuchsia::HandleDecoder,
10200{
10201 fn decode(
10202 mut slot: ::fidl_next::Slot<'_, Self>,
10203 decoder: &mut ___D,
10204 ) -> Result<(), ::fidl_next::DecodeError> {
10205 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
10206 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10207 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireNodeInfo>(raw, decoder)?,
10208
10209 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryInfo>(
10210 raw, decoder,
10211 )?,
10212
10213 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileInfo>(raw, decoder)?,
10214
10215 4 => {
10216 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkInfo>(raw, decoder)?
10217 }
10218
10219 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
10220 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
10221 }
10222
10223 Ok(())
10224 }
10225}
10226
10227impl ::core::fmt::Debug for WireOptionalRepresentation {
10228 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10229 self.as_ref().fmt(f)
10230 }
10231}
10232
10233::fidl_next::bitflags! {
10234 #[derive(
10235 Clone,
10236 Copy,
10237 Debug,
10238 PartialEq,
10239 Eq,
10240 Hash,
10241 )]
10242 pub struct NodeAttributesQuery: u64 {
10243 #[doc = " Requests [`NodeAttributes.protocols`].\n"]const PROTOCOLS = 1;
10244 #[doc = " Requests [`NodeAttributes.abilities`].\n"]const ABILITIES = 2;
10245 #[doc = " Requests [`NodeAttributes.content_size`].\n"]const CONTENT_SIZE = 4;
10246 #[doc = " Requests [`NodeAttributes.storage_size`].\n"]const STORAGE_SIZE = 8;
10247 #[doc = " Requests [`NodeAttributes.link_count`].\n"]const LINK_COUNT = 16;
10248 #[doc = " Requests [`NodeAttributes.id`].\n"]const ID = 32;
10249 #[doc = " Requests [`NodeAttributes.creation_time`].\n"]const CREATION_TIME = 64;
10250 #[doc = " Requests [`NodeAttributes.modification_time`].\n"]const MODIFICATION_TIME = 128;
10251 #[doc = " Posix attributes.\n"]const MODE = 256;
10252 const UID = 512;
10253 const GID = 1024;
10254 const RDEV = 2048;
10255 const ACCESS_TIME = 4096;
10256 const CHANGE_TIME = 8192;
10257 #[doc = " Verity attributes.\n"]const OPTIONS = 16384;
10258 const ROOT_HASH = 32768;
10259 const VERITY_ENABLED = 65536;
10260 #[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;
10261 #[doc = " Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.\n"]const SELINUX_CONTEXT = 262144;
10262 #[doc = " fscrypt attribute.\n"]const WRAPPING_KEY_ID = 524288;
10263 #[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;
10264 const _ = !0;
10265 }
10266}
10267
10268impl ::fidl_next::Encodable for NodeAttributesQuery {
10269 type Encoded = WireNodeAttributesQuery;
10270}
10271
10272unsafe impl<___E> ::fidl_next::Encode<___E> for NodeAttributesQuery
10273where
10274 ___E: ?Sized,
10275{
10276 #[inline]
10277 fn encode(
10278 self,
10279 encoder: &mut ___E,
10280 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10281 ) -> Result<(), ::fidl_next::EncodeError> {
10282 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10283 }
10284}
10285
10286unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeAttributesQuery
10287where
10288 ___E: ?Sized,
10289{
10290 #[inline]
10291 fn encode_ref(
10292 &self,
10293 _: &mut ___E,
10294 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10295 ) -> Result<(), ::fidl_next::EncodeError> {
10296 ::fidl_next::munge!(let WireNodeAttributesQuery { value } = out);
10297 let _ = value.write(::fidl_next::WireU64::from(self.bits()));
10298 Ok(())
10299 }
10300}
10301
10302impl ::core::convert::From<WireNodeAttributesQuery> for NodeAttributesQuery {
10303 fn from(wire: WireNodeAttributesQuery) -> Self {
10304 Self::from_bits_retain(u64::from(wire.value))
10305 }
10306}
10307
10308impl ::fidl_next::TakeFrom<WireNodeAttributesQuery> for NodeAttributesQuery {
10309 #[inline]
10310 fn take_from(from: &WireNodeAttributesQuery) -> Self {
10311 Self::from(*from)
10312 }
10313}
10314
10315#[derive(Clone, Copy, Debug)]
10317#[repr(transparent)]
10318pub struct WireNodeAttributesQuery {
10319 value: ::fidl_next::WireU64,
10320}
10321
10322unsafe impl ::fidl_next::ZeroPadding for WireNodeAttributesQuery {
10323 #[inline]
10324 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10325 }
10327}
10328
10329unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeAttributesQuery
10330where
10331 ___D: ?Sized,
10332{
10333 fn decode(
10334 slot: ::fidl_next::Slot<'_, Self>,
10335 _: &mut ___D,
10336 ) -> Result<(), ::fidl_next::DecodeError> {
10337 Ok(())
10338 }
10339}
10340
10341impl ::core::convert::From<NodeAttributesQuery> for WireNodeAttributesQuery {
10342 fn from(natural: NodeAttributesQuery) -> Self {
10343 Self { value: ::fidl_next::WireU64::from(natural.bits()) }
10344 }
10345}
10346
10347#[derive(Clone, Debug)]
10348#[repr(C)]
10349pub struct NodeGetAttributesRequest {
10350 pub query: crate::NodeAttributesQuery,
10351}
10352
10353impl ::fidl_next::Encodable for NodeGetAttributesRequest {
10354 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
10355 ::fidl_next::CopyOptimization::enable_if(
10356 true && <crate::NodeAttributesQuery as ::fidl_next::Encodable>::COPY_OPTIMIZATION
10357 .is_enabled(),
10358 )
10359 };
10360
10361 type Encoded = WireNodeGetAttributesRequest;
10362}
10363
10364unsafe impl<___E> ::fidl_next::Encode<___E> for NodeGetAttributesRequest
10365where
10366 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10367{
10368 #[inline]
10369 fn encode(
10370 self,
10371 encoder: &mut ___E,
10372 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10373 ) -> Result<(), ::fidl_next::EncodeError> {
10374 ::fidl_next::munge! {
10375 let Self::Encoded {
10376 query,
10377
10378 } = out;
10379 }
10380
10381 ::fidl_next::Encode::encode(self.query, encoder, query)?;
10382
10383 Ok(())
10384 }
10385}
10386
10387unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NodeGetAttributesRequest
10388where
10389 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10390{
10391 #[inline]
10392 fn encode_ref(
10393 &self,
10394 encoder: &mut ___E,
10395 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10396 ) -> Result<(), ::fidl_next::EncodeError> {
10397 ::fidl_next::munge! {
10398 let Self::Encoded {
10399 query,
10400
10401 } = out;
10402 }
10403
10404 ::fidl_next::EncodeRef::encode_ref(&self.query, encoder, query)?;
10405
10406 Ok(())
10407 }
10408}
10409
10410impl ::fidl_next::EncodableOption for Box<NodeGetAttributesRequest> {
10411 type EncodedOption = ::fidl_next::WireBox<WireNodeGetAttributesRequest>;
10412}
10413
10414unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeGetAttributesRequest>
10415where
10416 ___E: ::fidl_next::Encoder + ?Sized,
10417 NodeGetAttributesRequest: ::fidl_next::Encode<___E>,
10418{
10419 #[inline]
10420 fn encode_option(
10421 this: Option<Self>,
10422 encoder: &mut ___E,
10423 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10424 ) -> Result<(), ::fidl_next::EncodeError> {
10425 if let Some(inner) = this {
10426 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
10427 ::fidl_next::WireBox::encode_present(out);
10428 } else {
10429 ::fidl_next::WireBox::encode_absent(out);
10430 }
10431
10432 Ok(())
10433 }
10434}
10435
10436unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<NodeGetAttributesRequest>
10437where
10438 ___E: ::fidl_next::Encoder + ?Sized,
10439 NodeGetAttributesRequest: ::fidl_next::EncodeRef<___E>,
10440{
10441 #[inline]
10442 fn encode_option_ref(
10443 this: Option<&Self>,
10444 encoder: &mut ___E,
10445 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10446 ) -> Result<(), ::fidl_next::EncodeError> {
10447 if let Some(inner) = this {
10448 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10449 ::fidl_next::WireBox::encode_present(out);
10450 } else {
10451 ::fidl_next::WireBox::encode_absent(out);
10452 }
10453
10454 Ok(())
10455 }
10456}
10457
10458impl ::fidl_next::TakeFrom<WireNodeGetAttributesRequest> for NodeGetAttributesRequest {
10459 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
10460 ::fidl_next::CopyOptimization::enable_if(
10461 true && <crate::NodeAttributesQuery as ::fidl_next::Encodable>::COPY_OPTIMIZATION
10462 .is_enabled(),
10463 )
10464 };
10465
10466 #[inline]
10467 fn take_from(from: &WireNodeGetAttributesRequest) -> Self {
10468 Self { query: ::fidl_next::TakeFrom::take_from(&from.query) }
10469 }
10470}
10471
10472#[derive(Clone, Debug)]
10474#[repr(C)]
10475pub struct WireNodeGetAttributesRequest {
10476 pub query: crate::WireNodeAttributesQuery,
10477}
10478
10479unsafe impl ::fidl_next::ZeroPadding for WireNodeGetAttributesRequest {
10480 #[inline]
10481 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10482}
10483
10484unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeGetAttributesRequest
10485where
10486 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10487{
10488 fn decode(
10489 slot: ::fidl_next::Slot<'_, Self>,
10490 decoder: &mut ___D,
10491 ) -> Result<(), ::fidl_next::DecodeError> {
10492 ::fidl_next::munge! {
10493 let Self {
10494 mut query,
10495
10496 } = slot;
10497 }
10498
10499 ::fidl_next::Decode::decode(query.as_mut(), decoder)?;
10500
10501 Ok(())
10502 }
10503}
10504
10505#[doc = " Node defines the minimal interface for entities which can be accessed in a filesystem.\n"]
10507#[derive(Debug)]
10508pub struct Node;
10509
10510impl ::fidl_next::Discoverable for Node {
10511 const PROTOCOL_NAME: &'static str = "node";
10512}
10513
10514pub mod node {
10515 pub mod prelude {
10516 pub use crate::{
10517 node, Node, NodeClientHandler, NodeClientSender, NodeServerHandler, NodeServerSender,
10518 };
10519
10520 pub use crate::ConnectionInfo;
10521
10522 pub use crate::ExtendedAttributeValue;
10523
10524 pub use crate::MutableNodeAttributes;
10525
10526 pub use crate::NodeAttributes2;
10527
10528 pub use crate::NodeDeprecatedCloneRequest;
10529
10530 pub use crate::NodeDeprecatedGetFlagsResponse;
10531
10532 pub use crate::NodeDeprecatedSetFlagsRequest;
10533
10534 pub use crate::NodeDeprecatedSetFlagsResponse;
10535
10536 pub use crate::NodeGetAttrResponse;
10537
10538 pub use crate::NodeGetAttributesRequest;
10539
10540 pub use crate::NodeGetExtendedAttributeRequest;
10541
10542 pub use crate::NodeListExtendedAttributesRequest;
10543
10544 pub use crate::NodeOnOpenRequest;
10545
10546 pub use crate::NodeQueryFilesystemResponse;
10547
10548 pub use crate::NodeRemoveExtendedAttributeRequest;
10549
10550 pub use crate::NodeSetAttrRequest;
10551
10552 pub use crate::NodeSetAttrResponse;
10553
10554 pub use crate::NodeSetExtendedAttributeRequest;
10555
10556 pub use crate::NodeSetFlagsRequest;
10557
10558 pub use crate::NodeGetFlagsResponse;
10559
10560 pub use crate::NodeRemoveExtendedAttributeResponse;
10561
10562 pub use crate::NodeSetExtendedAttributeResponse;
10563
10564 pub use crate::NodeSetFlagsResponse;
10565
10566 pub use crate::NodeSyncResponse;
10567
10568 pub use crate::NodeUpdateAttributesResponse;
10569
10570 pub use crate::Representation;
10571
10572 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
10573
10574 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
10575
10576 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
10577 }
10578
10579 pub struct Clone;
10580
10581 impl ::fidl_next::Method for Clone {
10582 const ORDINAL: u64 = 2366825959783828089;
10583
10584 type Protocol = crate::Node;
10585
10586 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
10587
10588 type Response = ::fidl_next::Never;
10589 }
10590
10591 pub struct Close;
10592
10593 impl ::fidl_next::Method for Close {
10594 const ORDINAL: u64 = 6540867515453498750;
10595
10596 type Protocol = crate::Node;
10597
10598 type Request = ();
10599
10600 type Response = ::fidl_next::WireResult<
10601 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
10602 ::fidl_next::WireI32,
10603 >;
10604 }
10605
10606 pub struct Query;
10607
10608 impl ::fidl_next::Method for Query {
10609 const ORDINAL: u64 = 2763219980499352582;
10610
10611 type Protocol = crate::Node;
10612
10613 type Request = ();
10614
10615 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse;
10616 }
10617
10618 pub struct DeprecatedClone;
10619
10620 impl ::fidl_next::Method for DeprecatedClone {
10621 const ORDINAL: u64 = 6512600400724287855;
10622
10623 type Protocol = crate::Node;
10624
10625 type Request = crate::WireNodeDeprecatedCloneRequest;
10626
10627 type Response = ::fidl_next::Never;
10628 }
10629
10630 pub struct OnOpen;
10631
10632 impl ::fidl_next::Method for OnOpen {
10633 const ORDINAL: u64 = 9207534335756671346;
10634
10635 type Protocol = crate::Node;
10636
10637 type Request = ::fidl_next::Never;
10638
10639 type Response = crate::WireNodeOnOpenRequest;
10640 }
10641
10642 pub struct GetAttr;
10643
10644 impl ::fidl_next::Method for GetAttr {
10645 const ORDINAL: u64 = 8689798978500614909;
10646
10647 type Protocol = crate::Node;
10648
10649 type Request = ();
10650
10651 type Response = crate::WireNodeGetAttrResponse;
10652 }
10653
10654 pub struct SetAttr;
10655
10656 impl ::fidl_next::Method for SetAttr {
10657 const ORDINAL: u64 = 4721673413776871238;
10658
10659 type Protocol = crate::Node;
10660
10661 type Request = crate::WireNodeSetAttrRequest;
10662
10663 type Response = crate::WireNodeSetAttrResponse;
10664 }
10665
10666 pub struct DeprecatedGetFlags;
10667
10668 impl ::fidl_next::Method for DeprecatedGetFlags {
10669 const ORDINAL: u64 = 6595803110182632097;
10670
10671 type Protocol = crate::Node;
10672
10673 type Request = ();
10674
10675 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
10676 }
10677
10678 pub struct DeprecatedSetFlags;
10679
10680 impl ::fidl_next::Method for DeprecatedSetFlags {
10681 const ORDINAL: u64 = 5950864159036794675;
10682
10683 type Protocol = crate::Node;
10684
10685 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
10686
10687 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
10688 }
10689
10690 pub struct GetFlags;
10691
10692 impl ::fidl_next::Method for GetFlags {
10693 const ORDINAL: u64 = 105530239381466147;
10694
10695 type Protocol = crate::Node;
10696
10697 type Request = ();
10698
10699 type Response =
10700 ::fidl_next::WireFlexibleResult<crate::WireNodeGetFlagsResponse, ::fidl_next::WireI32>;
10701 }
10702
10703 pub struct SetFlags;
10704
10705 impl ::fidl_next::Method for SetFlags {
10706 const ORDINAL: u64 = 6172186066099445416;
10707
10708 type Protocol = crate::Node;
10709
10710 type Request = crate::WireNodeSetFlagsRequest;
10711
10712 type Response =
10713 ::fidl_next::WireFlexibleResult<crate::WireNodeSetFlagsResponse, ::fidl_next::WireI32>;
10714 }
10715
10716 pub struct QueryFilesystem;
10717
10718 impl ::fidl_next::Method for QueryFilesystem {
10719 const ORDINAL: u64 = 8013111122914313744;
10720
10721 type Protocol = crate::Node;
10722
10723 type Request = ();
10724
10725 type Response = crate::WireNodeQueryFilesystemResponse;
10726 }
10727
10728 pub struct OnRepresentation;
10729
10730 impl ::fidl_next::Method for OnRepresentation {
10731 const ORDINAL: u64 = 6679970090861613324;
10732
10733 type Protocol = crate::Node;
10734
10735 type Request = ::fidl_next::Never;
10736
10737 type Response = crate::WireRepresentation;
10738 }
10739
10740 pub struct GetConnectionInfo;
10741
10742 impl ::fidl_next::Method for GetConnectionInfo {
10743 const ORDINAL: u64 = 6362521381364198667;
10744
10745 type Protocol = crate::Node;
10746
10747 type Request = ();
10748
10749 type Response = crate::WireConnectionInfo;
10750 }
10751
10752 pub struct GetAttributes;
10753
10754 impl ::fidl_next::Method for GetAttributes {
10755 const ORDINAL: u64 = 4414537700416816443;
10756
10757 type Protocol = crate::Node;
10758
10759 type Request = crate::WireNodeGetAttributesRequest;
10760
10761 type Response = ::fidl_next::WireResult<crate::WireNodeAttributes2, ::fidl_next::WireI32>;
10762 }
10763
10764 pub struct UpdateAttributes;
10765
10766 impl ::fidl_next::Method for UpdateAttributes {
10767 const ORDINAL: u64 = 3677402239314018056;
10768
10769 type Protocol = crate::Node;
10770
10771 type Request = crate::WireMutableNodeAttributes;
10772
10773 type Response =
10774 ::fidl_next::WireResult<crate::WireNodeUpdateAttributesResponse, ::fidl_next::WireI32>;
10775 }
10776
10777 pub struct Sync;
10778
10779 impl ::fidl_next::Method for Sync {
10780 const ORDINAL: u64 = 3196473584242777161;
10781
10782 type Protocol = crate::Node;
10783
10784 type Request = ();
10785
10786 type Response = ::fidl_next::WireResult<crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
10787 }
10788
10789 pub struct ListExtendedAttributes;
10790
10791 impl ::fidl_next::Method for ListExtendedAttributes {
10792 const ORDINAL: u64 = 5431626189872037072;
10793
10794 type Protocol = crate::Node;
10795
10796 type Request = crate::WireNodeListExtendedAttributesRequest;
10797
10798 type Response = ::fidl_next::Never;
10799 }
10800
10801 pub struct GetExtendedAttribute;
10802
10803 impl ::fidl_next::Method for GetExtendedAttribute {
10804 const ORDINAL: u64 = 5043930208506967771;
10805
10806 type Protocol = crate::Node;
10807
10808 type Request = crate::WireNodeGetExtendedAttributeRequest;
10809
10810 type Response =
10811 ::fidl_next::WireResult<crate::WireExtendedAttributeValue, ::fidl_next::WireI32>;
10812 }
10813
10814 pub struct SetExtendedAttribute;
10815
10816 impl ::fidl_next::Method for SetExtendedAttribute {
10817 const ORDINAL: u64 = 5374223046099989052;
10818
10819 type Protocol = crate::Node;
10820
10821 type Request = crate::WireNodeSetExtendedAttributeRequest;
10822
10823 type Response = ::fidl_next::WireResult<
10824 crate::WireNodeSetExtendedAttributeResponse,
10825 ::fidl_next::WireI32,
10826 >;
10827 }
10828
10829 pub struct RemoveExtendedAttribute;
10830
10831 impl ::fidl_next::Method for RemoveExtendedAttribute {
10832 const ORDINAL: u64 = 8794297771444732717;
10833
10834 type Protocol = crate::Node;
10835
10836 type Request = crate::WireNodeRemoveExtendedAttributeRequest;
10837
10838 type Response = ::fidl_next::WireResult<
10839 crate::WireNodeRemoveExtendedAttributeResponse,
10840 ::fidl_next::WireI32,
10841 >;
10842 }
10843}
10844
10845pub trait NodeClientSender {
10847 type Transport: ::fidl_next::Transport;
10848
10849 fn clone<___R>(
10850 &self,
10851 request: ___R,
10852 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
10853 where
10854 ___R: ::fidl_next::Encode<
10855 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10856 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
10857 >;
10858
10859 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
10860 fn close(
10861 &self,
10862 ) -> Result<
10863 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Close>,
10864 ::fidl_next::EncodeError,
10865 >;
10866
10867 fn query(
10868 &self,
10869 ) -> Result<
10870 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Query>,
10871 ::fidl_next::EncodeError,
10872 >;
10873
10874 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
10875 fn deprecated_clone<___R>(
10876 &self,
10877 request: ___R,
10878 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
10879 where
10880 ___R: ::fidl_next::Encode<
10881 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10882 Encoded = crate::WireNodeDeprecatedCloneRequest,
10883 >;
10884
10885 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
10886 fn get_attr(
10887 &self,
10888 ) -> Result<
10889 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetAttr>,
10890 ::fidl_next::EncodeError,
10891 >;
10892
10893 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
10894 fn set_attr<___R>(
10895 &self,
10896 request: ___R,
10897 ) -> Result<
10898 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetAttr>,
10899 ::fidl_next::EncodeError,
10900 >
10901 where
10902 ___R: ::fidl_next::Encode<
10903 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10904 Encoded = crate::WireNodeSetAttrRequest,
10905 >;
10906
10907 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
10908 fn deprecated_get_flags(
10909 &self,
10910 ) -> Result<
10911 ::fidl_next::ResponseFuture<'_, Self::Transport, node::DeprecatedGetFlags>,
10912 ::fidl_next::EncodeError,
10913 >;
10914
10915 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
10916 fn deprecated_set_flags<___R>(
10917 &self,
10918 request: ___R,
10919 ) -> Result<
10920 ::fidl_next::ResponseFuture<'_, Self::Transport, node::DeprecatedSetFlags>,
10921 ::fidl_next::EncodeError,
10922 >
10923 where
10924 ___R: ::fidl_next::Encode<
10925 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10926 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
10927 >;
10928
10929 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
10930 fn get_flags(
10931 &self,
10932 ) -> Result<
10933 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetFlags>,
10934 ::fidl_next::EncodeError,
10935 >;
10936
10937 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
10938 fn set_flags<___R>(
10939 &self,
10940 request: ___R,
10941 ) -> Result<
10942 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetFlags>,
10943 ::fidl_next::EncodeError,
10944 >
10945 where
10946 ___R: ::fidl_next::Encode<
10947 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10948 Encoded = crate::WireNodeSetFlagsRequest,
10949 >;
10950
10951 #[doc = " Query the filesystem for filesystem-specific information.\n"]
10952 fn query_filesystem(
10953 &self,
10954 ) -> Result<
10955 ::fidl_next::ResponseFuture<'_, Self::Transport, node::QueryFilesystem>,
10956 ::fidl_next::EncodeError,
10957 >;
10958
10959 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
10960 fn get_connection_info(
10961 &self,
10962 ) -> Result<
10963 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetConnectionInfo>,
10964 ::fidl_next::EncodeError,
10965 >;
10966
10967 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
10968 fn get_attributes<___R>(
10969 &self,
10970 request: ___R,
10971 ) -> Result<
10972 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetAttributes>,
10973 ::fidl_next::EncodeError,
10974 >
10975 where
10976 ___R: ::fidl_next::Encode<
10977 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10978 Encoded = crate::WireNodeGetAttributesRequest,
10979 >;
10980
10981 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
10982 fn update_attributes<___R>(
10983 &self,
10984 request: ___R,
10985 ) -> Result<
10986 ::fidl_next::ResponseFuture<'_, Self::Transport, node::UpdateAttributes>,
10987 ::fidl_next::EncodeError,
10988 >
10989 where
10990 ___R: ::fidl_next::Encode<
10991 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10992 Encoded = crate::WireMutableNodeAttributes,
10993 >;
10994
10995 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
10996 fn sync(
10997 &self,
10998 ) -> Result<
10999 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Sync>,
11000 ::fidl_next::EncodeError,
11001 >;
11002
11003 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11004 fn list_extended_attributes<___R>(
11005 &self,
11006 request: ___R,
11007 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11008 where
11009 ___R: ::fidl_next::Encode<
11010 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11011 Encoded = crate::WireNodeListExtendedAttributesRequest,
11012 >;
11013
11014 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11015 fn get_extended_attribute<___R>(
11016 &self,
11017 request: ___R,
11018 ) -> Result<
11019 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetExtendedAttribute>,
11020 ::fidl_next::EncodeError,
11021 >
11022 where
11023 ___R: ::fidl_next::Encode<
11024 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11025 Encoded = crate::WireNodeGetExtendedAttributeRequest,
11026 >;
11027
11028 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11029 fn set_extended_attribute<___R>(
11030 &self,
11031 request: ___R,
11032 ) -> Result<
11033 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetExtendedAttribute>,
11034 ::fidl_next::EncodeError,
11035 >
11036 where
11037 ___R: ::fidl_next::Encode<
11038 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11039 Encoded = crate::WireNodeSetExtendedAttributeRequest,
11040 >;
11041
11042 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11043 fn remove_extended_attribute<___R>(
11044 &self,
11045 request: ___R,
11046 ) -> Result<
11047 ::fidl_next::ResponseFuture<'_, Self::Transport, node::RemoveExtendedAttribute>,
11048 ::fidl_next::EncodeError,
11049 >
11050 where
11051 ___R: ::fidl_next::Encode<
11052 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11053 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
11054 >;
11055}
11056
11057impl<___T> NodeClientSender for ::fidl_next::ClientSender<___T, Node>
11058where
11059 ___T: ::fidl_next::Transport,
11060{
11061 type Transport = ___T;
11062
11063 fn clone<___R>(
11064 &self,
11065 request: ___R,
11066 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11067 where
11068 ___R: ::fidl_next::Encode<
11069 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11070 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
11071 >,
11072 {
11073 self.as_untyped().send_one_way(2366825959783828089, request)
11074 }
11075
11076 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
11077 fn close(
11078 &self,
11079 ) -> Result<
11080 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Close>,
11081 ::fidl_next::EncodeError,
11082 > {
11083 self.as_untyped()
11084 .send_two_way(6540867515453498750, ())
11085 .map(::fidl_next::ResponseFuture::from_untyped)
11086 }
11087
11088 fn query(
11089 &self,
11090 ) -> Result<
11091 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Query>,
11092 ::fidl_next::EncodeError,
11093 > {
11094 self.as_untyped()
11095 .send_two_way(2763219980499352582, ())
11096 .map(::fidl_next::ResponseFuture::from_untyped)
11097 }
11098
11099 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
11100 fn deprecated_clone<___R>(
11101 &self,
11102 request: ___R,
11103 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11104 where
11105 ___R: ::fidl_next::Encode<
11106 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11107 Encoded = crate::WireNodeDeprecatedCloneRequest,
11108 >,
11109 {
11110 self.as_untyped().send_one_way(6512600400724287855, request)
11111 }
11112
11113 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
11114 fn get_attr(
11115 &self,
11116 ) -> Result<
11117 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetAttr>,
11118 ::fidl_next::EncodeError,
11119 > {
11120 self.as_untyped()
11121 .send_two_way(8689798978500614909, ())
11122 .map(::fidl_next::ResponseFuture::from_untyped)
11123 }
11124
11125 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
11126 fn set_attr<___R>(
11127 &self,
11128 request: ___R,
11129 ) -> Result<
11130 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetAttr>,
11131 ::fidl_next::EncodeError,
11132 >
11133 where
11134 ___R: ::fidl_next::Encode<
11135 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11136 Encoded = crate::WireNodeSetAttrRequest,
11137 >,
11138 {
11139 self.as_untyped()
11140 .send_two_way(4721673413776871238, request)
11141 .map(::fidl_next::ResponseFuture::from_untyped)
11142 }
11143
11144 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
11145 fn deprecated_get_flags(
11146 &self,
11147 ) -> Result<
11148 ::fidl_next::ResponseFuture<'_, Self::Transport, node::DeprecatedGetFlags>,
11149 ::fidl_next::EncodeError,
11150 > {
11151 self.as_untyped()
11152 .send_two_way(6595803110182632097, ())
11153 .map(::fidl_next::ResponseFuture::from_untyped)
11154 }
11155
11156 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
11157 fn deprecated_set_flags<___R>(
11158 &self,
11159 request: ___R,
11160 ) -> Result<
11161 ::fidl_next::ResponseFuture<'_, Self::Transport, node::DeprecatedSetFlags>,
11162 ::fidl_next::EncodeError,
11163 >
11164 where
11165 ___R: ::fidl_next::Encode<
11166 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11167 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
11168 >,
11169 {
11170 self.as_untyped()
11171 .send_two_way(5950864159036794675, request)
11172 .map(::fidl_next::ResponseFuture::from_untyped)
11173 }
11174
11175 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
11176 fn get_flags(
11177 &self,
11178 ) -> Result<
11179 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetFlags>,
11180 ::fidl_next::EncodeError,
11181 > {
11182 self.as_untyped()
11183 .send_two_way(105530239381466147, ())
11184 .map(::fidl_next::ResponseFuture::from_untyped)
11185 }
11186
11187 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
11188 fn set_flags<___R>(
11189 &self,
11190 request: ___R,
11191 ) -> Result<
11192 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetFlags>,
11193 ::fidl_next::EncodeError,
11194 >
11195 where
11196 ___R: ::fidl_next::Encode<
11197 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11198 Encoded = crate::WireNodeSetFlagsRequest,
11199 >,
11200 {
11201 self.as_untyped()
11202 .send_two_way(6172186066099445416, request)
11203 .map(::fidl_next::ResponseFuture::from_untyped)
11204 }
11205
11206 #[doc = " Query the filesystem for filesystem-specific information.\n"]
11207 fn query_filesystem(
11208 &self,
11209 ) -> Result<
11210 ::fidl_next::ResponseFuture<'_, Self::Transport, node::QueryFilesystem>,
11211 ::fidl_next::EncodeError,
11212 > {
11213 self.as_untyped()
11214 .send_two_way(8013111122914313744, ())
11215 .map(::fidl_next::ResponseFuture::from_untyped)
11216 }
11217
11218 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
11219 fn get_connection_info(
11220 &self,
11221 ) -> Result<
11222 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetConnectionInfo>,
11223 ::fidl_next::EncodeError,
11224 > {
11225 self.as_untyped()
11226 .send_two_way(6362521381364198667, ())
11227 .map(::fidl_next::ResponseFuture::from_untyped)
11228 }
11229
11230 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11231 fn get_attributes<___R>(
11232 &self,
11233 request: ___R,
11234 ) -> Result<
11235 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetAttributes>,
11236 ::fidl_next::EncodeError,
11237 >
11238 where
11239 ___R: ::fidl_next::Encode<
11240 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11241 Encoded = crate::WireNodeGetAttributesRequest,
11242 >,
11243 {
11244 self.as_untyped()
11245 .send_two_way(4414537700416816443, request)
11246 .map(::fidl_next::ResponseFuture::from_untyped)
11247 }
11248
11249 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11250 fn update_attributes<___R>(
11251 &self,
11252 request: ___R,
11253 ) -> Result<
11254 ::fidl_next::ResponseFuture<'_, Self::Transport, node::UpdateAttributes>,
11255 ::fidl_next::EncodeError,
11256 >
11257 where
11258 ___R: ::fidl_next::Encode<
11259 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11260 Encoded = crate::WireMutableNodeAttributes,
11261 >,
11262 {
11263 self.as_untyped()
11264 .send_two_way(3677402239314018056, request)
11265 .map(::fidl_next::ResponseFuture::from_untyped)
11266 }
11267
11268 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
11269 fn sync(
11270 &self,
11271 ) -> Result<
11272 ::fidl_next::ResponseFuture<'_, Self::Transport, node::Sync>,
11273 ::fidl_next::EncodeError,
11274 > {
11275 self.as_untyped()
11276 .send_two_way(3196473584242777161, ())
11277 .map(::fidl_next::ResponseFuture::from_untyped)
11278 }
11279
11280 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11281 fn list_extended_attributes<___R>(
11282 &self,
11283 request: ___R,
11284 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11285 where
11286 ___R: ::fidl_next::Encode<
11287 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11288 Encoded = crate::WireNodeListExtendedAttributesRequest,
11289 >,
11290 {
11291 self.as_untyped().send_one_way(5431626189872037072, request)
11292 }
11293
11294 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11295 fn get_extended_attribute<___R>(
11296 &self,
11297 request: ___R,
11298 ) -> Result<
11299 ::fidl_next::ResponseFuture<'_, Self::Transport, node::GetExtendedAttribute>,
11300 ::fidl_next::EncodeError,
11301 >
11302 where
11303 ___R: ::fidl_next::Encode<
11304 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11305 Encoded = crate::WireNodeGetExtendedAttributeRequest,
11306 >,
11307 {
11308 self.as_untyped()
11309 .send_two_way(5043930208506967771, request)
11310 .map(::fidl_next::ResponseFuture::from_untyped)
11311 }
11312
11313 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11314 fn set_extended_attribute<___R>(
11315 &self,
11316 request: ___R,
11317 ) -> Result<
11318 ::fidl_next::ResponseFuture<'_, Self::Transport, node::SetExtendedAttribute>,
11319 ::fidl_next::EncodeError,
11320 >
11321 where
11322 ___R: ::fidl_next::Encode<
11323 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11324 Encoded = crate::WireNodeSetExtendedAttributeRequest,
11325 >,
11326 {
11327 self.as_untyped()
11328 .send_two_way(5374223046099989052, request)
11329 .map(::fidl_next::ResponseFuture::from_untyped)
11330 }
11331
11332 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11333 fn remove_extended_attribute<___R>(
11334 &self,
11335 request: ___R,
11336 ) -> Result<
11337 ::fidl_next::ResponseFuture<'_, Self::Transport, node::RemoveExtendedAttribute>,
11338 ::fidl_next::EncodeError,
11339 >
11340 where
11341 ___R: ::fidl_next::Encode<
11342 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11343 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
11344 >,
11345 {
11346 self.as_untyped()
11347 .send_two_way(8794297771444732717, request)
11348 .map(::fidl_next::ResponseFuture::from_untyped)
11349 }
11350}
11351
11352pub trait NodeClientHandler<___T: ::fidl_next::Transport> {
11356 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
11357 fn on_open(
11358 &mut self,
11359 sender: &::fidl_next::ClientSender<___T, Node>,
11360
11361 event: ::fidl_next::Response<___T, node::OnOpen>,
11362 );
11363
11364 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
11365 fn on_representation(
11366 &mut self,
11367 sender: &::fidl_next::ClientSender<___T, Node>,
11368
11369 event: ::fidl_next::Response<___T, node::OnRepresentation>,
11370 );
11371
11372 fn on_unknown_interaction(
11373 &mut self,
11374 sender: &::fidl_next::ClientSender<___T, Node>,
11375 ordinal: u64,
11376 ) {
11377 sender.close();
11378 }
11379}
11380
11381impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Node
11382where
11383 ___T: ::fidl_next::Transport,
11384 ___H: NodeClientHandler<___T>,
11385
11386 <node::Close as ::fidl_next::Method>::Response:
11387 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11388
11389 <node::Query as ::fidl_next::Method>::Response:
11390 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11391
11392 <node::OnOpen as ::fidl_next::Method>::Response:
11393 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11394
11395 <node::GetAttr as ::fidl_next::Method>::Response:
11396 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11397
11398 <node::SetAttr as ::fidl_next::Method>::Response:
11399 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11400
11401 <node::DeprecatedGetFlags as ::fidl_next::Method>::Response:
11402 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11403
11404 <node::DeprecatedSetFlags as ::fidl_next::Method>::Response:
11405 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11406
11407 <node::GetFlags as ::fidl_next::Method>::Response:
11408 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11409
11410 <node::SetFlags as ::fidl_next::Method>::Response:
11411 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11412
11413 <node::QueryFilesystem as ::fidl_next::Method>::Response:
11414 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11415
11416 <node::OnRepresentation as ::fidl_next::Method>::Response:
11417 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11418
11419 <node::GetConnectionInfo as ::fidl_next::Method>::Response:
11420 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11421
11422 <node::GetAttributes as ::fidl_next::Method>::Response:
11423 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11424
11425 <node::UpdateAttributes as ::fidl_next::Method>::Response:
11426 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11427
11428 <node::Sync as ::fidl_next::Method>::Response:
11429 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11430
11431 <node::GetExtendedAttribute as ::fidl_next::Method>::Response:
11432 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11433
11434 <node::SetExtendedAttribute as ::fidl_next::Method>::Response:
11435 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11436
11437 <node::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
11438 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11439{
11440 fn on_event(
11441 handler: &mut ___H,
11442 sender: &::fidl_next::ClientSender<___T, Self>,
11443 ordinal: u64,
11444 buffer: ___T::RecvBuffer,
11445 ) {
11446 match ordinal {
11447 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
11448 Ok(decoded) => handler.on_open(sender, decoded),
11449 Err(e) => {
11450 sender.close();
11451 }
11452 },
11453
11454 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
11455 Ok(decoded) => handler.on_representation(sender, decoded),
11456 Err(e) => {
11457 sender.close();
11458 }
11459 },
11460
11461 ordinal => handler.on_unknown_interaction(sender, ordinal),
11462 }
11463 }
11464}
11465
11466pub trait NodeServerSender {
11468 type Transport: ::fidl_next::Transport;
11469
11470 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
11471
11472 fn on_open<___R>(
11473 &self,
11474 request: ___R,
11475 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11476 where
11477 ___R: ::fidl_next::Encode<
11478 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11479 Encoded = <node::OnOpen as ::fidl_next::Method>::Response,
11480 >;
11481
11482 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
11483
11484 fn on_representation<___R>(
11485 &self,
11486 request: ___R,
11487 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11488 where
11489 ___R: ::fidl_next::Encode<
11490 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11491 Encoded = <node::OnRepresentation as ::fidl_next::Method>::Response,
11492 >;
11493}
11494
11495impl<___T> NodeServerSender for ::fidl_next::ServerSender<___T, Node>
11496where
11497 ___T: ::fidl_next::Transport,
11498{
11499 type Transport = ___T;
11500
11501 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
11502
11503 fn on_open<___R>(
11504 &self,
11505 request: ___R,
11506 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11507 where
11508 ___R: ::fidl_next::Encode<
11509 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11510 Encoded = <node::OnOpen as ::fidl_next::Method>::Response,
11511 >,
11512 {
11513 self.as_untyped().send_event(9207534335756671346, request)
11514 }
11515
11516 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
11517
11518 fn on_representation<___R>(
11519 &self,
11520 request: ___R,
11521 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11522 where
11523 ___R: ::fidl_next::Encode<
11524 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11525 Encoded = <node::OnRepresentation as ::fidl_next::Method>::Response,
11526 >,
11527 {
11528 self.as_untyped().send_event(6679970090861613324, request)
11529 }
11530}
11531
11532pub trait NodeServerHandler<___T: ::fidl_next::Transport> {
11536 fn clone(
11537 &mut self,
11538 sender: &::fidl_next::ServerSender<___T, Node>,
11539
11540 request: ::fidl_next::Request<___T, node::Clone>,
11541 );
11542
11543 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
11544 fn close(
11545 &mut self,
11546 sender: &::fidl_next::ServerSender<___T, Node>,
11547
11548 responder: ::fidl_next::Responder<node::Close>,
11549 );
11550
11551 fn query(
11552 &mut self,
11553 sender: &::fidl_next::ServerSender<___T, Node>,
11554
11555 responder: ::fidl_next::Responder<node::Query>,
11556 );
11557
11558 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
11559 fn deprecated_clone(
11560 &mut self,
11561 sender: &::fidl_next::ServerSender<___T, Node>,
11562
11563 request: ::fidl_next::Request<___T, node::DeprecatedClone>,
11564 );
11565
11566 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
11567 fn get_attr(
11568 &mut self,
11569 sender: &::fidl_next::ServerSender<___T, Node>,
11570
11571 responder: ::fidl_next::Responder<node::GetAttr>,
11572 );
11573
11574 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
11575 fn set_attr(
11576 &mut self,
11577 sender: &::fidl_next::ServerSender<___T, Node>,
11578
11579 request: ::fidl_next::Request<___T, node::SetAttr>,
11580
11581 responder: ::fidl_next::Responder<node::SetAttr>,
11582 );
11583
11584 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
11585 fn deprecated_get_flags(
11586 &mut self,
11587 sender: &::fidl_next::ServerSender<___T, Node>,
11588
11589 responder: ::fidl_next::Responder<node::DeprecatedGetFlags>,
11590 );
11591
11592 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
11593 fn deprecated_set_flags(
11594 &mut self,
11595 sender: &::fidl_next::ServerSender<___T, Node>,
11596
11597 request: ::fidl_next::Request<___T, node::DeprecatedSetFlags>,
11598
11599 responder: ::fidl_next::Responder<node::DeprecatedSetFlags>,
11600 );
11601
11602 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
11603 fn get_flags(
11604 &mut self,
11605 sender: &::fidl_next::ServerSender<___T, Node>,
11606
11607 responder: ::fidl_next::Responder<node::GetFlags>,
11608 );
11609
11610 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
11611 fn set_flags(
11612 &mut self,
11613 sender: &::fidl_next::ServerSender<___T, Node>,
11614
11615 request: ::fidl_next::Request<___T, node::SetFlags>,
11616
11617 responder: ::fidl_next::Responder<node::SetFlags>,
11618 );
11619
11620 #[doc = " Query the filesystem for filesystem-specific information.\n"]
11621 fn query_filesystem(
11622 &mut self,
11623 sender: &::fidl_next::ServerSender<___T, Node>,
11624
11625 responder: ::fidl_next::Responder<node::QueryFilesystem>,
11626 );
11627
11628 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
11629 fn get_connection_info(
11630 &mut self,
11631 sender: &::fidl_next::ServerSender<___T, Node>,
11632
11633 responder: ::fidl_next::Responder<node::GetConnectionInfo>,
11634 );
11635
11636 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11637 fn get_attributes(
11638 &mut self,
11639 sender: &::fidl_next::ServerSender<___T, Node>,
11640
11641 request: ::fidl_next::Request<___T, node::GetAttributes>,
11642
11643 responder: ::fidl_next::Responder<node::GetAttributes>,
11644 );
11645
11646 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11647 fn update_attributes(
11648 &mut self,
11649 sender: &::fidl_next::ServerSender<___T, Node>,
11650
11651 request: ::fidl_next::Request<___T, node::UpdateAttributes>,
11652
11653 responder: ::fidl_next::Responder<node::UpdateAttributes>,
11654 );
11655
11656 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
11657 fn sync(
11658 &mut self,
11659 sender: &::fidl_next::ServerSender<___T, Node>,
11660
11661 responder: ::fidl_next::Responder<node::Sync>,
11662 );
11663
11664 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11665 fn list_extended_attributes(
11666 &mut self,
11667 sender: &::fidl_next::ServerSender<___T, Node>,
11668
11669 request: ::fidl_next::Request<___T, node::ListExtendedAttributes>,
11670 );
11671
11672 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
11673 fn get_extended_attribute(
11674 &mut self,
11675 sender: &::fidl_next::ServerSender<___T, Node>,
11676
11677 request: ::fidl_next::Request<___T, node::GetExtendedAttribute>,
11678
11679 responder: ::fidl_next::Responder<node::GetExtendedAttribute>,
11680 );
11681
11682 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11683 fn set_extended_attribute(
11684 &mut self,
11685 sender: &::fidl_next::ServerSender<___T, Node>,
11686
11687 request: ::fidl_next::Request<___T, node::SetExtendedAttribute>,
11688
11689 responder: ::fidl_next::Responder<node::SetExtendedAttribute>,
11690 );
11691
11692 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
11693 fn remove_extended_attribute(
11694 &mut self,
11695 sender: &::fidl_next::ServerSender<___T, Node>,
11696
11697 request: ::fidl_next::Request<___T, node::RemoveExtendedAttribute>,
11698
11699 responder: ::fidl_next::Responder<node::RemoveExtendedAttribute>,
11700 );
11701
11702 fn on_unknown_interaction(
11703 &mut self,
11704 sender: &::fidl_next::ServerSender<___T, Node>,
11705 ordinal: u64,
11706 ) {
11707 sender.close();
11708 }
11709}
11710
11711impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Node
11712where
11713 ___T: ::fidl_next::Transport,
11714 ___H: NodeServerHandler<___T>,
11715
11716 ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest:
11717 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11718
11719 crate::WireNodeDeprecatedCloneRequest:
11720 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11721
11722 crate::WireNodeSetAttrRequest:
11723 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11724
11725 crate::WireNodeDeprecatedSetFlagsRequest:
11726 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11727
11728 crate::WireNodeSetFlagsRequest:
11729 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11730
11731 crate::WireNodeGetAttributesRequest:
11732 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11733
11734 crate::WireMutableNodeAttributes:
11735 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11736
11737 crate::WireNodeListExtendedAttributesRequest:
11738 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11739
11740 crate::WireNodeGetExtendedAttributeRequest:
11741 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11742
11743 crate::WireNodeSetExtendedAttributeRequest:
11744 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11745
11746 crate::WireNodeRemoveExtendedAttributeRequest:
11747 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11748{
11749 fn on_one_way(
11750 handler: &mut ___H,
11751 sender: &::fidl_next::ServerSender<___T, Self>,
11752 ordinal: u64,
11753 buffer: ___T::RecvBuffer,
11754 ) {
11755 match ordinal {
11756 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
11757 Ok(decoded) => handler.clone(sender, decoded),
11758 Err(e) => {
11759 sender.close();
11760 }
11761 },
11762
11763 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
11764 Ok(decoded) => handler.deprecated_clone(sender, decoded),
11765 Err(e) => {
11766 sender.close();
11767 }
11768 },
11769
11770 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
11771 Ok(decoded) => handler.list_extended_attributes(sender, decoded),
11772 Err(e) => {
11773 sender.close();
11774 }
11775 },
11776
11777 ordinal => handler.on_unknown_interaction(sender, ordinal),
11778 }
11779 }
11780
11781 fn on_two_way(
11782 handler: &mut ___H,
11783 sender: &::fidl_next::ServerSender<___T, Self>,
11784 ordinal: u64,
11785 buffer: ___T::RecvBuffer,
11786 responder: ::fidl_next::protocol::Responder,
11787 ) {
11788 match ordinal {
11789 6540867515453498750 => {
11790 let responder = ::fidl_next::Responder::from_untyped(responder);
11791
11792 handler.close(sender, responder);
11793 }
11794
11795 2763219980499352582 => {
11796 let responder = ::fidl_next::Responder::from_untyped(responder);
11797
11798 handler.query(sender, responder);
11799 }
11800
11801 8689798978500614909 => {
11802 let responder = ::fidl_next::Responder::from_untyped(responder);
11803
11804 handler.get_attr(sender, responder);
11805 }
11806
11807 4721673413776871238 => {
11808 let responder = ::fidl_next::Responder::from_untyped(responder);
11809
11810 match ::fidl_next::DecoderExt::decode(buffer) {
11811 Ok(decoded) => handler.set_attr(sender, decoded, responder),
11812 Err(e) => {
11813 sender.close();
11814 }
11815 }
11816 }
11817
11818 6595803110182632097 => {
11819 let responder = ::fidl_next::Responder::from_untyped(responder);
11820
11821 handler.deprecated_get_flags(sender, responder);
11822 }
11823
11824 5950864159036794675 => {
11825 let responder = ::fidl_next::Responder::from_untyped(responder);
11826
11827 match ::fidl_next::DecoderExt::decode(buffer) {
11828 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder),
11829 Err(e) => {
11830 sender.close();
11831 }
11832 }
11833 }
11834
11835 105530239381466147 => {
11836 let responder = ::fidl_next::Responder::from_untyped(responder);
11837
11838 handler.get_flags(sender, responder);
11839 }
11840
11841 6172186066099445416 => {
11842 let responder = ::fidl_next::Responder::from_untyped(responder);
11843
11844 match ::fidl_next::DecoderExt::decode(buffer) {
11845 Ok(decoded) => handler.set_flags(sender, decoded, responder),
11846 Err(e) => {
11847 sender.close();
11848 }
11849 }
11850 }
11851
11852 8013111122914313744 => {
11853 let responder = ::fidl_next::Responder::from_untyped(responder);
11854
11855 handler.query_filesystem(sender, responder);
11856 }
11857
11858 6362521381364198667 => {
11859 let responder = ::fidl_next::Responder::from_untyped(responder);
11860
11861 handler.get_connection_info(sender, responder);
11862 }
11863
11864 4414537700416816443 => {
11865 let responder = ::fidl_next::Responder::from_untyped(responder);
11866
11867 match ::fidl_next::DecoderExt::decode(buffer) {
11868 Ok(decoded) => handler.get_attributes(sender, decoded, responder),
11869 Err(e) => {
11870 sender.close();
11871 }
11872 }
11873 }
11874
11875 3677402239314018056 => {
11876 let responder = ::fidl_next::Responder::from_untyped(responder);
11877
11878 match ::fidl_next::DecoderExt::decode(buffer) {
11879 Ok(decoded) => handler.update_attributes(sender, decoded, responder),
11880 Err(e) => {
11881 sender.close();
11882 }
11883 }
11884 }
11885
11886 3196473584242777161 => {
11887 let responder = ::fidl_next::Responder::from_untyped(responder);
11888
11889 handler.sync(sender, responder);
11890 }
11891
11892 5043930208506967771 => {
11893 let responder = ::fidl_next::Responder::from_untyped(responder);
11894
11895 match ::fidl_next::DecoderExt::decode(buffer) {
11896 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder),
11897 Err(e) => {
11898 sender.close();
11899 }
11900 }
11901 }
11902
11903 5374223046099989052 => {
11904 let responder = ::fidl_next::Responder::from_untyped(responder);
11905
11906 match ::fidl_next::DecoderExt::decode(buffer) {
11907 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder),
11908 Err(e) => {
11909 sender.close();
11910 }
11911 }
11912 }
11913
11914 8794297771444732717 => {
11915 let responder = ::fidl_next::Responder::from_untyped(responder);
11916
11917 match ::fidl_next::DecoderExt::decode(buffer) {
11918 Ok(decoded) => handler.remove_extended_attribute(sender, decoded, responder),
11919 Err(e) => {
11920 sender.close();
11921 }
11922 }
11923 }
11924
11925 ordinal => handler.on_unknown_interaction(sender, ordinal),
11926 }
11927 }
11928}
11929
11930#[derive(Debug)]
11931pub struct DirectoryDeprecatedOpenRequest {
11932 pub flags: crate::OpenFlags,
11933
11934 pub mode: crate::ModeType,
11935
11936 pub path: String,
11937
11938 pub object: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Node>,
11939}
11940
11941impl ::fidl_next::Encodable for DirectoryDeprecatedOpenRequest {
11942 type Encoded = WireDirectoryDeprecatedOpenRequest;
11943}
11944
11945unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryDeprecatedOpenRequest
11946where
11947 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11948
11949 ___E: ::fidl_next::Encoder,
11950
11951 ___E: ::fidl_next::fuchsia::HandleEncoder,
11952{
11953 #[inline]
11954 fn encode(
11955 self,
11956 encoder: &mut ___E,
11957 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11958 ) -> Result<(), ::fidl_next::EncodeError> {
11959 ::fidl_next::munge! {
11960 let Self::Encoded {
11961 flags,
11962 mode,
11963 path,
11964 object,
11965
11966 } = out;
11967 }
11968
11969 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
11970
11971 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
11972
11973 ::fidl_next::Encode::encode(self.path, encoder, path)?;
11974
11975 ::fidl_next::Encode::encode(self.object, encoder, object)?;
11976
11977 Ok(())
11978 }
11979}
11980
11981impl ::fidl_next::EncodableOption for Box<DirectoryDeprecatedOpenRequest> {
11982 type EncodedOption = ::fidl_next::WireBox<WireDirectoryDeprecatedOpenRequest>;
11983}
11984
11985unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryDeprecatedOpenRequest>
11986where
11987 ___E: ::fidl_next::Encoder + ?Sized,
11988 DirectoryDeprecatedOpenRequest: ::fidl_next::Encode<___E>,
11989{
11990 #[inline]
11991 fn encode_option(
11992 this: Option<Self>,
11993 encoder: &mut ___E,
11994 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11995 ) -> Result<(), ::fidl_next::EncodeError> {
11996 if let Some(inner) = this {
11997 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
11998 ::fidl_next::WireBox::encode_present(out);
11999 } else {
12000 ::fidl_next::WireBox::encode_absent(out);
12001 }
12002
12003 Ok(())
12004 }
12005}
12006
12007impl ::fidl_next::TakeFrom<WireDirectoryDeprecatedOpenRequest> for DirectoryDeprecatedOpenRequest {
12008 #[inline]
12009 fn take_from(from: &WireDirectoryDeprecatedOpenRequest) -> Self {
12010 Self {
12011 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
12012
12013 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
12014
12015 path: ::fidl_next::TakeFrom::take_from(&from.path),
12016
12017 object: ::fidl_next::TakeFrom::take_from(&from.object),
12018 }
12019 }
12020}
12021
12022#[derive(Debug)]
12024#[repr(C)]
12025pub struct WireDirectoryDeprecatedOpenRequest {
12026 pub flags: crate::WireOpenFlags,
12027
12028 pub mode: crate::WireModeType,
12029
12030 pub path: ::fidl_next::WireString,
12031
12032 pub object: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Node>,
12033}
12034
12035unsafe impl ::fidl_next::ZeroPadding for WireDirectoryDeprecatedOpenRequest {
12036 #[inline]
12037 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12038 unsafe {
12039 out.as_mut_ptr().cast::<u8>().add(28).write_bytes(0, 4);
12040 }
12041 }
12042}
12043
12044unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryDeprecatedOpenRequest
12045where
12046 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12047
12048 ___D: ::fidl_next::Decoder,
12049
12050 ___D: ::fidl_next::fuchsia::HandleDecoder,
12051{
12052 fn decode(
12053 slot: ::fidl_next::Slot<'_, Self>,
12054 decoder: &mut ___D,
12055 ) -> Result<(), ::fidl_next::DecodeError> {
12056 ::fidl_next::munge! {
12057 let Self {
12058 mut flags,
12059 mut mode,
12060 mut path,
12061 mut object,
12062
12063 } = slot;
12064 }
12065
12066 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
12067
12068 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
12069
12070 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
12071
12072 let path = unsafe { path.deref_unchecked() };
12073
12074 if path.len() > 4095 {
12075 return Err(::fidl_next::DecodeError::VectorTooLong {
12076 size: path.len() as u64,
12077 limit: 4095,
12078 });
12079 }
12080
12081 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
12082
12083 Ok(())
12084 }
12085}
12086
12087#[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"]
12088#[derive(Clone, Debug, Default)]
12089pub struct Options {
12090 pub attributes: Option<crate::NodeAttributesQuery>,
12091
12092 pub create_attributes: Option<crate::MutableNodeAttributes>,
12093}
12094
12095impl Options {
12096 fn __max_ordinal(&self) -> usize {
12097 if self.attributes.is_some() {
12098 return 1;
12099 }
12100
12101 if self.create_attributes.is_some() {
12102 return 2;
12103 }
12104
12105 0
12106 }
12107}
12108
12109impl ::fidl_next::Encodable for Options {
12110 type Encoded = WireOptions;
12111}
12112
12113unsafe impl<___E> ::fidl_next::Encode<___E> for Options
12114where
12115 ___E: ::fidl_next::Encoder + ?Sized,
12116{
12117 #[inline]
12118 fn encode(
12119 mut self,
12120 encoder: &mut ___E,
12121 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12122 ) -> Result<(), ::fidl_next::EncodeError> {
12123 ::fidl_next::munge!(let WireOptions { table } = out);
12124
12125 let max_ord = self.__max_ordinal();
12126
12127 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12128 ::fidl_next::ZeroPadding::zero_padding(&mut out);
12129
12130 let mut preallocated =
12131 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12132
12133 for i in 1..=max_ord {
12134 match i {
12135 2 => {
12136 if let Some(create_attributes) = self.create_attributes.take() {
12137 ::fidl_next::WireEnvelope::encode_value(
12138 create_attributes,
12139 preallocated.encoder,
12140 &mut out,
12141 )?;
12142 } else {
12143 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12144 }
12145 }
12146
12147 1 => {
12148 if let Some(attributes) = self.attributes.take() {
12149 ::fidl_next::WireEnvelope::encode_value(
12150 attributes,
12151 preallocated.encoder,
12152 &mut out,
12153 )?;
12154 } else {
12155 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12156 }
12157 }
12158
12159 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12160 }
12161 unsafe {
12162 preallocated.write_next(out.assume_init_ref());
12163 }
12164 }
12165
12166 ::fidl_next::WireTable::encode_len(table, max_ord);
12167
12168 Ok(())
12169 }
12170}
12171
12172unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Options
12173where
12174 ___E: ::fidl_next::Encoder + ?Sized,
12175{
12176 #[inline]
12177 fn encode_ref(
12178 &self,
12179 encoder: &mut ___E,
12180 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12181 ) -> Result<(), ::fidl_next::EncodeError> {
12182 ::fidl_next::munge!(let WireOptions { table } = out);
12183
12184 let max_ord = self.__max_ordinal();
12185
12186 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12187 ::fidl_next::ZeroPadding::zero_padding(&mut out);
12188
12189 let mut preallocated =
12190 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12191
12192 for i in 1..=max_ord {
12193 match i {
12194 2 => {
12195 if let Some(create_attributes) = &self.create_attributes {
12196 ::fidl_next::WireEnvelope::encode_value(
12197 create_attributes,
12198 preallocated.encoder,
12199 &mut out,
12200 )?;
12201 } else {
12202 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12203 }
12204 }
12205
12206 1 => {
12207 if let Some(attributes) = &self.attributes {
12208 ::fidl_next::WireEnvelope::encode_value(
12209 attributes,
12210 preallocated.encoder,
12211 &mut out,
12212 )?;
12213 } else {
12214 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12215 }
12216 }
12217
12218 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12219 }
12220 unsafe {
12221 preallocated.write_next(out.assume_init_ref());
12222 }
12223 }
12224
12225 ::fidl_next::WireTable::encode_len(table, max_ord);
12226
12227 Ok(())
12228 }
12229}
12230
12231impl ::fidl_next::TakeFrom<WireOptions> for Options {
12232 #[inline]
12233 fn take_from(from: &WireOptions) -> Self {
12234 Self {
12235 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
12236
12237 create_attributes: from.create_attributes().map(::fidl_next::TakeFrom::take_from),
12238 }
12239 }
12240}
12241
12242#[repr(C)]
12244pub struct WireOptions {
12245 table: ::fidl_next::WireTable,
12246}
12247
12248unsafe impl ::fidl_next::ZeroPadding for WireOptions {
12249 #[inline]
12250 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12251 ::fidl_next::munge!(let Self { table } = out);
12252 ::fidl_next::WireTable::zero_padding(table);
12253 }
12254}
12255
12256unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptions
12257where
12258 ___D: ::fidl_next::Decoder + ?Sized,
12259{
12260 fn decode(
12261 slot: ::fidl_next::Slot<'_, Self>,
12262 decoder: &mut ___D,
12263 ) -> Result<(), ::fidl_next::DecodeError> {
12264 ::fidl_next::munge!(let Self { table } = slot);
12265
12266 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12267 match ordinal {
12268 0 => unsafe { ::core::hint::unreachable_unchecked() },
12269
12270 1 => {
12271 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireNodeAttributesQuery>(
12272 slot.as_mut(),
12273 decoder,
12274 )?;
12275
12276 Ok(())
12277 }
12278
12279 2 => {
12280 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireMutableNodeAttributes>(
12281 slot.as_mut(),
12282 decoder,
12283 )?;
12284
12285 Ok(())
12286 }
12287
12288 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12289 }
12290 })
12291 }
12292}
12293
12294impl WireOptions {
12295 pub fn attributes(&self) -> Option<&crate::WireNodeAttributesQuery> {
12296 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12297 }
12298
12299 pub fn create_attributes(&self) -> Option<&crate::WireMutableNodeAttributes> {
12300 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12301 }
12302}
12303
12304impl ::core::fmt::Debug for WireOptions {
12305 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12306 f.debug_struct("Options")
12307 .field("attributes", &self.attributes())
12308 .field("create_attributes", &self.create_attributes())
12309 .finish()
12310 }
12311}
12312
12313#[derive(Debug)]
12314pub struct DirectoryOpenRequest {
12315 pub path: String,
12316
12317 pub flags: crate::Flags,
12318
12319 pub options: crate::Options,
12320
12321 pub object: ::fidl_next::fuchsia::zx::Handle,
12322}
12323
12324impl ::fidl_next::Encodable for DirectoryOpenRequest {
12325 type Encoded = WireDirectoryOpenRequest;
12326}
12327
12328unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryOpenRequest
12329where
12330 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12331
12332 ___E: ::fidl_next::Encoder,
12333
12334 ___E: ::fidl_next::fuchsia::HandleEncoder,
12335{
12336 #[inline]
12337 fn encode(
12338 self,
12339 encoder: &mut ___E,
12340 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12341 ) -> Result<(), ::fidl_next::EncodeError> {
12342 ::fidl_next::munge! {
12343 let Self::Encoded {
12344 path,
12345 flags,
12346 options,
12347 object,
12348
12349 } = out;
12350 }
12351
12352 ::fidl_next::Encode::encode(self.path, encoder, path)?;
12353
12354 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
12355
12356 ::fidl_next::Encode::encode(self.options, encoder, options)?;
12357
12358 ::fidl_next::Encode::encode(self.object, encoder, object)?;
12359
12360 Ok(())
12361 }
12362}
12363
12364impl ::fidl_next::EncodableOption for Box<DirectoryOpenRequest> {
12365 type EncodedOption = ::fidl_next::WireBox<WireDirectoryOpenRequest>;
12366}
12367
12368unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryOpenRequest>
12369where
12370 ___E: ::fidl_next::Encoder + ?Sized,
12371 DirectoryOpenRequest: ::fidl_next::Encode<___E>,
12372{
12373 #[inline]
12374 fn encode_option(
12375 this: Option<Self>,
12376 encoder: &mut ___E,
12377 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12378 ) -> Result<(), ::fidl_next::EncodeError> {
12379 if let Some(inner) = this {
12380 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
12381 ::fidl_next::WireBox::encode_present(out);
12382 } else {
12383 ::fidl_next::WireBox::encode_absent(out);
12384 }
12385
12386 Ok(())
12387 }
12388}
12389
12390impl ::fidl_next::TakeFrom<WireDirectoryOpenRequest> for DirectoryOpenRequest {
12391 #[inline]
12392 fn take_from(from: &WireDirectoryOpenRequest) -> Self {
12393 Self {
12394 path: ::fidl_next::TakeFrom::take_from(&from.path),
12395
12396 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
12397
12398 options: ::fidl_next::TakeFrom::take_from(&from.options),
12399
12400 object: ::fidl_next::TakeFrom::take_from(&from.object),
12401 }
12402 }
12403}
12404
12405#[derive(Debug)]
12407#[repr(C)]
12408pub struct WireDirectoryOpenRequest {
12409 pub path: ::fidl_next::WireString,
12410
12411 pub flags: crate::WireFlags,
12412
12413 pub options: crate::WireOptions,
12414
12415 pub object: ::fidl_next::fuchsia::WireHandle,
12416}
12417
12418unsafe impl ::fidl_next::ZeroPadding for WireDirectoryOpenRequest {
12419 #[inline]
12420 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12421 unsafe {
12422 out.as_mut_ptr().cast::<u8>().add(44).write_bytes(0, 4);
12423 }
12424 }
12425}
12426
12427unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryOpenRequest
12428where
12429 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12430
12431 ___D: ::fidl_next::Decoder,
12432
12433 ___D: ::fidl_next::fuchsia::HandleDecoder,
12434{
12435 fn decode(
12436 slot: ::fidl_next::Slot<'_, Self>,
12437 decoder: &mut ___D,
12438 ) -> Result<(), ::fidl_next::DecodeError> {
12439 ::fidl_next::munge! {
12440 let Self {
12441 mut path,
12442 mut flags,
12443 mut options,
12444 mut object,
12445
12446 } = slot;
12447 }
12448
12449 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
12450
12451 let path = unsafe { path.deref_unchecked() };
12452
12453 if path.len() > 4095 {
12454 return Err(::fidl_next::DecodeError::VectorTooLong {
12455 size: path.len() as u64,
12456 limit: 4095,
12457 });
12458 }
12459
12460 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
12461
12462 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
12463
12464 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
12465
12466 Ok(())
12467 }
12468}
12469
12470#[derive(Debug)]
12471pub struct DirectoryCreateSymlinkRequest {
12472 pub name: String,
12473
12474 pub target: Vec<u8>,
12475
12476 pub connection:
12477 ::fidl_next::ServerEnd<Option<::fidl_next::fuchsia::zx::Channel>, crate::Symlink>,
12478}
12479
12480impl ::fidl_next::Encodable for DirectoryCreateSymlinkRequest {
12481 type Encoded = WireDirectoryCreateSymlinkRequest;
12482}
12483
12484unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryCreateSymlinkRequest
12485where
12486 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12487
12488 ___E: ::fidl_next::Encoder,
12489
12490 ___E: ::fidl_next::fuchsia::HandleEncoder,
12491{
12492 #[inline]
12493 fn encode(
12494 self,
12495 encoder: &mut ___E,
12496 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12497 ) -> Result<(), ::fidl_next::EncodeError> {
12498 ::fidl_next::munge! {
12499 let Self::Encoded {
12500 name,
12501 target,
12502 connection,
12503
12504 } = out;
12505 }
12506
12507 ::fidl_next::Encode::encode(self.name, encoder, name)?;
12508
12509 ::fidl_next::Encode::encode(self.target, encoder, target)?;
12510
12511 ::fidl_next::Encode::encode(self.connection, encoder, connection)?;
12512
12513 Ok(())
12514 }
12515}
12516
12517impl ::fidl_next::EncodableOption for Box<DirectoryCreateSymlinkRequest> {
12518 type EncodedOption = ::fidl_next::WireBox<WireDirectoryCreateSymlinkRequest>;
12519}
12520
12521unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryCreateSymlinkRequest>
12522where
12523 ___E: ::fidl_next::Encoder + ?Sized,
12524 DirectoryCreateSymlinkRequest: ::fidl_next::Encode<___E>,
12525{
12526 #[inline]
12527 fn encode_option(
12528 this: Option<Self>,
12529 encoder: &mut ___E,
12530 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12531 ) -> Result<(), ::fidl_next::EncodeError> {
12532 if let Some(inner) = this {
12533 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
12534 ::fidl_next::WireBox::encode_present(out);
12535 } else {
12536 ::fidl_next::WireBox::encode_absent(out);
12537 }
12538
12539 Ok(())
12540 }
12541}
12542
12543impl ::fidl_next::TakeFrom<WireDirectoryCreateSymlinkRequest> for DirectoryCreateSymlinkRequest {
12544 #[inline]
12545 fn take_from(from: &WireDirectoryCreateSymlinkRequest) -> Self {
12546 Self {
12547 name: ::fidl_next::TakeFrom::take_from(&from.name),
12548
12549 target: ::fidl_next::TakeFrom::take_from(&from.target),
12550
12551 connection: ::fidl_next::TakeFrom::take_from(&from.connection),
12552 }
12553 }
12554}
12555
12556#[derive(Debug)]
12558#[repr(C)]
12559pub struct WireDirectoryCreateSymlinkRequest {
12560 pub name: ::fidl_next::WireString,
12561
12562 pub target: ::fidl_next::WireVector<u8>,
12563
12564 pub connection:
12565 ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireOptionalChannel, crate::Symlink>,
12566}
12567
12568unsafe impl ::fidl_next::ZeroPadding for WireDirectoryCreateSymlinkRequest {
12569 #[inline]
12570 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12571 unsafe {
12572 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
12573 }
12574 }
12575}
12576
12577unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryCreateSymlinkRequest
12578where
12579 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12580
12581 ___D: ::fidl_next::Decoder,
12582
12583 ___D: ::fidl_next::fuchsia::HandleDecoder,
12584{
12585 fn decode(
12586 slot: ::fidl_next::Slot<'_, Self>,
12587 decoder: &mut ___D,
12588 ) -> Result<(), ::fidl_next::DecodeError> {
12589 ::fidl_next::munge! {
12590 let Self {
12591 mut name,
12592 mut target,
12593 mut connection,
12594
12595 } = slot;
12596 }
12597
12598 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
12599
12600 let name = unsafe { name.deref_unchecked() };
12601
12602 if name.len() > 255 {
12603 return Err(::fidl_next::DecodeError::VectorTooLong {
12604 size: name.len() as u64,
12605 limit: 255,
12606 });
12607 }
12608
12609 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
12610
12611 let target = unsafe { target.deref_unchecked() };
12612
12613 if target.len() > 4095 {
12614 return Err(::fidl_next::DecodeError::VectorTooLong {
12615 size: target.len() as u64,
12616 limit: 4095,
12617 });
12618 }
12619
12620 ::fidl_next::Decode::decode(connection.as_mut(), decoder)?;
12621
12622 Ok(())
12623 }
12624}
12625
12626#[doc = " Directory defines a node which is capable of containing other Objects.\n"]
12628#[derive(Debug)]
12629pub struct Directory;
12630
12631impl ::fidl_next::Discoverable for Directory {
12632 const PROTOCOL_NAME: &'static str = "directory";
12633}
12634
12635pub mod directory {
12636 pub mod prelude {
12637 pub use crate::{
12638 directory, Directory, DirectoryClientHandler, DirectoryClientSender,
12639 DirectoryServerHandler, DirectoryServerSender,
12640 };
12641
12642 pub use crate::AdvisoryLockingAdvisoryLockRequest;
12643
12644 pub use crate::AdvisoryLockingAdvisoryLockResponse;
12645
12646 pub use crate::ConnectionInfo;
12647
12648 pub use crate::DirectoryCreateSymlinkRequest;
12649
12650 pub use crate::DirectoryDeprecatedOpenRequest;
12651
12652 pub use crate::DirectoryGetTokenResponse;
12653
12654 pub use crate::DirectoryLinkRequest;
12655
12656 pub use crate::DirectoryLinkResponse;
12657
12658 pub use crate::DirectoryOpenRequest;
12659
12660 pub use crate::DirectoryReadDirentsRequest;
12661
12662 pub use crate::DirectoryReadDirentsResponse;
12663
12664 pub use crate::DirectoryRenameRequest;
12665
12666 pub use crate::DirectoryRewindResponse;
12667
12668 pub use crate::DirectoryUnlinkRequest;
12669
12670 pub use crate::DirectoryWatchRequest;
12671
12672 pub use crate::DirectoryWatchResponse;
12673
12674 pub use crate::DirectoryCreateSymlinkResponse;
12675
12676 pub use crate::DirectoryRenameResponse;
12677
12678 pub use crate::DirectoryUnlinkResponse;
12679
12680 pub use crate::ExtendedAttributeValue;
12681
12682 pub use crate::MutableNodeAttributes;
12683
12684 pub use crate::NodeAttributes2;
12685
12686 pub use crate::NodeDeprecatedCloneRequest;
12687
12688 pub use crate::NodeDeprecatedGetFlagsResponse;
12689
12690 pub use crate::NodeDeprecatedSetFlagsRequest;
12691
12692 pub use crate::NodeDeprecatedSetFlagsResponse;
12693
12694 pub use crate::NodeGetAttrResponse;
12695
12696 pub use crate::NodeGetAttributesRequest;
12697
12698 pub use crate::NodeGetExtendedAttributeRequest;
12699
12700 pub use crate::NodeListExtendedAttributesRequest;
12701
12702 pub use crate::NodeOnOpenRequest;
12703
12704 pub use crate::NodeQueryFilesystemResponse;
12705
12706 pub use crate::NodeRemoveExtendedAttributeRequest;
12707
12708 pub use crate::NodeSetAttrRequest;
12709
12710 pub use crate::NodeSetAttrResponse;
12711
12712 pub use crate::NodeSetExtendedAttributeRequest;
12713
12714 pub use crate::NodeSetFlagsRequest;
12715
12716 pub use crate::NodeGetFlagsResponse;
12717
12718 pub use crate::NodeRemoveExtendedAttributeResponse;
12719
12720 pub use crate::NodeSetExtendedAttributeResponse;
12721
12722 pub use crate::NodeSetFlagsResponse;
12723
12724 pub use crate::NodeSyncResponse;
12725
12726 pub use crate::NodeUpdateAttributesResponse;
12727
12728 pub use crate::Representation;
12729
12730 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
12731
12732 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
12733
12734 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
12735 }
12736
12737 pub struct AdvisoryLock;
12738
12739 impl ::fidl_next::Method for AdvisoryLock {
12740 const ORDINAL: u64 = 7992130864415541162;
12741
12742 type Protocol = crate::Directory;
12743
12744 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest;
12745
12746 type Response = ::fidl_next::WireResult<
12747 crate::WireAdvisoryLockingAdvisoryLockResponse,
12748 ::fidl_next::WireI32,
12749 >;
12750 }
12751
12752 pub struct Clone;
12753
12754 impl ::fidl_next::Method for Clone {
12755 const ORDINAL: u64 = 2366825959783828089;
12756
12757 type Protocol = crate::Directory;
12758
12759 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
12760
12761 type Response = ::fidl_next::Never;
12762 }
12763
12764 pub struct Close;
12765
12766 impl ::fidl_next::Method for Close {
12767 const ORDINAL: u64 = 6540867515453498750;
12768
12769 type Protocol = crate::Directory;
12770
12771 type Request = ();
12772
12773 type Response = ::fidl_next::WireResult<
12774 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
12775 ::fidl_next::WireI32,
12776 >;
12777 }
12778
12779 pub struct Query;
12780
12781 impl ::fidl_next::Method for Query {
12782 const ORDINAL: u64 = 2763219980499352582;
12783
12784 type Protocol = crate::Directory;
12785
12786 type Request = ();
12787
12788 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse;
12789 }
12790
12791 pub struct DeprecatedClone;
12792
12793 impl ::fidl_next::Method for DeprecatedClone {
12794 const ORDINAL: u64 = 6512600400724287855;
12795
12796 type Protocol = crate::Directory;
12797
12798 type Request = crate::WireNodeDeprecatedCloneRequest;
12799
12800 type Response = ::fidl_next::Never;
12801 }
12802
12803 pub struct OnOpen;
12804
12805 impl ::fidl_next::Method for OnOpen {
12806 const ORDINAL: u64 = 9207534335756671346;
12807
12808 type Protocol = crate::Directory;
12809
12810 type Request = ::fidl_next::Never;
12811
12812 type Response = crate::WireNodeOnOpenRequest;
12813 }
12814
12815 pub struct GetAttr;
12816
12817 impl ::fidl_next::Method for GetAttr {
12818 const ORDINAL: u64 = 8689798978500614909;
12819
12820 type Protocol = crate::Directory;
12821
12822 type Request = ();
12823
12824 type Response = crate::WireNodeGetAttrResponse;
12825 }
12826
12827 pub struct SetAttr;
12828
12829 impl ::fidl_next::Method for SetAttr {
12830 const ORDINAL: u64 = 4721673413776871238;
12831
12832 type Protocol = crate::Directory;
12833
12834 type Request = crate::WireNodeSetAttrRequest;
12835
12836 type Response = crate::WireNodeSetAttrResponse;
12837 }
12838
12839 pub struct DeprecatedGetFlags;
12840
12841 impl ::fidl_next::Method for DeprecatedGetFlags {
12842 const ORDINAL: u64 = 6595803110182632097;
12843
12844 type Protocol = crate::Directory;
12845
12846 type Request = ();
12847
12848 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
12849 }
12850
12851 pub struct DeprecatedSetFlags;
12852
12853 impl ::fidl_next::Method for DeprecatedSetFlags {
12854 const ORDINAL: u64 = 5950864159036794675;
12855
12856 type Protocol = crate::Directory;
12857
12858 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
12859
12860 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
12861 }
12862
12863 pub struct GetFlags;
12864
12865 impl ::fidl_next::Method for GetFlags {
12866 const ORDINAL: u64 = 105530239381466147;
12867
12868 type Protocol = crate::Directory;
12869
12870 type Request = ();
12871
12872 type Response =
12873 ::fidl_next::WireFlexibleResult<crate::WireNodeGetFlagsResponse, ::fidl_next::WireI32>;
12874 }
12875
12876 pub struct SetFlags;
12877
12878 impl ::fidl_next::Method for SetFlags {
12879 const ORDINAL: u64 = 6172186066099445416;
12880
12881 type Protocol = crate::Directory;
12882
12883 type Request = crate::WireNodeSetFlagsRequest;
12884
12885 type Response =
12886 ::fidl_next::WireFlexibleResult<crate::WireNodeSetFlagsResponse, ::fidl_next::WireI32>;
12887 }
12888
12889 pub struct QueryFilesystem;
12890
12891 impl ::fidl_next::Method for QueryFilesystem {
12892 const ORDINAL: u64 = 8013111122914313744;
12893
12894 type Protocol = crate::Directory;
12895
12896 type Request = ();
12897
12898 type Response = crate::WireNodeQueryFilesystemResponse;
12899 }
12900
12901 pub struct OnRepresentation;
12902
12903 impl ::fidl_next::Method for OnRepresentation {
12904 const ORDINAL: u64 = 6679970090861613324;
12905
12906 type Protocol = crate::Directory;
12907
12908 type Request = ::fidl_next::Never;
12909
12910 type Response = crate::WireRepresentation;
12911 }
12912
12913 pub struct GetConnectionInfo;
12914
12915 impl ::fidl_next::Method for GetConnectionInfo {
12916 const ORDINAL: u64 = 6362521381364198667;
12917
12918 type Protocol = crate::Directory;
12919
12920 type Request = ();
12921
12922 type Response = crate::WireConnectionInfo;
12923 }
12924
12925 pub struct GetAttributes;
12926
12927 impl ::fidl_next::Method for GetAttributes {
12928 const ORDINAL: u64 = 4414537700416816443;
12929
12930 type Protocol = crate::Directory;
12931
12932 type Request = crate::WireNodeGetAttributesRequest;
12933
12934 type Response = ::fidl_next::WireResult<crate::WireNodeAttributes2, ::fidl_next::WireI32>;
12935 }
12936
12937 pub struct UpdateAttributes;
12938
12939 impl ::fidl_next::Method for UpdateAttributes {
12940 const ORDINAL: u64 = 3677402239314018056;
12941
12942 type Protocol = crate::Directory;
12943
12944 type Request = crate::WireMutableNodeAttributes;
12945
12946 type Response =
12947 ::fidl_next::WireResult<crate::WireNodeUpdateAttributesResponse, ::fidl_next::WireI32>;
12948 }
12949
12950 pub struct Sync;
12951
12952 impl ::fidl_next::Method for Sync {
12953 const ORDINAL: u64 = 3196473584242777161;
12954
12955 type Protocol = crate::Directory;
12956
12957 type Request = ();
12958
12959 type Response = ::fidl_next::WireResult<crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
12960 }
12961
12962 pub struct ListExtendedAttributes;
12963
12964 impl ::fidl_next::Method for ListExtendedAttributes {
12965 const ORDINAL: u64 = 5431626189872037072;
12966
12967 type Protocol = crate::Directory;
12968
12969 type Request = crate::WireNodeListExtendedAttributesRequest;
12970
12971 type Response = ::fidl_next::Never;
12972 }
12973
12974 pub struct GetExtendedAttribute;
12975
12976 impl ::fidl_next::Method for GetExtendedAttribute {
12977 const ORDINAL: u64 = 5043930208506967771;
12978
12979 type Protocol = crate::Directory;
12980
12981 type Request = crate::WireNodeGetExtendedAttributeRequest;
12982
12983 type Response =
12984 ::fidl_next::WireResult<crate::WireExtendedAttributeValue, ::fidl_next::WireI32>;
12985 }
12986
12987 pub struct SetExtendedAttribute;
12988
12989 impl ::fidl_next::Method for SetExtendedAttribute {
12990 const ORDINAL: u64 = 5374223046099989052;
12991
12992 type Protocol = crate::Directory;
12993
12994 type Request = crate::WireNodeSetExtendedAttributeRequest;
12995
12996 type Response = ::fidl_next::WireResult<
12997 crate::WireNodeSetExtendedAttributeResponse,
12998 ::fidl_next::WireI32,
12999 >;
13000 }
13001
13002 pub struct RemoveExtendedAttribute;
13003
13004 impl ::fidl_next::Method for RemoveExtendedAttribute {
13005 const ORDINAL: u64 = 8794297771444732717;
13006
13007 type Protocol = crate::Directory;
13008
13009 type Request = crate::WireNodeRemoveExtendedAttributeRequest;
13010
13011 type Response = ::fidl_next::WireResult<
13012 crate::WireNodeRemoveExtendedAttributeResponse,
13013 ::fidl_next::WireI32,
13014 >;
13015 }
13016
13017 pub struct DeprecatedOpen;
13018
13019 impl ::fidl_next::Method for DeprecatedOpen {
13020 const ORDINAL: u64 = 3193127272456937152;
13021
13022 type Protocol = crate::Directory;
13023
13024 type Request = crate::WireDirectoryDeprecatedOpenRequest;
13025
13026 type Response = ::fidl_next::Never;
13027 }
13028
13029 pub struct Open;
13030
13031 impl ::fidl_next::Method for Open {
13032 const ORDINAL: u64 = 6236883748953765593;
13033
13034 type Protocol = crate::Directory;
13035
13036 type Request = crate::WireDirectoryOpenRequest;
13037
13038 type Response = ::fidl_next::Never;
13039 }
13040
13041 pub struct ReadDirents;
13042
13043 impl ::fidl_next::Method for ReadDirents {
13044 const ORDINAL: u64 = 3855785432100874762;
13045
13046 type Protocol = crate::Directory;
13047
13048 type Request = crate::WireDirectoryReadDirentsRequest;
13049
13050 type Response = crate::WireDirectoryReadDirentsResponse;
13051 }
13052
13053 pub struct Rewind;
13054
13055 impl ::fidl_next::Method for Rewind {
13056 const ORDINAL: u64 = 1635123508515392625;
13057
13058 type Protocol = crate::Directory;
13059
13060 type Request = ();
13061
13062 type Response = crate::WireDirectoryRewindResponse;
13063 }
13064
13065 pub struct GetToken;
13066
13067 impl ::fidl_next::Method for GetToken {
13068 const ORDINAL: u64 = 2787337947777369685;
13069
13070 type Protocol = crate::Directory;
13071
13072 type Request = ();
13073
13074 type Response = crate::WireDirectoryGetTokenResponse;
13075 }
13076
13077 pub struct Link;
13078
13079 impl ::fidl_next::Method for Link {
13080 const ORDINAL: u64 = 8360374984291987687;
13081
13082 type Protocol = crate::Directory;
13083
13084 type Request = crate::WireDirectoryLinkRequest;
13085
13086 type Response = crate::WireDirectoryLinkResponse;
13087 }
13088
13089 pub struct Unlink;
13090
13091 impl ::fidl_next::Method for Unlink {
13092 const ORDINAL: u64 = 8433556716759383021;
13093
13094 type Protocol = crate::Directory;
13095
13096 type Request = crate::WireDirectoryUnlinkRequest;
13097
13098 type Response =
13099 ::fidl_next::WireResult<crate::WireDirectoryUnlinkResponse, ::fidl_next::WireI32>;
13100 }
13101
13102 pub struct Rename;
13103
13104 impl ::fidl_next::Method for Rename {
13105 const ORDINAL: u64 = 8097726607824333022;
13106
13107 type Protocol = crate::Directory;
13108
13109 type Request = crate::WireDirectoryRenameRequest;
13110
13111 type Response =
13112 ::fidl_next::WireResult<crate::WireDirectoryRenameResponse, ::fidl_next::WireI32>;
13113 }
13114
13115 pub struct CreateSymlink;
13116
13117 impl ::fidl_next::Method for CreateSymlink {
13118 const ORDINAL: u64 = 2435901052462315657;
13119
13120 type Protocol = crate::Directory;
13121
13122 type Request = crate::WireDirectoryCreateSymlinkRequest;
13123
13124 type Response = ::fidl_next::WireResult<
13125 crate::WireDirectoryCreateSymlinkResponse,
13126 ::fidl_next::WireI32,
13127 >;
13128 }
13129
13130 pub struct Watch;
13131
13132 impl ::fidl_next::Method for Watch {
13133 const ORDINAL: u64 = 6275512344170098065;
13134
13135 type Protocol = crate::Directory;
13136
13137 type Request = crate::WireDirectoryWatchRequest;
13138
13139 type Response = crate::WireDirectoryWatchResponse;
13140 }
13141}
13142
13143pub trait DirectoryClientSender {
13145 type Transport: ::fidl_next::Transport;
13146
13147 #[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"]
13148 fn advisory_lock<___R>(
13149 &self,
13150 request: ___R,
13151 ) -> Result<
13152 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::AdvisoryLock>,
13153 ::fidl_next::EncodeError,
13154 >
13155 where
13156 ___R: ::fidl_next::Encode<
13157 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13158 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
13159 >;
13160
13161 fn clone<___R>(
13162 &self,
13163 request: ___R,
13164 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13165 where
13166 ___R: ::fidl_next::Encode<
13167 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13168 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
13169 >;
13170
13171 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
13172 fn close(
13173 &self,
13174 ) -> Result<
13175 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Close>,
13176 ::fidl_next::EncodeError,
13177 >;
13178
13179 fn query(
13180 &self,
13181 ) -> Result<
13182 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Query>,
13183 ::fidl_next::EncodeError,
13184 >;
13185
13186 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13187 fn deprecated_clone<___R>(
13188 &self,
13189 request: ___R,
13190 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13191 where
13192 ___R: ::fidl_next::Encode<
13193 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13194 Encoded = crate::WireNodeDeprecatedCloneRequest,
13195 >;
13196
13197 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
13198 fn get_attr(
13199 &self,
13200 ) -> Result<
13201 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetAttr>,
13202 ::fidl_next::EncodeError,
13203 >;
13204
13205 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
13206 fn set_attr<___R>(
13207 &self,
13208 request: ___R,
13209 ) -> Result<
13210 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetAttr>,
13211 ::fidl_next::EncodeError,
13212 >
13213 where
13214 ___R: ::fidl_next::Encode<
13215 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13216 Encoded = crate::WireNodeSetAttrRequest,
13217 >;
13218
13219 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
13220 fn deprecated_get_flags(
13221 &self,
13222 ) -> Result<
13223 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::DeprecatedGetFlags>,
13224 ::fidl_next::EncodeError,
13225 >;
13226
13227 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13228 fn deprecated_set_flags<___R>(
13229 &self,
13230 request: ___R,
13231 ) -> Result<
13232 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::DeprecatedSetFlags>,
13233 ::fidl_next::EncodeError,
13234 >
13235 where
13236 ___R: ::fidl_next::Encode<
13237 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13238 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
13239 >;
13240
13241 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
13242 fn get_flags(
13243 &self,
13244 ) -> Result<
13245 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetFlags>,
13246 ::fidl_next::EncodeError,
13247 >;
13248
13249 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
13250 fn set_flags<___R>(
13251 &self,
13252 request: ___R,
13253 ) -> Result<
13254 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetFlags>,
13255 ::fidl_next::EncodeError,
13256 >
13257 where
13258 ___R: ::fidl_next::Encode<
13259 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13260 Encoded = crate::WireNodeSetFlagsRequest,
13261 >;
13262
13263 #[doc = " Query the filesystem for filesystem-specific information.\n"]
13264 fn query_filesystem(
13265 &self,
13266 ) -> Result<
13267 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::QueryFilesystem>,
13268 ::fidl_next::EncodeError,
13269 >;
13270
13271 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
13272 fn get_connection_info(
13273 &self,
13274 ) -> Result<
13275 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetConnectionInfo>,
13276 ::fidl_next::EncodeError,
13277 >;
13278
13279 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13280 fn get_attributes<___R>(
13281 &self,
13282 request: ___R,
13283 ) -> Result<
13284 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetAttributes>,
13285 ::fidl_next::EncodeError,
13286 >
13287 where
13288 ___R: ::fidl_next::Encode<
13289 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13290 Encoded = crate::WireNodeGetAttributesRequest,
13291 >;
13292
13293 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13294 fn update_attributes<___R>(
13295 &self,
13296 request: ___R,
13297 ) -> Result<
13298 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::UpdateAttributes>,
13299 ::fidl_next::EncodeError,
13300 >
13301 where
13302 ___R: ::fidl_next::Encode<
13303 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13304 Encoded = crate::WireMutableNodeAttributes,
13305 >;
13306
13307 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
13308 fn sync(
13309 &self,
13310 ) -> Result<
13311 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Sync>,
13312 ::fidl_next::EncodeError,
13313 >;
13314
13315 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13316 fn list_extended_attributes<___R>(
13317 &self,
13318 request: ___R,
13319 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13320 where
13321 ___R: ::fidl_next::Encode<
13322 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13323 Encoded = crate::WireNodeListExtendedAttributesRequest,
13324 >;
13325
13326 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13327 fn get_extended_attribute<___R>(
13328 &self,
13329 request: ___R,
13330 ) -> Result<
13331 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetExtendedAttribute>,
13332 ::fidl_next::EncodeError,
13333 >
13334 where
13335 ___R: ::fidl_next::Encode<
13336 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13337 Encoded = crate::WireNodeGetExtendedAttributeRequest,
13338 >;
13339
13340 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13341 fn set_extended_attribute<___R>(
13342 &self,
13343 request: ___R,
13344 ) -> Result<
13345 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetExtendedAttribute>,
13346 ::fidl_next::EncodeError,
13347 >
13348 where
13349 ___R: ::fidl_next::Encode<
13350 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13351 Encoded = crate::WireNodeSetExtendedAttributeRequest,
13352 >;
13353
13354 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13355 fn remove_extended_attribute<___R>(
13356 &self,
13357 request: ___R,
13358 ) -> Result<
13359 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::RemoveExtendedAttribute>,
13360 ::fidl_next::EncodeError,
13361 >
13362 where
13363 ___R: ::fidl_next::Encode<
13364 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13365 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
13366 >;
13367
13368 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
13369 fn deprecated_open<___R>(
13370 &self,
13371 request: ___R,
13372 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13373 where
13374 ___R: ::fidl_next::Encode<
13375 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13376 Encoded = crate::WireDirectoryDeprecatedOpenRequest,
13377 >;
13378
13379 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
13380 fn open<___R>(
13381 &self,
13382 request: ___R,
13383 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13384 where
13385 ___R: ::fidl_next::Encode<
13386 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13387 Encoded = crate::WireDirectoryOpenRequest,
13388 >;
13389
13390 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
13391 fn read_dirents<___R>(
13392 &self,
13393 request: ___R,
13394 ) -> Result<
13395 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::ReadDirents>,
13396 ::fidl_next::EncodeError,
13397 >
13398 where
13399 ___R: ::fidl_next::Encode<
13400 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13401 Encoded = crate::WireDirectoryReadDirentsRequest,
13402 >;
13403
13404 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
13405 fn rewind(
13406 &self,
13407 ) -> Result<
13408 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Rewind>,
13409 ::fidl_next::EncodeError,
13410 >;
13411
13412 #[doc = " Acquires a token to a Directory which can be used to identify access to it at a later point\n in time. The token will remain valid for as long as the connection requesting the token\n remains open.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
13413 fn get_token(
13414 &self,
13415 ) -> Result<
13416 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetToken>,
13417 ::fidl_next::EncodeError,
13418 >;
13419
13420 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
13421 fn link<___R>(
13422 &self,
13423 request: ___R,
13424 ) -> Result<
13425 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Link>,
13426 ::fidl_next::EncodeError,
13427 >
13428 where
13429 ___R: ::fidl_next::Encode<
13430 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13431 Encoded = crate::WireDirectoryLinkRequest,
13432 >;
13433
13434 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
13435 fn unlink<___R>(
13436 &self,
13437 request: ___R,
13438 ) -> Result<
13439 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Unlink>,
13440 ::fidl_next::EncodeError,
13441 >
13442 where
13443 ___R: ::fidl_next::Encode<
13444 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13445 Encoded = crate::WireDirectoryUnlinkRequest,
13446 >;
13447
13448 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
13449 fn rename<___R>(
13450 &self,
13451 request: ___R,
13452 ) -> Result<
13453 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Rename>,
13454 ::fidl_next::EncodeError,
13455 >
13456 where
13457 ___R: ::fidl_next::Encode<
13458 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13459 Encoded = crate::WireDirectoryRenameRequest,
13460 >;
13461
13462 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
13463 fn create_symlink<___R>(
13464 &self,
13465 request: ___R,
13466 ) -> Result<
13467 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::CreateSymlink>,
13468 ::fidl_next::EncodeError,
13469 >
13470 where
13471 ___R: ::fidl_next::Encode<
13472 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13473 Encoded = crate::WireDirectoryCreateSymlinkRequest,
13474 >;
13475
13476 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
13477 fn watch<___R>(
13478 &self,
13479 request: ___R,
13480 ) -> Result<
13481 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Watch>,
13482 ::fidl_next::EncodeError,
13483 >
13484 where
13485 ___R: ::fidl_next::Encode<
13486 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13487 Encoded = crate::WireDirectoryWatchRequest,
13488 >;
13489}
13490
13491impl<___T> DirectoryClientSender for ::fidl_next::ClientSender<___T, Directory>
13492where
13493 ___T: ::fidl_next::Transport,
13494{
13495 type Transport = ___T;
13496
13497 #[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"]
13498 fn advisory_lock<___R>(
13499 &self,
13500 request: ___R,
13501 ) -> Result<
13502 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::AdvisoryLock>,
13503 ::fidl_next::EncodeError,
13504 >
13505 where
13506 ___R: ::fidl_next::Encode<
13507 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13508 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
13509 >,
13510 {
13511 self.as_untyped()
13512 .send_two_way(7992130864415541162, request)
13513 .map(::fidl_next::ResponseFuture::from_untyped)
13514 }
13515
13516 fn clone<___R>(
13517 &self,
13518 request: ___R,
13519 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13520 where
13521 ___R: ::fidl_next::Encode<
13522 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13523 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
13524 >,
13525 {
13526 self.as_untyped().send_one_way(2366825959783828089, request)
13527 }
13528
13529 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
13530 fn close(
13531 &self,
13532 ) -> Result<
13533 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Close>,
13534 ::fidl_next::EncodeError,
13535 > {
13536 self.as_untyped()
13537 .send_two_way(6540867515453498750, ())
13538 .map(::fidl_next::ResponseFuture::from_untyped)
13539 }
13540
13541 fn query(
13542 &self,
13543 ) -> Result<
13544 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Query>,
13545 ::fidl_next::EncodeError,
13546 > {
13547 self.as_untyped()
13548 .send_two_way(2763219980499352582, ())
13549 .map(::fidl_next::ResponseFuture::from_untyped)
13550 }
13551
13552 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
13553 fn deprecated_clone<___R>(
13554 &self,
13555 request: ___R,
13556 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13557 where
13558 ___R: ::fidl_next::Encode<
13559 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13560 Encoded = crate::WireNodeDeprecatedCloneRequest,
13561 >,
13562 {
13563 self.as_untyped().send_one_way(6512600400724287855, request)
13564 }
13565
13566 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
13567 fn get_attr(
13568 &self,
13569 ) -> Result<
13570 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetAttr>,
13571 ::fidl_next::EncodeError,
13572 > {
13573 self.as_untyped()
13574 .send_two_way(8689798978500614909, ())
13575 .map(::fidl_next::ResponseFuture::from_untyped)
13576 }
13577
13578 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
13579 fn set_attr<___R>(
13580 &self,
13581 request: ___R,
13582 ) -> Result<
13583 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetAttr>,
13584 ::fidl_next::EncodeError,
13585 >
13586 where
13587 ___R: ::fidl_next::Encode<
13588 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13589 Encoded = crate::WireNodeSetAttrRequest,
13590 >,
13591 {
13592 self.as_untyped()
13593 .send_two_way(4721673413776871238, request)
13594 .map(::fidl_next::ResponseFuture::from_untyped)
13595 }
13596
13597 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
13598 fn deprecated_get_flags(
13599 &self,
13600 ) -> Result<
13601 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::DeprecatedGetFlags>,
13602 ::fidl_next::EncodeError,
13603 > {
13604 self.as_untyped()
13605 .send_two_way(6595803110182632097, ())
13606 .map(::fidl_next::ResponseFuture::from_untyped)
13607 }
13608
13609 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
13610 fn deprecated_set_flags<___R>(
13611 &self,
13612 request: ___R,
13613 ) -> Result<
13614 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::DeprecatedSetFlags>,
13615 ::fidl_next::EncodeError,
13616 >
13617 where
13618 ___R: ::fidl_next::Encode<
13619 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13620 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
13621 >,
13622 {
13623 self.as_untyped()
13624 .send_two_way(5950864159036794675, request)
13625 .map(::fidl_next::ResponseFuture::from_untyped)
13626 }
13627
13628 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
13629 fn get_flags(
13630 &self,
13631 ) -> Result<
13632 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetFlags>,
13633 ::fidl_next::EncodeError,
13634 > {
13635 self.as_untyped()
13636 .send_two_way(105530239381466147, ())
13637 .map(::fidl_next::ResponseFuture::from_untyped)
13638 }
13639
13640 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
13641 fn set_flags<___R>(
13642 &self,
13643 request: ___R,
13644 ) -> Result<
13645 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetFlags>,
13646 ::fidl_next::EncodeError,
13647 >
13648 where
13649 ___R: ::fidl_next::Encode<
13650 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13651 Encoded = crate::WireNodeSetFlagsRequest,
13652 >,
13653 {
13654 self.as_untyped()
13655 .send_two_way(6172186066099445416, request)
13656 .map(::fidl_next::ResponseFuture::from_untyped)
13657 }
13658
13659 #[doc = " Query the filesystem for filesystem-specific information.\n"]
13660 fn query_filesystem(
13661 &self,
13662 ) -> Result<
13663 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::QueryFilesystem>,
13664 ::fidl_next::EncodeError,
13665 > {
13666 self.as_untyped()
13667 .send_two_way(8013111122914313744, ())
13668 .map(::fidl_next::ResponseFuture::from_untyped)
13669 }
13670
13671 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
13672 fn get_connection_info(
13673 &self,
13674 ) -> Result<
13675 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetConnectionInfo>,
13676 ::fidl_next::EncodeError,
13677 > {
13678 self.as_untyped()
13679 .send_two_way(6362521381364198667, ())
13680 .map(::fidl_next::ResponseFuture::from_untyped)
13681 }
13682
13683 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13684 fn get_attributes<___R>(
13685 &self,
13686 request: ___R,
13687 ) -> Result<
13688 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetAttributes>,
13689 ::fidl_next::EncodeError,
13690 >
13691 where
13692 ___R: ::fidl_next::Encode<
13693 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13694 Encoded = crate::WireNodeGetAttributesRequest,
13695 >,
13696 {
13697 self.as_untyped()
13698 .send_two_way(4414537700416816443, request)
13699 .map(::fidl_next::ResponseFuture::from_untyped)
13700 }
13701
13702 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13703 fn update_attributes<___R>(
13704 &self,
13705 request: ___R,
13706 ) -> Result<
13707 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::UpdateAttributes>,
13708 ::fidl_next::EncodeError,
13709 >
13710 where
13711 ___R: ::fidl_next::Encode<
13712 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13713 Encoded = crate::WireMutableNodeAttributes,
13714 >,
13715 {
13716 self.as_untyped()
13717 .send_two_way(3677402239314018056, request)
13718 .map(::fidl_next::ResponseFuture::from_untyped)
13719 }
13720
13721 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
13722 fn sync(
13723 &self,
13724 ) -> Result<
13725 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Sync>,
13726 ::fidl_next::EncodeError,
13727 > {
13728 self.as_untyped()
13729 .send_two_way(3196473584242777161, ())
13730 .map(::fidl_next::ResponseFuture::from_untyped)
13731 }
13732
13733 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13734 fn list_extended_attributes<___R>(
13735 &self,
13736 request: ___R,
13737 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13738 where
13739 ___R: ::fidl_next::Encode<
13740 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13741 Encoded = crate::WireNodeListExtendedAttributesRequest,
13742 >,
13743 {
13744 self.as_untyped().send_one_way(5431626189872037072, request)
13745 }
13746
13747 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
13748 fn get_extended_attribute<___R>(
13749 &self,
13750 request: ___R,
13751 ) -> Result<
13752 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetExtendedAttribute>,
13753 ::fidl_next::EncodeError,
13754 >
13755 where
13756 ___R: ::fidl_next::Encode<
13757 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13758 Encoded = crate::WireNodeGetExtendedAttributeRequest,
13759 >,
13760 {
13761 self.as_untyped()
13762 .send_two_way(5043930208506967771, request)
13763 .map(::fidl_next::ResponseFuture::from_untyped)
13764 }
13765
13766 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13767 fn set_extended_attribute<___R>(
13768 &self,
13769 request: ___R,
13770 ) -> Result<
13771 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::SetExtendedAttribute>,
13772 ::fidl_next::EncodeError,
13773 >
13774 where
13775 ___R: ::fidl_next::Encode<
13776 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13777 Encoded = crate::WireNodeSetExtendedAttributeRequest,
13778 >,
13779 {
13780 self.as_untyped()
13781 .send_two_way(5374223046099989052, request)
13782 .map(::fidl_next::ResponseFuture::from_untyped)
13783 }
13784
13785 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
13786 fn remove_extended_attribute<___R>(
13787 &self,
13788 request: ___R,
13789 ) -> Result<
13790 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::RemoveExtendedAttribute>,
13791 ::fidl_next::EncodeError,
13792 >
13793 where
13794 ___R: ::fidl_next::Encode<
13795 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13796 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
13797 >,
13798 {
13799 self.as_untyped()
13800 .send_two_way(8794297771444732717, request)
13801 .map(::fidl_next::ResponseFuture::from_untyped)
13802 }
13803
13804 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
13805 fn deprecated_open<___R>(
13806 &self,
13807 request: ___R,
13808 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13809 where
13810 ___R: ::fidl_next::Encode<
13811 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13812 Encoded = crate::WireDirectoryDeprecatedOpenRequest,
13813 >,
13814 {
13815 self.as_untyped().send_one_way(3193127272456937152, request)
13816 }
13817
13818 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
13819 fn open<___R>(
13820 &self,
13821 request: ___R,
13822 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
13823 where
13824 ___R: ::fidl_next::Encode<
13825 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13826 Encoded = crate::WireDirectoryOpenRequest,
13827 >,
13828 {
13829 self.as_untyped().send_one_way(6236883748953765593, request)
13830 }
13831
13832 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
13833 fn read_dirents<___R>(
13834 &self,
13835 request: ___R,
13836 ) -> Result<
13837 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::ReadDirents>,
13838 ::fidl_next::EncodeError,
13839 >
13840 where
13841 ___R: ::fidl_next::Encode<
13842 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13843 Encoded = crate::WireDirectoryReadDirentsRequest,
13844 >,
13845 {
13846 self.as_untyped()
13847 .send_two_way(3855785432100874762, request)
13848 .map(::fidl_next::ResponseFuture::from_untyped)
13849 }
13850
13851 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
13852 fn rewind(
13853 &self,
13854 ) -> Result<
13855 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Rewind>,
13856 ::fidl_next::EncodeError,
13857 > {
13858 self.as_untyped()
13859 .send_two_way(1635123508515392625, ())
13860 .map(::fidl_next::ResponseFuture::from_untyped)
13861 }
13862
13863 #[doc = " Acquires a token to a Directory which can be used to identify access to it at a later point\n in time. The token will remain valid for as long as the connection requesting the token\n remains open.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
13864 fn get_token(
13865 &self,
13866 ) -> Result<
13867 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::GetToken>,
13868 ::fidl_next::EncodeError,
13869 > {
13870 self.as_untyped()
13871 .send_two_way(2787337947777369685, ())
13872 .map(::fidl_next::ResponseFuture::from_untyped)
13873 }
13874
13875 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
13876 fn link<___R>(
13877 &self,
13878 request: ___R,
13879 ) -> Result<
13880 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Link>,
13881 ::fidl_next::EncodeError,
13882 >
13883 where
13884 ___R: ::fidl_next::Encode<
13885 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13886 Encoded = crate::WireDirectoryLinkRequest,
13887 >,
13888 {
13889 self.as_untyped()
13890 .send_two_way(8360374984291987687, request)
13891 .map(::fidl_next::ResponseFuture::from_untyped)
13892 }
13893
13894 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
13895 fn unlink<___R>(
13896 &self,
13897 request: ___R,
13898 ) -> Result<
13899 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Unlink>,
13900 ::fidl_next::EncodeError,
13901 >
13902 where
13903 ___R: ::fidl_next::Encode<
13904 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13905 Encoded = crate::WireDirectoryUnlinkRequest,
13906 >,
13907 {
13908 self.as_untyped()
13909 .send_two_way(8433556716759383021, request)
13910 .map(::fidl_next::ResponseFuture::from_untyped)
13911 }
13912
13913 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
13914 fn rename<___R>(
13915 &self,
13916 request: ___R,
13917 ) -> Result<
13918 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Rename>,
13919 ::fidl_next::EncodeError,
13920 >
13921 where
13922 ___R: ::fidl_next::Encode<
13923 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13924 Encoded = crate::WireDirectoryRenameRequest,
13925 >,
13926 {
13927 self.as_untyped()
13928 .send_two_way(8097726607824333022, request)
13929 .map(::fidl_next::ResponseFuture::from_untyped)
13930 }
13931
13932 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
13933 fn create_symlink<___R>(
13934 &self,
13935 request: ___R,
13936 ) -> Result<
13937 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::CreateSymlink>,
13938 ::fidl_next::EncodeError,
13939 >
13940 where
13941 ___R: ::fidl_next::Encode<
13942 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13943 Encoded = crate::WireDirectoryCreateSymlinkRequest,
13944 >,
13945 {
13946 self.as_untyped()
13947 .send_two_way(2435901052462315657, request)
13948 .map(::fidl_next::ResponseFuture::from_untyped)
13949 }
13950
13951 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
13952 fn watch<___R>(
13953 &self,
13954 request: ___R,
13955 ) -> Result<
13956 ::fidl_next::ResponseFuture<'_, Self::Transport, directory::Watch>,
13957 ::fidl_next::EncodeError,
13958 >
13959 where
13960 ___R: ::fidl_next::Encode<
13961 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
13962 Encoded = crate::WireDirectoryWatchRequest,
13963 >,
13964 {
13965 self.as_untyped()
13966 .send_two_way(6275512344170098065, request)
13967 .map(::fidl_next::ResponseFuture::from_untyped)
13968 }
13969}
13970
13971pub trait DirectoryClientHandler<___T: ::fidl_next::Transport> {
13975 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
13976 fn on_open(
13977 &mut self,
13978 sender: &::fidl_next::ClientSender<___T, Directory>,
13979
13980 event: ::fidl_next::Response<___T, directory::OnOpen>,
13981 );
13982
13983 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
13984 fn on_representation(
13985 &mut self,
13986 sender: &::fidl_next::ClientSender<___T, Directory>,
13987
13988 event: ::fidl_next::Response<___T, directory::OnRepresentation>,
13989 );
13990
13991 fn on_unknown_interaction(
13992 &mut self,
13993 sender: &::fidl_next::ClientSender<___T, Directory>,
13994 ordinal: u64,
13995 ) {
13996 sender.close();
13997 }
13998}
13999
14000impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Directory
14001where
14002 ___T: ::fidl_next::Transport,
14003 ___H: DirectoryClientHandler<___T>,
14004
14005 <directory::AdvisoryLock as ::fidl_next::Method>::Response:
14006 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14007
14008 <directory::Close as ::fidl_next::Method>::Response:
14009 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14010
14011 <directory::Query as ::fidl_next::Method>::Response:
14012 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14013
14014 <directory::OnOpen as ::fidl_next::Method>::Response:
14015 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14016
14017 <directory::GetAttr as ::fidl_next::Method>::Response:
14018 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14019
14020 <directory::SetAttr as ::fidl_next::Method>::Response:
14021 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14022
14023 <directory::DeprecatedGetFlags as ::fidl_next::Method>::Response:
14024 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14025
14026 <directory::DeprecatedSetFlags as ::fidl_next::Method>::Response:
14027 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14028
14029 <directory::GetFlags as ::fidl_next::Method>::Response:
14030 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14031
14032 <directory::SetFlags as ::fidl_next::Method>::Response:
14033 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14034
14035 <directory::QueryFilesystem as ::fidl_next::Method>::Response:
14036 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14037
14038 <directory::OnRepresentation as ::fidl_next::Method>::Response:
14039 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14040
14041 <directory::GetConnectionInfo as ::fidl_next::Method>::Response:
14042 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14043
14044 <directory::GetAttributes as ::fidl_next::Method>::Response:
14045 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14046
14047 <directory::UpdateAttributes as ::fidl_next::Method>::Response:
14048 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14049
14050 <directory::Sync as ::fidl_next::Method>::Response:
14051 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14052
14053 <directory::GetExtendedAttribute as ::fidl_next::Method>::Response:
14054 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14055
14056 <directory::SetExtendedAttribute as ::fidl_next::Method>::Response:
14057 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14058
14059 <directory::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
14060 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14061
14062 <directory::ReadDirents as ::fidl_next::Method>::Response:
14063 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14064
14065 <directory::Rewind as ::fidl_next::Method>::Response:
14066 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14067
14068 <directory::GetToken as ::fidl_next::Method>::Response:
14069 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14070
14071 <directory::Link as ::fidl_next::Method>::Response:
14072 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14073
14074 <directory::Unlink as ::fidl_next::Method>::Response:
14075 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14076
14077 <directory::Rename as ::fidl_next::Method>::Response:
14078 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14079
14080 <directory::CreateSymlink as ::fidl_next::Method>::Response:
14081 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14082
14083 <directory::Watch as ::fidl_next::Method>::Response:
14084 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14085{
14086 fn on_event(
14087 handler: &mut ___H,
14088 sender: &::fidl_next::ClientSender<___T, Self>,
14089 ordinal: u64,
14090 buffer: ___T::RecvBuffer,
14091 ) {
14092 match ordinal {
14093 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
14094 Ok(decoded) => handler.on_open(sender, decoded),
14095 Err(e) => {
14096 sender.close();
14097 }
14098 },
14099
14100 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
14101 Ok(decoded) => handler.on_representation(sender, decoded),
14102 Err(e) => {
14103 sender.close();
14104 }
14105 },
14106
14107 ordinal => handler.on_unknown_interaction(sender, ordinal),
14108 }
14109 }
14110}
14111
14112pub trait DirectoryServerSender {
14114 type Transport: ::fidl_next::Transport;
14115
14116 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
14117
14118 fn on_open<___R>(
14119 &self,
14120 request: ___R,
14121 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
14122 where
14123 ___R: ::fidl_next::Encode<
14124 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
14125 Encoded = <directory::OnOpen as ::fidl_next::Method>::Response,
14126 >;
14127
14128 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
14129
14130 fn on_representation<___R>(
14131 &self,
14132 request: ___R,
14133 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
14134 where
14135 ___R: ::fidl_next::Encode<
14136 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
14137 Encoded = <directory::OnRepresentation as ::fidl_next::Method>::Response,
14138 >;
14139}
14140
14141impl<___T> DirectoryServerSender for ::fidl_next::ServerSender<___T, Directory>
14142where
14143 ___T: ::fidl_next::Transport,
14144{
14145 type Transport = ___T;
14146
14147 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
14148
14149 fn on_open<___R>(
14150 &self,
14151 request: ___R,
14152 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
14153 where
14154 ___R: ::fidl_next::Encode<
14155 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
14156 Encoded = <directory::OnOpen as ::fidl_next::Method>::Response,
14157 >,
14158 {
14159 self.as_untyped().send_event(9207534335756671346, request)
14160 }
14161
14162 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
14163
14164 fn on_representation<___R>(
14165 &self,
14166 request: ___R,
14167 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
14168 where
14169 ___R: ::fidl_next::Encode<
14170 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
14171 Encoded = <directory::OnRepresentation as ::fidl_next::Method>::Response,
14172 >,
14173 {
14174 self.as_untyped().send_event(6679970090861613324, request)
14175 }
14176}
14177
14178pub trait DirectoryServerHandler<___T: ::fidl_next::Transport> {
14182 #[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"]
14183 fn advisory_lock(
14184 &mut self,
14185 sender: &::fidl_next::ServerSender<___T, Directory>,
14186
14187 request: ::fidl_next::Request<___T, directory::AdvisoryLock>,
14188
14189 responder: ::fidl_next::Responder<directory::AdvisoryLock>,
14190 );
14191
14192 fn clone(
14193 &mut self,
14194 sender: &::fidl_next::ServerSender<___T, Directory>,
14195
14196 request: ::fidl_next::Request<___T, directory::Clone>,
14197 );
14198
14199 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
14200 fn close(
14201 &mut self,
14202 sender: &::fidl_next::ServerSender<___T, Directory>,
14203
14204 responder: ::fidl_next::Responder<directory::Close>,
14205 );
14206
14207 fn query(
14208 &mut self,
14209 sender: &::fidl_next::ServerSender<___T, Directory>,
14210
14211 responder: ::fidl_next::Responder<directory::Query>,
14212 );
14213
14214 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
14215 fn deprecated_clone(
14216 &mut self,
14217 sender: &::fidl_next::ServerSender<___T, Directory>,
14218
14219 request: ::fidl_next::Request<___T, directory::DeprecatedClone>,
14220 );
14221
14222 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
14223 fn get_attr(
14224 &mut self,
14225 sender: &::fidl_next::ServerSender<___T, Directory>,
14226
14227 responder: ::fidl_next::Responder<directory::GetAttr>,
14228 );
14229
14230 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
14231 fn set_attr(
14232 &mut self,
14233 sender: &::fidl_next::ServerSender<___T, Directory>,
14234
14235 request: ::fidl_next::Request<___T, directory::SetAttr>,
14236
14237 responder: ::fidl_next::Responder<directory::SetAttr>,
14238 );
14239
14240 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
14241 fn deprecated_get_flags(
14242 &mut self,
14243 sender: &::fidl_next::ServerSender<___T, Directory>,
14244
14245 responder: ::fidl_next::Responder<directory::DeprecatedGetFlags>,
14246 );
14247
14248 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
14249 fn deprecated_set_flags(
14250 &mut self,
14251 sender: &::fidl_next::ServerSender<___T, Directory>,
14252
14253 request: ::fidl_next::Request<___T, directory::DeprecatedSetFlags>,
14254
14255 responder: ::fidl_next::Responder<directory::DeprecatedSetFlags>,
14256 );
14257
14258 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
14259 fn get_flags(
14260 &mut self,
14261 sender: &::fidl_next::ServerSender<___T, Directory>,
14262
14263 responder: ::fidl_next::Responder<directory::GetFlags>,
14264 );
14265
14266 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
14267 fn set_flags(
14268 &mut self,
14269 sender: &::fidl_next::ServerSender<___T, Directory>,
14270
14271 request: ::fidl_next::Request<___T, directory::SetFlags>,
14272
14273 responder: ::fidl_next::Responder<directory::SetFlags>,
14274 );
14275
14276 #[doc = " Query the filesystem for filesystem-specific information.\n"]
14277 fn query_filesystem(
14278 &mut self,
14279 sender: &::fidl_next::ServerSender<___T, Directory>,
14280
14281 responder: ::fidl_next::Responder<directory::QueryFilesystem>,
14282 );
14283
14284 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
14285 fn get_connection_info(
14286 &mut self,
14287 sender: &::fidl_next::ServerSender<___T, Directory>,
14288
14289 responder: ::fidl_next::Responder<directory::GetConnectionInfo>,
14290 );
14291
14292 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14293 fn get_attributes(
14294 &mut self,
14295 sender: &::fidl_next::ServerSender<___T, Directory>,
14296
14297 request: ::fidl_next::Request<___T, directory::GetAttributes>,
14298
14299 responder: ::fidl_next::Responder<directory::GetAttributes>,
14300 );
14301
14302 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14303 fn update_attributes(
14304 &mut self,
14305 sender: &::fidl_next::ServerSender<___T, Directory>,
14306
14307 request: ::fidl_next::Request<___T, directory::UpdateAttributes>,
14308
14309 responder: ::fidl_next::Responder<directory::UpdateAttributes>,
14310 );
14311
14312 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
14313 fn sync(
14314 &mut self,
14315 sender: &::fidl_next::ServerSender<___T, Directory>,
14316
14317 responder: ::fidl_next::Responder<directory::Sync>,
14318 );
14319
14320 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14321 fn list_extended_attributes(
14322 &mut self,
14323 sender: &::fidl_next::ServerSender<___T, Directory>,
14324
14325 request: ::fidl_next::Request<___T, directory::ListExtendedAttributes>,
14326 );
14327
14328 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
14329 fn get_extended_attribute(
14330 &mut self,
14331 sender: &::fidl_next::ServerSender<___T, Directory>,
14332
14333 request: ::fidl_next::Request<___T, directory::GetExtendedAttribute>,
14334
14335 responder: ::fidl_next::Responder<directory::GetExtendedAttribute>,
14336 );
14337
14338 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14339 fn set_extended_attribute(
14340 &mut self,
14341 sender: &::fidl_next::ServerSender<___T, Directory>,
14342
14343 request: ::fidl_next::Request<___T, directory::SetExtendedAttribute>,
14344
14345 responder: ::fidl_next::Responder<directory::SetExtendedAttribute>,
14346 );
14347
14348 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
14349 fn remove_extended_attribute(
14350 &mut self,
14351 sender: &::fidl_next::ServerSender<___T, Directory>,
14352
14353 request: ::fidl_next::Request<___T, directory::RemoveExtendedAttribute>,
14354
14355 responder: ::fidl_next::Responder<directory::RemoveExtendedAttribute>,
14356 );
14357
14358 #[doc = " DEPRECATED - Use `fuchsia.io/Directory.Open` instead.\n"]
14359 fn deprecated_open(
14360 &mut self,
14361 sender: &::fidl_next::ServerSender<___T, Directory>,
14362
14363 request: ::fidl_next::Request<___T, directory::DeprecatedOpen>,
14364 );
14365
14366 #[doc = " Open (or create) a node relative to this directory. Any errors are communicated via an\n epitaph sent on the `object` channel.\n\n Errors:\n * `ZX_ERR_BAD_PATH` if `path` is invalid\n * See [`Flags`] for other errors which may be communicated based on `flags`\n"]
14367 fn open(
14368 &mut self,
14369 sender: &::fidl_next::ServerSender<___T, Directory>,
14370
14371 request: ::fidl_next::Request<___T, directory::Open>,
14372 );
14373
14374 #[doc = " Reads a collection of variably sized dirents into a buffer.\n The number of dirents in a directory may be very large: akin to\n calling read multiple times on a file, directories have a seek\n offset which is updated on subsequent calls to ReadDirents.\n Each call to ReadDirents will only return whole dirent structures,\n they will not get split across ReadDirent calls. When the seek\n offset reaches the end, `dirents` will be empty.\n\n These dirents are of the form:\n ```\n struct dirent {\n // Describes the inode of the entry.\n uint64 ino;\n // Describes the length of the dirent name in bytes.\n uint8 size;\n // Describes the type of the entry. Aligned with the\n // POSIX d_type values. Use `DirentType` constants.\n uint8 type;\n // Unterminated name of entry.\n char name[0];\n }\n ```\n\n This method does not require any rights, since one could always probe for\n directory contents by triggering name conflicts during file creation.\n"]
14375 fn read_dirents(
14376 &mut self,
14377 sender: &::fidl_next::ServerSender<___T, Directory>,
14378
14379 request: ::fidl_next::Request<___T, directory::ReadDirents>,
14380
14381 responder: ::fidl_next::Responder<directory::ReadDirents>,
14382 );
14383
14384 #[doc = " Resets the directory seek offset.\n\n This method does not require any rights, similar to ReadDirents.\n"]
14385 fn rewind(
14386 &mut self,
14387 sender: &::fidl_next::ServerSender<___T, Directory>,
14388
14389 responder: ::fidl_next::Responder<directory::Rewind>,
14390 );
14391
14392 #[doc = " Acquires a token to a Directory which can be used to identify access to it at a later point\n in time. The token will remain valid for as long as the connection requesting the token\n remains open.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
14393 fn get_token(
14394 &mut self,
14395 sender: &::fidl_next::ServerSender<___T, Directory>,
14396
14397 responder: ::fidl_next::Responder<directory::GetToken>,
14398 );
14399
14400 #[doc = " Creates a link to an object named src by the name dst, within a directory represented by\n token.\n\n `src` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will\n return `ZX_ERR_INVALID_ARGS`.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE` and\n `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.\n\n This will be atomic with respect to renaming or unlinking the source concurrently e.g. if\n there are two actors operating concurrently, and one actor performs a rename that affects\n the source within this directory, and the other does a link, each will appear to occur\n atomically in an unspecified order.\n"]
14401 fn link(
14402 &mut self,
14403 sender: &::fidl_next::ServerSender<___T, Directory>,
14404
14405 request: ::fidl_next::Request<___T, directory::Link>,
14406
14407 responder: ::fidl_next::Responder<directory::Link>,
14408 );
14409
14410 #[doc = " Removes a child node from the this directory\'s list of entries.\n\n Note: this does not guarantee that the underlying object is destroyed.\n Although the link will be removed from the containing directory,\n objects with multiple references (such as files which are still open)\n will not actually be destroyed until all references are closed.\n\n * error `ZX_ERR_ACCESS_DENIED` if the connection does not have\n [`Rights.WRITE_BYTES`].\n * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not\n support writing.\n * error `ZX_ERR_BAD_PATH` if `name` is invalid.\n * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.\n * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,\n containing a remote channel.\n * error `ZX_ERR_NOT_DIR` if the options requested a directory but\n something other than a directory was found.\n\n Other errors may be returned for filesystem-specific reasons.\n\n This method requires the following rights:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n"]
14411 fn unlink(
14412 &mut self,
14413 sender: &::fidl_next::ServerSender<___T, Directory>,
14414
14415 request: ::fidl_next::Request<___T, directory::Unlink>,
14416
14417 responder: ::fidl_next::Responder<directory::Unlink>,
14418 );
14419
14420 #[doc = " Renames a node named `src` to the name `dst`, in a directory represented\n by `dst_parent_token`.\n\n `src` and `dst` must be valid node names.\n See [`Name`] for what constitutes a valid name.\n\n This method requires the following rights on both the current connection, and the connection\n identified by `dst_parent_token`:\n\n * [`Rights.ENUMERATE`]\n * [`Rights.MODIFY_DIRECTORY`]\n\n The following requirements are necessary to avoid rights escalations.\n\n If the source and destination directory differ, the source directory must also have the\n maximal set of abilities supported for files, which would typically be\n [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and\n [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]\n right.\n\n If `src` refers to a directory, and differs from the destination directory, then the source\n directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.\n\n * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.\n * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.\n"]
14421 fn rename(
14422 &mut self,
14423 sender: &::fidl_next::ServerSender<___T, Directory>,
14424
14425 request: ::fidl_next::Request<___T, directory::Rename>,
14426
14427 responder: ::fidl_next::Responder<directory::Rename>,
14428 );
14429
14430 #[doc = " Creates a symbolic link.\n\n `name` is the name to be given to the created symbolic link.\n `target` is the target of the symbolic link, which has no meaning on the server. The server\n will perform no validation of `target` except for a server chosen maximum length.\n `connection` is an optional server end of a channel that will speak the Symlink protocol\n on the successfully created node.\n\n * [`Rights.MODIFY_DIRECTORY`]\n\n * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.\n * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.\n * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].\n * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.\n"]
14431 fn create_symlink(
14432 &mut self,
14433 sender: &::fidl_next::ServerSender<___T, Directory>,
14434
14435 request: ::fidl_next::Request<___T, directory::CreateSymlink>,
14436
14437 responder: ::fidl_next::Responder<directory::CreateSymlink>,
14438 );
14439
14440 #[doc = " Watches a directory, receiving events of added messages on the\n watcher request channel.\n\n Options must be zero; it is reserved.\n\n This method does not require any rights, similar to ReadDirents.\n"]
14441 fn watch(
14442 &mut self,
14443 sender: &::fidl_next::ServerSender<___T, Directory>,
14444
14445 request: ::fidl_next::Request<___T, directory::Watch>,
14446
14447 responder: ::fidl_next::Responder<directory::Watch>,
14448 );
14449
14450 fn on_unknown_interaction(
14451 &mut self,
14452 sender: &::fidl_next::ServerSender<___T, Directory>,
14453 ordinal: u64,
14454 ) {
14455 sender.close();
14456 }
14457}
14458
14459impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Directory
14460where
14461 ___T: ::fidl_next::Transport,
14462 ___H: DirectoryServerHandler<___T>,
14463
14464 crate::WireAdvisoryLockingAdvisoryLockRequest:
14465 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14466
14467 ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest:
14468 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14469
14470 crate::WireNodeDeprecatedCloneRequest:
14471 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14472
14473 crate::WireNodeSetAttrRequest:
14474 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14475
14476 crate::WireNodeDeprecatedSetFlagsRequest:
14477 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14478
14479 crate::WireNodeSetFlagsRequest:
14480 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14481
14482 crate::WireNodeGetAttributesRequest:
14483 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14484
14485 crate::WireMutableNodeAttributes:
14486 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14487
14488 crate::WireNodeListExtendedAttributesRequest:
14489 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14490
14491 crate::WireNodeGetExtendedAttributeRequest:
14492 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14493
14494 crate::WireNodeSetExtendedAttributeRequest:
14495 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14496
14497 crate::WireNodeRemoveExtendedAttributeRequest:
14498 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14499
14500 crate::WireDirectoryDeprecatedOpenRequest:
14501 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14502
14503 crate::WireDirectoryOpenRequest:
14504 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14505
14506 crate::WireDirectoryReadDirentsRequest:
14507 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14508
14509 crate::WireDirectoryLinkRequest:
14510 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14511
14512 crate::WireDirectoryUnlinkRequest:
14513 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14514
14515 crate::WireDirectoryRenameRequest:
14516 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14517
14518 crate::WireDirectoryCreateSymlinkRequest:
14519 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14520
14521 crate::WireDirectoryWatchRequest:
14522 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14523{
14524 fn on_one_way(
14525 handler: &mut ___H,
14526 sender: &::fidl_next::ServerSender<___T, Self>,
14527 ordinal: u64,
14528 buffer: ___T::RecvBuffer,
14529 ) {
14530 match ordinal {
14531 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
14532 Ok(decoded) => handler.clone(sender, decoded),
14533 Err(e) => {
14534 sender.close();
14535 }
14536 },
14537
14538 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
14539 Ok(decoded) => handler.deprecated_clone(sender, decoded),
14540 Err(e) => {
14541 sender.close();
14542 }
14543 },
14544
14545 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
14546 Ok(decoded) => handler.list_extended_attributes(sender, decoded),
14547 Err(e) => {
14548 sender.close();
14549 }
14550 },
14551
14552 3193127272456937152 => match ::fidl_next::DecoderExt::decode(buffer) {
14553 Ok(decoded) => handler.deprecated_open(sender, decoded),
14554 Err(e) => {
14555 sender.close();
14556 }
14557 },
14558
14559 6236883748953765593 => match ::fidl_next::DecoderExt::decode(buffer) {
14560 Ok(decoded) => handler.open(sender, decoded),
14561 Err(e) => {
14562 sender.close();
14563 }
14564 },
14565
14566 ordinal => handler.on_unknown_interaction(sender, ordinal),
14567 }
14568 }
14569
14570 fn on_two_way(
14571 handler: &mut ___H,
14572 sender: &::fidl_next::ServerSender<___T, Self>,
14573 ordinal: u64,
14574 buffer: ___T::RecvBuffer,
14575 responder: ::fidl_next::protocol::Responder,
14576 ) {
14577 match ordinal {
14578 7992130864415541162 => {
14579 let responder = ::fidl_next::Responder::from_untyped(responder);
14580
14581 match ::fidl_next::DecoderExt::decode(buffer) {
14582 Ok(decoded) => handler.advisory_lock(sender, decoded, responder),
14583 Err(e) => {
14584 sender.close();
14585 }
14586 }
14587 }
14588
14589 6540867515453498750 => {
14590 let responder = ::fidl_next::Responder::from_untyped(responder);
14591
14592 handler.close(sender, responder);
14593 }
14594
14595 2763219980499352582 => {
14596 let responder = ::fidl_next::Responder::from_untyped(responder);
14597
14598 handler.query(sender, responder);
14599 }
14600
14601 8689798978500614909 => {
14602 let responder = ::fidl_next::Responder::from_untyped(responder);
14603
14604 handler.get_attr(sender, responder);
14605 }
14606
14607 4721673413776871238 => {
14608 let responder = ::fidl_next::Responder::from_untyped(responder);
14609
14610 match ::fidl_next::DecoderExt::decode(buffer) {
14611 Ok(decoded) => handler.set_attr(sender, decoded, responder),
14612 Err(e) => {
14613 sender.close();
14614 }
14615 }
14616 }
14617
14618 6595803110182632097 => {
14619 let responder = ::fidl_next::Responder::from_untyped(responder);
14620
14621 handler.deprecated_get_flags(sender, responder);
14622 }
14623
14624 5950864159036794675 => {
14625 let responder = ::fidl_next::Responder::from_untyped(responder);
14626
14627 match ::fidl_next::DecoderExt::decode(buffer) {
14628 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder),
14629 Err(e) => {
14630 sender.close();
14631 }
14632 }
14633 }
14634
14635 105530239381466147 => {
14636 let responder = ::fidl_next::Responder::from_untyped(responder);
14637
14638 handler.get_flags(sender, responder);
14639 }
14640
14641 6172186066099445416 => {
14642 let responder = ::fidl_next::Responder::from_untyped(responder);
14643
14644 match ::fidl_next::DecoderExt::decode(buffer) {
14645 Ok(decoded) => handler.set_flags(sender, decoded, responder),
14646 Err(e) => {
14647 sender.close();
14648 }
14649 }
14650 }
14651
14652 8013111122914313744 => {
14653 let responder = ::fidl_next::Responder::from_untyped(responder);
14654
14655 handler.query_filesystem(sender, responder);
14656 }
14657
14658 6362521381364198667 => {
14659 let responder = ::fidl_next::Responder::from_untyped(responder);
14660
14661 handler.get_connection_info(sender, responder);
14662 }
14663
14664 4414537700416816443 => {
14665 let responder = ::fidl_next::Responder::from_untyped(responder);
14666
14667 match ::fidl_next::DecoderExt::decode(buffer) {
14668 Ok(decoded) => handler.get_attributes(sender, decoded, responder),
14669 Err(e) => {
14670 sender.close();
14671 }
14672 }
14673 }
14674
14675 3677402239314018056 => {
14676 let responder = ::fidl_next::Responder::from_untyped(responder);
14677
14678 match ::fidl_next::DecoderExt::decode(buffer) {
14679 Ok(decoded) => handler.update_attributes(sender, decoded, responder),
14680 Err(e) => {
14681 sender.close();
14682 }
14683 }
14684 }
14685
14686 3196473584242777161 => {
14687 let responder = ::fidl_next::Responder::from_untyped(responder);
14688
14689 handler.sync(sender, responder);
14690 }
14691
14692 5043930208506967771 => {
14693 let responder = ::fidl_next::Responder::from_untyped(responder);
14694
14695 match ::fidl_next::DecoderExt::decode(buffer) {
14696 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder),
14697 Err(e) => {
14698 sender.close();
14699 }
14700 }
14701 }
14702
14703 5374223046099989052 => {
14704 let responder = ::fidl_next::Responder::from_untyped(responder);
14705
14706 match ::fidl_next::DecoderExt::decode(buffer) {
14707 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder),
14708 Err(e) => {
14709 sender.close();
14710 }
14711 }
14712 }
14713
14714 8794297771444732717 => {
14715 let responder = ::fidl_next::Responder::from_untyped(responder);
14716
14717 match ::fidl_next::DecoderExt::decode(buffer) {
14718 Ok(decoded) => handler.remove_extended_attribute(sender, decoded, responder),
14719 Err(e) => {
14720 sender.close();
14721 }
14722 }
14723 }
14724
14725 3855785432100874762 => {
14726 let responder = ::fidl_next::Responder::from_untyped(responder);
14727
14728 match ::fidl_next::DecoderExt::decode(buffer) {
14729 Ok(decoded) => handler.read_dirents(sender, decoded, responder),
14730 Err(e) => {
14731 sender.close();
14732 }
14733 }
14734 }
14735
14736 1635123508515392625 => {
14737 let responder = ::fidl_next::Responder::from_untyped(responder);
14738
14739 handler.rewind(sender, responder);
14740 }
14741
14742 2787337947777369685 => {
14743 let responder = ::fidl_next::Responder::from_untyped(responder);
14744
14745 handler.get_token(sender, responder);
14746 }
14747
14748 8360374984291987687 => {
14749 let responder = ::fidl_next::Responder::from_untyped(responder);
14750
14751 match ::fidl_next::DecoderExt::decode(buffer) {
14752 Ok(decoded) => handler.link(sender, decoded, responder),
14753 Err(e) => {
14754 sender.close();
14755 }
14756 }
14757 }
14758
14759 8433556716759383021 => {
14760 let responder = ::fidl_next::Responder::from_untyped(responder);
14761
14762 match ::fidl_next::DecoderExt::decode(buffer) {
14763 Ok(decoded) => handler.unlink(sender, decoded, responder),
14764 Err(e) => {
14765 sender.close();
14766 }
14767 }
14768 }
14769
14770 8097726607824333022 => {
14771 let responder = ::fidl_next::Responder::from_untyped(responder);
14772
14773 match ::fidl_next::DecoderExt::decode(buffer) {
14774 Ok(decoded) => handler.rename(sender, decoded, responder),
14775 Err(e) => {
14776 sender.close();
14777 }
14778 }
14779 }
14780
14781 2435901052462315657 => {
14782 let responder = ::fidl_next::Responder::from_untyped(responder);
14783
14784 match ::fidl_next::DecoderExt::decode(buffer) {
14785 Ok(decoded) => handler.create_symlink(sender, decoded, responder),
14786 Err(e) => {
14787 sender.close();
14788 }
14789 }
14790 }
14791
14792 6275512344170098065 => {
14793 let responder = ::fidl_next::Responder::from_untyped(responder);
14794
14795 match ::fidl_next::DecoderExt::decode(buffer) {
14796 Ok(decoded) => handler.watch(sender, decoded, responder),
14797 Err(e) => {
14798 sender.close();
14799 }
14800 }
14801 }
14802
14803 ordinal => handler.on_unknown_interaction(sender, ordinal),
14804 }
14805 }
14806}
14807
14808#[derive(Clone, Debug)]
14809#[repr(C)]
14810pub struct DirectoryObject {}
14811
14812impl ::fidl_next::Encodable for DirectoryObject {
14813 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
14814 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
14815
14816 type Encoded = WireDirectoryObject;
14817}
14818
14819unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryObject
14820where
14821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14822{
14823 #[inline]
14824 fn encode(
14825 self,
14826 encoder: &mut ___E,
14827 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14828 ) -> Result<(), ::fidl_next::EncodeError> {
14829 ::fidl_next::munge! {
14830 let Self::Encoded {
14831
14832 } = out;
14833 }
14834
14835 Ok(())
14836 }
14837}
14838
14839unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirectoryObject
14840where
14841 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14842{
14843 #[inline]
14844 fn encode_ref(
14845 &self,
14846 encoder: &mut ___E,
14847 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14848 ) -> Result<(), ::fidl_next::EncodeError> {
14849 ::fidl_next::munge! {
14850 let Self::Encoded {
14851
14852 } = out;
14853 }
14854
14855 Ok(())
14856 }
14857}
14858
14859impl ::fidl_next::EncodableOption for Box<DirectoryObject> {
14860 type EncodedOption = ::fidl_next::WireBox<WireDirectoryObject>;
14861}
14862
14863unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DirectoryObject>
14864where
14865 ___E: ::fidl_next::Encoder + ?Sized,
14866 DirectoryObject: ::fidl_next::Encode<___E>,
14867{
14868 #[inline]
14869 fn encode_option(
14870 this: Option<Self>,
14871 encoder: &mut ___E,
14872 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14873 ) -> Result<(), ::fidl_next::EncodeError> {
14874 if let Some(inner) = this {
14875 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
14876 ::fidl_next::WireBox::encode_present(out);
14877 } else {
14878 ::fidl_next::WireBox::encode_absent(out);
14879 }
14880
14881 Ok(())
14882 }
14883}
14884
14885unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<DirectoryObject>
14886where
14887 ___E: ::fidl_next::Encoder + ?Sized,
14888 DirectoryObject: ::fidl_next::EncodeRef<___E>,
14889{
14890 #[inline]
14891 fn encode_option_ref(
14892 this: Option<&Self>,
14893 encoder: &mut ___E,
14894 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14895 ) -> Result<(), ::fidl_next::EncodeError> {
14896 if let Some(inner) = this {
14897 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14898 ::fidl_next::WireBox::encode_present(out);
14899 } else {
14900 ::fidl_next::WireBox::encode_absent(out);
14901 }
14902
14903 Ok(())
14904 }
14905}
14906
14907impl ::fidl_next::TakeFrom<WireDirectoryObject> for DirectoryObject {
14908 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
14909 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
14910
14911 #[inline]
14912 fn take_from(from: &WireDirectoryObject) -> Self {
14913 Self {}
14914 }
14915}
14916
14917#[derive(Clone, Debug)]
14919#[repr(C)]
14920pub struct WireDirectoryObject {}
14921
14922unsafe impl ::fidl_next::ZeroPadding for WireDirectoryObject {
14923 #[inline]
14924 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
14925}
14926
14927unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryObject
14928where
14929 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14930{
14931 fn decode(
14932 slot: ::fidl_next::Slot<'_, Self>,
14933 decoder: &mut ___D,
14934 ) -> Result<(), ::fidl_next::DecodeError> {
14935 ::fidl_next::munge! {
14936 let Self {
14937
14938 } = slot;
14939 }
14940
14941 Ok(())
14942 }
14943}
14944
14945#[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"]
14947#[derive(Debug)]
14948pub struct DirectoryWatcher;
14949
14950pub mod directory_watcher {
14951 pub mod prelude {
14952 pub use crate::{
14953 directory_watcher, DirectoryWatcher, DirectoryWatcherClientHandler,
14954 DirectoryWatcherClientSender, DirectoryWatcherServerHandler,
14955 DirectoryWatcherServerSender,
14956 };
14957 }
14958}
14959
14960pub trait DirectoryWatcherClientSender {
14962 type Transport: ::fidl_next::Transport;
14963}
14964
14965impl<___T> DirectoryWatcherClientSender for ::fidl_next::ClientSender<___T, DirectoryWatcher>
14966where
14967 ___T: ::fidl_next::Transport,
14968{
14969 type Transport = ___T;
14970}
14971
14972pub trait DirectoryWatcherClientHandler<___T: ::fidl_next::Transport> {}
14976
14977impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DirectoryWatcher
14978where
14979 ___T: ::fidl_next::Transport,
14980 ___H: DirectoryWatcherClientHandler<___T>,
14981{
14982 fn on_event(
14983 handler: &mut ___H,
14984 sender: &::fidl_next::ClientSender<___T, Self>,
14985 ordinal: u64,
14986 buffer: ___T::RecvBuffer,
14987 ) {
14988 match ordinal {
14989 ordinal => {
14990 sender.close();
14991 }
14992 }
14993 }
14994}
14995
14996pub trait DirectoryWatcherServerSender {
14998 type Transport: ::fidl_next::Transport;
14999}
15000
15001impl<___T> DirectoryWatcherServerSender for ::fidl_next::ServerSender<___T, DirectoryWatcher>
15002where
15003 ___T: ::fidl_next::Transport,
15004{
15005 type Transport = ___T;
15006}
15007
15008pub trait DirectoryWatcherServerHandler<___T: ::fidl_next::Transport> {}
15012
15013impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DirectoryWatcher
15014where
15015 ___T: ::fidl_next::Transport,
15016 ___H: DirectoryWatcherServerHandler<___T>,
15017{
15018 fn on_one_way(
15019 handler: &mut ___H,
15020 sender: &::fidl_next::ServerSender<___T, Self>,
15021 ordinal: u64,
15022 buffer: ___T::RecvBuffer,
15023 ) {
15024 match ordinal {
15025 ordinal => {
15026 sender.close();
15027 }
15028 }
15029 }
15030
15031 fn on_two_way(
15032 handler: &mut ___H,
15033 sender: &::fidl_next::ServerSender<___T, Self>,
15034 ordinal: u64,
15035 buffer: ___T::RecvBuffer,
15036 responder: ::fidl_next::protocol::Responder,
15037 ) {
15038 match ordinal {
15039 ordinal => {
15040 sender.close();
15041 }
15042 }
15043 }
15044}
15045
15046#[derive(Clone, Copy, Debug, PartialEq, Eq)]
15047#[repr(u8)]
15048pub enum DirentType {
15049 Unknown = 0,
15050 Directory = 4,
15051 BlockDevice = 6,
15052 File = 8,
15053 Symlink = 10,
15054 Service = 16,
15055 UnknownOrdinal_(u8),
15056}
15057
15058impl ::fidl_next::Encodable for DirentType {
15059 type Encoded = WireDirentType;
15060}
15061impl ::std::convert::From<u8> for DirentType {
15062 fn from(value: u8) -> Self {
15063 match value {
15064 0 => Self::Unknown,
15065 4 => Self::Directory,
15066 6 => Self::BlockDevice,
15067 8 => Self::File,
15068 10 => Self::Symlink,
15069 16 => Self::Service,
15070
15071 _ => Self::UnknownOrdinal_(value),
15072 }
15073 }
15074}
15075
15076unsafe impl<___E> ::fidl_next::Encode<___E> for DirentType
15077where
15078 ___E: ?Sized,
15079{
15080 #[inline]
15081 fn encode(
15082 self,
15083 encoder: &mut ___E,
15084 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15085 ) -> Result<(), ::fidl_next::EncodeError> {
15086 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
15087 }
15088}
15089
15090unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DirentType
15091where
15092 ___E: ?Sized,
15093{
15094 #[inline]
15095 fn encode_ref(
15096 &self,
15097 encoder: &mut ___E,
15098 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15099 ) -> Result<(), ::fidl_next::EncodeError> {
15100 ::fidl_next::munge!(let WireDirentType { value } = out);
15101 let _ = value.write(u8::from(match *self {
15102 Self::Unknown => 0,
15103
15104 Self::Directory => 4,
15105
15106 Self::BlockDevice => 6,
15107
15108 Self::File => 8,
15109
15110 Self::Symlink => 10,
15111
15112 Self::Service => 16,
15113
15114 Self::UnknownOrdinal_(value) => value,
15115 }));
15116
15117 Ok(())
15118 }
15119}
15120
15121impl ::core::convert::From<WireDirentType> for DirentType {
15122 fn from(wire: WireDirentType) -> Self {
15123 match u8::from(wire.value) {
15124 0 => Self::Unknown,
15125
15126 4 => Self::Directory,
15127
15128 6 => Self::BlockDevice,
15129
15130 8 => Self::File,
15131
15132 10 => Self::Symlink,
15133
15134 16 => Self::Service,
15135
15136 value => Self::UnknownOrdinal_(value),
15137 }
15138 }
15139}
15140
15141impl ::fidl_next::TakeFrom<WireDirentType> for DirentType {
15142 #[inline]
15143 fn take_from(from: &WireDirentType) -> Self {
15144 Self::from(*from)
15145 }
15146}
15147
15148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
15150#[repr(transparent)]
15151pub struct WireDirentType {
15152 value: u8,
15153}
15154
15155unsafe impl ::fidl_next::ZeroPadding for WireDirentType {
15156 #[inline]
15157 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
15158 }
15160}
15161
15162impl WireDirentType {
15163 pub const UNKNOWN: WireDirentType = WireDirentType { value: 0 };
15164
15165 pub const DIRECTORY: WireDirentType = WireDirentType { value: 4 };
15166
15167 pub const BLOCK_DEVICE: WireDirentType = WireDirentType { value: 6 };
15168
15169 pub const FILE: WireDirentType = WireDirentType { value: 8 };
15170
15171 pub const SYMLINK: WireDirentType = WireDirentType { value: 10 };
15172
15173 pub const SERVICE: WireDirentType = WireDirentType { value: 16 };
15174}
15175
15176unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirentType
15177where
15178 ___D: ?Sized,
15179{
15180 fn decode(
15181 slot: ::fidl_next::Slot<'_, Self>,
15182 _: &mut ___D,
15183 ) -> Result<(), ::fidl_next::DecodeError> {
15184 Ok(())
15185 }
15186}
15187
15188impl ::core::convert::From<DirentType> for WireDirentType {
15189 fn from(natural: DirentType) -> Self {
15190 match natural {
15191 DirentType::Unknown => WireDirentType::UNKNOWN,
15192
15193 DirentType::Directory => WireDirentType::DIRECTORY,
15194
15195 DirentType::BlockDevice => WireDirentType::BLOCK_DEVICE,
15196
15197 DirentType::File => WireDirentType::FILE,
15198
15199 DirentType::Symlink => WireDirentType::SYMLINK,
15200
15201 DirentType::Service => WireDirentType::SERVICE,
15202
15203 DirentType::UnknownOrdinal_(value) => WireDirentType { value: u8::from(value) },
15204 }
15205 }
15206}
15207
15208#[doc = " The maximum size of a chunk in the ListExtendedAttributes iterator.\n"]
15209pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128;
15210
15211#[derive(Clone, Debug)]
15212pub struct ExtendedAttributeIteratorGetNextResponse {
15213 pub attributes: Vec<Vec<u8>>,
15214
15215 pub last: bool,
15216}
15217
15218impl ::fidl_next::Encodable for ExtendedAttributeIteratorGetNextResponse {
15219 type Encoded = WireExtendedAttributeIteratorGetNextResponse;
15220}
15221
15222unsafe impl<___E> ::fidl_next::Encode<___E> for ExtendedAttributeIteratorGetNextResponse
15223where
15224 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15225
15226 ___E: ::fidl_next::Encoder,
15227{
15228 #[inline]
15229 fn encode(
15230 self,
15231 encoder: &mut ___E,
15232 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15233 ) -> Result<(), ::fidl_next::EncodeError> {
15234 ::fidl_next::munge! {
15235 let Self::Encoded {
15236 attributes,
15237 last,
15238
15239 } = out;
15240 }
15241
15242 ::fidl_next::Encode::encode(self.attributes, encoder, attributes)?;
15243
15244 ::fidl_next::Encode::encode(self.last, encoder, last)?;
15245
15246 Ok(())
15247 }
15248}
15249
15250unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExtendedAttributeIteratorGetNextResponse
15251where
15252 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15253
15254 ___E: ::fidl_next::Encoder,
15255{
15256 #[inline]
15257 fn encode_ref(
15258 &self,
15259 encoder: &mut ___E,
15260 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15261 ) -> Result<(), ::fidl_next::EncodeError> {
15262 ::fidl_next::munge! {
15263 let Self::Encoded {
15264 attributes,
15265 last,
15266
15267 } = out;
15268 }
15269
15270 ::fidl_next::EncodeRef::encode_ref(&self.attributes, encoder, attributes)?;
15271
15272 ::fidl_next::EncodeRef::encode_ref(&self.last, encoder, last)?;
15273
15274 Ok(())
15275 }
15276}
15277
15278impl ::fidl_next::EncodableOption for Box<ExtendedAttributeIteratorGetNextResponse> {
15279 type EncodedOption = ::fidl_next::WireBox<WireExtendedAttributeIteratorGetNextResponse>;
15280}
15281
15282unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ExtendedAttributeIteratorGetNextResponse>
15283where
15284 ___E: ::fidl_next::Encoder + ?Sized,
15285 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::Encode<___E>,
15286{
15287 #[inline]
15288 fn encode_option(
15289 this: Option<Self>,
15290 encoder: &mut ___E,
15291 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15292 ) -> Result<(), ::fidl_next::EncodeError> {
15293 if let Some(inner) = this {
15294 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
15295 ::fidl_next::WireBox::encode_present(out);
15296 } else {
15297 ::fidl_next::WireBox::encode_absent(out);
15298 }
15299
15300 Ok(())
15301 }
15302}
15303
15304unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E>
15305 for Box<ExtendedAttributeIteratorGetNextResponse>
15306where
15307 ___E: ::fidl_next::Encoder + ?Sized,
15308 ExtendedAttributeIteratorGetNextResponse: ::fidl_next::EncodeRef<___E>,
15309{
15310 #[inline]
15311 fn encode_option_ref(
15312 this: Option<&Self>,
15313 encoder: &mut ___E,
15314 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15315 ) -> Result<(), ::fidl_next::EncodeError> {
15316 if let Some(inner) = this {
15317 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
15318 ::fidl_next::WireBox::encode_present(out);
15319 } else {
15320 ::fidl_next::WireBox::encode_absent(out);
15321 }
15322
15323 Ok(())
15324 }
15325}
15326
15327impl ::fidl_next::TakeFrom<WireExtendedAttributeIteratorGetNextResponse>
15328 for ExtendedAttributeIteratorGetNextResponse
15329{
15330 #[inline]
15331 fn take_from(from: &WireExtendedAttributeIteratorGetNextResponse) -> Self {
15332 Self {
15333 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
15334
15335 last: ::fidl_next::TakeFrom::take_from(&from.last),
15336 }
15337 }
15338}
15339
15340#[derive(Debug)]
15342#[repr(C)]
15343pub struct WireExtendedAttributeIteratorGetNextResponse {
15344 pub attributes: ::fidl_next::WireVector<::fidl_next::WireVector<u8>>,
15345
15346 pub last: bool,
15347}
15348
15349unsafe impl ::fidl_next::ZeroPadding for WireExtendedAttributeIteratorGetNextResponse {
15350 #[inline]
15351 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15352 unsafe {
15353 out.as_mut_ptr().cast::<u8>().add(17).write_bytes(0, 7);
15354 }
15355 }
15356}
15357
15358unsafe impl<___D> ::fidl_next::Decode<___D> for WireExtendedAttributeIteratorGetNextResponse
15359where
15360 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15361
15362 ___D: ::fidl_next::Decoder,
15363{
15364 fn decode(
15365 slot: ::fidl_next::Slot<'_, Self>,
15366 decoder: &mut ___D,
15367 ) -> Result<(), ::fidl_next::DecodeError> {
15368 ::fidl_next::munge! {
15369 let Self {
15370 mut attributes,
15371 mut last,
15372
15373 } = slot;
15374 }
15375
15376 ::fidl_next::Decode::decode(attributes.as_mut(), decoder)?;
15377
15378 let attributes = unsafe { attributes.deref_unchecked() };
15379
15380 if attributes.len() > 128 {
15381 return Err(::fidl_next::DecodeError::VectorTooLong {
15382 size: attributes.len() as u64,
15383 limit: 128,
15384 });
15385 }
15386
15387 ::fidl_next::Decode::decode(last.as_mut(), decoder)?;
15388
15389 Ok(())
15390 }
15391}
15392
15393#[derive(Debug)]
15395pub struct ExtendedAttributeIterator;
15396
15397pub mod extended_attribute_iterator {
15398 pub mod prelude {
15399 pub use crate::{
15400 extended_attribute_iterator, ExtendedAttributeIterator,
15401 ExtendedAttributeIteratorClientHandler, ExtendedAttributeIteratorClientSender,
15402 ExtendedAttributeIteratorServerHandler, ExtendedAttributeIteratorServerSender,
15403 };
15404
15405 pub use crate::ExtendedAttributeIteratorGetNextResponse;
15406 }
15407
15408 pub struct GetNext;
15409
15410 impl ::fidl_next::Method for GetNext {
15411 const ORDINAL: u64 = 268639596268373415;
15412
15413 type Protocol = crate::ExtendedAttributeIterator;
15414
15415 type Request = ();
15416
15417 type Response = ::fidl_next::WireResult<
15418 crate::WireExtendedAttributeIteratorGetNextResponse,
15419 ::fidl_next::WireI32,
15420 >;
15421 }
15422}
15423
15424pub trait ExtendedAttributeIteratorClientSender {
15426 type Transport: ::fidl_next::Transport;
15427
15428 #[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"]
15429 fn get_next(
15430 &self,
15431 ) -> Result<
15432 ::fidl_next::ResponseFuture<'_, Self::Transport, extended_attribute_iterator::GetNext>,
15433 ::fidl_next::EncodeError,
15434 >;
15435}
15436
15437impl<___T> ExtendedAttributeIteratorClientSender
15438 for ::fidl_next::ClientSender<___T, ExtendedAttributeIterator>
15439where
15440 ___T: ::fidl_next::Transport,
15441{
15442 type Transport = ___T;
15443
15444 #[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"]
15445 fn get_next(
15446 &self,
15447 ) -> Result<
15448 ::fidl_next::ResponseFuture<'_, Self::Transport, extended_attribute_iterator::GetNext>,
15449 ::fidl_next::EncodeError,
15450 > {
15451 self.as_untyped()
15452 .send_two_way(268639596268373415, ())
15453 .map(::fidl_next::ResponseFuture::from_untyped)
15454 }
15455}
15456
15457pub trait ExtendedAttributeIteratorClientHandler<___T: ::fidl_next::Transport> {}
15461
15462impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ExtendedAttributeIterator
15463where
15464 ___T: ::fidl_next::Transport,
15465 ___H: ExtendedAttributeIteratorClientHandler<___T>,
15466
15467 <extended_attribute_iterator::GetNext as ::fidl_next::Method>::Response:
15468 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
15469{
15470 fn on_event(
15471 handler: &mut ___H,
15472 sender: &::fidl_next::ClientSender<___T, Self>,
15473 ordinal: u64,
15474 buffer: ___T::RecvBuffer,
15475 ) {
15476 match ordinal {
15477 ordinal => {
15478 sender.close();
15479 }
15480 }
15481 }
15482}
15483
15484pub trait ExtendedAttributeIteratorServerSender {
15486 type Transport: ::fidl_next::Transport;
15487}
15488
15489impl<___T> ExtendedAttributeIteratorServerSender
15490 for ::fidl_next::ServerSender<___T, ExtendedAttributeIterator>
15491where
15492 ___T: ::fidl_next::Transport,
15493{
15494 type Transport = ___T;
15495}
15496
15497pub trait ExtendedAttributeIteratorServerHandler<___T: ::fidl_next::Transport> {
15501 #[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"]
15502 fn get_next(
15503 &mut self,
15504 sender: &::fidl_next::ServerSender<___T, ExtendedAttributeIterator>,
15505
15506 responder: ::fidl_next::Responder<extended_attribute_iterator::GetNext>,
15507 );
15508}
15509
15510impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ExtendedAttributeIterator
15511where
15512 ___T: ::fidl_next::Transport,
15513 ___H: ExtendedAttributeIteratorServerHandler<___T>,
15514{
15515 fn on_one_way(
15516 handler: &mut ___H,
15517 sender: &::fidl_next::ServerSender<___T, Self>,
15518 ordinal: u64,
15519 buffer: ___T::RecvBuffer,
15520 ) {
15521 match ordinal {
15522 ordinal => {
15523 sender.close();
15524 }
15525 }
15526 }
15527
15528 fn on_two_way(
15529 handler: &mut ___H,
15530 sender: &::fidl_next::ServerSender<___T, Self>,
15531 ordinal: u64,
15532 buffer: ___T::RecvBuffer,
15533 responder: ::fidl_next::protocol::Responder,
15534 ) {
15535 match ordinal {
15536 268639596268373415 => {
15537 let responder = ::fidl_next::Responder::from_untyped(responder);
15538
15539 handler.get_next(sender, responder);
15540 }
15541
15542 ordinal => {
15543 sender.close();
15544 }
15545 }
15546 }
15547}
15548
15549pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
15550
15551#[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"]
15552pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: crate::Flags = crate::Flags::FLAG_MUST_CREATE;
15553
15554#[derive(Clone, Debug)]
15555#[repr(C)]
15556pub struct ReadableReadRequest {
15557 pub count: u64,
15558}
15559
15560impl ::fidl_next::Encodable for ReadableReadRequest {
15561 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
15562 ::fidl_next::CopyOptimization::enable_if(
15563 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
15564 )
15565 };
15566
15567 type Encoded = WireReadableReadRequest;
15568}
15569
15570unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadRequest
15571where
15572 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15573{
15574 #[inline]
15575 fn encode(
15576 self,
15577 encoder: &mut ___E,
15578 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15579 ) -> Result<(), ::fidl_next::EncodeError> {
15580 ::fidl_next::munge! {
15581 let Self::Encoded {
15582 count,
15583
15584 } = out;
15585 }
15586
15587 ::fidl_next::Encode::encode(self.count, encoder, count)?;
15588
15589 Ok(())
15590 }
15591}
15592
15593unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadRequest
15594where
15595 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15596{
15597 #[inline]
15598 fn encode_ref(
15599 &self,
15600 encoder: &mut ___E,
15601 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15602 ) -> Result<(), ::fidl_next::EncodeError> {
15603 ::fidl_next::munge! {
15604 let Self::Encoded {
15605 count,
15606
15607 } = out;
15608 }
15609
15610 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
15611
15612 Ok(())
15613 }
15614}
15615
15616impl ::fidl_next::EncodableOption for Box<ReadableReadRequest> {
15617 type EncodedOption = ::fidl_next::WireBox<WireReadableReadRequest>;
15618}
15619
15620unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ReadableReadRequest>
15621where
15622 ___E: ::fidl_next::Encoder + ?Sized,
15623 ReadableReadRequest: ::fidl_next::Encode<___E>,
15624{
15625 #[inline]
15626 fn encode_option(
15627 this: Option<Self>,
15628 encoder: &mut ___E,
15629 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15630 ) -> Result<(), ::fidl_next::EncodeError> {
15631 if let Some(inner) = this {
15632 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
15633 ::fidl_next::WireBox::encode_present(out);
15634 } else {
15635 ::fidl_next::WireBox::encode_absent(out);
15636 }
15637
15638 Ok(())
15639 }
15640}
15641
15642unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<ReadableReadRequest>
15643where
15644 ___E: ::fidl_next::Encoder + ?Sized,
15645 ReadableReadRequest: ::fidl_next::EncodeRef<___E>,
15646{
15647 #[inline]
15648 fn encode_option_ref(
15649 this: Option<&Self>,
15650 encoder: &mut ___E,
15651 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15652 ) -> Result<(), ::fidl_next::EncodeError> {
15653 if let Some(inner) = this {
15654 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
15655 ::fidl_next::WireBox::encode_present(out);
15656 } else {
15657 ::fidl_next::WireBox::encode_absent(out);
15658 }
15659
15660 Ok(())
15661 }
15662}
15663
15664impl ::fidl_next::TakeFrom<WireReadableReadRequest> for ReadableReadRequest {
15665 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
15666 ::fidl_next::CopyOptimization::enable_if(
15667 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
15668 )
15669 };
15670
15671 #[inline]
15672 fn take_from(from: &WireReadableReadRequest) -> Self {
15673 Self { count: ::fidl_next::TakeFrom::take_from(&from.count) }
15674 }
15675}
15676
15677#[derive(Clone, Debug)]
15679#[repr(C)]
15680pub struct WireReadableReadRequest {
15681 pub count: ::fidl_next::WireU64,
15682}
15683
15684unsafe impl ::fidl_next::ZeroPadding for WireReadableReadRequest {
15685 #[inline]
15686 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
15687}
15688
15689unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadRequest
15690where
15691 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15692{
15693 fn decode(
15694 slot: ::fidl_next::Slot<'_, Self>,
15695 decoder: &mut ___D,
15696 ) -> Result<(), ::fidl_next::DecodeError> {
15697 ::fidl_next::munge! {
15698 let Self {
15699 mut count,
15700
15701 } = slot;
15702 }
15703
15704 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
15705
15706 Ok(())
15707 }
15708}
15709
15710#[doc = " The maximum I/O size that is allowed for read/write operations using\n byte vectors.\n"]
15711pub const MAX_TRANSFER_SIZE: u64 = 8192;
15712
15713#[doc = " The byte vector type used for read/write operations.\n"]
15714pub type Transfer = Vec<u8>;
15715
15716pub type WireTransfer = ::fidl_next::WireVector<u8>;
15718
15719#[derive(Clone, Debug)]
15720pub struct ReadableReadResponse {
15721 pub data: Vec<u8>,
15722}
15723
15724impl ::fidl_next::Encodable for ReadableReadResponse {
15725 type Encoded = WireReadableReadResponse;
15726}
15727
15728unsafe impl<___E> ::fidl_next::Encode<___E> for ReadableReadResponse
15729where
15730 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15731
15732 ___E: ::fidl_next::Encoder,
15733{
15734 #[inline]
15735 fn encode(
15736 self,
15737 encoder: &mut ___E,
15738 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15739 ) -> Result<(), ::fidl_next::EncodeError> {
15740 ::fidl_next::munge! {
15741 let Self::Encoded {
15742 data,
15743
15744 } = out;
15745 }
15746
15747 ::fidl_next::Encode::encode(self.data, encoder, data)?;
15748
15749 Ok(())
15750 }
15751}
15752
15753unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ReadableReadResponse
15754where
15755 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15756
15757 ___E: ::fidl_next::Encoder,
15758{
15759 #[inline]
15760 fn encode_ref(
15761 &self,
15762 encoder: &mut ___E,
15763 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15764 ) -> Result<(), ::fidl_next::EncodeError> {
15765 ::fidl_next::munge! {
15766 let Self::Encoded {
15767 data,
15768
15769 } = out;
15770 }
15771
15772 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
15773
15774 Ok(())
15775 }
15776}
15777
15778impl ::fidl_next::EncodableOption for Box<ReadableReadResponse> {
15779 type EncodedOption = ::fidl_next::WireBox<WireReadableReadResponse>;
15780}
15781
15782unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ReadableReadResponse>
15783where
15784 ___E: ::fidl_next::Encoder + ?Sized,
15785 ReadableReadResponse: ::fidl_next::Encode<___E>,
15786{
15787 #[inline]
15788 fn encode_option(
15789 this: Option<Self>,
15790 encoder: &mut ___E,
15791 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15792 ) -> Result<(), ::fidl_next::EncodeError> {
15793 if let Some(inner) = this {
15794 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
15795 ::fidl_next::WireBox::encode_present(out);
15796 } else {
15797 ::fidl_next::WireBox::encode_absent(out);
15798 }
15799
15800 Ok(())
15801 }
15802}
15803
15804unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<ReadableReadResponse>
15805where
15806 ___E: ::fidl_next::Encoder + ?Sized,
15807 ReadableReadResponse: ::fidl_next::EncodeRef<___E>,
15808{
15809 #[inline]
15810 fn encode_option_ref(
15811 this: Option<&Self>,
15812 encoder: &mut ___E,
15813 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15814 ) -> Result<(), ::fidl_next::EncodeError> {
15815 if let Some(inner) = this {
15816 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
15817 ::fidl_next::WireBox::encode_present(out);
15818 } else {
15819 ::fidl_next::WireBox::encode_absent(out);
15820 }
15821
15822 Ok(())
15823 }
15824}
15825
15826impl ::fidl_next::TakeFrom<WireReadableReadResponse> for ReadableReadResponse {
15827 #[inline]
15828 fn take_from(from: &WireReadableReadResponse) -> Self {
15829 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
15830 }
15831}
15832
15833#[derive(Debug)]
15835#[repr(C)]
15836pub struct WireReadableReadResponse {
15837 pub data: ::fidl_next::WireVector<u8>,
15838}
15839
15840unsafe impl ::fidl_next::ZeroPadding for WireReadableReadResponse {
15841 #[inline]
15842 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
15843}
15844
15845unsafe impl<___D> ::fidl_next::Decode<___D> for WireReadableReadResponse
15846where
15847 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
15848
15849 ___D: ::fidl_next::Decoder,
15850{
15851 fn decode(
15852 slot: ::fidl_next::Slot<'_, Self>,
15853 decoder: &mut ___D,
15854 ) -> Result<(), ::fidl_next::DecodeError> {
15855 ::fidl_next::munge! {
15856 let Self {
15857 mut data,
15858
15859 } = slot;
15860 }
15861
15862 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
15863
15864 let data = unsafe { data.deref_unchecked() };
15865
15866 if data.len() > 8192 {
15867 return Err(::fidl_next::DecodeError::VectorTooLong {
15868 size: data.len() as u64,
15869 limit: 8192,
15870 });
15871 }
15872
15873 Ok(())
15874 }
15875}
15876
15877#[derive(Debug)]
15879pub struct Readable;
15880
15881pub mod readable {
15882 pub mod prelude {
15883 pub use crate::{
15884 readable, Readable, ReadableClientHandler, ReadableClientSender, ReadableServerHandler,
15885 ReadableServerSender,
15886 };
15887
15888 pub use crate::ReadableReadRequest;
15889
15890 pub use crate::ReadableReadResponse;
15891 }
15892
15893 pub struct Read;
15894
15895 impl ::fidl_next::Method for Read {
15896 const ORDINAL: u64 = 395825947633028830;
15897
15898 type Protocol = crate::Readable;
15899
15900 type Request = crate::WireReadableReadRequest;
15901
15902 type Response =
15903 ::fidl_next::WireResult<crate::WireReadableReadResponse, ::fidl_next::WireI32>;
15904 }
15905}
15906
15907pub trait ReadableClientSender {
15909 type Transport: ::fidl_next::Transport;
15910
15911 #[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"]
15912 fn read<___R>(
15913 &self,
15914 request: ___R,
15915 ) -> Result<
15916 ::fidl_next::ResponseFuture<'_, Self::Transport, readable::Read>,
15917 ::fidl_next::EncodeError,
15918 >
15919 where
15920 ___R: ::fidl_next::Encode<
15921 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
15922 Encoded = crate::WireReadableReadRequest,
15923 >;
15924}
15925
15926impl<___T> ReadableClientSender for ::fidl_next::ClientSender<___T, Readable>
15927where
15928 ___T: ::fidl_next::Transport,
15929{
15930 type Transport = ___T;
15931
15932 #[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"]
15933 fn read<___R>(
15934 &self,
15935 request: ___R,
15936 ) -> Result<
15937 ::fidl_next::ResponseFuture<'_, Self::Transport, readable::Read>,
15938 ::fidl_next::EncodeError,
15939 >
15940 where
15941 ___R: ::fidl_next::Encode<
15942 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
15943 Encoded = crate::WireReadableReadRequest,
15944 >,
15945 {
15946 self.as_untyped()
15947 .send_two_way(395825947633028830, request)
15948 .map(::fidl_next::ResponseFuture::from_untyped)
15949 }
15950}
15951
15952pub trait ReadableClientHandler<___T: ::fidl_next::Transport> {}
15956
15957impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Readable
15958where
15959 ___T: ::fidl_next::Transport,
15960 ___H: ReadableClientHandler<___T>,
15961
15962 <readable::Read as ::fidl_next::Method>::Response:
15963 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
15964{
15965 fn on_event(
15966 handler: &mut ___H,
15967 sender: &::fidl_next::ClientSender<___T, Self>,
15968 ordinal: u64,
15969 buffer: ___T::RecvBuffer,
15970 ) {
15971 match ordinal {
15972 ordinal => {
15973 sender.close();
15974 }
15975 }
15976 }
15977}
15978
15979pub trait ReadableServerSender {
15981 type Transport: ::fidl_next::Transport;
15982}
15983
15984impl<___T> ReadableServerSender for ::fidl_next::ServerSender<___T, Readable>
15985where
15986 ___T: ::fidl_next::Transport,
15987{
15988 type Transport = ___T;
15989}
15990
15991pub trait ReadableServerHandler<___T: ::fidl_next::Transport> {
15995 #[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"]
15996 fn read(
15997 &mut self,
15998 sender: &::fidl_next::ServerSender<___T, Readable>,
15999
16000 request: ::fidl_next::Request<___T, readable::Read>,
16001
16002 responder: ::fidl_next::Responder<readable::Read>,
16003 );
16004}
16005
16006impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Readable
16007where
16008 ___T: ::fidl_next::Transport,
16009 ___H: ReadableServerHandler<___T>,
16010
16011 crate::WireReadableReadRequest:
16012 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16013{
16014 fn on_one_way(
16015 handler: &mut ___H,
16016 sender: &::fidl_next::ServerSender<___T, Self>,
16017 ordinal: u64,
16018 buffer: ___T::RecvBuffer,
16019 ) {
16020 match ordinal {
16021 ordinal => {
16022 sender.close();
16023 }
16024 }
16025 }
16026
16027 fn on_two_way(
16028 handler: &mut ___H,
16029 sender: &::fidl_next::ServerSender<___T, Self>,
16030 ordinal: u64,
16031 buffer: ___T::RecvBuffer,
16032 responder: ::fidl_next::protocol::Responder,
16033 ) {
16034 match ordinal {
16035 395825947633028830 => {
16036 let responder = ::fidl_next::Responder::from_untyped(responder);
16037
16038 match ::fidl_next::DecoderExt::decode(buffer) {
16039 Ok(decoded) => handler.read(sender, decoded, responder),
16040 Err(e) => {
16041 sender.close();
16042 }
16043 }
16044 }
16045
16046 ordinal => {
16047 sender.close();
16048 }
16049 }
16050 }
16051}
16052
16053#[derive(Clone, Debug)]
16054pub struct WritableWriteRequest {
16055 pub data: Vec<u8>,
16056}
16057
16058impl ::fidl_next::Encodable for WritableWriteRequest {
16059 type Encoded = WireWritableWriteRequest;
16060}
16061
16062unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteRequest
16063where
16064 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16065
16066 ___E: ::fidl_next::Encoder,
16067{
16068 #[inline]
16069 fn encode(
16070 self,
16071 encoder: &mut ___E,
16072 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16073 ) -> Result<(), ::fidl_next::EncodeError> {
16074 ::fidl_next::munge! {
16075 let Self::Encoded {
16076 data,
16077
16078 } = out;
16079 }
16080
16081 ::fidl_next::Encode::encode(self.data, encoder, data)?;
16082
16083 Ok(())
16084 }
16085}
16086
16087unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteRequest
16088where
16089 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16090
16091 ___E: ::fidl_next::Encoder,
16092{
16093 #[inline]
16094 fn encode_ref(
16095 &self,
16096 encoder: &mut ___E,
16097 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16098 ) -> Result<(), ::fidl_next::EncodeError> {
16099 ::fidl_next::munge! {
16100 let Self::Encoded {
16101 data,
16102
16103 } = out;
16104 }
16105
16106 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
16107
16108 Ok(())
16109 }
16110}
16111
16112impl ::fidl_next::EncodableOption for Box<WritableWriteRequest> {
16113 type EncodedOption = ::fidl_next::WireBox<WireWritableWriteRequest>;
16114}
16115
16116unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<WritableWriteRequest>
16117where
16118 ___E: ::fidl_next::Encoder + ?Sized,
16119 WritableWriteRequest: ::fidl_next::Encode<___E>,
16120{
16121 #[inline]
16122 fn encode_option(
16123 this: Option<Self>,
16124 encoder: &mut ___E,
16125 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16126 ) -> Result<(), ::fidl_next::EncodeError> {
16127 if let Some(inner) = this {
16128 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
16129 ::fidl_next::WireBox::encode_present(out);
16130 } else {
16131 ::fidl_next::WireBox::encode_absent(out);
16132 }
16133
16134 Ok(())
16135 }
16136}
16137
16138unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<WritableWriteRequest>
16139where
16140 ___E: ::fidl_next::Encoder + ?Sized,
16141 WritableWriteRequest: ::fidl_next::EncodeRef<___E>,
16142{
16143 #[inline]
16144 fn encode_option_ref(
16145 this: Option<&Self>,
16146 encoder: &mut ___E,
16147 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16148 ) -> Result<(), ::fidl_next::EncodeError> {
16149 if let Some(inner) = this {
16150 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
16151 ::fidl_next::WireBox::encode_present(out);
16152 } else {
16153 ::fidl_next::WireBox::encode_absent(out);
16154 }
16155
16156 Ok(())
16157 }
16158}
16159
16160impl ::fidl_next::TakeFrom<WireWritableWriteRequest> for WritableWriteRequest {
16161 #[inline]
16162 fn take_from(from: &WireWritableWriteRequest) -> Self {
16163 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
16164 }
16165}
16166
16167#[derive(Debug)]
16169#[repr(C)]
16170pub struct WireWritableWriteRequest {
16171 pub data: ::fidl_next::WireVector<u8>,
16172}
16173
16174unsafe impl ::fidl_next::ZeroPadding for WireWritableWriteRequest {
16175 #[inline]
16176 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
16177}
16178
16179unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteRequest
16180where
16181 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16182
16183 ___D: ::fidl_next::Decoder,
16184{
16185 fn decode(
16186 slot: ::fidl_next::Slot<'_, Self>,
16187 decoder: &mut ___D,
16188 ) -> Result<(), ::fidl_next::DecodeError> {
16189 ::fidl_next::munge! {
16190 let Self {
16191 mut data,
16192
16193 } = slot;
16194 }
16195
16196 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
16197
16198 let data = unsafe { data.deref_unchecked() };
16199
16200 if data.len() > 8192 {
16201 return Err(::fidl_next::DecodeError::VectorTooLong {
16202 size: data.len() as u64,
16203 limit: 8192,
16204 });
16205 }
16206
16207 Ok(())
16208 }
16209}
16210
16211#[derive(Clone, Debug)]
16212#[repr(C)]
16213pub struct WritableWriteResponse {
16214 pub actual_count: u64,
16215}
16216
16217impl ::fidl_next::Encodable for WritableWriteResponse {
16218 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16219 ::fidl_next::CopyOptimization::enable_if(
16220 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16221 )
16222 };
16223
16224 type Encoded = WireWritableWriteResponse;
16225}
16226
16227unsafe impl<___E> ::fidl_next::Encode<___E> for WritableWriteResponse
16228where
16229 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16230{
16231 #[inline]
16232 fn encode(
16233 self,
16234 encoder: &mut ___E,
16235 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16236 ) -> Result<(), ::fidl_next::EncodeError> {
16237 ::fidl_next::munge! {
16238 let Self::Encoded {
16239 actual_count,
16240
16241 } = out;
16242 }
16243
16244 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
16245
16246 Ok(())
16247 }
16248}
16249
16250unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WritableWriteResponse
16251where
16252 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16253{
16254 #[inline]
16255 fn encode_ref(
16256 &self,
16257 encoder: &mut ___E,
16258 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16259 ) -> Result<(), ::fidl_next::EncodeError> {
16260 ::fidl_next::munge! {
16261 let Self::Encoded {
16262 actual_count,
16263
16264 } = out;
16265 }
16266
16267 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
16268
16269 Ok(())
16270 }
16271}
16272
16273impl ::fidl_next::EncodableOption for Box<WritableWriteResponse> {
16274 type EncodedOption = ::fidl_next::WireBox<WireWritableWriteResponse>;
16275}
16276
16277unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<WritableWriteResponse>
16278where
16279 ___E: ::fidl_next::Encoder + ?Sized,
16280 WritableWriteResponse: ::fidl_next::Encode<___E>,
16281{
16282 #[inline]
16283 fn encode_option(
16284 this: Option<Self>,
16285 encoder: &mut ___E,
16286 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16287 ) -> Result<(), ::fidl_next::EncodeError> {
16288 if let Some(inner) = this {
16289 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
16290 ::fidl_next::WireBox::encode_present(out);
16291 } else {
16292 ::fidl_next::WireBox::encode_absent(out);
16293 }
16294
16295 Ok(())
16296 }
16297}
16298
16299unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<WritableWriteResponse>
16300where
16301 ___E: ::fidl_next::Encoder + ?Sized,
16302 WritableWriteResponse: ::fidl_next::EncodeRef<___E>,
16303{
16304 #[inline]
16305 fn encode_option_ref(
16306 this: Option<&Self>,
16307 encoder: &mut ___E,
16308 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16309 ) -> Result<(), ::fidl_next::EncodeError> {
16310 if let Some(inner) = this {
16311 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
16312 ::fidl_next::WireBox::encode_present(out);
16313 } else {
16314 ::fidl_next::WireBox::encode_absent(out);
16315 }
16316
16317 Ok(())
16318 }
16319}
16320
16321impl ::fidl_next::TakeFrom<WireWritableWriteResponse> for WritableWriteResponse {
16322 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16323 ::fidl_next::CopyOptimization::enable_if(
16324 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16325 )
16326 };
16327
16328 #[inline]
16329 fn take_from(from: &WireWritableWriteResponse) -> Self {
16330 Self { actual_count: ::fidl_next::TakeFrom::take_from(&from.actual_count) }
16331 }
16332}
16333
16334#[derive(Clone, Debug)]
16336#[repr(C)]
16337pub struct WireWritableWriteResponse {
16338 pub actual_count: ::fidl_next::WireU64,
16339}
16340
16341unsafe impl ::fidl_next::ZeroPadding for WireWritableWriteResponse {
16342 #[inline]
16343 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
16344}
16345
16346unsafe impl<___D> ::fidl_next::Decode<___D> for WireWritableWriteResponse
16347where
16348 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16349{
16350 fn decode(
16351 slot: ::fidl_next::Slot<'_, Self>,
16352 decoder: &mut ___D,
16353 ) -> Result<(), ::fidl_next::DecodeError> {
16354 ::fidl_next::munge! {
16355 let Self {
16356 mut actual_count,
16357
16358 } = slot;
16359 }
16360
16361 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
16362
16363 Ok(())
16364 }
16365}
16366
16367#[derive(Debug)]
16369pub struct Writable;
16370
16371pub mod writable {
16372 pub mod prelude {
16373 pub use crate::{
16374 writable, Writable, WritableClientHandler, WritableClientSender, WritableServerHandler,
16375 WritableServerSender,
16376 };
16377
16378 pub use crate::WritableWriteRequest;
16379
16380 pub use crate::WritableWriteResponse;
16381 }
16382
16383 pub struct Write;
16384
16385 impl ::fidl_next::Method for Write {
16386 const ORDINAL: u64 = 7651971425397809026;
16387
16388 type Protocol = crate::Writable;
16389
16390 type Request = crate::WireWritableWriteRequest;
16391
16392 type Response =
16393 ::fidl_next::WireResult<crate::WireWritableWriteResponse, ::fidl_next::WireI32>;
16394 }
16395}
16396
16397pub trait WritableClientSender {
16399 type Transport: ::fidl_next::Transport;
16400
16401 #[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"]
16402 fn write<___R>(
16403 &self,
16404 request: ___R,
16405 ) -> Result<
16406 ::fidl_next::ResponseFuture<'_, Self::Transport, writable::Write>,
16407 ::fidl_next::EncodeError,
16408 >
16409 where
16410 ___R: ::fidl_next::Encode<
16411 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
16412 Encoded = crate::WireWritableWriteRequest,
16413 >;
16414}
16415
16416impl<___T> WritableClientSender for ::fidl_next::ClientSender<___T, Writable>
16417where
16418 ___T: ::fidl_next::Transport,
16419{
16420 type Transport = ___T;
16421
16422 #[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"]
16423 fn write<___R>(
16424 &self,
16425 request: ___R,
16426 ) -> Result<
16427 ::fidl_next::ResponseFuture<'_, Self::Transport, writable::Write>,
16428 ::fidl_next::EncodeError,
16429 >
16430 where
16431 ___R: ::fidl_next::Encode<
16432 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
16433 Encoded = crate::WireWritableWriteRequest,
16434 >,
16435 {
16436 self.as_untyped()
16437 .send_two_way(7651971425397809026, request)
16438 .map(::fidl_next::ResponseFuture::from_untyped)
16439 }
16440}
16441
16442pub trait WritableClientHandler<___T: ::fidl_next::Transport> {}
16446
16447impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Writable
16448where
16449 ___T: ::fidl_next::Transport,
16450 ___H: WritableClientHandler<___T>,
16451
16452 <writable::Write as ::fidl_next::Method>::Response:
16453 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16454{
16455 fn on_event(
16456 handler: &mut ___H,
16457 sender: &::fidl_next::ClientSender<___T, Self>,
16458 ordinal: u64,
16459 buffer: ___T::RecvBuffer,
16460 ) {
16461 match ordinal {
16462 ordinal => {
16463 sender.close();
16464 }
16465 }
16466 }
16467}
16468
16469pub trait WritableServerSender {
16471 type Transport: ::fidl_next::Transport;
16472}
16473
16474impl<___T> WritableServerSender for ::fidl_next::ServerSender<___T, Writable>
16475where
16476 ___T: ::fidl_next::Transport,
16477{
16478 type Transport = ___T;
16479}
16480
16481pub trait WritableServerHandler<___T: ::fidl_next::Transport> {
16485 #[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"]
16486 fn write(
16487 &mut self,
16488 sender: &::fidl_next::ServerSender<___T, Writable>,
16489
16490 request: ::fidl_next::Request<___T, writable::Write>,
16491
16492 responder: ::fidl_next::Responder<writable::Write>,
16493 );
16494}
16495
16496impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Writable
16497where
16498 ___T: ::fidl_next::Transport,
16499 ___H: WritableServerHandler<___T>,
16500
16501 crate::WireWritableWriteRequest:
16502 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
16503{
16504 fn on_one_way(
16505 handler: &mut ___H,
16506 sender: &::fidl_next::ServerSender<___T, Self>,
16507 ordinal: u64,
16508 buffer: ___T::RecvBuffer,
16509 ) {
16510 match ordinal {
16511 ordinal => {
16512 sender.close();
16513 }
16514 }
16515 }
16516
16517 fn on_two_way(
16518 handler: &mut ___H,
16519 sender: &::fidl_next::ServerSender<___T, Self>,
16520 ordinal: u64,
16521 buffer: ___T::RecvBuffer,
16522 responder: ::fidl_next::protocol::Responder,
16523 ) {
16524 match ordinal {
16525 7651971425397809026 => {
16526 let responder = ::fidl_next::Responder::from_untyped(responder);
16527
16528 match ::fidl_next::DecoderExt::decode(buffer) {
16529 Ok(decoded) => handler.write(sender, decoded, responder),
16530 Err(e) => {
16531 sender.close();
16532 }
16533 }
16534 }
16535
16536 ordinal => {
16537 sender.close();
16538 }
16539 }
16540 }
16541}
16542
16543#[derive(Clone, Debug)]
16544pub struct FileSeekRequest {
16545 pub origin: crate::SeekOrigin,
16546
16547 pub offset: i64,
16548}
16549
16550impl ::fidl_next::Encodable for FileSeekRequest {
16551 type Encoded = WireFileSeekRequest;
16552}
16553
16554unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekRequest
16555where
16556 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16557{
16558 #[inline]
16559 fn encode(
16560 self,
16561 encoder: &mut ___E,
16562 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16563 ) -> Result<(), ::fidl_next::EncodeError> {
16564 ::fidl_next::munge! {
16565 let Self::Encoded {
16566 origin,
16567 offset,
16568
16569 } = out;
16570 }
16571
16572 ::fidl_next::Encode::encode(self.origin, encoder, origin)?;
16573
16574 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
16575
16576 Ok(())
16577 }
16578}
16579
16580unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekRequest
16581where
16582 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16583{
16584 #[inline]
16585 fn encode_ref(
16586 &self,
16587 encoder: &mut ___E,
16588 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16589 ) -> Result<(), ::fidl_next::EncodeError> {
16590 ::fidl_next::munge! {
16591 let Self::Encoded {
16592 origin,
16593 offset,
16594
16595 } = out;
16596 }
16597
16598 ::fidl_next::EncodeRef::encode_ref(&self.origin, encoder, origin)?;
16599
16600 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
16601
16602 Ok(())
16603 }
16604}
16605
16606impl ::fidl_next::EncodableOption for Box<FileSeekRequest> {
16607 type EncodedOption = ::fidl_next::WireBox<WireFileSeekRequest>;
16608}
16609
16610unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileSeekRequest>
16611where
16612 ___E: ::fidl_next::Encoder + ?Sized,
16613 FileSeekRequest: ::fidl_next::Encode<___E>,
16614{
16615 #[inline]
16616 fn encode_option(
16617 this: Option<Self>,
16618 encoder: &mut ___E,
16619 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16620 ) -> Result<(), ::fidl_next::EncodeError> {
16621 if let Some(inner) = this {
16622 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
16623 ::fidl_next::WireBox::encode_present(out);
16624 } else {
16625 ::fidl_next::WireBox::encode_absent(out);
16626 }
16627
16628 Ok(())
16629 }
16630}
16631
16632unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileSeekRequest>
16633where
16634 ___E: ::fidl_next::Encoder + ?Sized,
16635 FileSeekRequest: ::fidl_next::EncodeRef<___E>,
16636{
16637 #[inline]
16638 fn encode_option_ref(
16639 this: Option<&Self>,
16640 encoder: &mut ___E,
16641 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16642 ) -> Result<(), ::fidl_next::EncodeError> {
16643 if let Some(inner) = this {
16644 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
16645 ::fidl_next::WireBox::encode_present(out);
16646 } else {
16647 ::fidl_next::WireBox::encode_absent(out);
16648 }
16649
16650 Ok(())
16651 }
16652}
16653
16654impl ::fidl_next::TakeFrom<WireFileSeekRequest> for FileSeekRequest {
16655 #[inline]
16656 fn take_from(from: &WireFileSeekRequest) -> Self {
16657 Self {
16658 origin: ::fidl_next::TakeFrom::take_from(&from.origin),
16659
16660 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
16661 }
16662 }
16663}
16664
16665#[derive(Clone, Debug)]
16667#[repr(C)]
16668pub struct WireFileSeekRequest {
16669 pub origin: crate::WireSeekOrigin,
16670
16671 pub offset: ::fidl_next::WireI64,
16672}
16673
16674unsafe impl ::fidl_next::ZeroPadding for WireFileSeekRequest {
16675 #[inline]
16676 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16677 unsafe {
16678 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
16679 }
16680 }
16681}
16682
16683unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekRequest
16684where
16685 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16686{
16687 fn decode(
16688 slot: ::fidl_next::Slot<'_, Self>,
16689 decoder: &mut ___D,
16690 ) -> Result<(), ::fidl_next::DecodeError> {
16691 ::fidl_next::munge! {
16692 let Self {
16693 mut origin,
16694 mut offset,
16695
16696 } = slot;
16697 }
16698
16699 ::fidl_next::Decode::decode(origin.as_mut(), decoder)?;
16700
16701 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
16702
16703 Ok(())
16704 }
16705}
16706
16707#[derive(Clone, Debug)]
16708#[repr(C)]
16709pub struct FileSeekResponse {
16710 pub offset_from_start: u64,
16711}
16712
16713impl ::fidl_next::Encodable for FileSeekResponse {
16714 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16715 ::fidl_next::CopyOptimization::enable_if(
16716 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16717 )
16718 };
16719
16720 type Encoded = WireFileSeekResponse;
16721}
16722
16723unsafe impl<___E> ::fidl_next::Encode<___E> for FileSeekResponse
16724where
16725 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16726{
16727 #[inline]
16728 fn encode(
16729 self,
16730 encoder: &mut ___E,
16731 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16732 ) -> Result<(), ::fidl_next::EncodeError> {
16733 ::fidl_next::munge! {
16734 let Self::Encoded {
16735 offset_from_start,
16736
16737 } = out;
16738 }
16739
16740 ::fidl_next::Encode::encode(self.offset_from_start, encoder, offset_from_start)?;
16741
16742 Ok(())
16743 }
16744}
16745
16746unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSeekResponse
16747where
16748 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16749{
16750 #[inline]
16751 fn encode_ref(
16752 &self,
16753 encoder: &mut ___E,
16754 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16755 ) -> Result<(), ::fidl_next::EncodeError> {
16756 ::fidl_next::munge! {
16757 let Self::Encoded {
16758 offset_from_start,
16759
16760 } = out;
16761 }
16762
16763 ::fidl_next::EncodeRef::encode_ref(&self.offset_from_start, encoder, offset_from_start)?;
16764
16765 Ok(())
16766 }
16767}
16768
16769impl ::fidl_next::EncodableOption for Box<FileSeekResponse> {
16770 type EncodedOption = ::fidl_next::WireBox<WireFileSeekResponse>;
16771}
16772
16773unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileSeekResponse>
16774where
16775 ___E: ::fidl_next::Encoder + ?Sized,
16776 FileSeekResponse: ::fidl_next::Encode<___E>,
16777{
16778 #[inline]
16779 fn encode_option(
16780 this: Option<Self>,
16781 encoder: &mut ___E,
16782 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16783 ) -> Result<(), ::fidl_next::EncodeError> {
16784 if let Some(inner) = this {
16785 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
16786 ::fidl_next::WireBox::encode_present(out);
16787 } else {
16788 ::fidl_next::WireBox::encode_absent(out);
16789 }
16790
16791 Ok(())
16792 }
16793}
16794
16795unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileSeekResponse>
16796where
16797 ___E: ::fidl_next::Encoder + ?Sized,
16798 FileSeekResponse: ::fidl_next::EncodeRef<___E>,
16799{
16800 #[inline]
16801 fn encode_option_ref(
16802 this: Option<&Self>,
16803 encoder: &mut ___E,
16804 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16805 ) -> Result<(), ::fidl_next::EncodeError> {
16806 if let Some(inner) = this {
16807 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
16808 ::fidl_next::WireBox::encode_present(out);
16809 } else {
16810 ::fidl_next::WireBox::encode_absent(out);
16811 }
16812
16813 Ok(())
16814 }
16815}
16816
16817impl ::fidl_next::TakeFrom<WireFileSeekResponse> for FileSeekResponse {
16818 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16819 ::fidl_next::CopyOptimization::enable_if(
16820 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16821 )
16822 };
16823
16824 #[inline]
16825 fn take_from(from: &WireFileSeekResponse) -> Self {
16826 Self { offset_from_start: ::fidl_next::TakeFrom::take_from(&from.offset_from_start) }
16827 }
16828}
16829
16830#[derive(Clone, Debug)]
16832#[repr(C)]
16833pub struct WireFileSeekResponse {
16834 pub offset_from_start: ::fidl_next::WireU64,
16835}
16836
16837unsafe impl ::fidl_next::ZeroPadding for WireFileSeekResponse {
16838 #[inline]
16839 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
16840}
16841
16842unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSeekResponse
16843where
16844 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16845{
16846 fn decode(
16847 slot: ::fidl_next::Slot<'_, Self>,
16848 decoder: &mut ___D,
16849 ) -> Result<(), ::fidl_next::DecodeError> {
16850 ::fidl_next::munge! {
16851 let Self {
16852 mut offset_from_start,
16853
16854 } = slot;
16855 }
16856
16857 ::fidl_next::Decode::decode(offset_from_start.as_mut(), decoder)?;
16858
16859 Ok(())
16860 }
16861}
16862
16863#[derive(Clone, Debug)]
16864#[repr(C)]
16865pub struct FileReadAtRequest {
16866 pub count: u64,
16867
16868 pub offset: u64,
16869}
16870
16871impl ::fidl_next::Encodable for FileReadAtRequest {
16872 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16873 ::fidl_next::CopyOptimization::enable_if(
16874 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
16875 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16876 )
16877 };
16878
16879 type Encoded = WireFileReadAtRequest;
16880}
16881
16882unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtRequest
16883where
16884 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16885{
16886 #[inline]
16887 fn encode(
16888 self,
16889 encoder: &mut ___E,
16890 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16891 ) -> Result<(), ::fidl_next::EncodeError> {
16892 ::fidl_next::munge! {
16893 let Self::Encoded {
16894 count,
16895 offset,
16896
16897 } = out;
16898 }
16899
16900 ::fidl_next::Encode::encode(self.count, encoder, count)?;
16901
16902 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
16903
16904 Ok(())
16905 }
16906}
16907
16908unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtRequest
16909where
16910 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16911{
16912 #[inline]
16913 fn encode_ref(
16914 &self,
16915 encoder: &mut ___E,
16916 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16917 ) -> Result<(), ::fidl_next::EncodeError> {
16918 ::fidl_next::munge! {
16919 let Self::Encoded {
16920 count,
16921 offset,
16922
16923 } = out;
16924 }
16925
16926 ::fidl_next::EncodeRef::encode_ref(&self.count, encoder, count)?;
16927
16928 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
16929
16930 Ok(())
16931 }
16932}
16933
16934impl ::fidl_next::EncodableOption for Box<FileReadAtRequest> {
16935 type EncodedOption = ::fidl_next::WireBox<WireFileReadAtRequest>;
16936}
16937
16938unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileReadAtRequest>
16939where
16940 ___E: ::fidl_next::Encoder + ?Sized,
16941 FileReadAtRequest: ::fidl_next::Encode<___E>,
16942{
16943 #[inline]
16944 fn encode_option(
16945 this: Option<Self>,
16946 encoder: &mut ___E,
16947 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16948 ) -> Result<(), ::fidl_next::EncodeError> {
16949 if let Some(inner) = this {
16950 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
16951 ::fidl_next::WireBox::encode_present(out);
16952 } else {
16953 ::fidl_next::WireBox::encode_absent(out);
16954 }
16955
16956 Ok(())
16957 }
16958}
16959
16960unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileReadAtRequest>
16961where
16962 ___E: ::fidl_next::Encoder + ?Sized,
16963 FileReadAtRequest: ::fidl_next::EncodeRef<___E>,
16964{
16965 #[inline]
16966 fn encode_option_ref(
16967 this: Option<&Self>,
16968 encoder: &mut ___E,
16969 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16970 ) -> Result<(), ::fidl_next::EncodeError> {
16971 if let Some(inner) = this {
16972 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
16973 ::fidl_next::WireBox::encode_present(out);
16974 } else {
16975 ::fidl_next::WireBox::encode_absent(out);
16976 }
16977
16978 Ok(())
16979 }
16980}
16981
16982impl ::fidl_next::TakeFrom<WireFileReadAtRequest> for FileReadAtRequest {
16983 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
16984 ::fidl_next::CopyOptimization::enable_if(
16985 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
16986 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
16987 )
16988 };
16989
16990 #[inline]
16991 fn take_from(from: &WireFileReadAtRequest) -> Self {
16992 Self {
16993 count: ::fidl_next::TakeFrom::take_from(&from.count),
16994
16995 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
16996 }
16997 }
16998}
16999
17000#[derive(Clone, Debug)]
17002#[repr(C)]
17003pub struct WireFileReadAtRequest {
17004 pub count: ::fidl_next::WireU64,
17005
17006 pub offset: ::fidl_next::WireU64,
17007}
17008
17009unsafe impl ::fidl_next::ZeroPadding for WireFileReadAtRequest {
17010 #[inline]
17011 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17012}
17013
17014unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtRequest
17015where
17016 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17017{
17018 fn decode(
17019 slot: ::fidl_next::Slot<'_, Self>,
17020 decoder: &mut ___D,
17021 ) -> Result<(), ::fidl_next::DecodeError> {
17022 ::fidl_next::munge! {
17023 let Self {
17024 mut count,
17025 mut offset,
17026
17027 } = slot;
17028 }
17029
17030 ::fidl_next::Decode::decode(count.as_mut(), decoder)?;
17031
17032 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
17033
17034 Ok(())
17035 }
17036}
17037
17038#[derive(Clone, Debug)]
17039pub struct FileReadAtResponse {
17040 pub data: Vec<u8>,
17041}
17042
17043impl ::fidl_next::Encodable for FileReadAtResponse {
17044 type Encoded = WireFileReadAtResponse;
17045}
17046
17047unsafe impl<___E> ::fidl_next::Encode<___E> for FileReadAtResponse
17048where
17049 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17050
17051 ___E: ::fidl_next::Encoder,
17052{
17053 #[inline]
17054 fn encode(
17055 self,
17056 encoder: &mut ___E,
17057 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17058 ) -> Result<(), ::fidl_next::EncodeError> {
17059 ::fidl_next::munge! {
17060 let Self::Encoded {
17061 data,
17062
17063 } = out;
17064 }
17065
17066 ::fidl_next::Encode::encode(self.data, encoder, data)?;
17067
17068 Ok(())
17069 }
17070}
17071
17072unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileReadAtResponse
17073where
17074 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17075
17076 ___E: ::fidl_next::Encoder,
17077{
17078 #[inline]
17079 fn encode_ref(
17080 &self,
17081 encoder: &mut ___E,
17082 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17083 ) -> Result<(), ::fidl_next::EncodeError> {
17084 ::fidl_next::munge! {
17085 let Self::Encoded {
17086 data,
17087
17088 } = out;
17089 }
17090
17091 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
17092
17093 Ok(())
17094 }
17095}
17096
17097impl ::fidl_next::EncodableOption for Box<FileReadAtResponse> {
17098 type EncodedOption = ::fidl_next::WireBox<WireFileReadAtResponse>;
17099}
17100
17101unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileReadAtResponse>
17102where
17103 ___E: ::fidl_next::Encoder + ?Sized,
17104 FileReadAtResponse: ::fidl_next::Encode<___E>,
17105{
17106 #[inline]
17107 fn encode_option(
17108 this: Option<Self>,
17109 encoder: &mut ___E,
17110 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17111 ) -> Result<(), ::fidl_next::EncodeError> {
17112 if let Some(inner) = this {
17113 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
17114 ::fidl_next::WireBox::encode_present(out);
17115 } else {
17116 ::fidl_next::WireBox::encode_absent(out);
17117 }
17118
17119 Ok(())
17120 }
17121}
17122
17123unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileReadAtResponse>
17124where
17125 ___E: ::fidl_next::Encoder + ?Sized,
17126 FileReadAtResponse: ::fidl_next::EncodeRef<___E>,
17127{
17128 #[inline]
17129 fn encode_option_ref(
17130 this: Option<&Self>,
17131 encoder: &mut ___E,
17132 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17133 ) -> Result<(), ::fidl_next::EncodeError> {
17134 if let Some(inner) = this {
17135 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17136 ::fidl_next::WireBox::encode_present(out);
17137 } else {
17138 ::fidl_next::WireBox::encode_absent(out);
17139 }
17140
17141 Ok(())
17142 }
17143}
17144
17145impl ::fidl_next::TakeFrom<WireFileReadAtResponse> for FileReadAtResponse {
17146 #[inline]
17147 fn take_from(from: &WireFileReadAtResponse) -> Self {
17148 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
17149 }
17150}
17151
17152#[derive(Debug)]
17154#[repr(C)]
17155pub struct WireFileReadAtResponse {
17156 pub data: ::fidl_next::WireVector<u8>,
17157}
17158
17159unsafe impl ::fidl_next::ZeroPadding for WireFileReadAtResponse {
17160 #[inline]
17161 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17162}
17163
17164unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileReadAtResponse
17165where
17166 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17167
17168 ___D: ::fidl_next::Decoder,
17169{
17170 fn decode(
17171 slot: ::fidl_next::Slot<'_, Self>,
17172 decoder: &mut ___D,
17173 ) -> Result<(), ::fidl_next::DecodeError> {
17174 ::fidl_next::munge! {
17175 let Self {
17176 mut data,
17177
17178 } = slot;
17179 }
17180
17181 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
17182
17183 let data = unsafe { data.deref_unchecked() };
17184
17185 if data.len() > 8192 {
17186 return Err(::fidl_next::DecodeError::VectorTooLong {
17187 size: data.len() as u64,
17188 limit: 8192,
17189 });
17190 }
17191
17192 Ok(())
17193 }
17194}
17195
17196#[derive(Clone, Debug)]
17197pub struct FileWriteAtRequest {
17198 pub data: Vec<u8>,
17199
17200 pub offset: u64,
17201}
17202
17203impl ::fidl_next::Encodable for FileWriteAtRequest {
17204 type Encoded = WireFileWriteAtRequest;
17205}
17206
17207unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtRequest
17208where
17209 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17210
17211 ___E: ::fidl_next::Encoder,
17212{
17213 #[inline]
17214 fn encode(
17215 self,
17216 encoder: &mut ___E,
17217 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17218 ) -> Result<(), ::fidl_next::EncodeError> {
17219 ::fidl_next::munge! {
17220 let Self::Encoded {
17221 data,
17222 offset,
17223
17224 } = out;
17225 }
17226
17227 ::fidl_next::Encode::encode(self.data, encoder, data)?;
17228
17229 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
17230
17231 Ok(())
17232 }
17233}
17234
17235unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtRequest
17236where
17237 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17238
17239 ___E: ::fidl_next::Encoder,
17240{
17241 #[inline]
17242 fn encode_ref(
17243 &self,
17244 encoder: &mut ___E,
17245 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17246 ) -> Result<(), ::fidl_next::EncodeError> {
17247 ::fidl_next::munge! {
17248 let Self::Encoded {
17249 data,
17250 offset,
17251
17252 } = out;
17253 }
17254
17255 ::fidl_next::EncodeRef::encode_ref(&self.data, encoder, data)?;
17256
17257 ::fidl_next::EncodeRef::encode_ref(&self.offset, encoder, offset)?;
17258
17259 Ok(())
17260 }
17261}
17262
17263impl ::fidl_next::EncodableOption for Box<FileWriteAtRequest> {
17264 type EncodedOption = ::fidl_next::WireBox<WireFileWriteAtRequest>;
17265}
17266
17267unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileWriteAtRequest>
17268where
17269 ___E: ::fidl_next::Encoder + ?Sized,
17270 FileWriteAtRequest: ::fidl_next::Encode<___E>,
17271{
17272 #[inline]
17273 fn encode_option(
17274 this: Option<Self>,
17275 encoder: &mut ___E,
17276 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17277 ) -> Result<(), ::fidl_next::EncodeError> {
17278 if let Some(inner) = this {
17279 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
17280 ::fidl_next::WireBox::encode_present(out);
17281 } else {
17282 ::fidl_next::WireBox::encode_absent(out);
17283 }
17284
17285 Ok(())
17286 }
17287}
17288
17289unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileWriteAtRequest>
17290where
17291 ___E: ::fidl_next::Encoder + ?Sized,
17292 FileWriteAtRequest: ::fidl_next::EncodeRef<___E>,
17293{
17294 #[inline]
17295 fn encode_option_ref(
17296 this: Option<&Self>,
17297 encoder: &mut ___E,
17298 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17299 ) -> Result<(), ::fidl_next::EncodeError> {
17300 if let Some(inner) = this {
17301 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17302 ::fidl_next::WireBox::encode_present(out);
17303 } else {
17304 ::fidl_next::WireBox::encode_absent(out);
17305 }
17306
17307 Ok(())
17308 }
17309}
17310
17311impl ::fidl_next::TakeFrom<WireFileWriteAtRequest> for FileWriteAtRequest {
17312 #[inline]
17313 fn take_from(from: &WireFileWriteAtRequest) -> Self {
17314 Self {
17315 data: ::fidl_next::TakeFrom::take_from(&from.data),
17316
17317 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
17318 }
17319 }
17320}
17321
17322#[derive(Debug)]
17324#[repr(C)]
17325pub struct WireFileWriteAtRequest {
17326 pub data: ::fidl_next::WireVector<u8>,
17327
17328 pub offset: ::fidl_next::WireU64,
17329}
17330
17331unsafe impl ::fidl_next::ZeroPadding for WireFileWriteAtRequest {
17332 #[inline]
17333 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17334}
17335
17336unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtRequest
17337where
17338 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17339
17340 ___D: ::fidl_next::Decoder,
17341{
17342 fn decode(
17343 slot: ::fidl_next::Slot<'_, Self>,
17344 decoder: &mut ___D,
17345 ) -> Result<(), ::fidl_next::DecodeError> {
17346 ::fidl_next::munge! {
17347 let Self {
17348 mut data,
17349 mut offset,
17350
17351 } = slot;
17352 }
17353
17354 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
17355
17356 let data = unsafe { data.deref_unchecked() };
17357
17358 if data.len() > 8192 {
17359 return Err(::fidl_next::DecodeError::VectorTooLong {
17360 size: data.len() as u64,
17361 limit: 8192,
17362 });
17363 }
17364
17365 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
17366
17367 Ok(())
17368 }
17369}
17370
17371#[derive(Clone, Debug)]
17372#[repr(C)]
17373pub struct FileWriteAtResponse {
17374 pub actual_count: u64,
17375}
17376
17377impl ::fidl_next::Encodable for FileWriteAtResponse {
17378 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17379 ::fidl_next::CopyOptimization::enable_if(
17380 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17381 )
17382 };
17383
17384 type Encoded = WireFileWriteAtResponse;
17385}
17386
17387unsafe impl<___E> ::fidl_next::Encode<___E> for FileWriteAtResponse
17388where
17389 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17390{
17391 #[inline]
17392 fn encode(
17393 self,
17394 encoder: &mut ___E,
17395 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17396 ) -> Result<(), ::fidl_next::EncodeError> {
17397 ::fidl_next::munge! {
17398 let Self::Encoded {
17399 actual_count,
17400
17401 } = out;
17402 }
17403
17404 ::fidl_next::Encode::encode(self.actual_count, encoder, actual_count)?;
17405
17406 Ok(())
17407 }
17408}
17409
17410unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileWriteAtResponse
17411where
17412 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17413{
17414 #[inline]
17415 fn encode_ref(
17416 &self,
17417 encoder: &mut ___E,
17418 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17419 ) -> Result<(), ::fidl_next::EncodeError> {
17420 ::fidl_next::munge! {
17421 let Self::Encoded {
17422 actual_count,
17423
17424 } = out;
17425 }
17426
17427 ::fidl_next::EncodeRef::encode_ref(&self.actual_count, encoder, actual_count)?;
17428
17429 Ok(())
17430 }
17431}
17432
17433impl ::fidl_next::EncodableOption for Box<FileWriteAtResponse> {
17434 type EncodedOption = ::fidl_next::WireBox<WireFileWriteAtResponse>;
17435}
17436
17437unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileWriteAtResponse>
17438where
17439 ___E: ::fidl_next::Encoder + ?Sized,
17440 FileWriteAtResponse: ::fidl_next::Encode<___E>,
17441{
17442 #[inline]
17443 fn encode_option(
17444 this: Option<Self>,
17445 encoder: &mut ___E,
17446 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17447 ) -> Result<(), ::fidl_next::EncodeError> {
17448 if let Some(inner) = this {
17449 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
17450 ::fidl_next::WireBox::encode_present(out);
17451 } else {
17452 ::fidl_next::WireBox::encode_absent(out);
17453 }
17454
17455 Ok(())
17456 }
17457}
17458
17459unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileWriteAtResponse>
17460where
17461 ___E: ::fidl_next::Encoder + ?Sized,
17462 FileWriteAtResponse: ::fidl_next::EncodeRef<___E>,
17463{
17464 #[inline]
17465 fn encode_option_ref(
17466 this: Option<&Self>,
17467 encoder: &mut ___E,
17468 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17469 ) -> Result<(), ::fidl_next::EncodeError> {
17470 if let Some(inner) = this {
17471 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17472 ::fidl_next::WireBox::encode_present(out);
17473 } else {
17474 ::fidl_next::WireBox::encode_absent(out);
17475 }
17476
17477 Ok(())
17478 }
17479}
17480
17481impl ::fidl_next::TakeFrom<WireFileWriteAtResponse> for FileWriteAtResponse {
17482 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17483 ::fidl_next::CopyOptimization::enable_if(
17484 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17485 )
17486 };
17487
17488 #[inline]
17489 fn take_from(from: &WireFileWriteAtResponse) -> Self {
17490 Self { actual_count: ::fidl_next::TakeFrom::take_from(&from.actual_count) }
17491 }
17492}
17493
17494#[derive(Clone, Debug)]
17496#[repr(C)]
17497pub struct WireFileWriteAtResponse {
17498 pub actual_count: ::fidl_next::WireU64,
17499}
17500
17501unsafe impl ::fidl_next::ZeroPadding for WireFileWriteAtResponse {
17502 #[inline]
17503 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17504}
17505
17506unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileWriteAtResponse
17507where
17508 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17509{
17510 fn decode(
17511 slot: ::fidl_next::Slot<'_, Self>,
17512 decoder: &mut ___D,
17513 ) -> Result<(), ::fidl_next::DecodeError> {
17514 ::fidl_next::munge! {
17515 let Self {
17516 mut actual_count,
17517
17518 } = slot;
17519 }
17520
17521 ::fidl_next::Decode::decode(actual_count.as_mut(), decoder)?;
17522
17523 Ok(())
17524 }
17525}
17526
17527#[derive(Clone, Debug)]
17528#[repr(C)]
17529pub struct FileResizeRequest {
17530 pub length: u64,
17531}
17532
17533impl ::fidl_next::Encodable for FileResizeRequest {
17534 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17535 ::fidl_next::CopyOptimization::enable_if(
17536 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17537 )
17538 };
17539
17540 type Encoded = WireFileResizeRequest;
17541}
17542
17543unsafe impl<___E> ::fidl_next::Encode<___E> for FileResizeRequest
17544where
17545 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17546{
17547 #[inline]
17548 fn encode(
17549 self,
17550 encoder: &mut ___E,
17551 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17552 ) -> Result<(), ::fidl_next::EncodeError> {
17553 ::fidl_next::munge! {
17554 let Self::Encoded {
17555 length,
17556
17557 } = out;
17558 }
17559
17560 ::fidl_next::Encode::encode(self.length, encoder, length)?;
17561
17562 Ok(())
17563 }
17564}
17565
17566unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileResizeRequest
17567where
17568 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17569{
17570 #[inline]
17571 fn encode_ref(
17572 &self,
17573 encoder: &mut ___E,
17574 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17575 ) -> Result<(), ::fidl_next::EncodeError> {
17576 ::fidl_next::munge! {
17577 let Self::Encoded {
17578 length,
17579
17580 } = out;
17581 }
17582
17583 ::fidl_next::EncodeRef::encode_ref(&self.length, encoder, length)?;
17584
17585 Ok(())
17586 }
17587}
17588
17589impl ::fidl_next::EncodableOption for Box<FileResizeRequest> {
17590 type EncodedOption = ::fidl_next::WireBox<WireFileResizeRequest>;
17591}
17592
17593unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileResizeRequest>
17594where
17595 ___E: ::fidl_next::Encoder + ?Sized,
17596 FileResizeRequest: ::fidl_next::Encode<___E>,
17597{
17598 #[inline]
17599 fn encode_option(
17600 this: Option<Self>,
17601 encoder: &mut ___E,
17602 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17603 ) -> Result<(), ::fidl_next::EncodeError> {
17604 if let Some(inner) = this {
17605 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
17606 ::fidl_next::WireBox::encode_present(out);
17607 } else {
17608 ::fidl_next::WireBox::encode_absent(out);
17609 }
17610
17611 Ok(())
17612 }
17613}
17614
17615unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileResizeRequest>
17616where
17617 ___E: ::fidl_next::Encoder + ?Sized,
17618 FileResizeRequest: ::fidl_next::EncodeRef<___E>,
17619{
17620 #[inline]
17621 fn encode_option_ref(
17622 this: Option<&Self>,
17623 encoder: &mut ___E,
17624 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17625 ) -> Result<(), ::fidl_next::EncodeError> {
17626 if let Some(inner) = this {
17627 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17628 ::fidl_next::WireBox::encode_present(out);
17629 } else {
17630 ::fidl_next::WireBox::encode_absent(out);
17631 }
17632
17633 Ok(())
17634 }
17635}
17636
17637impl ::fidl_next::TakeFrom<WireFileResizeRequest> for FileResizeRequest {
17638 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17639 ::fidl_next::CopyOptimization::enable_if(
17640 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17641 )
17642 };
17643
17644 #[inline]
17645 fn take_from(from: &WireFileResizeRequest) -> Self {
17646 Self { length: ::fidl_next::TakeFrom::take_from(&from.length) }
17647 }
17648}
17649
17650#[derive(Clone, Debug)]
17652#[repr(C)]
17653pub struct WireFileResizeRequest {
17654 pub length: ::fidl_next::WireU64,
17655}
17656
17657unsafe impl ::fidl_next::ZeroPadding for WireFileResizeRequest {
17658 #[inline]
17659 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17660}
17661
17662unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileResizeRequest
17663where
17664 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17665{
17666 fn decode(
17667 slot: ::fidl_next::Slot<'_, Self>,
17668 decoder: &mut ___D,
17669 ) -> Result<(), ::fidl_next::DecodeError> {
17670 ::fidl_next::munge! {
17671 let Self {
17672 mut length,
17673
17674 } = slot;
17675 }
17676
17677 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
17678
17679 Ok(())
17680 }
17681}
17682
17683pub type FileResizeResponse = ();
17684
17685pub type WireFileResizeResponse = ();
17687
17688::fidl_next::bitflags! {
17689 #[derive(
17690 Clone,
17691 Copy,
17692 Debug,
17693 PartialEq,
17694 Eq,
17695 Hash,
17696 )]
17697 pub struct VmoFlags: u32 {
17698 #[doc = " Requests that the VMO be readable.\n"]const READ = 1;
17699 #[doc = " Requests that the VMO be writable.\n"]const WRITE = 2;
17700 #[doc = " Request that the VMO be executable.\n"]const EXECUTE = 4;
17701 #[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;
17702 #[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;
17703
17704 }
17705}
17706
17707impl ::fidl_next::Encodable for VmoFlags {
17708 type Encoded = WireVmoFlags;
17709}
17710
17711unsafe impl<___E> ::fidl_next::Encode<___E> for VmoFlags
17712where
17713 ___E: ?Sized,
17714{
17715 #[inline]
17716 fn encode(
17717 self,
17718 encoder: &mut ___E,
17719 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17720 ) -> Result<(), ::fidl_next::EncodeError> {
17721 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
17722 }
17723}
17724
17725unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VmoFlags
17726where
17727 ___E: ?Sized,
17728{
17729 #[inline]
17730 fn encode_ref(
17731 &self,
17732 _: &mut ___E,
17733 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17734 ) -> Result<(), ::fidl_next::EncodeError> {
17735 ::fidl_next::munge!(let WireVmoFlags { value } = out);
17736 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
17737 Ok(())
17738 }
17739}
17740
17741impl ::core::convert::From<WireVmoFlags> for VmoFlags {
17742 fn from(wire: WireVmoFlags) -> Self {
17743 Self::from_bits_retain(u32::from(wire.value))
17744 }
17745}
17746
17747impl ::fidl_next::TakeFrom<WireVmoFlags> for VmoFlags {
17748 #[inline]
17749 fn take_from(from: &WireVmoFlags) -> Self {
17750 Self::from(*from)
17751 }
17752}
17753
17754#[derive(Clone, Copy, Debug)]
17756#[repr(transparent)]
17757pub struct WireVmoFlags {
17758 value: ::fidl_next::WireU32,
17759}
17760
17761unsafe impl ::fidl_next::ZeroPadding for WireVmoFlags {
17762 #[inline]
17763 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
17764 }
17766}
17767
17768unsafe impl<___D> ::fidl_next::Decode<___D> for WireVmoFlags
17769where
17770 ___D: ?Sized,
17771{
17772 fn decode(
17773 slot: ::fidl_next::Slot<'_, Self>,
17774 _: &mut ___D,
17775 ) -> Result<(), ::fidl_next::DecodeError> {
17776 ::fidl_next::munge!(let Self { value } = slot);
17777 let set = u32::from(*value);
17778 if set & !VmoFlags::all().bits() != 0 {
17779 return Err(::fidl_next::DecodeError::InvalidBits {
17780 expected: VmoFlags::all().bits() as usize,
17781 actual: set as usize,
17782 });
17783 }
17784
17785 Ok(())
17786 }
17787}
17788
17789impl ::core::convert::From<VmoFlags> for WireVmoFlags {
17790 fn from(natural: VmoFlags) -> Self {
17791 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
17792 }
17793}
17794
17795#[derive(Clone, Debug)]
17796#[repr(C)]
17797pub struct FileGetBackingMemoryRequest {
17798 pub flags: crate::VmoFlags,
17799}
17800
17801impl ::fidl_next::Encodable for FileGetBackingMemoryRequest {
17802 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17803 ::fidl_next::CopyOptimization::enable_if(
17804 true && <crate::VmoFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17805 )
17806 };
17807
17808 type Encoded = WireFileGetBackingMemoryRequest;
17809}
17810
17811unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryRequest
17812where
17813 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17814{
17815 #[inline]
17816 fn encode(
17817 self,
17818 encoder: &mut ___E,
17819 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17820 ) -> Result<(), ::fidl_next::EncodeError> {
17821 ::fidl_next::munge! {
17822 let Self::Encoded {
17823 flags,
17824
17825 } = out;
17826 }
17827
17828 ::fidl_next::Encode::encode(self.flags, encoder, flags)?;
17829
17830 Ok(())
17831 }
17832}
17833
17834unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileGetBackingMemoryRequest
17835where
17836 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17837{
17838 #[inline]
17839 fn encode_ref(
17840 &self,
17841 encoder: &mut ___E,
17842 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17843 ) -> Result<(), ::fidl_next::EncodeError> {
17844 ::fidl_next::munge! {
17845 let Self::Encoded {
17846 flags,
17847
17848 } = out;
17849 }
17850
17851 ::fidl_next::EncodeRef::encode_ref(&self.flags, encoder, flags)?;
17852
17853 Ok(())
17854 }
17855}
17856
17857impl ::fidl_next::EncodableOption for Box<FileGetBackingMemoryRequest> {
17858 type EncodedOption = ::fidl_next::WireBox<WireFileGetBackingMemoryRequest>;
17859}
17860
17861unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileGetBackingMemoryRequest>
17862where
17863 ___E: ::fidl_next::Encoder + ?Sized,
17864 FileGetBackingMemoryRequest: ::fidl_next::Encode<___E>,
17865{
17866 #[inline]
17867 fn encode_option(
17868 this: Option<Self>,
17869 encoder: &mut ___E,
17870 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17871 ) -> Result<(), ::fidl_next::EncodeError> {
17872 if let Some(inner) = this {
17873 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
17874 ::fidl_next::WireBox::encode_present(out);
17875 } else {
17876 ::fidl_next::WireBox::encode_absent(out);
17877 }
17878
17879 Ok(())
17880 }
17881}
17882
17883unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FileGetBackingMemoryRequest>
17884where
17885 ___E: ::fidl_next::Encoder + ?Sized,
17886 FileGetBackingMemoryRequest: ::fidl_next::EncodeRef<___E>,
17887{
17888 #[inline]
17889 fn encode_option_ref(
17890 this: Option<&Self>,
17891 encoder: &mut ___E,
17892 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17893 ) -> Result<(), ::fidl_next::EncodeError> {
17894 if let Some(inner) = this {
17895 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
17896 ::fidl_next::WireBox::encode_present(out);
17897 } else {
17898 ::fidl_next::WireBox::encode_absent(out);
17899 }
17900
17901 Ok(())
17902 }
17903}
17904
17905impl ::fidl_next::TakeFrom<WireFileGetBackingMemoryRequest> for FileGetBackingMemoryRequest {
17906 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17907 ::fidl_next::CopyOptimization::enable_if(
17908 true && <crate::VmoFlags as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
17909 )
17910 };
17911
17912 #[inline]
17913 fn take_from(from: &WireFileGetBackingMemoryRequest) -> Self {
17914 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
17915 }
17916}
17917
17918#[derive(Clone, Debug)]
17920#[repr(C)]
17921pub struct WireFileGetBackingMemoryRequest {
17922 pub flags: crate::WireVmoFlags,
17923}
17924
17925unsafe impl ::fidl_next::ZeroPadding for WireFileGetBackingMemoryRequest {
17926 #[inline]
17927 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
17928}
17929
17930unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryRequest
17931where
17932 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17933{
17934 fn decode(
17935 slot: ::fidl_next::Slot<'_, Self>,
17936 decoder: &mut ___D,
17937 ) -> Result<(), ::fidl_next::DecodeError> {
17938 ::fidl_next::munge! {
17939 let Self {
17940 mut flags,
17941
17942 } = slot;
17943 }
17944
17945 ::fidl_next::Decode::decode(flags.as_mut(), decoder)?;
17946
17947 Ok(())
17948 }
17949}
17950
17951#[derive(Debug)]
17952#[repr(C)]
17953pub struct FileGetBackingMemoryResponse {
17954 pub vmo: ::fidl_next::fuchsia::zx::Handle,
17955}
17956
17957impl ::fidl_next::Encodable for FileGetBackingMemoryResponse {
17958 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
17959 ::fidl_next::CopyOptimization::enable_if(
17960 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
17961 .is_enabled(),
17962 )
17963 };
17964
17965 type Encoded = WireFileGetBackingMemoryResponse;
17966}
17967
17968unsafe impl<___E> ::fidl_next::Encode<___E> for FileGetBackingMemoryResponse
17969where
17970 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17971
17972 ___E: ::fidl_next::fuchsia::HandleEncoder,
17973{
17974 #[inline]
17975 fn encode(
17976 self,
17977 encoder: &mut ___E,
17978 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17979 ) -> Result<(), ::fidl_next::EncodeError> {
17980 ::fidl_next::munge! {
17981 let Self::Encoded {
17982 vmo,
17983
17984 } = out;
17985 }
17986
17987 ::fidl_next::Encode::encode(self.vmo, encoder, vmo)?;
17988
17989 Ok(())
17990 }
17991}
17992
17993impl ::fidl_next::EncodableOption for Box<FileGetBackingMemoryResponse> {
17994 type EncodedOption = ::fidl_next::WireBox<WireFileGetBackingMemoryResponse>;
17995}
17996
17997unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileGetBackingMemoryResponse>
17998where
17999 ___E: ::fidl_next::Encoder + ?Sized,
18000 FileGetBackingMemoryResponse: ::fidl_next::Encode<___E>,
18001{
18002 #[inline]
18003 fn encode_option(
18004 this: Option<Self>,
18005 encoder: &mut ___E,
18006 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18007 ) -> Result<(), ::fidl_next::EncodeError> {
18008 if let Some(inner) = this {
18009 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
18010 ::fidl_next::WireBox::encode_present(out);
18011 } else {
18012 ::fidl_next::WireBox::encode_absent(out);
18013 }
18014
18015 Ok(())
18016 }
18017}
18018
18019impl ::fidl_next::TakeFrom<WireFileGetBackingMemoryResponse> for FileGetBackingMemoryResponse {
18020 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
18021 ::fidl_next::CopyOptimization::enable_if(
18022 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
18023 .is_enabled(),
18024 )
18025 };
18026
18027 #[inline]
18028 fn take_from(from: &WireFileGetBackingMemoryResponse) -> Self {
18029 Self { vmo: ::fidl_next::TakeFrom::take_from(&from.vmo) }
18030 }
18031}
18032
18033#[derive(Debug)]
18035#[repr(C)]
18036pub struct WireFileGetBackingMemoryResponse {
18037 pub vmo: ::fidl_next::fuchsia::WireHandle,
18038}
18039
18040unsafe impl ::fidl_next::ZeroPadding for WireFileGetBackingMemoryResponse {
18041 #[inline]
18042 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18043}
18044
18045unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileGetBackingMemoryResponse
18046where
18047 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18048
18049 ___D: ::fidl_next::fuchsia::HandleDecoder,
18050{
18051 fn decode(
18052 slot: ::fidl_next::Slot<'_, Self>,
18053 decoder: &mut ___D,
18054 ) -> Result<(), ::fidl_next::DecodeError> {
18055 ::fidl_next::munge! {
18056 let Self {
18057 mut vmo,
18058
18059 } = slot;
18060 }
18061
18062 ::fidl_next::Decode::decode(vmo.as_mut(), decoder)?;
18063
18064 Ok(())
18065 }
18066}
18067
18068#[derive(Debug)]
18069pub struct LinkableLinkIntoRequest {
18070 pub dst_parent_token: ::fidl_next::fuchsia::zx::Handle,
18071
18072 pub dst: String,
18073}
18074
18075impl ::fidl_next::Encodable for LinkableLinkIntoRequest {
18076 type Encoded = WireLinkableLinkIntoRequest;
18077}
18078
18079unsafe impl<___E> ::fidl_next::Encode<___E> for LinkableLinkIntoRequest
18080where
18081 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18082
18083 ___E: ::fidl_next::Encoder,
18084
18085 ___E: ::fidl_next::fuchsia::HandleEncoder,
18086{
18087 #[inline]
18088 fn encode(
18089 self,
18090 encoder: &mut ___E,
18091 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18092 ) -> Result<(), ::fidl_next::EncodeError> {
18093 ::fidl_next::munge! {
18094 let Self::Encoded {
18095 dst_parent_token,
18096 dst,
18097
18098 } = out;
18099 }
18100
18101 ::fidl_next::Encode::encode(self.dst_parent_token, encoder, dst_parent_token)?;
18102
18103 ::fidl_next::Encode::encode(self.dst, encoder, dst)?;
18104
18105 Ok(())
18106 }
18107}
18108
18109impl ::fidl_next::EncodableOption for Box<LinkableLinkIntoRequest> {
18110 type EncodedOption = ::fidl_next::WireBox<WireLinkableLinkIntoRequest>;
18111}
18112
18113unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LinkableLinkIntoRequest>
18114where
18115 ___E: ::fidl_next::Encoder + ?Sized,
18116 LinkableLinkIntoRequest: ::fidl_next::Encode<___E>,
18117{
18118 #[inline]
18119 fn encode_option(
18120 this: Option<Self>,
18121 encoder: &mut ___E,
18122 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18123 ) -> Result<(), ::fidl_next::EncodeError> {
18124 if let Some(inner) = this {
18125 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
18126 ::fidl_next::WireBox::encode_present(out);
18127 } else {
18128 ::fidl_next::WireBox::encode_absent(out);
18129 }
18130
18131 Ok(())
18132 }
18133}
18134
18135impl ::fidl_next::TakeFrom<WireLinkableLinkIntoRequest> for LinkableLinkIntoRequest {
18136 #[inline]
18137 fn take_from(from: &WireLinkableLinkIntoRequest) -> Self {
18138 Self {
18139 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
18140
18141 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
18142 }
18143 }
18144}
18145
18146#[derive(Debug)]
18148#[repr(C)]
18149pub struct WireLinkableLinkIntoRequest {
18150 pub dst_parent_token: ::fidl_next::fuchsia::WireHandle,
18151
18152 pub dst: ::fidl_next::WireString,
18153}
18154
18155unsafe impl ::fidl_next::ZeroPadding for WireLinkableLinkIntoRequest {
18156 #[inline]
18157 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18158 unsafe {
18159 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
18160 }
18161 }
18162}
18163
18164unsafe impl<___D> ::fidl_next::Decode<___D> for WireLinkableLinkIntoRequest
18165where
18166 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18167
18168 ___D: ::fidl_next::Decoder,
18169
18170 ___D: ::fidl_next::fuchsia::HandleDecoder,
18171{
18172 fn decode(
18173 slot: ::fidl_next::Slot<'_, Self>,
18174 decoder: &mut ___D,
18175 ) -> Result<(), ::fidl_next::DecodeError> {
18176 ::fidl_next::munge! {
18177 let Self {
18178 mut dst_parent_token,
18179 mut dst,
18180
18181 } = slot;
18182 }
18183
18184 ::fidl_next::Decode::decode(dst_parent_token.as_mut(), decoder)?;
18185
18186 ::fidl_next::Decode::decode(dst.as_mut(), decoder)?;
18187
18188 let dst = unsafe { dst.deref_unchecked() };
18189
18190 if dst.len() > 255 {
18191 return Err(::fidl_next::DecodeError::VectorTooLong {
18192 size: dst.len() as u64,
18193 limit: 255,
18194 });
18195 }
18196
18197 Ok(())
18198 }
18199}
18200
18201pub type LinkableLinkIntoResponse = ();
18202
18203pub type WireLinkableLinkIntoResponse = ();
18205
18206#[derive(Debug)]
18208pub struct Linkable;
18209
18210pub mod linkable {
18211 pub mod prelude {
18212 pub use crate::{
18213 linkable, Linkable, LinkableClientHandler, LinkableClientSender, LinkableServerHandler,
18214 LinkableServerSender,
18215 };
18216
18217 pub use crate::LinkableLinkIntoRequest;
18218
18219 pub use crate::LinkableLinkIntoResponse;
18220 }
18221
18222 pub struct LinkInto;
18223
18224 impl ::fidl_next::Method for LinkInto {
18225 const ORDINAL: u64 = 6121399674497678964;
18226
18227 type Protocol = crate::Linkable;
18228
18229 type Request = crate::WireLinkableLinkIntoRequest;
18230
18231 type Response =
18232 ::fidl_next::WireResult<crate::WireLinkableLinkIntoResponse, ::fidl_next::WireI32>;
18233 }
18234}
18235
18236pub trait LinkableClientSender {
18238 type Transport: ::fidl_next::Transport;
18239
18240 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
18241 fn link_into<___R>(
18242 &self,
18243 request: ___R,
18244 ) -> Result<
18245 ::fidl_next::ResponseFuture<'_, Self::Transport, linkable::LinkInto>,
18246 ::fidl_next::EncodeError,
18247 >
18248 where
18249 ___R: ::fidl_next::Encode<
18250 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
18251 Encoded = crate::WireLinkableLinkIntoRequest,
18252 >;
18253}
18254
18255impl<___T> LinkableClientSender for ::fidl_next::ClientSender<___T, Linkable>
18256where
18257 ___T: ::fidl_next::Transport,
18258{
18259 type Transport = ___T;
18260
18261 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
18262 fn link_into<___R>(
18263 &self,
18264 request: ___R,
18265 ) -> Result<
18266 ::fidl_next::ResponseFuture<'_, Self::Transport, linkable::LinkInto>,
18267 ::fidl_next::EncodeError,
18268 >
18269 where
18270 ___R: ::fidl_next::Encode<
18271 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
18272 Encoded = crate::WireLinkableLinkIntoRequest,
18273 >,
18274 {
18275 self.as_untyped()
18276 .send_two_way(6121399674497678964, request)
18277 .map(::fidl_next::ResponseFuture::from_untyped)
18278 }
18279}
18280
18281pub trait LinkableClientHandler<___T: ::fidl_next::Transport> {}
18285
18286impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Linkable
18287where
18288 ___T: ::fidl_next::Transport,
18289 ___H: LinkableClientHandler<___T>,
18290
18291 <linkable::LinkInto as ::fidl_next::Method>::Response:
18292 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18293{
18294 fn on_event(
18295 handler: &mut ___H,
18296 sender: &::fidl_next::ClientSender<___T, Self>,
18297 ordinal: u64,
18298 buffer: ___T::RecvBuffer,
18299 ) {
18300 match ordinal {
18301 ordinal => {
18302 sender.close();
18303 }
18304 }
18305 }
18306}
18307
18308pub trait LinkableServerSender {
18310 type Transport: ::fidl_next::Transport;
18311}
18312
18313impl<___T> LinkableServerSender for ::fidl_next::ServerSender<___T, Linkable>
18314where
18315 ___T: ::fidl_next::Transport,
18316{
18317 type Transport = ___T;
18318}
18319
18320pub trait LinkableServerHandler<___T: ::fidl_next::Transport> {
18324 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
18325 fn link_into(
18326 &mut self,
18327 sender: &::fidl_next::ServerSender<___T, Linkable>,
18328
18329 request: ::fidl_next::Request<___T, linkable::LinkInto>,
18330
18331 responder: ::fidl_next::Responder<linkable::LinkInto>,
18332 );
18333}
18334
18335impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Linkable
18336where
18337 ___T: ::fidl_next::Transport,
18338 ___H: LinkableServerHandler<___T>,
18339
18340 crate::WireLinkableLinkIntoRequest:
18341 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
18342{
18343 fn on_one_way(
18344 handler: &mut ___H,
18345 sender: &::fidl_next::ServerSender<___T, Self>,
18346 ordinal: u64,
18347 buffer: ___T::RecvBuffer,
18348 ) {
18349 match ordinal {
18350 ordinal => {
18351 sender.close();
18352 }
18353 }
18354 }
18355
18356 fn on_two_way(
18357 handler: &mut ___H,
18358 sender: &::fidl_next::ServerSender<___T, Self>,
18359 ordinal: u64,
18360 buffer: ___T::RecvBuffer,
18361 responder: ::fidl_next::protocol::Responder,
18362 ) {
18363 match ordinal {
18364 6121399674497678964 => {
18365 let responder = ::fidl_next::Responder::from_untyped(responder);
18366
18367 match ::fidl_next::DecoderExt::decode(buffer) {
18368 Ok(decoded) => handler.link_into(sender, decoded, responder),
18369 Err(e) => {
18370 sender.close();
18371 }
18372 }
18373 }
18374
18375 ordinal => {
18376 sender.close();
18377 }
18378 }
18379 }
18380}
18381
18382#[derive(Debug)]
18383pub struct FileAllocateRequest {
18384 pub offset: u64,
18385
18386 pub length: u64,
18387
18388 pub mode: crate::AllocateMode,
18389}
18390
18391impl ::fidl_next::Encodable for FileAllocateRequest {
18392 type Encoded = WireFileAllocateRequest;
18393}
18394
18395unsafe impl<___E> ::fidl_next::Encode<___E> for FileAllocateRequest
18396where
18397 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18398
18399 ___E: ::fidl_next::fuchsia::HandleEncoder,
18400{
18401 #[inline]
18402 fn encode(
18403 self,
18404 encoder: &mut ___E,
18405 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18406 ) -> Result<(), ::fidl_next::EncodeError> {
18407 ::fidl_next::munge! {
18408 let Self::Encoded {
18409 offset,
18410 length,
18411 mode,
18412
18413 } = out;
18414 }
18415
18416 ::fidl_next::Encode::encode(self.offset, encoder, offset)?;
18417
18418 ::fidl_next::Encode::encode(self.length, encoder, length)?;
18419
18420 ::fidl_next::Encode::encode(self.mode, encoder, mode)?;
18421
18422 Ok(())
18423 }
18424}
18425
18426impl ::fidl_next::EncodableOption for Box<FileAllocateRequest> {
18427 type EncodedOption = ::fidl_next::WireBox<WireFileAllocateRequest>;
18428}
18429
18430unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileAllocateRequest>
18431where
18432 ___E: ::fidl_next::Encoder + ?Sized,
18433 FileAllocateRequest: ::fidl_next::Encode<___E>,
18434{
18435 #[inline]
18436 fn encode_option(
18437 this: Option<Self>,
18438 encoder: &mut ___E,
18439 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18440 ) -> Result<(), ::fidl_next::EncodeError> {
18441 if let Some(inner) = this {
18442 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
18443 ::fidl_next::WireBox::encode_present(out);
18444 } else {
18445 ::fidl_next::WireBox::encode_absent(out);
18446 }
18447
18448 Ok(())
18449 }
18450}
18451
18452impl ::fidl_next::TakeFrom<WireFileAllocateRequest> for FileAllocateRequest {
18453 #[inline]
18454 fn take_from(from: &WireFileAllocateRequest) -> Self {
18455 Self {
18456 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
18457
18458 length: ::fidl_next::TakeFrom::take_from(&from.length),
18459
18460 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
18461 }
18462 }
18463}
18464
18465#[derive(Debug)]
18467#[repr(C)]
18468pub struct WireFileAllocateRequest {
18469 pub offset: ::fidl_next::WireU64,
18470
18471 pub length: ::fidl_next::WireU64,
18472
18473 pub mode: crate::WireAllocateMode,
18474}
18475
18476unsafe impl ::fidl_next::ZeroPadding for WireFileAllocateRequest {
18477 #[inline]
18478 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18479 unsafe {
18480 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
18481 }
18482 }
18483}
18484
18485unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileAllocateRequest
18486where
18487 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18488
18489 ___D: ::fidl_next::fuchsia::HandleDecoder,
18490{
18491 fn decode(
18492 slot: ::fidl_next::Slot<'_, Self>,
18493 decoder: &mut ___D,
18494 ) -> Result<(), ::fidl_next::DecodeError> {
18495 ::fidl_next::munge! {
18496 let Self {
18497 mut offset,
18498 mut length,
18499 mut mode,
18500
18501 } = slot;
18502 }
18503
18504 ::fidl_next::Decode::decode(offset.as_mut(), decoder)?;
18505
18506 ::fidl_next::Decode::decode(length.as_mut(), decoder)?;
18507
18508 ::fidl_next::Decode::decode(mode.as_mut(), decoder)?;
18509
18510 Ok(())
18511 }
18512}
18513
18514pub type FileAllocateResponse = ();
18515
18516pub type WireFileAllocateResponse = ();
18518
18519#[derive(Debug)]
18520pub struct FileEnableVerityRequest {
18521 pub options: crate::VerificationOptions,
18522}
18523
18524impl ::fidl_next::Encodable for FileEnableVerityRequest {
18525 type Encoded = WireFileEnableVerityRequest;
18526}
18527
18528unsafe impl<___E> ::fidl_next::Encode<___E> for FileEnableVerityRequest
18529where
18530 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18531
18532 ___E: ::fidl_next::Encoder,
18533
18534 ___E: ::fidl_next::fuchsia::HandleEncoder,
18535{
18536 #[inline]
18537 fn encode(
18538 self,
18539 encoder: &mut ___E,
18540 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18541 ) -> Result<(), ::fidl_next::EncodeError> {
18542 ::fidl_next::munge! {
18543 let Self::Encoded {
18544 options,
18545
18546 } = out;
18547 }
18548
18549 ::fidl_next::Encode::encode(self.options, encoder, options)?;
18550
18551 Ok(())
18552 }
18553}
18554
18555impl ::fidl_next::EncodableOption for Box<FileEnableVerityRequest> {
18556 type EncodedOption = ::fidl_next::WireBox<WireFileEnableVerityRequest>;
18557}
18558
18559unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileEnableVerityRequest>
18560where
18561 ___E: ::fidl_next::Encoder + ?Sized,
18562 FileEnableVerityRequest: ::fidl_next::Encode<___E>,
18563{
18564 #[inline]
18565 fn encode_option(
18566 this: Option<Self>,
18567 encoder: &mut ___E,
18568 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18569 ) -> Result<(), ::fidl_next::EncodeError> {
18570 if let Some(inner) = this {
18571 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
18572 ::fidl_next::WireBox::encode_present(out);
18573 } else {
18574 ::fidl_next::WireBox::encode_absent(out);
18575 }
18576
18577 Ok(())
18578 }
18579}
18580
18581impl ::fidl_next::TakeFrom<WireFileEnableVerityRequest> for FileEnableVerityRequest {
18582 #[inline]
18583 fn take_from(from: &WireFileEnableVerityRequest) -> Self {
18584 Self { options: ::fidl_next::TakeFrom::take_from(&from.options) }
18585 }
18586}
18587
18588#[derive(Debug)]
18590#[repr(C)]
18591pub struct WireFileEnableVerityRequest {
18592 pub options: crate::WireVerificationOptions,
18593}
18594
18595unsafe impl ::fidl_next::ZeroPadding for WireFileEnableVerityRequest {
18596 #[inline]
18597 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
18598}
18599
18600unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileEnableVerityRequest
18601where
18602 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18603
18604 ___D: ::fidl_next::Decoder,
18605
18606 ___D: ::fidl_next::fuchsia::HandleDecoder,
18607{
18608 fn decode(
18609 slot: ::fidl_next::Slot<'_, Self>,
18610 decoder: &mut ___D,
18611 ) -> Result<(), ::fidl_next::DecodeError> {
18612 ::fidl_next::munge! {
18613 let Self {
18614 mut options,
18615
18616 } = slot;
18617 }
18618
18619 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
18620
18621 Ok(())
18622 }
18623}
18624
18625pub type FileEnableVerityResponse = ();
18626
18627pub type WireFileEnableVerityResponse = ();
18629
18630#[doc = " A [`Node`] which contains a sequence of bytes of definite length.\n\n NOTE: cloned connections do not share their seek offset with their source\n connection.\n"]
18632#[derive(Debug)]
18633pub struct File;
18634
18635impl ::fidl_next::Discoverable for File {
18636 const PROTOCOL_NAME: &'static str = "file";
18637}
18638
18639pub mod file {
18640 pub mod prelude {
18641 pub use crate::{
18642 file, File, FileClientHandler, FileClientSender, FileServerHandler, FileServerSender,
18643 };
18644
18645 pub use crate::AdvisoryLockingAdvisoryLockRequest;
18646
18647 pub use crate::AdvisoryLockingAdvisoryLockResponse;
18648
18649 pub use crate::ConnectionInfo;
18650
18651 pub use crate::ExtendedAttributeValue;
18652
18653 pub use crate::FileAllocateRequest;
18654
18655 pub use crate::FileEnableVerityRequest;
18656
18657 pub use crate::FileGetBackingMemoryRequest;
18658
18659 pub use crate::FileInfo;
18660
18661 pub use crate::FileReadAtRequest;
18662
18663 pub use crate::FileResizeRequest;
18664
18665 pub use crate::FileSeekRequest;
18666
18667 pub use crate::FileWriteAtRequest;
18668
18669 pub use crate::FileAllocateResponse;
18670
18671 pub use crate::FileEnableVerityResponse;
18672
18673 pub use crate::FileGetBackingMemoryResponse;
18674
18675 pub use crate::FileReadAtResponse;
18676
18677 pub use crate::FileResizeResponse;
18678
18679 pub use crate::FileSeekResponse;
18680
18681 pub use crate::FileWriteAtResponse;
18682
18683 pub use crate::LinkableLinkIntoRequest;
18684
18685 pub use crate::LinkableLinkIntoResponse;
18686
18687 pub use crate::MutableNodeAttributes;
18688
18689 pub use crate::NodeAttributes2;
18690
18691 pub use crate::NodeDeprecatedCloneRequest;
18692
18693 pub use crate::NodeDeprecatedGetFlagsResponse;
18694
18695 pub use crate::NodeDeprecatedSetFlagsRequest;
18696
18697 pub use crate::NodeDeprecatedSetFlagsResponse;
18698
18699 pub use crate::NodeGetAttrResponse;
18700
18701 pub use crate::NodeGetAttributesRequest;
18702
18703 pub use crate::NodeGetExtendedAttributeRequest;
18704
18705 pub use crate::NodeListExtendedAttributesRequest;
18706
18707 pub use crate::NodeOnOpenRequest;
18708
18709 pub use crate::NodeQueryFilesystemResponse;
18710
18711 pub use crate::NodeRemoveExtendedAttributeRequest;
18712
18713 pub use crate::NodeSetAttrRequest;
18714
18715 pub use crate::NodeSetAttrResponse;
18716
18717 pub use crate::NodeSetExtendedAttributeRequest;
18718
18719 pub use crate::NodeSetFlagsRequest;
18720
18721 pub use crate::NodeGetFlagsResponse;
18722
18723 pub use crate::NodeRemoveExtendedAttributeResponse;
18724
18725 pub use crate::NodeSetExtendedAttributeResponse;
18726
18727 pub use crate::NodeSetFlagsResponse;
18728
18729 pub use crate::NodeSyncResponse;
18730
18731 pub use crate::NodeUpdateAttributesResponse;
18732
18733 pub use crate::ReadableReadRequest;
18734
18735 pub use crate::ReadableReadResponse;
18736
18737 pub use crate::Representation;
18738
18739 pub use crate::WritableWriteRequest;
18740
18741 pub use crate::WritableWriteResponse;
18742
18743 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
18744
18745 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
18746
18747 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
18748 }
18749
18750 pub struct AdvisoryLock;
18751
18752 impl ::fidl_next::Method for AdvisoryLock {
18753 const ORDINAL: u64 = 7992130864415541162;
18754
18755 type Protocol = crate::File;
18756
18757 type Request = crate::WireAdvisoryLockingAdvisoryLockRequest;
18758
18759 type Response = ::fidl_next::WireResult<
18760 crate::WireAdvisoryLockingAdvisoryLockResponse,
18761 ::fidl_next::WireI32,
18762 >;
18763 }
18764
18765 pub struct LinkInto;
18766
18767 impl ::fidl_next::Method for LinkInto {
18768 const ORDINAL: u64 = 6121399674497678964;
18769
18770 type Protocol = crate::File;
18771
18772 type Request = crate::WireLinkableLinkIntoRequest;
18773
18774 type Response =
18775 ::fidl_next::WireResult<crate::WireLinkableLinkIntoResponse, ::fidl_next::WireI32>;
18776 }
18777
18778 pub struct Clone;
18779
18780 impl ::fidl_next::Method for Clone {
18781 const ORDINAL: u64 = 2366825959783828089;
18782
18783 type Protocol = crate::File;
18784
18785 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
18786
18787 type Response = ::fidl_next::Never;
18788 }
18789
18790 pub struct Close;
18791
18792 impl ::fidl_next::Method for Close {
18793 const ORDINAL: u64 = 6540867515453498750;
18794
18795 type Protocol = crate::File;
18796
18797 type Request = ();
18798
18799 type Response = ::fidl_next::WireResult<
18800 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
18801 ::fidl_next::WireI32,
18802 >;
18803 }
18804
18805 pub struct Query;
18806
18807 impl ::fidl_next::Method for Query {
18808 const ORDINAL: u64 = 2763219980499352582;
18809
18810 type Protocol = crate::File;
18811
18812 type Request = ();
18813
18814 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse;
18815 }
18816
18817 pub struct DeprecatedClone;
18818
18819 impl ::fidl_next::Method for DeprecatedClone {
18820 const ORDINAL: u64 = 6512600400724287855;
18821
18822 type Protocol = crate::File;
18823
18824 type Request = crate::WireNodeDeprecatedCloneRequest;
18825
18826 type Response = ::fidl_next::Never;
18827 }
18828
18829 pub struct OnOpen;
18830
18831 impl ::fidl_next::Method for OnOpen {
18832 const ORDINAL: u64 = 9207534335756671346;
18833
18834 type Protocol = crate::File;
18835
18836 type Request = ::fidl_next::Never;
18837
18838 type Response = crate::WireNodeOnOpenRequest;
18839 }
18840
18841 pub struct GetAttr;
18842
18843 impl ::fidl_next::Method for GetAttr {
18844 const ORDINAL: u64 = 8689798978500614909;
18845
18846 type Protocol = crate::File;
18847
18848 type Request = ();
18849
18850 type Response = crate::WireNodeGetAttrResponse;
18851 }
18852
18853 pub struct SetAttr;
18854
18855 impl ::fidl_next::Method for SetAttr {
18856 const ORDINAL: u64 = 4721673413776871238;
18857
18858 type Protocol = crate::File;
18859
18860 type Request = crate::WireNodeSetAttrRequest;
18861
18862 type Response = crate::WireNodeSetAttrResponse;
18863 }
18864
18865 pub struct DeprecatedGetFlags;
18866
18867 impl ::fidl_next::Method for DeprecatedGetFlags {
18868 const ORDINAL: u64 = 6595803110182632097;
18869
18870 type Protocol = crate::File;
18871
18872 type Request = ();
18873
18874 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
18875 }
18876
18877 pub struct DeprecatedSetFlags;
18878
18879 impl ::fidl_next::Method for DeprecatedSetFlags {
18880 const ORDINAL: u64 = 5950864159036794675;
18881
18882 type Protocol = crate::File;
18883
18884 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
18885
18886 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
18887 }
18888
18889 pub struct GetFlags;
18890
18891 impl ::fidl_next::Method for GetFlags {
18892 const ORDINAL: u64 = 105530239381466147;
18893
18894 type Protocol = crate::File;
18895
18896 type Request = ();
18897
18898 type Response =
18899 ::fidl_next::WireFlexibleResult<crate::WireNodeGetFlagsResponse, ::fidl_next::WireI32>;
18900 }
18901
18902 pub struct SetFlags;
18903
18904 impl ::fidl_next::Method for SetFlags {
18905 const ORDINAL: u64 = 6172186066099445416;
18906
18907 type Protocol = crate::File;
18908
18909 type Request = crate::WireNodeSetFlagsRequest;
18910
18911 type Response =
18912 ::fidl_next::WireFlexibleResult<crate::WireNodeSetFlagsResponse, ::fidl_next::WireI32>;
18913 }
18914
18915 pub struct QueryFilesystem;
18916
18917 impl ::fidl_next::Method for QueryFilesystem {
18918 const ORDINAL: u64 = 8013111122914313744;
18919
18920 type Protocol = crate::File;
18921
18922 type Request = ();
18923
18924 type Response = crate::WireNodeQueryFilesystemResponse;
18925 }
18926
18927 pub struct OnRepresentation;
18928
18929 impl ::fidl_next::Method for OnRepresentation {
18930 const ORDINAL: u64 = 6679970090861613324;
18931
18932 type Protocol = crate::File;
18933
18934 type Request = ::fidl_next::Never;
18935
18936 type Response = crate::WireRepresentation;
18937 }
18938
18939 pub struct GetConnectionInfo;
18940
18941 impl ::fidl_next::Method for GetConnectionInfo {
18942 const ORDINAL: u64 = 6362521381364198667;
18943
18944 type Protocol = crate::File;
18945
18946 type Request = ();
18947
18948 type Response = crate::WireConnectionInfo;
18949 }
18950
18951 pub struct GetAttributes;
18952
18953 impl ::fidl_next::Method for GetAttributes {
18954 const ORDINAL: u64 = 4414537700416816443;
18955
18956 type Protocol = crate::File;
18957
18958 type Request = crate::WireNodeGetAttributesRequest;
18959
18960 type Response = ::fidl_next::WireResult<crate::WireNodeAttributes2, ::fidl_next::WireI32>;
18961 }
18962
18963 pub struct UpdateAttributes;
18964
18965 impl ::fidl_next::Method for UpdateAttributes {
18966 const ORDINAL: u64 = 3677402239314018056;
18967
18968 type Protocol = crate::File;
18969
18970 type Request = crate::WireMutableNodeAttributes;
18971
18972 type Response =
18973 ::fidl_next::WireResult<crate::WireNodeUpdateAttributesResponse, ::fidl_next::WireI32>;
18974 }
18975
18976 pub struct Sync;
18977
18978 impl ::fidl_next::Method for Sync {
18979 const ORDINAL: u64 = 3196473584242777161;
18980
18981 type Protocol = crate::File;
18982
18983 type Request = ();
18984
18985 type Response = ::fidl_next::WireResult<crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
18986 }
18987
18988 pub struct ListExtendedAttributes;
18989
18990 impl ::fidl_next::Method for ListExtendedAttributes {
18991 const ORDINAL: u64 = 5431626189872037072;
18992
18993 type Protocol = crate::File;
18994
18995 type Request = crate::WireNodeListExtendedAttributesRequest;
18996
18997 type Response = ::fidl_next::Never;
18998 }
18999
19000 pub struct GetExtendedAttribute;
19001
19002 impl ::fidl_next::Method for GetExtendedAttribute {
19003 const ORDINAL: u64 = 5043930208506967771;
19004
19005 type Protocol = crate::File;
19006
19007 type Request = crate::WireNodeGetExtendedAttributeRequest;
19008
19009 type Response =
19010 ::fidl_next::WireResult<crate::WireExtendedAttributeValue, ::fidl_next::WireI32>;
19011 }
19012
19013 pub struct SetExtendedAttribute;
19014
19015 impl ::fidl_next::Method for SetExtendedAttribute {
19016 const ORDINAL: u64 = 5374223046099989052;
19017
19018 type Protocol = crate::File;
19019
19020 type Request = crate::WireNodeSetExtendedAttributeRequest;
19021
19022 type Response = ::fidl_next::WireResult<
19023 crate::WireNodeSetExtendedAttributeResponse,
19024 ::fidl_next::WireI32,
19025 >;
19026 }
19027
19028 pub struct RemoveExtendedAttribute;
19029
19030 impl ::fidl_next::Method for RemoveExtendedAttribute {
19031 const ORDINAL: u64 = 8794297771444732717;
19032
19033 type Protocol = crate::File;
19034
19035 type Request = crate::WireNodeRemoveExtendedAttributeRequest;
19036
19037 type Response = ::fidl_next::WireResult<
19038 crate::WireNodeRemoveExtendedAttributeResponse,
19039 ::fidl_next::WireI32,
19040 >;
19041 }
19042
19043 pub struct Read;
19044
19045 impl ::fidl_next::Method for Read {
19046 const ORDINAL: u64 = 395825947633028830;
19047
19048 type Protocol = crate::File;
19049
19050 type Request = crate::WireReadableReadRequest;
19051
19052 type Response =
19053 ::fidl_next::WireResult<crate::WireReadableReadResponse, ::fidl_next::WireI32>;
19054 }
19055
19056 pub struct Write;
19057
19058 impl ::fidl_next::Method for Write {
19059 const ORDINAL: u64 = 7651971425397809026;
19060
19061 type Protocol = crate::File;
19062
19063 type Request = crate::WireWritableWriteRequest;
19064
19065 type Response =
19066 ::fidl_next::WireResult<crate::WireWritableWriteResponse, ::fidl_next::WireI32>;
19067 }
19068
19069 pub struct Describe;
19070
19071 impl ::fidl_next::Method for Describe {
19072 const ORDINAL: u64 = 7545125870053689020;
19073
19074 type Protocol = crate::File;
19075
19076 type Request = ();
19077
19078 type Response = crate::WireFileInfo;
19079 }
19080
19081 pub struct Seek;
19082
19083 impl ::fidl_next::Method for Seek {
19084 const ORDINAL: u64 = 8649041485622956551;
19085
19086 type Protocol = crate::File;
19087
19088 type Request = crate::WireFileSeekRequest;
19089
19090 type Response = ::fidl_next::WireResult<crate::WireFileSeekResponse, ::fidl_next::WireI32>;
19091 }
19092
19093 pub struct ReadAt;
19094
19095 impl ::fidl_next::Method for ReadAt {
19096 const ORDINAL: u64 = 1587416148701180478;
19097
19098 type Protocol = crate::File;
19099
19100 type Request = crate::WireFileReadAtRequest;
19101
19102 type Response =
19103 ::fidl_next::WireResult<crate::WireFileReadAtResponse, ::fidl_next::WireI32>;
19104 }
19105
19106 pub struct WriteAt;
19107
19108 impl ::fidl_next::Method for WriteAt {
19109 const ORDINAL: u64 = 8736683935131400491;
19110
19111 type Protocol = crate::File;
19112
19113 type Request = crate::WireFileWriteAtRequest;
19114
19115 type Response =
19116 ::fidl_next::WireResult<crate::WireFileWriteAtResponse, ::fidl_next::WireI32>;
19117 }
19118
19119 pub struct Resize;
19120
19121 impl ::fidl_next::Method for Resize {
19122 const ORDINAL: u64 = 3134648685270758458;
19123
19124 type Protocol = crate::File;
19125
19126 type Request = crate::WireFileResizeRequest;
19127
19128 type Response =
19129 ::fidl_next::WireResult<crate::WireFileResizeResponse, ::fidl_next::WireI32>;
19130 }
19131
19132 pub struct GetBackingMemory;
19133
19134 impl ::fidl_next::Method for GetBackingMemory {
19135 const ORDINAL: u64 = 46911652864194091;
19136
19137 type Protocol = crate::File;
19138
19139 type Request = crate::WireFileGetBackingMemoryRequest;
19140
19141 type Response =
19142 ::fidl_next::WireResult<crate::WireFileGetBackingMemoryResponse, ::fidl_next::WireI32>;
19143 }
19144
19145 pub struct Allocate;
19146
19147 impl ::fidl_next::Method for Allocate {
19148 const ORDINAL: u64 = 8645235848064269614;
19149
19150 type Protocol = crate::File;
19151
19152 type Request = crate::WireFileAllocateRequest;
19153
19154 type Response =
19155 ::fidl_next::WireFlexibleResult<crate::WireFileAllocateResponse, ::fidl_next::WireI32>;
19156 }
19157
19158 pub struct EnableVerity;
19159
19160 impl ::fidl_next::Method for EnableVerity {
19161 const ORDINAL: u64 = 3189145313204943035;
19162
19163 type Protocol = crate::File;
19164
19165 type Request = crate::WireFileEnableVerityRequest;
19166
19167 type Response = ::fidl_next::WireFlexibleResult<
19168 crate::WireFileEnableVerityResponse,
19169 ::fidl_next::WireI32,
19170 >;
19171 }
19172}
19173
19174pub trait FileClientSender {
19176 type Transport: ::fidl_next::Transport;
19177
19178 #[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"]
19179 fn advisory_lock<___R>(
19180 &self,
19181 request: ___R,
19182 ) -> Result<
19183 ::fidl_next::ResponseFuture<'_, Self::Transport, file::AdvisoryLock>,
19184 ::fidl_next::EncodeError,
19185 >
19186 where
19187 ___R: ::fidl_next::Encode<
19188 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19189 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
19190 >;
19191
19192 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
19193 fn link_into<___R>(
19194 &self,
19195 request: ___R,
19196 ) -> Result<
19197 ::fidl_next::ResponseFuture<'_, Self::Transport, file::LinkInto>,
19198 ::fidl_next::EncodeError,
19199 >
19200 where
19201 ___R: ::fidl_next::Encode<
19202 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19203 Encoded = crate::WireLinkableLinkIntoRequest,
19204 >;
19205
19206 fn clone<___R>(
19207 &self,
19208 request: ___R,
19209 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19210 where
19211 ___R: ::fidl_next::Encode<
19212 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19213 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
19214 >;
19215
19216 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
19217 fn close(
19218 &self,
19219 ) -> Result<
19220 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Close>,
19221 ::fidl_next::EncodeError,
19222 >;
19223
19224 fn query(
19225 &self,
19226 ) -> Result<
19227 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Query>,
19228 ::fidl_next::EncodeError,
19229 >;
19230
19231 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
19232 fn deprecated_clone<___R>(
19233 &self,
19234 request: ___R,
19235 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19236 where
19237 ___R: ::fidl_next::Encode<
19238 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19239 Encoded = crate::WireNodeDeprecatedCloneRequest,
19240 >;
19241
19242 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
19243 fn get_attr(
19244 &self,
19245 ) -> Result<
19246 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetAttr>,
19247 ::fidl_next::EncodeError,
19248 >;
19249
19250 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
19251 fn set_attr<___R>(
19252 &self,
19253 request: ___R,
19254 ) -> Result<
19255 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetAttr>,
19256 ::fidl_next::EncodeError,
19257 >
19258 where
19259 ___R: ::fidl_next::Encode<
19260 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19261 Encoded = crate::WireNodeSetAttrRequest,
19262 >;
19263
19264 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
19265 fn deprecated_get_flags(
19266 &self,
19267 ) -> Result<
19268 ::fidl_next::ResponseFuture<'_, Self::Transport, file::DeprecatedGetFlags>,
19269 ::fidl_next::EncodeError,
19270 >;
19271
19272 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
19273 fn deprecated_set_flags<___R>(
19274 &self,
19275 request: ___R,
19276 ) -> Result<
19277 ::fidl_next::ResponseFuture<'_, Self::Transport, file::DeprecatedSetFlags>,
19278 ::fidl_next::EncodeError,
19279 >
19280 where
19281 ___R: ::fidl_next::Encode<
19282 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19283 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
19284 >;
19285
19286 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
19287 fn get_flags(
19288 &self,
19289 ) -> Result<
19290 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetFlags>,
19291 ::fidl_next::EncodeError,
19292 >;
19293
19294 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
19295 fn set_flags<___R>(
19296 &self,
19297 request: ___R,
19298 ) -> Result<
19299 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetFlags>,
19300 ::fidl_next::EncodeError,
19301 >
19302 where
19303 ___R: ::fidl_next::Encode<
19304 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19305 Encoded = crate::WireNodeSetFlagsRequest,
19306 >;
19307
19308 #[doc = " Query the filesystem for filesystem-specific information.\n"]
19309 fn query_filesystem(
19310 &self,
19311 ) -> Result<
19312 ::fidl_next::ResponseFuture<'_, Self::Transport, file::QueryFilesystem>,
19313 ::fidl_next::EncodeError,
19314 >;
19315
19316 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
19317 fn get_connection_info(
19318 &self,
19319 ) -> Result<
19320 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetConnectionInfo>,
19321 ::fidl_next::EncodeError,
19322 >;
19323
19324 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19325 fn get_attributes<___R>(
19326 &self,
19327 request: ___R,
19328 ) -> Result<
19329 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetAttributes>,
19330 ::fidl_next::EncodeError,
19331 >
19332 where
19333 ___R: ::fidl_next::Encode<
19334 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19335 Encoded = crate::WireNodeGetAttributesRequest,
19336 >;
19337
19338 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19339 fn update_attributes<___R>(
19340 &self,
19341 request: ___R,
19342 ) -> Result<
19343 ::fidl_next::ResponseFuture<'_, Self::Transport, file::UpdateAttributes>,
19344 ::fidl_next::EncodeError,
19345 >
19346 where
19347 ___R: ::fidl_next::Encode<
19348 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19349 Encoded = crate::WireMutableNodeAttributes,
19350 >;
19351
19352 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
19353 fn sync(
19354 &self,
19355 ) -> Result<
19356 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Sync>,
19357 ::fidl_next::EncodeError,
19358 >;
19359
19360 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19361 fn list_extended_attributes<___R>(
19362 &self,
19363 request: ___R,
19364 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19365 where
19366 ___R: ::fidl_next::Encode<
19367 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19368 Encoded = crate::WireNodeListExtendedAttributesRequest,
19369 >;
19370
19371 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19372 fn get_extended_attribute<___R>(
19373 &self,
19374 request: ___R,
19375 ) -> Result<
19376 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetExtendedAttribute>,
19377 ::fidl_next::EncodeError,
19378 >
19379 where
19380 ___R: ::fidl_next::Encode<
19381 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19382 Encoded = crate::WireNodeGetExtendedAttributeRequest,
19383 >;
19384
19385 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19386 fn set_extended_attribute<___R>(
19387 &self,
19388 request: ___R,
19389 ) -> Result<
19390 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetExtendedAttribute>,
19391 ::fidl_next::EncodeError,
19392 >
19393 where
19394 ___R: ::fidl_next::Encode<
19395 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19396 Encoded = crate::WireNodeSetExtendedAttributeRequest,
19397 >;
19398
19399 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19400 fn remove_extended_attribute<___R>(
19401 &self,
19402 request: ___R,
19403 ) -> Result<
19404 ::fidl_next::ResponseFuture<'_, Self::Transport, file::RemoveExtendedAttribute>,
19405 ::fidl_next::EncodeError,
19406 >
19407 where
19408 ___R: ::fidl_next::Encode<
19409 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19410 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
19411 >;
19412
19413 #[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"]
19414 fn read<___R>(
19415 &self,
19416 request: ___R,
19417 ) -> Result<
19418 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Read>,
19419 ::fidl_next::EncodeError,
19420 >
19421 where
19422 ___R: ::fidl_next::Encode<
19423 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19424 Encoded = crate::WireReadableReadRequest,
19425 >;
19426
19427 #[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"]
19428 fn write<___R>(
19429 &self,
19430 request: ___R,
19431 ) -> Result<
19432 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Write>,
19433 ::fidl_next::EncodeError,
19434 >
19435 where
19436 ___R: ::fidl_next::Encode<
19437 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19438 Encoded = crate::WireWritableWriteRequest,
19439 >;
19440
19441 fn describe(
19442 &self,
19443 ) -> Result<
19444 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Describe>,
19445 ::fidl_next::EncodeError,
19446 >;
19447
19448 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
19449 fn seek<___R>(
19450 &self,
19451 request: ___R,
19452 ) -> Result<
19453 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Seek>,
19454 ::fidl_next::EncodeError,
19455 >
19456 where
19457 ___R: ::fidl_next::Encode<
19458 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19459 Encoded = crate::WireFileSeekRequest,
19460 >;
19461
19462 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
19463 fn read_at<___R>(
19464 &self,
19465 request: ___R,
19466 ) -> Result<
19467 ::fidl_next::ResponseFuture<'_, Self::Transport, file::ReadAt>,
19468 ::fidl_next::EncodeError,
19469 >
19470 where
19471 ___R: ::fidl_next::Encode<
19472 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19473 Encoded = crate::WireFileReadAtRequest,
19474 >;
19475
19476 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
19477 fn write_at<___R>(
19478 &self,
19479 request: ___R,
19480 ) -> Result<
19481 ::fidl_next::ResponseFuture<'_, Self::Transport, file::WriteAt>,
19482 ::fidl_next::EncodeError,
19483 >
19484 where
19485 ___R: ::fidl_next::Encode<
19486 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19487 Encoded = crate::WireFileWriteAtRequest,
19488 >;
19489
19490 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
19491 fn resize<___R>(
19492 &self,
19493 request: ___R,
19494 ) -> Result<
19495 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Resize>,
19496 ::fidl_next::EncodeError,
19497 >
19498 where
19499 ___R: ::fidl_next::Encode<
19500 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19501 Encoded = crate::WireFileResizeRequest,
19502 >;
19503
19504 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
19505 fn get_backing_memory<___R>(
19506 &self,
19507 request: ___R,
19508 ) -> Result<
19509 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetBackingMemory>,
19510 ::fidl_next::EncodeError,
19511 >
19512 where
19513 ___R: ::fidl_next::Encode<
19514 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19515 Encoded = crate::WireFileGetBackingMemoryRequest,
19516 >;
19517
19518 #[doc = " Pre-allocate on-disk space for this file.\n"]
19519 fn allocate<___R>(
19520 &self,
19521 request: ___R,
19522 ) -> Result<
19523 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Allocate>,
19524 ::fidl_next::EncodeError,
19525 >
19526 where
19527 ___R: ::fidl_next::Encode<
19528 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19529 Encoded = crate::WireFileAllocateRequest,
19530 >;
19531
19532 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
19533 fn enable_verity<___R>(
19534 &self,
19535 request: ___R,
19536 ) -> Result<
19537 ::fidl_next::ResponseFuture<'_, Self::Transport, file::EnableVerity>,
19538 ::fidl_next::EncodeError,
19539 >
19540 where
19541 ___R: ::fidl_next::Encode<
19542 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19543 Encoded = crate::WireFileEnableVerityRequest,
19544 >;
19545}
19546
19547impl<___T> FileClientSender for ::fidl_next::ClientSender<___T, File>
19548where
19549 ___T: ::fidl_next::Transport,
19550{
19551 type Transport = ___T;
19552
19553 #[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"]
19554 fn advisory_lock<___R>(
19555 &self,
19556 request: ___R,
19557 ) -> Result<
19558 ::fidl_next::ResponseFuture<'_, Self::Transport, file::AdvisoryLock>,
19559 ::fidl_next::EncodeError,
19560 >
19561 where
19562 ___R: ::fidl_next::Encode<
19563 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19564 Encoded = crate::WireAdvisoryLockingAdvisoryLockRequest,
19565 >,
19566 {
19567 self.as_untyped()
19568 .send_two_way(7992130864415541162, request)
19569 .map(::fidl_next::ResponseFuture::from_untyped)
19570 }
19571
19572 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
19573 fn link_into<___R>(
19574 &self,
19575 request: ___R,
19576 ) -> Result<
19577 ::fidl_next::ResponseFuture<'_, Self::Transport, file::LinkInto>,
19578 ::fidl_next::EncodeError,
19579 >
19580 where
19581 ___R: ::fidl_next::Encode<
19582 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19583 Encoded = crate::WireLinkableLinkIntoRequest,
19584 >,
19585 {
19586 self.as_untyped()
19587 .send_two_way(6121399674497678964, request)
19588 .map(::fidl_next::ResponseFuture::from_untyped)
19589 }
19590
19591 fn clone<___R>(
19592 &self,
19593 request: ___R,
19594 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19595 where
19596 ___R: ::fidl_next::Encode<
19597 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19598 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
19599 >,
19600 {
19601 self.as_untyped().send_one_way(2366825959783828089, request)
19602 }
19603
19604 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
19605 fn close(
19606 &self,
19607 ) -> Result<
19608 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Close>,
19609 ::fidl_next::EncodeError,
19610 > {
19611 self.as_untyped()
19612 .send_two_way(6540867515453498750, ())
19613 .map(::fidl_next::ResponseFuture::from_untyped)
19614 }
19615
19616 fn query(
19617 &self,
19618 ) -> Result<
19619 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Query>,
19620 ::fidl_next::EncodeError,
19621 > {
19622 self.as_untyped()
19623 .send_two_way(2763219980499352582, ())
19624 .map(::fidl_next::ResponseFuture::from_untyped)
19625 }
19626
19627 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
19628 fn deprecated_clone<___R>(
19629 &self,
19630 request: ___R,
19631 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19632 where
19633 ___R: ::fidl_next::Encode<
19634 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19635 Encoded = crate::WireNodeDeprecatedCloneRequest,
19636 >,
19637 {
19638 self.as_untyped().send_one_way(6512600400724287855, request)
19639 }
19640
19641 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
19642 fn get_attr(
19643 &self,
19644 ) -> Result<
19645 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetAttr>,
19646 ::fidl_next::EncodeError,
19647 > {
19648 self.as_untyped()
19649 .send_two_way(8689798978500614909, ())
19650 .map(::fidl_next::ResponseFuture::from_untyped)
19651 }
19652
19653 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
19654 fn set_attr<___R>(
19655 &self,
19656 request: ___R,
19657 ) -> Result<
19658 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetAttr>,
19659 ::fidl_next::EncodeError,
19660 >
19661 where
19662 ___R: ::fidl_next::Encode<
19663 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19664 Encoded = crate::WireNodeSetAttrRequest,
19665 >,
19666 {
19667 self.as_untyped()
19668 .send_two_way(4721673413776871238, request)
19669 .map(::fidl_next::ResponseFuture::from_untyped)
19670 }
19671
19672 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
19673 fn deprecated_get_flags(
19674 &self,
19675 ) -> Result<
19676 ::fidl_next::ResponseFuture<'_, Self::Transport, file::DeprecatedGetFlags>,
19677 ::fidl_next::EncodeError,
19678 > {
19679 self.as_untyped()
19680 .send_two_way(6595803110182632097, ())
19681 .map(::fidl_next::ResponseFuture::from_untyped)
19682 }
19683
19684 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
19685 fn deprecated_set_flags<___R>(
19686 &self,
19687 request: ___R,
19688 ) -> Result<
19689 ::fidl_next::ResponseFuture<'_, Self::Transport, file::DeprecatedSetFlags>,
19690 ::fidl_next::EncodeError,
19691 >
19692 where
19693 ___R: ::fidl_next::Encode<
19694 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19695 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
19696 >,
19697 {
19698 self.as_untyped()
19699 .send_two_way(5950864159036794675, request)
19700 .map(::fidl_next::ResponseFuture::from_untyped)
19701 }
19702
19703 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
19704 fn get_flags(
19705 &self,
19706 ) -> Result<
19707 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetFlags>,
19708 ::fidl_next::EncodeError,
19709 > {
19710 self.as_untyped()
19711 .send_two_way(105530239381466147, ())
19712 .map(::fidl_next::ResponseFuture::from_untyped)
19713 }
19714
19715 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
19716 fn set_flags<___R>(
19717 &self,
19718 request: ___R,
19719 ) -> Result<
19720 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetFlags>,
19721 ::fidl_next::EncodeError,
19722 >
19723 where
19724 ___R: ::fidl_next::Encode<
19725 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19726 Encoded = crate::WireNodeSetFlagsRequest,
19727 >,
19728 {
19729 self.as_untyped()
19730 .send_two_way(6172186066099445416, request)
19731 .map(::fidl_next::ResponseFuture::from_untyped)
19732 }
19733
19734 #[doc = " Query the filesystem for filesystem-specific information.\n"]
19735 fn query_filesystem(
19736 &self,
19737 ) -> Result<
19738 ::fidl_next::ResponseFuture<'_, Self::Transport, file::QueryFilesystem>,
19739 ::fidl_next::EncodeError,
19740 > {
19741 self.as_untyped()
19742 .send_two_way(8013111122914313744, ())
19743 .map(::fidl_next::ResponseFuture::from_untyped)
19744 }
19745
19746 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
19747 fn get_connection_info(
19748 &self,
19749 ) -> Result<
19750 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetConnectionInfo>,
19751 ::fidl_next::EncodeError,
19752 > {
19753 self.as_untyped()
19754 .send_two_way(6362521381364198667, ())
19755 .map(::fidl_next::ResponseFuture::from_untyped)
19756 }
19757
19758 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19759 fn get_attributes<___R>(
19760 &self,
19761 request: ___R,
19762 ) -> Result<
19763 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetAttributes>,
19764 ::fidl_next::EncodeError,
19765 >
19766 where
19767 ___R: ::fidl_next::Encode<
19768 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19769 Encoded = crate::WireNodeGetAttributesRequest,
19770 >,
19771 {
19772 self.as_untyped()
19773 .send_two_way(4414537700416816443, request)
19774 .map(::fidl_next::ResponseFuture::from_untyped)
19775 }
19776
19777 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19778 fn update_attributes<___R>(
19779 &self,
19780 request: ___R,
19781 ) -> Result<
19782 ::fidl_next::ResponseFuture<'_, Self::Transport, file::UpdateAttributes>,
19783 ::fidl_next::EncodeError,
19784 >
19785 where
19786 ___R: ::fidl_next::Encode<
19787 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19788 Encoded = crate::WireMutableNodeAttributes,
19789 >,
19790 {
19791 self.as_untyped()
19792 .send_two_way(3677402239314018056, request)
19793 .map(::fidl_next::ResponseFuture::from_untyped)
19794 }
19795
19796 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
19797 fn sync(
19798 &self,
19799 ) -> Result<
19800 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Sync>,
19801 ::fidl_next::EncodeError,
19802 > {
19803 self.as_untyped()
19804 .send_two_way(3196473584242777161, ())
19805 .map(::fidl_next::ResponseFuture::from_untyped)
19806 }
19807
19808 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19809 fn list_extended_attributes<___R>(
19810 &self,
19811 request: ___R,
19812 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
19813 where
19814 ___R: ::fidl_next::Encode<
19815 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19816 Encoded = crate::WireNodeListExtendedAttributesRequest,
19817 >,
19818 {
19819 self.as_untyped().send_one_way(5431626189872037072, request)
19820 }
19821
19822 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
19823 fn get_extended_attribute<___R>(
19824 &self,
19825 request: ___R,
19826 ) -> Result<
19827 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetExtendedAttribute>,
19828 ::fidl_next::EncodeError,
19829 >
19830 where
19831 ___R: ::fidl_next::Encode<
19832 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19833 Encoded = crate::WireNodeGetExtendedAttributeRequest,
19834 >,
19835 {
19836 self.as_untyped()
19837 .send_two_way(5043930208506967771, request)
19838 .map(::fidl_next::ResponseFuture::from_untyped)
19839 }
19840
19841 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19842 fn set_extended_attribute<___R>(
19843 &self,
19844 request: ___R,
19845 ) -> Result<
19846 ::fidl_next::ResponseFuture<'_, Self::Transport, file::SetExtendedAttribute>,
19847 ::fidl_next::EncodeError,
19848 >
19849 where
19850 ___R: ::fidl_next::Encode<
19851 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19852 Encoded = crate::WireNodeSetExtendedAttributeRequest,
19853 >,
19854 {
19855 self.as_untyped()
19856 .send_two_way(5374223046099989052, request)
19857 .map(::fidl_next::ResponseFuture::from_untyped)
19858 }
19859
19860 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
19861 fn remove_extended_attribute<___R>(
19862 &self,
19863 request: ___R,
19864 ) -> Result<
19865 ::fidl_next::ResponseFuture<'_, Self::Transport, file::RemoveExtendedAttribute>,
19866 ::fidl_next::EncodeError,
19867 >
19868 where
19869 ___R: ::fidl_next::Encode<
19870 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19871 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
19872 >,
19873 {
19874 self.as_untyped()
19875 .send_two_way(8794297771444732717, request)
19876 .map(::fidl_next::ResponseFuture::from_untyped)
19877 }
19878
19879 #[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"]
19880 fn read<___R>(
19881 &self,
19882 request: ___R,
19883 ) -> Result<
19884 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Read>,
19885 ::fidl_next::EncodeError,
19886 >
19887 where
19888 ___R: ::fidl_next::Encode<
19889 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19890 Encoded = crate::WireReadableReadRequest,
19891 >,
19892 {
19893 self.as_untyped()
19894 .send_two_way(395825947633028830, request)
19895 .map(::fidl_next::ResponseFuture::from_untyped)
19896 }
19897
19898 #[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"]
19899 fn write<___R>(
19900 &self,
19901 request: ___R,
19902 ) -> Result<
19903 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Write>,
19904 ::fidl_next::EncodeError,
19905 >
19906 where
19907 ___R: ::fidl_next::Encode<
19908 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19909 Encoded = crate::WireWritableWriteRequest,
19910 >,
19911 {
19912 self.as_untyped()
19913 .send_two_way(7651971425397809026, request)
19914 .map(::fidl_next::ResponseFuture::from_untyped)
19915 }
19916
19917 fn describe(
19918 &self,
19919 ) -> Result<
19920 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Describe>,
19921 ::fidl_next::EncodeError,
19922 > {
19923 self.as_untyped()
19924 .send_two_way(7545125870053689020, ())
19925 .map(::fidl_next::ResponseFuture::from_untyped)
19926 }
19927
19928 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
19929 fn seek<___R>(
19930 &self,
19931 request: ___R,
19932 ) -> Result<
19933 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Seek>,
19934 ::fidl_next::EncodeError,
19935 >
19936 where
19937 ___R: ::fidl_next::Encode<
19938 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19939 Encoded = crate::WireFileSeekRequest,
19940 >,
19941 {
19942 self.as_untyped()
19943 .send_two_way(8649041485622956551, request)
19944 .map(::fidl_next::ResponseFuture::from_untyped)
19945 }
19946
19947 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
19948 fn read_at<___R>(
19949 &self,
19950 request: ___R,
19951 ) -> Result<
19952 ::fidl_next::ResponseFuture<'_, Self::Transport, file::ReadAt>,
19953 ::fidl_next::EncodeError,
19954 >
19955 where
19956 ___R: ::fidl_next::Encode<
19957 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19958 Encoded = crate::WireFileReadAtRequest,
19959 >,
19960 {
19961 self.as_untyped()
19962 .send_two_way(1587416148701180478, request)
19963 .map(::fidl_next::ResponseFuture::from_untyped)
19964 }
19965
19966 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
19967 fn write_at<___R>(
19968 &self,
19969 request: ___R,
19970 ) -> Result<
19971 ::fidl_next::ResponseFuture<'_, Self::Transport, file::WriteAt>,
19972 ::fidl_next::EncodeError,
19973 >
19974 where
19975 ___R: ::fidl_next::Encode<
19976 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19977 Encoded = crate::WireFileWriteAtRequest,
19978 >,
19979 {
19980 self.as_untyped()
19981 .send_two_way(8736683935131400491, request)
19982 .map(::fidl_next::ResponseFuture::from_untyped)
19983 }
19984
19985 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
19986 fn resize<___R>(
19987 &self,
19988 request: ___R,
19989 ) -> Result<
19990 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Resize>,
19991 ::fidl_next::EncodeError,
19992 >
19993 where
19994 ___R: ::fidl_next::Encode<
19995 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
19996 Encoded = crate::WireFileResizeRequest,
19997 >,
19998 {
19999 self.as_untyped()
20000 .send_two_way(3134648685270758458, request)
20001 .map(::fidl_next::ResponseFuture::from_untyped)
20002 }
20003
20004 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
20005 fn get_backing_memory<___R>(
20006 &self,
20007 request: ___R,
20008 ) -> Result<
20009 ::fidl_next::ResponseFuture<'_, Self::Transport, file::GetBackingMemory>,
20010 ::fidl_next::EncodeError,
20011 >
20012 where
20013 ___R: ::fidl_next::Encode<
20014 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20015 Encoded = crate::WireFileGetBackingMemoryRequest,
20016 >,
20017 {
20018 self.as_untyped()
20019 .send_two_way(46911652864194091, request)
20020 .map(::fidl_next::ResponseFuture::from_untyped)
20021 }
20022
20023 #[doc = " Pre-allocate on-disk space for this file.\n"]
20024 fn allocate<___R>(
20025 &self,
20026 request: ___R,
20027 ) -> Result<
20028 ::fidl_next::ResponseFuture<'_, Self::Transport, file::Allocate>,
20029 ::fidl_next::EncodeError,
20030 >
20031 where
20032 ___R: ::fidl_next::Encode<
20033 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20034 Encoded = crate::WireFileAllocateRequest,
20035 >,
20036 {
20037 self.as_untyped()
20038 .send_two_way(8645235848064269614, request)
20039 .map(::fidl_next::ResponseFuture::from_untyped)
20040 }
20041
20042 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
20043 fn enable_verity<___R>(
20044 &self,
20045 request: ___R,
20046 ) -> Result<
20047 ::fidl_next::ResponseFuture<'_, Self::Transport, file::EnableVerity>,
20048 ::fidl_next::EncodeError,
20049 >
20050 where
20051 ___R: ::fidl_next::Encode<
20052 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20053 Encoded = crate::WireFileEnableVerityRequest,
20054 >,
20055 {
20056 self.as_untyped()
20057 .send_two_way(3189145313204943035, request)
20058 .map(::fidl_next::ResponseFuture::from_untyped)
20059 }
20060}
20061
20062pub trait FileClientHandler<___T: ::fidl_next::Transport> {
20066 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
20067 fn on_open(
20068 &mut self,
20069 sender: &::fidl_next::ClientSender<___T, File>,
20070
20071 event: ::fidl_next::Response<___T, file::OnOpen>,
20072 );
20073
20074 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
20075 fn on_representation(
20076 &mut self,
20077 sender: &::fidl_next::ClientSender<___T, File>,
20078
20079 event: ::fidl_next::Response<___T, file::OnRepresentation>,
20080 );
20081
20082 fn on_unknown_interaction(
20083 &mut self,
20084 sender: &::fidl_next::ClientSender<___T, File>,
20085 ordinal: u64,
20086 ) {
20087 sender.close();
20088 }
20089}
20090
20091impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for File
20092where
20093 ___T: ::fidl_next::Transport,
20094 ___H: FileClientHandler<___T>,
20095
20096 <file::AdvisoryLock as ::fidl_next::Method>::Response:
20097 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20098
20099 <file::LinkInto as ::fidl_next::Method>::Response:
20100 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20101
20102 <file::Close as ::fidl_next::Method>::Response:
20103 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20104
20105 <file::Query as ::fidl_next::Method>::Response:
20106 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20107
20108 <file::OnOpen as ::fidl_next::Method>::Response:
20109 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20110
20111 <file::GetAttr as ::fidl_next::Method>::Response:
20112 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20113
20114 <file::SetAttr as ::fidl_next::Method>::Response:
20115 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20116
20117 <file::DeprecatedGetFlags as ::fidl_next::Method>::Response:
20118 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20119
20120 <file::DeprecatedSetFlags as ::fidl_next::Method>::Response:
20121 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20122
20123 <file::GetFlags as ::fidl_next::Method>::Response:
20124 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20125
20126 <file::SetFlags as ::fidl_next::Method>::Response:
20127 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20128
20129 <file::QueryFilesystem as ::fidl_next::Method>::Response:
20130 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20131
20132 <file::OnRepresentation as ::fidl_next::Method>::Response:
20133 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20134
20135 <file::GetConnectionInfo as ::fidl_next::Method>::Response:
20136 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20137
20138 <file::GetAttributes as ::fidl_next::Method>::Response:
20139 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20140
20141 <file::UpdateAttributes as ::fidl_next::Method>::Response:
20142 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20143
20144 <file::Sync as ::fidl_next::Method>::Response:
20145 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20146
20147 <file::GetExtendedAttribute as ::fidl_next::Method>::Response:
20148 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20149
20150 <file::SetExtendedAttribute as ::fidl_next::Method>::Response:
20151 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20152
20153 <file::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
20154 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20155
20156 <file::Read as ::fidl_next::Method>::Response:
20157 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20158
20159 <file::Write as ::fidl_next::Method>::Response:
20160 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20161
20162 <file::Describe as ::fidl_next::Method>::Response:
20163 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20164
20165 <file::Seek as ::fidl_next::Method>::Response:
20166 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20167
20168 <file::ReadAt as ::fidl_next::Method>::Response:
20169 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20170
20171 <file::WriteAt as ::fidl_next::Method>::Response:
20172 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20173
20174 <file::Resize as ::fidl_next::Method>::Response:
20175 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20176
20177 <file::GetBackingMemory as ::fidl_next::Method>::Response:
20178 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20179
20180 <file::Allocate as ::fidl_next::Method>::Response:
20181 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20182
20183 <file::EnableVerity as ::fidl_next::Method>::Response:
20184 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20185{
20186 fn on_event(
20187 handler: &mut ___H,
20188 sender: &::fidl_next::ClientSender<___T, Self>,
20189 ordinal: u64,
20190 buffer: ___T::RecvBuffer,
20191 ) {
20192 match ordinal {
20193 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
20194 Ok(decoded) => handler.on_open(sender, decoded),
20195 Err(e) => {
20196 sender.close();
20197 }
20198 },
20199
20200 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
20201 Ok(decoded) => handler.on_representation(sender, decoded),
20202 Err(e) => {
20203 sender.close();
20204 }
20205 },
20206
20207 ordinal => handler.on_unknown_interaction(sender, ordinal),
20208 }
20209 }
20210}
20211
20212pub trait FileServerSender {
20214 type Transport: ::fidl_next::Transport;
20215
20216 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
20217
20218 fn on_open<___R>(
20219 &self,
20220 request: ___R,
20221 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
20222 where
20223 ___R: ::fidl_next::Encode<
20224 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20225 Encoded = <file::OnOpen as ::fidl_next::Method>::Response,
20226 >;
20227
20228 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
20229
20230 fn on_representation<___R>(
20231 &self,
20232 request: ___R,
20233 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
20234 where
20235 ___R: ::fidl_next::Encode<
20236 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20237 Encoded = <file::OnRepresentation as ::fidl_next::Method>::Response,
20238 >;
20239}
20240
20241impl<___T> FileServerSender for ::fidl_next::ServerSender<___T, File>
20242where
20243 ___T: ::fidl_next::Transport,
20244{
20245 type Transport = ___T;
20246
20247 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
20248
20249 fn on_open<___R>(
20250 &self,
20251 request: ___R,
20252 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
20253 where
20254 ___R: ::fidl_next::Encode<
20255 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20256 Encoded = <file::OnOpen as ::fidl_next::Method>::Response,
20257 >,
20258 {
20259 self.as_untyped().send_event(9207534335756671346, request)
20260 }
20261
20262 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
20263
20264 fn on_representation<___R>(
20265 &self,
20266 request: ___R,
20267 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
20268 where
20269 ___R: ::fidl_next::Encode<
20270 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
20271 Encoded = <file::OnRepresentation as ::fidl_next::Method>::Response,
20272 >,
20273 {
20274 self.as_untyped().send_event(6679970090861613324, request)
20275 }
20276}
20277
20278pub trait FileServerHandler<___T: ::fidl_next::Transport> {
20282 #[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"]
20283 fn advisory_lock(
20284 &mut self,
20285 sender: &::fidl_next::ServerSender<___T, File>,
20286
20287 request: ::fidl_next::Request<___T, file::AdvisoryLock>,
20288
20289 responder: ::fidl_next::Responder<file::AdvisoryLock>,
20290 );
20291
20292 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
20293 fn link_into(
20294 &mut self,
20295 sender: &::fidl_next::ServerSender<___T, File>,
20296
20297 request: ::fidl_next::Request<___T, file::LinkInto>,
20298
20299 responder: ::fidl_next::Responder<file::LinkInto>,
20300 );
20301
20302 fn clone(
20303 &mut self,
20304 sender: &::fidl_next::ServerSender<___T, File>,
20305
20306 request: ::fidl_next::Request<___T, file::Clone>,
20307 );
20308
20309 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
20310 fn close(
20311 &mut self,
20312 sender: &::fidl_next::ServerSender<___T, File>,
20313
20314 responder: ::fidl_next::Responder<file::Close>,
20315 );
20316
20317 fn query(
20318 &mut self,
20319 sender: &::fidl_next::ServerSender<___T, File>,
20320
20321 responder: ::fidl_next::Responder<file::Query>,
20322 );
20323
20324 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
20325 fn deprecated_clone(
20326 &mut self,
20327 sender: &::fidl_next::ServerSender<___T, File>,
20328
20329 request: ::fidl_next::Request<___T, file::DeprecatedClone>,
20330 );
20331
20332 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
20333 fn get_attr(
20334 &mut self,
20335 sender: &::fidl_next::ServerSender<___T, File>,
20336
20337 responder: ::fidl_next::Responder<file::GetAttr>,
20338 );
20339
20340 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
20341 fn set_attr(
20342 &mut self,
20343 sender: &::fidl_next::ServerSender<___T, File>,
20344
20345 request: ::fidl_next::Request<___T, file::SetAttr>,
20346
20347 responder: ::fidl_next::Responder<file::SetAttr>,
20348 );
20349
20350 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
20351 fn deprecated_get_flags(
20352 &mut self,
20353 sender: &::fidl_next::ServerSender<___T, File>,
20354
20355 responder: ::fidl_next::Responder<file::DeprecatedGetFlags>,
20356 );
20357
20358 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
20359 fn deprecated_set_flags(
20360 &mut self,
20361 sender: &::fidl_next::ServerSender<___T, File>,
20362
20363 request: ::fidl_next::Request<___T, file::DeprecatedSetFlags>,
20364
20365 responder: ::fidl_next::Responder<file::DeprecatedSetFlags>,
20366 );
20367
20368 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
20369 fn get_flags(
20370 &mut self,
20371 sender: &::fidl_next::ServerSender<___T, File>,
20372
20373 responder: ::fidl_next::Responder<file::GetFlags>,
20374 );
20375
20376 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
20377 fn set_flags(
20378 &mut self,
20379 sender: &::fidl_next::ServerSender<___T, File>,
20380
20381 request: ::fidl_next::Request<___T, file::SetFlags>,
20382
20383 responder: ::fidl_next::Responder<file::SetFlags>,
20384 );
20385
20386 #[doc = " Query the filesystem for filesystem-specific information.\n"]
20387 fn query_filesystem(
20388 &mut self,
20389 sender: &::fidl_next::ServerSender<___T, File>,
20390
20391 responder: ::fidl_next::Responder<file::QueryFilesystem>,
20392 );
20393
20394 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
20395 fn get_connection_info(
20396 &mut self,
20397 sender: &::fidl_next::ServerSender<___T, File>,
20398
20399 responder: ::fidl_next::Responder<file::GetConnectionInfo>,
20400 );
20401
20402 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
20403 fn get_attributes(
20404 &mut self,
20405 sender: &::fidl_next::ServerSender<___T, File>,
20406
20407 request: ::fidl_next::Request<___T, file::GetAttributes>,
20408
20409 responder: ::fidl_next::Responder<file::GetAttributes>,
20410 );
20411
20412 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
20413 fn update_attributes(
20414 &mut self,
20415 sender: &::fidl_next::ServerSender<___T, File>,
20416
20417 request: ::fidl_next::Request<___T, file::UpdateAttributes>,
20418
20419 responder: ::fidl_next::Responder<file::UpdateAttributes>,
20420 );
20421
20422 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
20423 fn sync(
20424 &mut self,
20425 sender: &::fidl_next::ServerSender<___T, File>,
20426
20427 responder: ::fidl_next::Responder<file::Sync>,
20428 );
20429
20430 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
20431 fn list_extended_attributes(
20432 &mut self,
20433 sender: &::fidl_next::ServerSender<___T, File>,
20434
20435 request: ::fidl_next::Request<___T, file::ListExtendedAttributes>,
20436 );
20437
20438 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
20439 fn get_extended_attribute(
20440 &mut self,
20441 sender: &::fidl_next::ServerSender<___T, File>,
20442
20443 request: ::fidl_next::Request<___T, file::GetExtendedAttribute>,
20444
20445 responder: ::fidl_next::Responder<file::GetExtendedAttribute>,
20446 );
20447
20448 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
20449 fn set_extended_attribute(
20450 &mut self,
20451 sender: &::fidl_next::ServerSender<___T, File>,
20452
20453 request: ::fidl_next::Request<___T, file::SetExtendedAttribute>,
20454
20455 responder: ::fidl_next::Responder<file::SetExtendedAttribute>,
20456 );
20457
20458 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
20459 fn remove_extended_attribute(
20460 &mut self,
20461 sender: &::fidl_next::ServerSender<___T, File>,
20462
20463 request: ::fidl_next::Request<___T, file::RemoveExtendedAttribute>,
20464
20465 responder: ::fidl_next::Responder<file::RemoveExtendedAttribute>,
20466 );
20467
20468 #[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"]
20469 fn read(
20470 &mut self,
20471 sender: &::fidl_next::ServerSender<___T, File>,
20472
20473 request: ::fidl_next::Request<___T, file::Read>,
20474
20475 responder: ::fidl_next::Responder<file::Read>,
20476 );
20477
20478 #[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"]
20479 fn write(
20480 &mut self,
20481 sender: &::fidl_next::ServerSender<___T, File>,
20482
20483 request: ::fidl_next::Request<___T, file::Write>,
20484
20485 responder: ::fidl_next::Responder<file::Write>,
20486 );
20487
20488 fn describe(
20489 &mut self,
20490 sender: &::fidl_next::ServerSender<___T, File>,
20491
20492 responder: ::fidl_next::Responder<file::Describe>,
20493 );
20494
20495 #[doc = " Moves the offset at which the next invocation of [`Read`] or [`Write`]\n will occur. The seek offset is specific to each file connection.\n\n + request `origin` the reference point where `offset` will be based on.\n + request `offset` the number of bytes to seek.\n - response `offset_from_start` the adjusted seek offset, from the start\n of the file.\n\n This method does not require any rights.\n"]
20496 fn seek(
20497 &mut self,
20498 sender: &::fidl_next::ServerSender<___T, File>,
20499
20500 request: ::fidl_next::Request<___T, file::Seek>,
20501
20502 responder: ::fidl_next::Responder<file::Seek>,
20503 );
20504
20505 #[doc = " Reads up to \'count\' bytes at the provided offset.\n Does not affect the seek offset.\n\n ## Invariants\n\n * The returned `data.length` will never be greater than `count`.\n * If `data.length` is less than `count`, it means that `ReadAt` has hit\n the end of file as part of this operation.\n * If `data.length` is zero while `count` is not, it means that `offset`\n is at or past the end of file, and no data can be read.\n * If `count` is zero, the server should perform all the checks ensuring\n read access without actually reading anything, and return an empty\n `data` vector.\n\n This method requires the [`Rights.READ_BYTES`] right.\n\n Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.\n"]
20506 fn read_at(
20507 &mut self,
20508 sender: &::fidl_next::ServerSender<___T, File>,
20509
20510 request: ::fidl_next::Request<___T, file::ReadAt>,
20511
20512 responder: ::fidl_next::Responder<file::ReadAt>,
20513 );
20514
20515 #[doc = " Writes data at the provided offset.\n Does not affect the seek offset.\n\n The file size may grow if `offset` plus `data.length` is past the\n current end of file.\n\n + request `data` the byte buffer to write to the file.\n + request `offset` the offset from start of the file to begin writing.\n - response `actual_count` the number of bytes written.\n\n ## Invariants\n\n * The returned `actual_count` will never be greater than `data.length`.\n * If the server is unable to write all the data due to e.g. not enough\n space, `actual_count` may be less than `data.length`. If no bytes\n could be written, an error is returned.\n * If `data.length` is zero, the server should perform all the checks\n ensuring write access without mutating the file, and will return a\n successful write of zero bytes.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
20516 fn write_at(
20517 &mut self,
20518 sender: &::fidl_next::ServerSender<___T, File>,
20519
20520 request: ::fidl_next::Request<___T, file::WriteAt>,
20521
20522 responder: ::fidl_next::Responder<file::WriteAt>,
20523 );
20524
20525 #[doc = " Shrinks or grows the file size to \'length\' bytes.\n\n If file size is reduced by this operation, the extra trailing data\'\n is discarded.\n If file size is increased by this operation, the extended area appears\n as if it was zeroed.\n\n This method requires the [`Rights.WRITE_BYTES`] right.\n"]
20526 fn resize(
20527 &mut self,
20528 sender: &::fidl_next::ServerSender<___T, File>,
20529
20530 request: ::fidl_next::Request<___T, file::Resize>,
20531
20532 responder: ::fidl_next::Responder<file::Resize>,
20533 );
20534
20535 #[doc = " Acquires a [`zx.Handle:VMO`] representing this file, if there is one,\n with the requested access rights.\n\n Implementations are not required to implement files backed by VMOs so\n this request may fail. Additionally, implementations may only support\n a certain subset of the flags. Clients should be prepared with fallback\n behavior if this request fails.\n\n If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the\n implementation is free to choose the semantics of the returned VMO.\n\n + request `flags` a [`VmoFlags`] indicating the desired mode of access.\n - response `vmo` the requested [`zx.Handle:VMO`].\n * error a [`zx.Status`] value indicating the failure.\n\n This method requires the following rights:\n\n * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].\n * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].\n * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].\n"]
20536 fn get_backing_memory(
20537 &mut self,
20538 sender: &::fidl_next::ServerSender<___T, File>,
20539
20540 request: ::fidl_next::Request<___T, file::GetBackingMemory>,
20541
20542 responder: ::fidl_next::Responder<file::GetBackingMemory>,
20543 );
20544
20545 #[doc = " Pre-allocate on-disk space for this file.\n"]
20546 fn allocate(
20547 &mut self,
20548 sender: &::fidl_next::ServerSender<___T, File>,
20549
20550 request: ::fidl_next::Request<___T, file::Allocate>,
20551
20552 responder: ::fidl_next::Responder<file::Allocate>,
20553 );
20554
20555 #[doc = " Enables verification for the file (permanently) which involves computing a merkle tree for\n the file. Forces a flush prior to building the merkle tree to ensure cached data is\n captured. Future reads will be verified against the computed merkle tree and writes will be\n rejected. This method can take some time to complete as it depends on the size of the file.\n This method can be aborted by closing the connection that this method was issued on.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.\n Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.\n Also returns any error that might arise from reading the file, or from flushing the file,\n such as `ZX_ERR_IO`.\n"]
20556 fn enable_verity(
20557 &mut self,
20558 sender: &::fidl_next::ServerSender<___T, File>,
20559
20560 request: ::fidl_next::Request<___T, file::EnableVerity>,
20561
20562 responder: ::fidl_next::Responder<file::EnableVerity>,
20563 );
20564
20565 fn on_unknown_interaction(
20566 &mut self,
20567 sender: &::fidl_next::ServerSender<___T, File>,
20568 ordinal: u64,
20569 ) {
20570 sender.close();
20571 }
20572}
20573
20574impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for File
20575where
20576 ___T: ::fidl_next::Transport,
20577 ___H: FileServerHandler<___T>,
20578
20579 crate::WireAdvisoryLockingAdvisoryLockRequest:
20580 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20581
20582 crate::WireLinkableLinkIntoRequest:
20583 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20584
20585 ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest:
20586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20587
20588 crate::WireNodeDeprecatedCloneRequest:
20589 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20590
20591 crate::WireNodeSetAttrRequest:
20592 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20593
20594 crate::WireNodeDeprecatedSetFlagsRequest:
20595 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20596
20597 crate::WireNodeSetFlagsRequest:
20598 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20599
20600 crate::WireNodeGetAttributesRequest:
20601 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20602
20603 crate::WireMutableNodeAttributes:
20604 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20605
20606 crate::WireNodeListExtendedAttributesRequest:
20607 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20608
20609 crate::WireNodeGetExtendedAttributeRequest:
20610 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20611
20612 crate::WireNodeSetExtendedAttributeRequest:
20613 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20614
20615 crate::WireNodeRemoveExtendedAttributeRequest:
20616 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20617
20618 crate::WireReadableReadRequest:
20619 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20620
20621 crate::WireWritableWriteRequest:
20622 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20623
20624 crate::WireFileSeekRequest: ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20625
20626 crate::WireFileReadAtRequest: ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20627
20628 crate::WireFileWriteAtRequest:
20629 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20630
20631 crate::WireFileResizeRequest: ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20632
20633 crate::WireFileGetBackingMemoryRequest:
20634 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20635
20636 crate::WireFileAllocateRequest:
20637 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20638
20639 crate::WireFileEnableVerityRequest:
20640 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
20641{
20642 fn on_one_way(
20643 handler: &mut ___H,
20644 sender: &::fidl_next::ServerSender<___T, Self>,
20645 ordinal: u64,
20646 buffer: ___T::RecvBuffer,
20647 ) {
20648 match ordinal {
20649 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
20650 Ok(decoded) => handler.clone(sender, decoded),
20651 Err(e) => {
20652 sender.close();
20653 }
20654 },
20655
20656 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
20657 Ok(decoded) => handler.deprecated_clone(sender, decoded),
20658 Err(e) => {
20659 sender.close();
20660 }
20661 },
20662
20663 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
20664 Ok(decoded) => handler.list_extended_attributes(sender, decoded),
20665 Err(e) => {
20666 sender.close();
20667 }
20668 },
20669
20670 ordinal => handler.on_unknown_interaction(sender, ordinal),
20671 }
20672 }
20673
20674 fn on_two_way(
20675 handler: &mut ___H,
20676 sender: &::fidl_next::ServerSender<___T, Self>,
20677 ordinal: u64,
20678 buffer: ___T::RecvBuffer,
20679 responder: ::fidl_next::protocol::Responder,
20680 ) {
20681 match ordinal {
20682 7992130864415541162 => {
20683 let responder = ::fidl_next::Responder::from_untyped(responder);
20684
20685 match ::fidl_next::DecoderExt::decode(buffer) {
20686 Ok(decoded) => handler.advisory_lock(sender, decoded, responder),
20687 Err(e) => {
20688 sender.close();
20689 }
20690 }
20691 }
20692
20693 6121399674497678964 => {
20694 let responder = ::fidl_next::Responder::from_untyped(responder);
20695
20696 match ::fidl_next::DecoderExt::decode(buffer) {
20697 Ok(decoded) => handler.link_into(sender, decoded, responder),
20698 Err(e) => {
20699 sender.close();
20700 }
20701 }
20702 }
20703
20704 6540867515453498750 => {
20705 let responder = ::fidl_next::Responder::from_untyped(responder);
20706
20707 handler.close(sender, responder);
20708 }
20709
20710 2763219980499352582 => {
20711 let responder = ::fidl_next::Responder::from_untyped(responder);
20712
20713 handler.query(sender, responder);
20714 }
20715
20716 8689798978500614909 => {
20717 let responder = ::fidl_next::Responder::from_untyped(responder);
20718
20719 handler.get_attr(sender, responder);
20720 }
20721
20722 4721673413776871238 => {
20723 let responder = ::fidl_next::Responder::from_untyped(responder);
20724
20725 match ::fidl_next::DecoderExt::decode(buffer) {
20726 Ok(decoded) => handler.set_attr(sender, decoded, responder),
20727 Err(e) => {
20728 sender.close();
20729 }
20730 }
20731 }
20732
20733 6595803110182632097 => {
20734 let responder = ::fidl_next::Responder::from_untyped(responder);
20735
20736 handler.deprecated_get_flags(sender, responder);
20737 }
20738
20739 5950864159036794675 => {
20740 let responder = ::fidl_next::Responder::from_untyped(responder);
20741
20742 match ::fidl_next::DecoderExt::decode(buffer) {
20743 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder),
20744 Err(e) => {
20745 sender.close();
20746 }
20747 }
20748 }
20749
20750 105530239381466147 => {
20751 let responder = ::fidl_next::Responder::from_untyped(responder);
20752
20753 handler.get_flags(sender, responder);
20754 }
20755
20756 6172186066099445416 => {
20757 let responder = ::fidl_next::Responder::from_untyped(responder);
20758
20759 match ::fidl_next::DecoderExt::decode(buffer) {
20760 Ok(decoded) => handler.set_flags(sender, decoded, responder),
20761 Err(e) => {
20762 sender.close();
20763 }
20764 }
20765 }
20766
20767 8013111122914313744 => {
20768 let responder = ::fidl_next::Responder::from_untyped(responder);
20769
20770 handler.query_filesystem(sender, responder);
20771 }
20772
20773 6362521381364198667 => {
20774 let responder = ::fidl_next::Responder::from_untyped(responder);
20775
20776 handler.get_connection_info(sender, responder);
20777 }
20778
20779 4414537700416816443 => {
20780 let responder = ::fidl_next::Responder::from_untyped(responder);
20781
20782 match ::fidl_next::DecoderExt::decode(buffer) {
20783 Ok(decoded) => handler.get_attributes(sender, decoded, responder),
20784 Err(e) => {
20785 sender.close();
20786 }
20787 }
20788 }
20789
20790 3677402239314018056 => {
20791 let responder = ::fidl_next::Responder::from_untyped(responder);
20792
20793 match ::fidl_next::DecoderExt::decode(buffer) {
20794 Ok(decoded) => handler.update_attributes(sender, decoded, responder),
20795 Err(e) => {
20796 sender.close();
20797 }
20798 }
20799 }
20800
20801 3196473584242777161 => {
20802 let responder = ::fidl_next::Responder::from_untyped(responder);
20803
20804 handler.sync(sender, responder);
20805 }
20806
20807 5043930208506967771 => {
20808 let responder = ::fidl_next::Responder::from_untyped(responder);
20809
20810 match ::fidl_next::DecoderExt::decode(buffer) {
20811 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder),
20812 Err(e) => {
20813 sender.close();
20814 }
20815 }
20816 }
20817
20818 5374223046099989052 => {
20819 let responder = ::fidl_next::Responder::from_untyped(responder);
20820
20821 match ::fidl_next::DecoderExt::decode(buffer) {
20822 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder),
20823 Err(e) => {
20824 sender.close();
20825 }
20826 }
20827 }
20828
20829 8794297771444732717 => {
20830 let responder = ::fidl_next::Responder::from_untyped(responder);
20831
20832 match ::fidl_next::DecoderExt::decode(buffer) {
20833 Ok(decoded) => handler.remove_extended_attribute(sender, decoded, responder),
20834 Err(e) => {
20835 sender.close();
20836 }
20837 }
20838 }
20839
20840 395825947633028830 => {
20841 let responder = ::fidl_next::Responder::from_untyped(responder);
20842
20843 match ::fidl_next::DecoderExt::decode(buffer) {
20844 Ok(decoded) => handler.read(sender, decoded, responder),
20845 Err(e) => {
20846 sender.close();
20847 }
20848 }
20849 }
20850
20851 7651971425397809026 => {
20852 let responder = ::fidl_next::Responder::from_untyped(responder);
20853
20854 match ::fidl_next::DecoderExt::decode(buffer) {
20855 Ok(decoded) => handler.write(sender, decoded, responder),
20856 Err(e) => {
20857 sender.close();
20858 }
20859 }
20860 }
20861
20862 7545125870053689020 => {
20863 let responder = ::fidl_next::Responder::from_untyped(responder);
20864
20865 handler.describe(sender, responder);
20866 }
20867
20868 8649041485622956551 => {
20869 let responder = ::fidl_next::Responder::from_untyped(responder);
20870
20871 match ::fidl_next::DecoderExt::decode(buffer) {
20872 Ok(decoded) => handler.seek(sender, decoded, responder),
20873 Err(e) => {
20874 sender.close();
20875 }
20876 }
20877 }
20878
20879 1587416148701180478 => {
20880 let responder = ::fidl_next::Responder::from_untyped(responder);
20881
20882 match ::fidl_next::DecoderExt::decode(buffer) {
20883 Ok(decoded) => handler.read_at(sender, decoded, responder),
20884 Err(e) => {
20885 sender.close();
20886 }
20887 }
20888 }
20889
20890 8736683935131400491 => {
20891 let responder = ::fidl_next::Responder::from_untyped(responder);
20892
20893 match ::fidl_next::DecoderExt::decode(buffer) {
20894 Ok(decoded) => handler.write_at(sender, decoded, responder),
20895 Err(e) => {
20896 sender.close();
20897 }
20898 }
20899 }
20900
20901 3134648685270758458 => {
20902 let responder = ::fidl_next::Responder::from_untyped(responder);
20903
20904 match ::fidl_next::DecoderExt::decode(buffer) {
20905 Ok(decoded) => handler.resize(sender, decoded, responder),
20906 Err(e) => {
20907 sender.close();
20908 }
20909 }
20910 }
20911
20912 46911652864194091 => {
20913 let responder = ::fidl_next::Responder::from_untyped(responder);
20914
20915 match ::fidl_next::DecoderExt::decode(buffer) {
20916 Ok(decoded) => handler.get_backing_memory(sender, decoded, responder),
20917 Err(e) => {
20918 sender.close();
20919 }
20920 }
20921 }
20922
20923 8645235848064269614 => {
20924 let responder = ::fidl_next::Responder::from_untyped(responder);
20925
20926 match ::fidl_next::DecoderExt::decode(buffer) {
20927 Ok(decoded) => handler.allocate(sender, decoded, responder),
20928 Err(e) => {
20929 sender.close();
20930 }
20931 }
20932 }
20933
20934 3189145313204943035 => {
20935 let responder = ::fidl_next::Responder::from_untyped(responder);
20936
20937 match ::fidl_next::DecoderExt::decode(buffer) {
20938 Ok(decoded) => handler.enable_verity(sender, decoded, responder),
20939 Err(e) => {
20940 sender.close();
20941 }
20942 }
20943 }
20944
20945 ordinal => handler.on_unknown_interaction(sender, ordinal),
20946 }
20947 }
20948}
20949
20950#[derive(Debug)]
20951#[repr(C)]
20952pub struct FileObject {
20953 pub event: Option<::fidl_next::fuchsia::zx::Handle>,
20954
20955 pub stream: Option<::fidl_next::fuchsia::zx::Handle>,
20956}
20957
20958impl ::fidl_next::Encodable for FileObject {
20959 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
20960 ::fidl_next::CopyOptimization::enable_if(
20961 true
20962
20963 && <
20964 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
20965 >::COPY_OPTIMIZATION.is_enabled()
20966
20967 && <
20968 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
20969 >::COPY_OPTIMIZATION.is_enabled()
20970
20971 )
20972 };
20973
20974 type Encoded = WireFileObject;
20975}
20976
20977unsafe impl<___E> ::fidl_next::Encode<___E> for FileObject
20978where
20979 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20980
20981 ___E: ::fidl_next::fuchsia::HandleEncoder,
20982{
20983 #[inline]
20984 fn encode(
20985 self,
20986 encoder: &mut ___E,
20987 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20988 ) -> Result<(), ::fidl_next::EncodeError> {
20989 ::fidl_next::munge! {
20990 let Self::Encoded {
20991 event,
20992 stream,
20993
20994 } = out;
20995 }
20996
20997 ::fidl_next::Encode::encode(self.event, encoder, event)?;
20998
20999 ::fidl_next::Encode::encode(self.stream, encoder, stream)?;
21000
21001 Ok(())
21002 }
21003}
21004
21005impl ::fidl_next::EncodableOption for Box<FileObject> {
21006 type EncodedOption = ::fidl_next::WireBox<WireFileObject>;
21007}
21008
21009unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FileObject>
21010where
21011 ___E: ::fidl_next::Encoder + ?Sized,
21012 FileObject: ::fidl_next::Encode<___E>,
21013{
21014 #[inline]
21015 fn encode_option(
21016 this: Option<Self>,
21017 encoder: &mut ___E,
21018 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21019 ) -> Result<(), ::fidl_next::EncodeError> {
21020 if let Some(inner) = this {
21021 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
21022 ::fidl_next::WireBox::encode_present(out);
21023 } else {
21024 ::fidl_next::WireBox::encode_absent(out);
21025 }
21026
21027 Ok(())
21028 }
21029}
21030
21031impl ::fidl_next::TakeFrom<WireFileObject> for FileObject {
21032 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
21033 ::fidl_next::CopyOptimization::enable_if(
21034 true
21035
21036 && <
21037 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
21038 >::COPY_OPTIMIZATION.is_enabled()
21039
21040 && <
21041 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
21042 >::COPY_OPTIMIZATION.is_enabled()
21043
21044 )
21045 };
21046
21047 #[inline]
21048 fn take_from(from: &WireFileObject) -> Self {
21049 Self {
21050 event: ::fidl_next::TakeFrom::take_from(&from.event),
21051
21052 stream: ::fidl_next::TakeFrom::take_from(&from.stream),
21053 }
21054 }
21055}
21056
21057#[derive(Debug)]
21059#[repr(C)]
21060pub struct WireFileObject {
21061 pub event: ::fidl_next::fuchsia::WireOptionalHandle,
21062
21063 pub stream: ::fidl_next::fuchsia::WireOptionalHandle,
21064}
21065
21066unsafe impl ::fidl_next::ZeroPadding for WireFileObject {
21067 #[inline]
21068 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21069}
21070
21071unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileObject
21072where
21073 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21074
21075 ___D: ::fidl_next::fuchsia::HandleDecoder,
21076{
21077 fn decode(
21078 slot: ::fidl_next::Slot<'_, Self>,
21079 decoder: &mut ___D,
21080 ) -> Result<(), ::fidl_next::DecodeError> {
21081 ::fidl_next::munge! {
21082 let Self {
21083 mut event,
21084 mut stream,
21085
21086 } = slot;
21087 }
21088
21089 ::fidl_next::Decode::decode(event.as_mut(), decoder)?;
21090
21091 ::fidl_next::Decode::decode(stream.as_mut(), decoder)?;
21092
21093 Ok(())
21094 }
21095}
21096
21097::fidl_next::bitflags! {
21098 #[derive(
21099 Clone,
21100 Copy,
21101 Debug,
21102 PartialEq,
21103 Eq,
21104 Hash,
21105 )]
21106 pub struct FileSignal: u32 {
21107 #[doc = " Indicates the file is ready for reading.\n"]const READABLE = 16777216;
21108 #[doc = " Indicates the file is ready for writing.\n"]const WRITABLE = 33554432;
21109
21110 }
21111}
21112
21113impl ::fidl_next::Encodable for FileSignal {
21114 type Encoded = WireFileSignal;
21115}
21116
21117unsafe impl<___E> ::fidl_next::Encode<___E> for FileSignal
21118where
21119 ___E: ?Sized,
21120{
21121 #[inline]
21122 fn encode(
21123 self,
21124 encoder: &mut ___E,
21125 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21126 ) -> Result<(), ::fidl_next::EncodeError> {
21127 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
21128 }
21129}
21130
21131unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FileSignal
21132where
21133 ___E: ?Sized,
21134{
21135 #[inline]
21136 fn encode_ref(
21137 &self,
21138 _: &mut ___E,
21139 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21140 ) -> Result<(), ::fidl_next::EncodeError> {
21141 ::fidl_next::munge!(let WireFileSignal { value } = out);
21142 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
21143 Ok(())
21144 }
21145}
21146
21147impl ::core::convert::From<WireFileSignal> for FileSignal {
21148 fn from(wire: WireFileSignal) -> Self {
21149 Self::from_bits_retain(u32::from(wire.value))
21150 }
21151}
21152
21153impl ::fidl_next::TakeFrom<WireFileSignal> for FileSignal {
21154 #[inline]
21155 fn take_from(from: &WireFileSignal) -> Self {
21156 Self::from(*from)
21157 }
21158}
21159
21160#[derive(Clone, Copy, Debug)]
21162#[repr(transparent)]
21163pub struct WireFileSignal {
21164 value: ::fidl_next::WireU32,
21165}
21166
21167unsafe impl ::fidl_next::ZeroPadding for WireFileSignal {
21168 #[inline]
21169 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21170 }
21172}
21173
21174unsafe impl<___D> ::fidl_next::Decode<___D> for WireFileSignal
21175where
21176 ___D: ?Sized,
21177{
21178 fn decode(
21179 slot: ::fidl_next::Slot<'_, Self>,
21180 _: &mut ___D,
21181 ) -> Result<(), ::fidl_next::DecodeError> {
21182 ::fidl_next::munge!(let Self { value } = slot);
21183 let set = u32::from(*value);
21184 if set & !FileSignal::all().bits() != 0 {
21185 return Err(::fidl_next::DecodeError::InvalidBits {
21186 expected: FileSignal::all().bits() as usize,
21187 actual: set as usize,
21188 });
21189 }
21190
21191 Ok(())
21192 }
21193}
21194
21195impl ::core::convert::From<FileSignal> for WireFileSignal {
21196 fn from(natural: FileSignal) -> Self {
21197 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
21198 }
21199}
21200
21201pub const MAX_FS_NAME_BUFFER: u64 = 32;
21202
21203#[derive(Clone, Debug)]
21204#[repr(C)]
21205pub struct FilesystemInfo {
21206 pub total_bytes: u64,
21207
21208 pub used_bytes: u64,
21209
21210 pub total_nodes: u64,
21211
21212 pub used_nodes: u64,
21213
21214 pub free_shared_pool_bytes: u64,
21215
21216 pub fs_id: u64,
21217
21218 pub block_size: u32,
21219
21220 pub max_filename_size: u32,
21221
21222 pub fs_type: u32,
21223
21224 pub padding: u32,
21225
21226 pub name: [i8; 32],
21227}
21228
21229impl ::fidl_next::Encodable for FilesystemInfo {
21230 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
21231 ::fidl_next::CopyOptimization::enable_if(
21232 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21233 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21234 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21235 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21236 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21237 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21238 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21239 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21240 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21241 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21242 && <[i8; 32] as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21243 )
21244 };
21245
21246 type Encoded = WireFilesystemInfo;
21247}
21248
21249unsafe impl<___E> ::fidl_next::Encode<___E> for FilesystemInfo
21250where
21251 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21252{
21253 #[inline]
21254 fn encode(
21255 self,
21256 encoder: &mut ___E,
21257 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21258 ) -> Result<(), ::fidl_next::EncodeError> {
21259 ::fidl_next::munge! {
21260 let Self::Encoded {
21261 total_bytes,
21262 used_bytes,
21263 total_nodes,
21264 used_nodes,
21265 free_shared_pool_bytes,
21266 fs_id,
21267 block_size,
21268 max_filename_size,
21269 fs_type,
21270 padding,
21271 name,
21272
21273 } = out;
21274 }
21275
21276 ::fidl_next::Encode::encode(self.total_bytes, encoder, total_bytes)?;
21277
21278 ::fidl_next::Encode::encode(self.used_bytes, encoder, used_bytes)?;
21279
21280 ::fidl_next::Encode::encode(self.total_nodes, encoder, total_nodes)?;
21281
21282 ::fidl_next::Encode::encode(self.used_nodes, encoder, used_nodes)?;
21283
21284 ::fidl_next::Encode::encode(self.free_shared_pool_bytes, encoder, free_shared_pool_bytes)?;
21285
21286 ::fidl_next::Encode::encode(self.fs_id, encoder, fs_id)?;
21287
21288 ::fidl_next::Encode::encode(self.block_size, encoder, block_size)?;
21289
21290 ::fidl_next::Encode::encode(self.max_filename_size, encoder, max_filename_size)?;
21291
21292 ::fidl_next::Encode::encode(self.fs_type, encoder, fs_type)?;
21293
21294 ::fidl_next::Encode::encode(self.padding, encoder, padding)?;
21295
21296 ::fidl_next::Encode::encode(self.name, encoder, name)?;
21297
21298 Ok(())
21299 }
21300}
21301
21302unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FilesystemInfo
21303where
21304 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21305{
21306 #[inline]
21307 fn encode_ref(
21308 &self,
21309 encoder: &mut ___E,
21310 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21311 ) -> Result<(), ::fidl_next::EncodeError> {
21312 ::fidl_next::munge! {
21313 let Self::Encoded {
21314 total_bytes,
21315 used_bytes,
21316 total_nodes,
21317 used_nodes,
21318 free_shared_pool_bytes,
21319 fs_id,
21320 block_size,
21321 max_filename_size,
21322 fs_type,
21323 padding,
21324 name,
21325
21326 } = out;
21327 }
21328
21329 ::fidl_next::EncodeRef::encode_ref(&self.total_bytes, encoder, total_bytes)?;
21330
21331 ::fidl_next::EncodeRef::encode_ref(&self.used_bytes, encoder, used_bytes)?;
21332
21333 ::fidl_next::EncodeRef::encode_ref(&self.total_nodes, encoder, total_nodes)?;
21334
21335 ::fidl_next::EncodeRef::encode_ref(&self.used_nodes, encoder, used_nodes)?;
21336
21337 ::fidl_next::EncodeRef::encode_ref(
21338 &self.free_shared_pool_bytes,
21339 encoder,
21340 free_shared_pool_bytes,
21341 )?;
21342
21343 ::fidl_next::EncodeRef::encode_ref(&self.fs_id, encoder, fs_id)?;
21344
21345 ::fidl_next::EncodeRef::encode_ref(&self.block_size, encoder, block_size)?;
21346
21347 ::fidl_next::EncodeRef::encode_ref(&self.max_filename_size, encoder, max_filename_size)?;
21348
21349 ::fidl_next::EncodeRef::encode_ref(&self.fs_type, encoder, fs_type)?;
21350
21351 ::fidl_next::EncodeRef::encode_ref(&self.padding, encoder, padding)?;
21352
21353 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
21354
21355 Ok(())
21356 }
21357}
21358
21359impl ::fidl_next::EncodableOption for Box<FilesystemInfo> {
21360 type EncodedOption = ::fidl_next::WireBox<WireFilesystemInfo>;
21361}
21362
21363unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FilesystemInfo>
21364where
21365 ___E: ::fidl_next::Encoder + ?Sized,
21366 FilesystemInfo: ::fidl_next::Encode<___E>,
21367{
21368 #[inline]
21369 fn encode_option(
21370 this: Option<Self>,
21371 encoder: &mut ___E,
21372 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21373 ) -> Result<(), ::fidl_next::EncodeError> {
21374 if let Some(inner) = this {
21375 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
21376 ::fidl_next::WireBox::encode_present(out);
21377 } else {
21378 ::fidl_next::WireBox::encode_absent(out);
21379 }
21380
21381 Ok(())
21382 }
21383}
21384
21385unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<FilesystemInfo>
21386where
21387 ___E: ::fidl_next::Encoder + ?Sized,
21388 FilesystemInfo: ::fidl_next::EncodeRef<___E>,
21389{
21390 #[inline]
21391 fn encode_option_ref(
21392 this: Option<&Self>,
21393 encoder: &mut ___E,
21394 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21395 ) -> Result<(), ::fidl_next::EncodeError> {
21396 if let Some(inner) = this {
21397 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21398 ::fidl_next::WireBox::encode_present(out);
21399 } else {
21400 ::fidl_next::WireBox::encode_absent(out);
21401 }
21402
21403 Ok(())
21404 }
21405}
21406
21407impl ::fidl_next::TakeFrom<WireFilesystemInfo> for FilesystemInfo {
21408 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
21409 ::fidl_next::CopyOptimization::enable_if(
21410 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21411 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21412 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21413 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21414 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21415 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21416 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21417 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21418 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21419 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
21420 && <[i8; 32] as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
21421 )
21422 };
21423
21424 #[inline]
21425 fn take_from(from: &WireFilesystemInfo) -> Self {
21426 Self {
21427 total_bytes: ::fidl_next::TakeFrom::take_from(&from.total_bytes),
21428
21429 used_bytes: ::fidl_next::TakeFrom::take_from(&from.used_bytes),
21430
21431 total_nodes: ::fidl_next::TakeFrom::take_from(&from.total_nodes),
21432
21433 used_nodes: ::fidl_next::TakeFrom::take_from(&from.used_nodes),
21434
21435 free_shared_pool_bytes: ::fidl_next::TakeFrom::take_from(&from.free_shared_pool_bytes),
21436
21437 fs_id: ::fidl_next::TakeFrom::take_from(&from.fs_id),
21438
21439 block_size: ::fidl_next::TakeFrom::take_from(&from.block_size),
21440
21441 max_filename_size: ::fidl_next::TakeFrom::take_from(&from.max_filename_size),
21442
21443 fs_type: ::fidl_next::TakeFrom::take_from(&from.fs_type),
21444
21445 padding: ::fidl_next::TakeFrom::take_from(&from.padding),
21446
21447 name: ::fidl_next::TakeFrom::take_from(&from.name),
21448 }
21449 }
21450}
21451
21452#[derive(Clone, Debug)]
21454#[repr(C)]
21455pub struct WireFilesystemInfo {
21456 pub total_bytes: ::fidl_next::WireU64,
21457
21458 pub used_bytes: ::fidl_next::WireU64,
21459
21460 pub total_nodes: ::fidl_next::WireU64,
21461
21462 pub used_nodes: ::fidl_next::WireU64,
21463
21464 pub free_shared_pool_bytes: ::fidl_next::WireU64,
21465
21466 pub fs_id: ::fidl_next::WireU64,
21467
21468 pub block_size: ::fidl_next::WireU32,
21469
21470 pub max_filename_size: ::fidl_next::WireU32,
21471
21472 pub fs_type: ::fidl_next::WireU32,
21473
21474 pub padding: ::fidl_next::WireU32,
21475
21476 pub name: [i8; 32],
21477}
21478
21479unsafe impl ::fidl_next::ZeroPadding for WireFilesystemInfo {
21480 #[inline]
21481 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21482}
21483
21484unsafe impl<___D> ::fidl_next::Decode<___D> for WireFilesystemInfo
21485where
21486 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21487{
21488 fn decode(
21489 slot: ::fidl_next::Slot<'_, Self>,
21490 decoder: &mut ___D,
21491 ) -> Result<(), ::fidl_next::DecodeError> {
21492 ::fidl_next::munge! {
21493 let Self {
21494 mut total_bytes,
21495 mut used_bytes,
21496 mut total_nodes,
21497 mut used_nodes,
21498 mut free_shared_pool_bytes,
21499 mut fs_id,
21500 mut block_size,
21501 mut max_filename_size,
21502 mut fs_type,
21503 mut padding,
21504 mut name,
21505
21506 } = slot;
21507 }
21508
21509 ::fidl_next::Decode::decode(total_bytes.as_mut(), decoder)?;
21510
21511 ::fidl_next::Decode::decode(used_bytes.as_mut(), decoder)?;
21512
21513 ::fidl_next::Decode::decode(total_nodes.as_mut(), decoder)?;
21514
21515 ::fidl_next::Decode::decode(used_nodes.as_mut(), decoder)?;
21516
21517 ::fidl_next::Decode::decode(free_shared_pool_bytes.as_mut(), decoder)?;
21518
21519 ::fidl_next::Decode::decode(fs_id.as_mut(), decoder)?;
21520
21521 ::fidl_next::Decode::decode(block_size.as_mut(), decoder)?;
21522
21523 ::fidl_next::Decode::decode(max_filename_size.as_mut(), decoder)?;
21524
21525 ::fidl_next::Decode::decode(fs_type.as_mut(), decoder)?;
21526
21527 ::fidl_next::Decode::decode(padding.as_mut(), decoder)?;
21528
21529 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
21530
21531 Ok(())
21532 }
21533}
21534
21535#[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"]
21536pub const INHERITED_WRITE_PERMISSIONS: crate::Operations = crate::Operations::from_bits_retain(356);
21537
21538#[doc = " Nodes which do not have ino values should return this value\n from Readdir and GetAttr.\n"]
21539pub const INO_UNKNOWN: u64 = 18446744073709551615;
21540
21541pub const MASK_KNOWN_PERMISSIONS: crate::Flags = crate::Flags::from_bits_retain(25087);
21542
21543pub const MASK_KNOWN_PROTOCOLS: crate::Flags = crate::Flags::from_bits_retain(30069489664);
21544
21545pub const MASK_PERMISSION_FLAGS: u64 = 65535;
21546
21547pub const MASK_POSIX_FLAGS: u64 = 4294967295;
21548
21549#[doc = " The maximum length, in bytes, of a single filesystem component.\n"]
21550pub const MAX_FILENAME: u64 = 255;
21551
21552#[doc = " Bits reserved for posix protections. Native fuchsia filesystems\n are not required to set bits contained within `MODE_PROTECTION_MASK`,\n but filesystems that wish to do so may refer to sys/stat.h for their\n definitions.\n"]
21553pub const MODE_PROTECTION_MASK: u32 = 4095;
21554
21555pub const MODE_TYPE_BLOCK_DEVICE: u32 = 24576;
21556
21557pub const MODE_TYPE_DIRECTORY: u32 = 16384;
21558
21559pub const MODE_TYPE_FILE: u32 = 32768;
21560
21561#[doc = " Bits indicating node type. The canonical mechanism to check\n for a node type is to take \'mode\', bitwise AND it with the\n `MODE_TYPE_MASK`, and check exact equality against a mode type.\n"]
21562pub const MODE_TYPE_MASK: u32 = 1044480;
21563
21564pub const MODE_TYPE_SERVICE: u32 = 65536;
21565
21566pub const MODE_TYPE_SYMLINK: u32 = 40960;
21567
21568pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
21569
21570#[derive(Clone, Debug)]
21571#[repr(C)]
21572pub struct Service {}
21573
21574impl ::fidl_next::Encodable for Service {
21575 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
21576 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
21577
21578 type Encoded = WireService;
21579}
21580
21581unsafe impl<___E> ::fidl_next::Encode<___E> for Service
21582where
21583 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21584{
21585 #[inline]
21586 fn encode(
21587 self,
21588 encoder: &mut ___E,
21589 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21590 ) -> Result<(), ::fidl_next::EncodeError> {
21591 ::fidl_next::munge! {
21592 let Self::Encoded {
21593
21594 } = out;
21595 }
21596
21597 Ok(())
21598 }
21599}
21600
21601unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
21602where
21603 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21604{
21605 #[inline]
21606 fn encode_ref(
21607 &self,
21608 encoder: &mut ___E,
21609 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21610 ) -> Result<(), ::fidl_next::EncodeError> {
21611 ::fidl_next::munge! {
21612 let Self::Encoded {
21613
21614 } = out;
21615 }
21616
21617 Ok(())
21618 }
21619}
21620
21621impl ::fidl_next::EncodableOption for Box<Service> {
21622 type EncodedOption = ::fidl_next::WireBox<WireService>;
21623}
21624
21625unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Service>
21626where
21627 ___E: ::fidl_next::Encoder + ?Sized,
21628 Service: ::fidl_next::Encode<___E>,
21629{
21630 #[inline]
21631 fn encode_option(
21632 this: Option<Self>,
21633 encoder: &mut ___E,
21634 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21635 ) -> Result<(), ::fidl_next::EncodeError> {
21636 if let Some(inner) = this {
21637 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
21638 ::fidl_next::WireBox::encode_present(out);
21639 } else {
21640 ::fidl_next::WireBox::encode_absent(out);
21641 }
21642
21643 Ok(())
21644 }
21645}
21646
21647unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<Service>
21648where
21649 ___E: ::fidl_next::Encoder + ?Sized,
21650 Service: ::fidl_next::EncodeRef<___E>,
21651{
21652 #[inline]
21653 fn encode_option_ref(
21654 this: Option<&Self>,
21655 encoder: &mut ___E,
21656 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21657 ) -> Result<(), ::fidl_next::EncodeError> {
21658 if let Some(inner) = this {
21659 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21660 ::fidl_next::WireBox::encode_present(out);
21661 } else {
21662 ::fidl_next::WireBox::encode_absent(out);
21663 }
21664
21665 Ok(())
21666 }
21667}
21668
21669impl ::fidl_next::TakeFrom<WireService> for Service {
21670 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
21671 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
21672
21673 #[inline]
21674 fn take_from(from: &WireService) -> Self {
21675 Self {}
21676 }
21677}
21678
21679#[derive(Clone, Debug)]
21681#[repr(C)]
21682pub struct WireService {}
21683
21684unsafe impl ::fidl_next::ZeroPadding for WireService {
21685 #[inline]
21686 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21687}
21688
21689unsafe impl<___D> ::fidl_next::Decode<___D> for WireService
21690where
21691 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21692{
21693 fn decode(
21694 slot: ::fidl_next::Slot<'_, Self>,
21695 decoder: &mut ___D,
21696 ) -> Result<(), ::fidl_next::DecodeError> {
21697 ::fidl_next::munge! {
21698 let Self {
21699
21700 } = slot;
21701 }
21702
21703 Ok(())
21704 }
21705}
21706
21707#[derive(Clone, Debug)]
21708pub struct SymlinkObject {
21709 pub target: Vec<u8>,
21710}
21711
21712impl ::fidl_next::Encodable for SymlinkObject {
21713 type Encoded = WireSymlinkObject;
21714}
21715
21716unsafe impl<___E> ::fidl_next::Encode<___E> for SymlinkObject
21717where
21718 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21719
21720 ___E: ::fidl_next::Encoder,
21721{
21722 #[inline]
21723 fn encode(
21724 self,
21725 encoder: &mut ___E,
21726 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21727 ) -> Result<(), ::fidl_next::EncodeError> {
21728 ::fidl_next::munge! {
21729 let Self::Encoded {
21730 target,
21731
21732 } = out;
21733 }
21734
21735 ::fidl_next::Encode::encode(self.target, encoder, target)?;
21736
21737 Ok(())
21738 }
21739}
21740
21741unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SymlinkObject
21742where
21743 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21744
21745 ___E: ::fidl_next::Encoder,
21746{
21747 #[inline]
21748 fn encode_ref(
21749 &self,
21750 encoder: &mut ___E,
21751 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21752 ) -> Result<(), ::fidl_next::EncodeError> {
21753 ::fidl_next::munge! {
21754 let Self::Encoded {
21755 target,
21756
21757 } = out;
21758 }
21759
21760 ::fidl_next::EncodeRef::encode_ref(&self.target, encoder, target)?;
21761
21762 Ok(())
21763 }
21764}
21765
21766impl ::fidl_next::EncodableOption for Box<SymlinkObject> {
21767 type EncodedOption = ::fidl_next::WireBox<WireSymlinkObject>;
21768}
21769
21770unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<SymlinkObject>
21771where
21772 ___E: ::fidl_next::Encoder + ?Sized,
21773 SymlinkObject: ::fidl_next::Encode<___E>,
21774{
21775 #[inline]
21776 fn encode_option(
21777 this: Option<Self>,
21778 encoder: &mut ___E,
21779 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21780 ) -> Result<(), ::fidl_next::EncodeError> {
21781 if let Some(inner) = this {
21782 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
21783 ::fidl_next::WireBox::encode_present(out);
21784 } else {
21785 ::fidl_next::WireBox::encode_absent(out);
21786 }
21787
21788 Ok(())
21789 }
21790}
21791
21792unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<SymlinkObject>
21793where
21794 ___E: ::fidl_next::Encoder + ?Sized,
21795 SymlinkObject: ::fidl_next::EncodeRef<___E>,
21796{
21797 #[inline]
21798 fn encode_option_ref(
21799 this: Option<&Self>,
21800 encoder: &mut ___E,
21801 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21802 ) -> Result<(), ::fidl_next::EncodeError> {
21803 if let Some(inner) = this {
21804 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21805 ::fidl_next::WireBox::encode_present(out);
21806 } else {
21807 ::fidl_next::WireBox::encode_absent(out);
21808 }
21809
21810 Ok(())
21811 }
21812}
21813
21814impl ::fidl_next::TakeFrom<WireSymlinkObject> for SymlinkObject {
21815 #[inline]
21816 fn take_from(from: &WireSymlinkObject) -> Self {
21817 Self { target: ::fidl_next::TakeFrom::take_from(&from.target) }
21818 }
21819}
21820
21821#[derive(Debug)]
21823#[repr(C)]
21824pub struct WireSymlinkObject {
21825 pub target: ::fidl_next::WireVector<u8>,
21826}
21827
21828unsafe impl ::fidl_next::ZeroPadding for WireSymlinkObject {
21829 #[inline]
21830 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
21831}
21832
21833unsafe impl<___D> ::fidl_next::Decode<___D> for WireSymlinkObject
21834where
21835 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21836
21837 ___D: ::fidl_next::Decoder,
21838{
21839 fn decode(
21840 slot: ::fidl_next::Slot<'_, Self>,
21841 decoder: &mut ___D,
21842 ) -> Result<(), ::fidl_next::DecodeError> {
21843 ::fidl_next::munge! {
21844 let Self {
21845 mut target,
21846
21847 } = slot;
21848 }
21849
21850 ::fidl_next::Decode::decode(target.as_mut(), decoder)?;
21851
21852 let target = unsafe { target.deref_unchecked() };
21853
21854 if target.len() > 4095 {
21855 return Err(::fidl_next::DecodeError::VectorTooLong {
21856 size: target.len() as u64,
21857 limit: 4095,
21858 });
21859 }
21860
21861 Ok(())
21862 }
21863}
21864
21865#[derive(Debug)]
21866pub enum NodeInfoDeprecated {
21867 Service(crate::Service),
21868
21869 File(crate::FileObject),
21870
21871 Directory(crate::DirectoryObject),
21872
21873 Symlink(crate::SymlinkObject),
21874}
21875
21876impl ::fidl_next::Encodable for NodeInfoDeprecated {
21877 type Encoded = WireNodeInfoDeprecated;
21878}
21879
21880unsafe impl<___E> ::fidl_next::Encode<___E> for NodeInfoDeprecated
21881where
21882 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21883
21884 ___E: ::fidl_next::Encoder,
21885
21886 ___E: ::fidl_next::fuchsia::HandleEncoder,
21887{
21888 #[inline]
21889 fn encode(
21890 self,
21891 encoder: &mut ___E,
21892 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21893 ) -> Result<(), ::fidl_next::EncodeError> {
21894 ::fidl_next::munge!(let WireNodeInfoDeprecated { raw } = out);
21895
21896 match self {
21897 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
21898 value, 1, encoder, raw,
21899 )?,
21900
21901 Self::File(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::FileObject>(
21902 value, 2, encoder, raw,
21903 )?,
21904
21905 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
21906 ___E,
21907 crate::DirectoryObject,
21908 >(value, 3, encoder, raw)?,
21909
21910 Self::Symlink(value) => ::fidl_next::RawWireUnion::encode_as::<
21911 ___E,
21912 crate::SymlinkObject,
21913 >(value, 4, encoder, raw)?,
21914 }
21915
21916 Ok(())
21917 }
21918}
21919
21920impl ::fidl_next::EncodableOption for Box<NodeInfoDeprecated> {
21921 type EncodedOption = WireOptionalNodeInfoDeprecated;
21922}
21923
21924unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NodeInfoDeprecated>
21925where
21926 ___E: ?Sized,
21927 NodeInfoDeprecated: ::fidl_next::Encode<___E>,
21928{
21929 #[inline]
21930 fn encode_option(
21931 this: Option<Self>,
21932 encoder: &mut ___E,
21933 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21934 ) -> Result<(), ::fidl_next::EncodeError> {
21935 ::fidl_next::munge!(let WireOptionalNodeInfoDeprecated { raw } = &mut *out);
21936
21937 if let Some(inner) = this {
21938 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21939 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
21940 } else {
21941 ::fidl_next::RawWireUnion::encode_absent(raw);
21942 }
21943
21944 Ok(())
21945 }
21946}
21947
21948impl ::fidl_next::TakeFrom<WireNodeInfoDeprecated> for NodeInfoDeprecated {
21949 #[inline]
21950 fn take_from(from: &WireNodeInfoDeprecated) -> Self {
21951 match from.raw.ordinal() {
21952 1 => Self::Service(::fidl_next::TakeFrom::take_from(unsafe {
21953 from.raw.get().deref_unchecked::<crate::WireService>()
21954 })),
21955
21956 2 => Self::File(::fidl_next::TakeFrom::take_from(unsafe {
21957 from.raw.get().deref_unchecked::<crate::WireFileObject>()
21958 })),
21959
21960 3 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
21961 from.raw.get().deref_unchecked::<crate::WireDirectoryObject>()
21962 })),
21963
21964 4 => Self::Symlink(::fidl_next::TakeFrom::take_from(unsafe {
21965 from.raw.get().deref_unchecked::<crate::WireSymlinkObject>()
21966 })),
21967
21968 _ => unsafe { ::core::hint::unreachable_unchecked() },
21969 }
21970 }
21971}
21972
21973impl ::fidl_next::TakeFrom<WireOptionalNodeInfoDeprecated> for Option<Box<NodeInfoDeprecated>> {
21974 #[inline]
21975 fn take_from(from: &WireOptionalNodeInfoDeprecated) -> Self {
21976 if let Some(inner) = from.as_ref() {
21977 Some(::fidl_next::TakeFrom::take_from(inner))
21978 } else {
21979 None
21980 }
21981 }
21982}
21983
21984#[repr(transparent)]
21986pub struct WireNodeInfoDeprecated {
21987 raw: ::fidl_next::RawWireUnion,
21988}
21989
21990unsafe impl ::fidl_next::ZeroPadding for WireNodeInfoDeprecated {
21991 #[inline]
21992 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21993 ::fidl_next::munge!(let Self { raw } = out);
21994 ::fidl_next::RawWireUnion::zero_padding(raw);
21995 }
21996}
21997
21998pub mod node_info_deprecated {
21999 pub enum Ref<'union> {
22000 Service(&'union crate::WireService),
22001
22002 File(&'union crate::WireFileObject),
22003
22004 Directory(&'union crate::WireDirectoryObject),
22005
22006 Symlink(&'union crate::WireSymlinkObject),
22007 }
22008}
22009
22010impl WireNodeInfoDeprecated {
22011 pub fn as_ref(&self) -> crate::node_info_deprecated::Ref<'_> {
22012 match self.raw.ordinal() {
22013 1 => crate::node_info_deprecated::Ref::Service(unsafe {
22014 self.raw.get().deref_unchecked::<crate::WireService>()
22015 }),
22016
22017 2 => crate::node_info_deprecated::Ref::File(unsafe {
22018 self.raw.get().deref_unchecked::<crate::WireFileObject>()
22019 }),
22020
22021 3 => crate::node_info_deprecated::Ref::Directory(unsafe {
22022 self.raw.get().deref_unchecked::<crate::WireDirectoryObject>()
22023 }),
22024
22025 4 => crate::node_info_deprecated::Ref::Symlink(unsafe {
22026 self.raw.get().deref_unchecked::<crate::WireSymlinkObject>()
22027 }),
22028
22029 _ => unsafe { ::core::hint::unreachable_unchecked() },
22030 }
22031 }
22032}
22033
22034unsafe impl<___D> ::fidl_next::Decode<___D> for WireNodeInfoDeprecated
22035where
22036 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22037
22038 ___D: ::fidl_next::Decoder,
22039
22040 ___D: ::fidl_next::fuchsia::HandleDecoder,
22041{
22042 fn decode(
22043 mut slot: ::fidl_next::Slot<'_, Self>,
22044 decoder: &mut ___D,
22045 ) -> Result<(), ::fidl_next::DecodeError> {
22046 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
22047 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
22048 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
22049
22050 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
22051
22052 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
22053 raw, decoder,
22054 )?,
22055
22056 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject>(
22057 raw, decoder,
22058 )?,
22059
22060 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
22061 }
22062
22063 Ok(())
22064 }
22065}
22066
22067impl ::core::fmt::Debug for WireNodeInfoDeprecated {
22068 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22069 match self.raw.ordinal() {
22070 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService>().fmt(f) },
22071 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireFileObject>().fmt(f) },
22072 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectoryObject>().fmt(f) },
22073 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireSymlinkObject>().fmt(f) },
22074 _ => unsafe { ::core::hint::unreachable_unchecked() },
22075 }
22076 }
22077}
22078
22079#[repr(transparent)]
22080pub struct WireOptionalNodeInfoDeprecated {
22081 raw: ::fidl_next::RawWireUnion,
22082}
22083
22084unsafe impl ::fidl_next::ZeroPadding for WireOptionalNodeInfoDeprecated {
22085 #[inline]
22086 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22087 ::fidl_next::munge!(let Self { raw } = out);
22088 ::fidl_next::RawWireUnion::zero_padding(raw);
22089 }
22090}
22091
22092impl WireOptionalNodeInfoDeprecated {
22093 pub fn is_some(&self) -> bool {
22094 self.raw.is_some()
22095 }
22096
22097 pub fn is_none(&self) -> bool {
22098 self.raw.is_none()
22099 }
22100
22101 pub fn as_ref(&self) -> Option<&WireNodeInfoDeprecated> {
22102 if self.is_some() {
22103 Some(unsafe { &*(self as *const Self).cast() })
22104 } else {
22105 None
22106 }
22107 }
22108}
22109
22110unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalNodeInfoDeprecated
22111where
22112 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22113
22114 ___D: ::fidl_next::Decoder,
22115
22116 ___D: ::fidl_next::fuchsia::HandleDecoder,
22117{
22118 fn decode(
22119 mut slot: ::fidl_next::Slot<'_, Self>,
22120 decoder: &mut ___D,
22121 ) -> Result<(), ::fidl_next::DecodeError> {
22122 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
22123 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
22124 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
22125
22126 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFileObject>(raw, decoder)?,
22127
22128 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectoryObject>(
22129 raw, decoder,
22130 )?,
22131
22132 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSymlinkObject>(
22133 raw, decoder,
22134 )?,
22135
22136 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
22137 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
22138 }
22139
22140 Ok(())
22141 }
22142}
22143
22144impl ::core::fmt::Debug for WireOptionalNodeInfoDeprecated {
22145 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22146 self.as_ref().fmt(f)
22147 }
22148}
22149
22150#[doc = " Flags used when opening a node reference must fall within this mask.\n"]
22151pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: crate::OpenFlags =
22152 crate::OpenFlags::from_bits_retain(46661632);
22153
22154#[doc = " All known rights.\n"]
22155pub const OPEN_RIGHTS: crate::OpenFlags = crate::OpenFlags::from_bits_retain(11);
22156
22157#[doc = " Set of permissions that are expected when opening a node as executable.\n"]
22158pub const PERM_EXECUTABLE: crate::Flags = crate::Flags::from_bits_retain(201);
22159
22160#[doc = " Set of permissions that are expected when opening a node as readable.\n"]
22161pub const PERM_READABLE: crate::Flags = crate::Flags::from_bits_retain(211);
22162
22163#[doc = " Set of permissions that are expected when opening a node as writable.\n"]
22164pub const PERM_WRITABLE: crate::Flags = crate::Flags::from_bits_retain(485);
22165
22166#[doc = " Alias for directory permission alias rw*\n"]
22167pub const RW_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(503);
22168
22169#[doc = " Alias for directory permission alias rx*\n"]
22170pub const RX_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(219);
22171
22172#[doc = " Alias for directory permission alias r*\n"]
22173pub const R_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(211);
22174
22175#[doc = " The name of the extended attribute accessible via the SELinux context attribute.\n"]
22176pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
22177
22178pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
22179
22180#[doc = " A [\'Node\'] which contains a symbolic link.\n"]
22182#[derive(Debug)]
22183pub struct Symlink;
22184
22185impl ::fidl_next::Discoverable for Symlink {
22186 const PROTOCOL_NAME: &'static str = "symlink";
22187}
22188
22189pub mod symlink {
22190 pub mod prelude {
22191 pub use crate::{
22192 symlink, Symlink, SymlinkClientHandler, SymlinkClientSender, SymlinkServerHandler,
22193 SymlinkServerSender,
22194 };
22195
22196 pub use crate::ConnectionInfo;
22197
22198 pub use crate::ExtendedAttributeValue;
22199
22200 pub use crate::LinkableLinkIntoRequest;
22201
22202 pub use crate::LinkableLinkIntoResponse;
22203
22204 pub use crate::MutableNodeAttributes;
22205
22206 pub use crate::NodeAttributes2;
22207
22208 pub use crate::NodeDeprecatedCloneRequest;
22209
22210 pub use crate::NodeDeprecatedGetFlagsResponse;
22211
22212 pub use crate::NodeDeprecatedSetFlagsRequest;
22213
22214 pub use crate::NodeDeprecatedSetFlagsResponse;
22215
22216 pub use crate::NodeGetAttrResponse;
22217
22218 pub use crate::NodeGetAttributesRequest;
22219
22220 pub use crate::NodeGetExtendedAttributeRequest;
22221
22222 pub use crate::NodeListExtendedAttributesRequest;
22223
22224 pub use crate::NodeOnOpenRequest;
22225
22226 pub use crate::NodeQueryFilesystemResponse;
22227
22228 pub use crate::NodeRemoveExtendedAttributeRequest;
22229
22230 pub use crate::NodeSetAttrRequest;
22231
22232 pub use crate::NodeSetAttrResponse;
22233
22234 pub use crate::NodeSetExtendedAttributeRequest;
22235
22236 pub use crate::NodeSetFlagsRequest;
22237
22238 pub use crate::NodeGetFlagsResponse;
22239
22240 pub use crate::NodeRemoveExtendedAttributeResponse;
22241
22242 pub use crate::NodeSetExtendedAttributeResponse;
22243
22244 pub use crate::NodeSetFlagsResponse;
22245
22246 pub use crate::NodeSyncResponse;
22247
22248 pub use crate::NodeUpdateAttributesResponse;
22249
22250 pub use crate::Representation;
22251
22252 pub use crate::SymlinkInfo;
22253
22254 pub use ::fidl_next_fuchsia_unknown::CloneableCloneRequest;
22255
22256 pub use ::fidl_next_fuchsia_unknown::CloseableCloseResponse;
22257
22258 pub use ::fidl_next_fuchsia_unknown::QueryableQueryResponse;
22259 }
22260
22261 pub struct LinkInto;
22262
22263 impl ::fidl_next::Method for LinkInto {
22264 const ORDINAL: u64 = 6121399674497678964;
22265
22266 type Protocol = crate::Symlink;
22267
22268 type Request = crate::WireLinkableLinkIntoRequest;
22269
22270 type Response =
22271 ::fidl_next::WireResult<crate::WireLinkableLinkIntoResponse, ::fidl_next::WireI32>;
22272 }
22273
22274 pub struct Clone;
22275
22276 impl ::fidl_next::Method for Clone {
22277 const ORDINAL: u64 = 2366825959783828089;
22278
22279 type Protocol = crate::Symlink;
22280
22281 type Request = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest;
22282
22283 type Response = ::fidl_next::Never;
22284 }
22285
22286 pub struct Close;
22287
22288 impl ::fidl_next::Method for Close {
22289 const ORDINAL: u64 = 6540867515453498750;
22290
22291 type Protocol = crate::Symlink;
22292
22293 type Request = ();
22294
22295 type Response = ::fidl_next::WireResult<
22296 ::fidl_next_fuchsia_unknown::WireCloseableCloseResponse,
22297 ::fidl_next::WireI32,
22298 >;
22299 }
22300
22301 pub struct Query;
22302
22303 impl ::fidl_next::Method for Query {
22304 const ORDINAL: u64 = 2763219980499352582;
22305
22306 type Protocol = crate::Symlink;
22307
22308 type Request = ();
22309
22310 type Response = ::fidl_next_fuchsia_unknown::WireQueryableQueryResponse;
22311 }
22312
22313 pub struct DeprecatedClone;
22314
22315 impl ::fidl_next::Method for DeprecatedClone {
22316 const ORDINAL: u64 = 6512600400724287855;
22317
22318 type Protocol = crate::Symlink;
22319
22320 type Request = crate::WireNodeDeprecatedCloneRequest;
22321
22322 type Response = ::fidl_next::Never;
22323 }
22324
22325 pub struct OnOpen;
22326
22327 impl ::fidl_next::Method for OnOpen {
22328 const ORDINAL: u64 = 9207534335756671346;
22329
22330 type Protocol = crate::Symlink;
22331
22332 type Request = ::fidl_next::Never;
22333
22334 type Response = crate::WireNodeOnOpenRequest;
22335 }
22336
22337 pub struct GetAttr;
22338
22339 impl ::fidl_next::Method for GetAttr {
22340 const ORDINAL: u64 = 8689798978500614909;
22341
22342 type Protocol = crate::Symlink;
22343
22344 type Request = ();
22345
22346 type Response = crate::WireNodeGetAttrResponse;
22347 }
22348
22349 pub struct SetAttr;
22350
22351 impl ::fidl_next::Method for SetAttr {
22352 const ORDINAL: u64 = 4721673413776871238;
22353
22354 type Protocol = crate::Symlink;
22355
22356 type Request = crate::WireNodeSetAttrRequest;
22357
22358 type Response = crate::WireNodeSetAttrResponse;
22359 }
22360
22361 pub struct DeprecatedGetFlags;
22362
22363 impl ::fidl_next::Method for DeprecatedGetFlags {
22364 const ORDINAL: u64 = 6595803110182632097;
22365
22366 type Protocol = crate::Symlink;
22367
22368 type Request = ();
22369
22370 type Response = crate::WireNodeDeprecatedGetFlagsResponse;
22371 }
22372
22373 pub struct DeprecatedSetFlags;
22374
22375 impl ::fidl_next::Method for DeprecatedSetFlags {
22376 const ORDINAL: u64 = 5950864159036794675;
22377
22378 type Protocol = crate::Symlink;
22379
22380 type Request = crate::WireNodeDeprecatedSetFlagsRequest;
22381
22382 type Response = crate::WireNodeDeprecatedSetFlagsResponse;
22383 }
22384
22385 pub struct GetFlags;
22386
22387 impl ::fidl_next::Method for GetFlags {
22388 const ORDINAL: u64 = 105530239381466147;
22389
22390 type Protocol = crate::Symlink;
22391
22392 type Request = ();
22393
22394 type Response =
22395 ::fidl_next::WireFlexibleResult<crate::WireNodeGetFlagsResponse, ::fidl_next::WireI32>;
22396 }
22397
22398 pub struct SetFlags;
22399
22400 impl ::fidl_next::Method for SetFlags {
22401 const ORDINAL: u64 = 6172186066099445416;
22402
22403 type Protocol = crate::Symlink;
22404
22405 type Request = crate::WireNodeSetFlagsRequest;
22406
22407 type Response =
22408 ::fidl_next::WireFlexibleResult<crate::WireNodeSetFlagsResponse, ::fidl_next::WireI32>;
22409 }
22410
22411 pub struct QueryFilesystem;
22412
22413 impl ::fidl_next::Method for QueryFilesystem {
22414 const ORDINAL: u64 = 8013111122914313744;
22415
22416 type Protocol = crate::Symlink;
22417
22418 type Request = ();
22419
22420 type Response = crate::WireNodeQueryFilesystemResponse;
22421 }
22422
22423 pub struct OnRepresentation;
22424
22425 impl ::fidl_next::Method for OnRepresentation {
22426 const ORDINAL: u64 = 6679970090861613324;
22427
22428 type Protocol = crate::Symlink;
22429
22430 type Request = ::fidl_next::Never;
22431
22432 type Response = crate::WireRepresentation;
22433 }
22434
22435 pub struct GetConnectionInfo;
22436
22437 impl ::fidl_next::Method for GetConnectionInfo {
22438 const ORDINAL: u64 = 6362521381364198667;
22439
22440 type Protocol = crate::Symlink;
22441
22442 type Request = ();
22443
22444 type Response = crate::WireConnectionInfo;
22445 }
22446
22447 pub struct GetAttributes;
22448
22449 impl ::fidl_next::Method for GetAttributes {
22450 const ORDINAL: u64 = 4414537700416816443;
22451
22452 type Protocol = crate::Symlink;
22453
22454 type Request = crate::WireNodeGetAttributesRequest;
22455
22456 type Response = ::fidl_next::WireResult<crate::WireNodeAttributes2, ::fidl_next::WireI32>;
22457 }
22458
22459 pub struct UpdateAttributes;
22460
22461 impl ::fidl_next::Method for UpdateAttributes {
22462 const ORDINAL: u64 = 3677402239314018056;
22463
22464 type Protocol = crate::Symlink;
22465
22466 type Request = crate::WireMutableNodeAttributes;
22467
22468 type Response =
22469 ::fidl_next::WireResult<crate::WireNodeUpdateAttributesResponse, ::fidl_next::WireI32>;
22470 }
22471
22472 pub struct Sync;
22473
22474 impl ::fidl_next::Method for Sync {
22475 const ORDINAL: u64 = 3196473584242777161;
22476
22477 type Protocol = crate::Symlink;
22478
22479 type Request = ();
22480
22481 type Response = ::fidl_next::WireResult<crate::WireNodeSyncResponse, ::fidl_next::WireI32>;
22482 }
22483
22484 pub struct ListExtendedAttributes;
22485
22486 impl ::fidl_next::Method for ListExtendedAttributes {
22487 const ORDINAL: u64 = 5431626189872037072;
22488
22489 type Protocol = crate::Symlink;
22490
22491 type Request = crate::WireNodeListExtendedAttributesRequest;
22492
22493 type Response = ::fidl_next::Never;
22494 }
22495
22496 pub struct GetExtendedAttribute;
22497
22498 impl ::fidl_next::Method for GetExtendedAttribute {
22499 const ORDINAL: u64 = 5043930208506967771;
22500
22501 type Protocol = crate::Symlink;
22502
22503 type Request = crate::WireNodeGetExtendedAttributeRequest;
22504
22505 type Response =
22506 ::fidl_next::WireResult<crate::WireExtendedAttributeValue, ::fidl_next::WireI32>;
22507 }
22508
22509 pub struct SetExtendedAttribute;
22510
22511 impl ::fidl_next::Method for SetExtendedAttribute {
22512 const ORDINAL: u64 = 5374223046099989052;
22513
22514 type Protocol = crate::Symlink;
22515
22516 type Request = crate::WireNodeSetExtendedAttributeRequest;
22517
22518 type Response = ::fidl_next::WireResult<
22519 crate::WireNodeSetExtendedAttributeResponse,
22520 ::fidl_next::WireI32,
22521 >;
22522 }
22523
22524 pub struct RemoveExtendedAttribute;
22525
22526 impl ::fidl_next::Method for RemoveExtendedAttribute {
22527 const ORDINAL: u64 = 8794297771444732717;
22528
22529 type Protocol = crate::Symlink;
22530
22531 type Request = crate::WireNodeRemoveExtendedAttributeRequest;
22532
22533 type Response = ::fidl_next::WireResult<
22534 crate::WireNodeRemoveExtendedAttributeResponse,
22535 ::fidl_next::WireI32,
22536 >;
22537 }
22538
22539 pub struct Describe;
22540
22541 impl ::fidl_next::Method for Describe {
22542 const ORDINAL: u64 = 8371117097481679347;
22543
22544 type Protocol = crate::Symlink;
22545
22546 type Request = ();
22547
22548 type Response = ::fidl_next::WireFlexible<crate::WireSymlinkInfo>;
22549 }
22550}
22551
22552pub trait SymlinkClientSender {
22554 type Transport: ::fidl_next::Transport;
22555
22556 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
22557 fn link_into<___R>(
22558 &self,
22559 request: ___R,
22560 ) -> Result<
22561 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::LinkInto>,
22562 ::fidl_next::EncodeError,
22563 >
22564 where
22565 ___R: ::fidl_next::Encode<
22566 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22567 Encoded = crate::WireLinkableLinkIntoRequest,
22568 >;
22569
22570 fn clone<___R>(
22571 &self,
22572 request: ___R,
22573 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
22574 where
22575 ___R: ::fidl_next::Encode<
22576 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22577 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
22578 >;
22579
22580 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
22581 fn close(
22582 &self,
22583 ) -> Result<
22584 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Close>,
22585 ::fidl_next::EncodeError,
22586 >;
22587
22588 fn query(
22589 &self,
22590 ) -> Result<
22591 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Query>,
22592 ::fidl_next::EncodeError,
22593 >;
22594
22595 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
22596 fn deprecated_clone<___R>(
22597 &self,
22598 request: ___R,
22599 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
22600 where
22601 ___R: ::fidl_next::Encode<
22602 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22603 Encoded = crate::WireNodeDeprecatedCloneRequest,
22604 >;
22605
22606 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
22607 fn get_attr(
22608 &self,
22609 ) -> Result<
22610 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetAttr>,
22611 ::fidl_next::EncodeError,
22612 >;
22613
22614 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
22615 fn set_attr<___R>(
22616 &self,
22617 request: ___R,
22618 ) -> Result<
22619 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetAttr>,
22620 ::fidl_next::EncodeError,
22621 >
22622 where
22623 ___R: ::fidl_next::Encode<
22624 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22625 Encoded = crate::WireNodeSetAttrRequest,
22626 >;
22627
22628 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
22629 fn deprecated_get_flags(
22630 &self,
22631 ) -> Result<
22632 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::DeprecatedGetFlags>,
22633 ::fidl_next::EncodeError,
22634 >;
22635
22636 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
22637 fn deprecated_set_flags<___R>(
22638 &self,
22639 request: ___R,
22640 ) -> Result<
22641 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::DeprecatedSetFlags>,
22642 ::fidl_next::EncodeError,
22643 >
22644 where
22645 ___R: ::fidl_next::Encode<
22646 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22647 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
22648 >;
22649
22650 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
22651 fn get_flags(
22652 &self,
22653 ) -> Result<
22654 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetFlags>,
22655 ::fidl_next::EncodeError,
22656 >;
22657
22658 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
22659 fn set_flags<___R>(
22660 &self,
22661 request: ___R,
22662 ) -> Result<
22663 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetFlags>,
22664 ::fidl_next::EncodeError,
22665 >
22666 where
22667 ___R: ::fidl_next::Encode<
22668 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22669 Encoded = crate::WireNodeSetFlagsRequest,
22670 >;
22671
22672 #[doc = " Query the filesystem for filesystem-specific information.\n"]
22673 fn query_filesystem(
22674 &self,
22675 ) -> Result<
22676 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::QueryFilesystem>,
22677 ::fidl_next::EncodeError,
22678 >;
22679
22680 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
22681 fn get_connection_info(
22682 &self,
22683 ) -> Result<
22684 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetConnectionInfo>,
22685 ::fidl_next::EncodeError,
22686 >;
22687
22688 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
22689 fn get_attributes<___R>(
22690 &self,
22691 request: ___R,
22692 ) -> Result<
22693 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetAttributes>,
22694 ::fidl_next::EncodeError,
22695 >
22696 where
22697 ___R: ::fidl_next::Encode<
22698 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22699 Encoded = crate::WireNodeGetAttributesRequest,
22700 >;
22701
22702 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
22703 fn update_attributes<___R>(
22704 &self,
22705 request: ___R,
22706 ) -> Result<
22707 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::UpdateAttributes>,
22708 ::fidl_next::EncodeError,
22709 >
22710 where
22711 ___R: ::fidl_next::Encode<
22712 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22713 Encoded = crate::WireMutableNodeAttributes,
22714 >;
22715
22716 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
22717 fn sync(
22718 &self,
22719 ) -> Result<
22720 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Sync>,
22721 ::fidl_next::EncodeError,
22722 >;
22723
22724 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
22725 fn list_extended_attributes<___R>(
22726 &self,
22727 request: ___R,
22728 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
22729 where
22730 ___R: ::fidl_next::Encode<
22731 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22732 Encoded = crate::WireNodeListExtendedAttributesRequest,
22733 >;
22734
22735 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
22736 fn get_extended_attribute<___R>(
22737 &self,
22738 request: ___R,
22739 ) -> Result<
22740 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetExtendedAttribute>,
22741 ::fidl_next::EncodeError,
22742 >
22743 where
22744 ___R: ::fidl_next::Encode<
22745 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22746 Encoded = crate::WireNodeGetExtendedAttributeRequest,
22747 >;
22748
22749 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
22750 fn set_extended_attribute<___R>(
22751 &self,
22752 request: ___R,
22753 ) -> Result<
22754 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetExtendedAttribute>,
22755 ::fidl_next::EncodeError,
22756 >
22757 where
22758 ___R: ::fidl_next::Encode<
22759 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22760 Encoded = crate::WireNodeSetExtendedAttributeRequest,
22761 >;
22762
22763 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
22764 fn remove_extended_attribute<___R>(
22765 &self,
22766 request: ___R,
22767 ) -> Result<
22768 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::RemoveExtendedAttribute>,
22769 ::fidl_next::EncodeError,
22770 >
22771 where
22772 ___R: ::fidl_next::Encode<
22773 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22774 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
22775 >;
22776
22777 fn describe(
22778 &self,
22779 ) -> Result<
22780 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Describe>,
22781 ::fidl_next::EncodeError,
22782 >;
22783}
22784
22785impl<___T> SymlinkClientSender for ::fidl_next::ClientSender<___T, Symlink>
22786where
22787 ___T: ::fidl_next::Transport,
22788{
22789 type Transport = ___T;
22790
22791 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
22792 fn link_into<___R>(
22793 &self,
22794 request: ___R,
22795 ) -> Result<
22796 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::LinkInto>,
22797 ::fidl_next::EncodeError,
22798 >
22799 where
22800 ___R: ::fidl_next::Encode<
22801 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22802 Encoded = crate::WireLinkableLinkIntoRequest,
22803 >,
22804 {
22805 self.as_untyped()
22806 .send_two_way(6121399674497678964, request)
22807 .map(::fidl_next::ResponseFuture::from_untyped)
22808 }
22809
22810 fn clone<___R>(
22811 &self,
22812 request: ___R,
22813 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
22814 where
22815 ___R: ::fidl_next::Encode<
22816 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22817 Encoded = ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest,
22818 >,
22819 {
22820 self.as_untyped().send_one_way(2366825959783828089, request)
22821 }
22822
22823 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
22824 fn close(
22825 &self,
22826 ) -> Result<
22827 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Close>,
22828 ::fidl_next::EncodeError,
22829 > {
22830 self.as_untyped()
22831 .send_two_way(6540867515453498750, ())
22832 .map(::fidl_next::ResponseFuture::from_untyped)
22833 }
22834
22835 fn query(
22836 &self,
22837 ) -> Result<
22838 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Query>,
22839 ::fidl_next::EncodeError,
22840 > {
22841 self.as_untyped()
22842 .send_two_way(2763219980499352582, ())
22843 .map(::fidl_next::ResponseFuture::from_untyped)
22844 }
22845
22846 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
22847 fn deprecated_clone<___R>(
22848 &self,
22849 request: ___R,
22850 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
22851 where
22852 ___R: ::fidl_next::Encode<
22853 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22854 Encoded = crate::WireNodeDeprecatedCloneRequest,
22855 >,
22856 {
22857 self.as_untyped().send_one_way(6512600400724287855, request)
22858 }
22859
22860 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
22861 fn get_attr(
22862 &self,
22863 ) -> Result<
22864 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetAttr>,
22865 ::fidl_next::EncodeError,
22866 > {
22867 self.as_untyped()
22868 .send_two_way(8689798978500614909, ())
22869 .map(::fidl_next::ResponseFuture::from_untyped)
22870 }
22871
22872 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
22873 fn set_attr<___R>(
22874 &self,
22875 request: ___R,
22876 ) -> Result<
22877 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetAttr>,
22878 ::fidl_next::EncodeError,
22879 >
22880 where
22881 ___R: ::fidl_next::Encode<
22882 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22883 Encoded = crate::WireNodeSetAttrRequest,
22884 >,
22885 {
22886 self.as_untyped()
22887 .send_two_way(4721673413776871238, request)
22888 .map(::fidl_next::ResponseFuture::from_untyped)
22889 }
22890
22891 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
22892 fn deprecated_get_flags(
22893 &self,
22894 ) -> Result<
22895 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::DeprecatedGetFlags>,
22896 ::fidl_next::EncodeError,
22897 > {
22898 self.as_untyped()
22899 .send_two_way(6595803110182632097, ())
22900 .map(::fidl_next::ResponseFuture::from_untyped)
22901 }
22902
22903 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
22904 fn deprecated_set_flags<___R>(
22905 &self,
22906 request: ___R,
22907 ) -> Result<
22908 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::DeprecatedSetFlags>,
22909 ::fidl_next::EncodeError,
22910 >
22911 where
22912 ___R: ::fidl_next::Encode<
22913 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22914 Encoded = crate::WireNodeDeprecatedSetFlagsRequest,
22915 >,
22916 {
22917 self.as_untyped()
22918 .send_two_way(5950864159036794675, request)
22919 .map(::fidl_next::ResponseFuture::from_untyped)
22920 }
22921
22922 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
22923 fn get_flags(
22924 &self,
22925 ) -> Result<
22926 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetFlags>,
22927 ::fidl_next::EncodeError,
22928 > {
22929 self.as_untyped()
22930 .send_two_way(105530239381466147, ())
22931 .map(::fidl_next::ResponseFuture::from_untyped)
22932 }
22933
22934 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
22935 fn set_flags<___R>(
22936 &self,
22937 request: ___R,
22938 ) -> Result<
22939 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetFlags>,
22940 ::fidl_next::EncodeError,
22941 >
22942 where
22943 ___R: ::fidl_next::Encode<
22944 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22945 Encoded = crate::WireNodeSetFlagsRequest,
22946 >,
22947 {
22948 self.as_untyped()
22949 .send_two_way(6172186066099445416, request)
22950 .map(::fidl_next::ResponseFuture::from_untyped)
22951 }
22952
22953 #[doc = " Query the filesystem for filesystem-specific information.\n"]
22954 fn query_filesystem(
22955 &self,
22956 ) -> Result<
22957 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::QueryFilesystem>,
22958 ::fidl_next::EncodeError,
22959 > {
22960 self.as_untyped()
22961 .send_two_way(8013111122914313744, ())
22962 .map(::fidl_next::ResponseFuture::from_untyped)
22963 }
22964
22965 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
22966 fn get_connection_info(
22967 &self,
22968 ) -> Result<
22969 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetConnectionInfo>,
22970 ::fidl_next::EncodeError,
22971 > {
22972 self.as_untyped()
22973 .send_two_way(6362521381364198667, ())
22974 .map(::fidl_next::ResponseFuture::from_untyped)
22975 }
22976
22977 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
22978 fn get_attributes<___R>(
22979 &self,
22980 request: ___R,
22981 ) -> Result<
22982 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetAttributes>,
22983 ::fidl_next::EncodeError,
22984 >
22985 where
22986 ___R: ::fidl_next::Encode<
22987 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
22988 Encoded = crate::WireNodeGetAttributesRequest,
22989 >,
22990 {
22991 self.as_untyped()
22992 .send_two_way(4414537700416816443, request)
22993 .map(::fidl_next::ResponseFuture::from_untyped)
22994 }
22995
22996 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
22997 fn update_attributes<___R>(
22998 &self,
22999 request: ___R,
23000 ) -> Result<
23001 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::UpdateAttributes>,
23002 ::fidl_next::EncodeError,
23003 >
23004 where
23005 ___R: ::fidl_next::Encode<
23006 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23007 Encoded = crate::WireMutableNodeAttributes,
23008 >,
23009 {
23010 self.as_untyped()
23011 .send_two_way(3677402239314018056, request)
23012 .map(::fidl_next::ResponseFuture::from_untyped)
23013 }
23014
23015 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
23016 fn sync(
23017 &self,
23018 ) -> Result<
23019 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Sync>,
23020 ::fidl_next::EncodeError,
23021 > {
23022 self.as_untyped()
23023 .send_two_way(3196473584242777161, ())
23024 .map(::fidl_next::ResponseFuture::from_untyped)
23025 }
23026
23027 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
23028 fn list_extended_attributes<___R>(
23029 &self,
23030 request: ___R,
23031 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
23032 where
23033 ___R: ::fidl_next::Encode<
23034 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23035 Encoded = crate::WireNodeListExtendedAttributesRequest,
23036 >,
23037 {
23038 self.as_untyped().send_one_way(5431626189872037072, request)
23039 }
23040
23041 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
23042 fn get_extended_attribute<___R>(
23043 &self,
23044 request: ___R,
23045 ) -> Result<
23046 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::GetExtendedAttribute>,
23047 ::fidl_next::EncodeError,
23048 >
23049 where
23050 ___R: ::fidl_next::Encode<
23051 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23052 Encoded = crate::WireNodeGetExtendedAttributeRequest,
23053 >,
23054 {
23055 self.as_untyped()
23056 .send_two_way(5043930208506967771, request)
23057 .map(::fidl_next::ResponseFuture::from_untyped)
23058 }
23059
23060 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
23061 fn set_extended_attribute<___R>(
23062 &self,
23063 request: ___R,
23064 ) -> Result<
23065 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::SetExtendedAttribute>,
23066 ::fidl_next::EncodeError,
23067 >
23068 where
23069 ___R: ::fidl_next::Encode<
23070 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23071 Encoded = crate::WireNodeSetExtendedAttributeRequest,
23072 >,
23073 {
23074 self.as_untyped()
23075 .send_two_way(5374223046099989052, request)
23076 .map(::fidl_next::ResponseFuture::from_untyped)
23077 }
23078
23079 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
23080 fn remove_extended_attribute<___R>(
23081 &self,
23082 request: ___R,
23083 ) -> Result<
23084 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::RemoveExtendedAttribute>,
23085 ::fidl_next::EncodeError,
23086 >
23087 where
23088 ___R: ::fidl_next::Encode<
23089 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23090 Encoded = crate::WireNodeRemoveExtendedAttributeRequest,
23091 >,
23092 {
23093 self.as_untyped()
23094 .send_two_way(8794297771444732717, request)
23095 .map(::fidl_next::ResponseFuture::from_untyped)
23096 }
23097
23098 fn describe(
23099 &self,
23100 ) -> Result<
23101 ::fidl_next::ResponseFuture<'_, Self::Transport, symlink::Describe>,
23102 ::fidl_next::EncodeError,
23103 > {
23104 self.as_untyped()
23105 .send_two_way(8371117097481679347, ())
23106 .map(::fidl_next::ResponseFuture::from_untyped)
23107 }
23108}
23109
23110pub trait SymlinkClientHandler<___T: ::fidl_next::Transport> {
23114 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
23115 fn on_open(
23116 &mut self,
23117 sender: &::fidl_next::ClientSender<___T, Symlink>,
23118
23119 event: ::fidl_next::Response<___T, symlink::OnOpen>,
23120 );
23121
23122 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
23123 fn on_representation(
23124 &mut self,
23125 sender: &::fidl_next::ClientSender<___T, Symlink>,
23126
23127 event: ::fidl_next::Response<___T, symlink::OnRepresentation>,
23128 );
23129
23130 fn on_unknown_interaction(
23131 &mut self,
23132 sender: &::fidl_next::ClientSender<___T, Symlink>,
23133 ordinal: u64,
23134 ) {
23135 sender.close();
23136 }
23137}
23138
23139impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Symlink
23140where
23141 ___T: ::fidl_next::Transport,
23142 ___H: SymlinkClientHandler<___T>,
23143
23144 <symlink::LinkInto as ::fidl_next::Method>::Response:
23145 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23146
23147 <symlink::Close as ::fidl_next::Method>::Response:
23148 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23149
23150 <symlink::Query as ::fidl_next::Method>::Response:
23151 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23152
23153 <symlink::OnOpen as ::fidl_next::Method>::Response:
23154 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23155
23156 <symlink::GetAttr as ::fidl_next::Method>::Response:
23157 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23158
23159 <symlink::SetAttr as ::fidl_next::Method>::Response:
23160 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23161
23162 <symlink::DeprecatedGetFlags as ::fidl_next::Method>::Response:
23163 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23164
23165 <symlink::DeprecatedSetFlags as ::fidl_next::Method>::Response:
23166 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23167
23168 <symlink::GetFlags as ::fidl_next::Method>::Response:
23169 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23170
23171 <symlink::SetFlags as ::fidl_next::Method>::Response:
23172 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23173
23174 <symlink::QueryFilesystem as ::fidl_next::Method>::Response:
23175 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23176
23177 <symlink::OnRepresentation as ::fidl_next::Method>::Response:
23178 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23179
23180 <symlink::GetConnectionInfo as ::fidl_next::Method>::Response:
23181 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23182
23183 <symlink::GetAttributes as ::fidl_next::Method>::Response:
23184 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23185
23186 <symlink::UpdateAttributes as ::fidl_next::Method>::Response:
23187 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23188
23189 <symlink::Sync as ::fidl_next::Method>::Response:
23190 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23191
23192 <symlink::GetExtendedAttribute as ::fidl_next::Method>::Response:
23193 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23194
23195 <symlink::SetExtendedAttribute as ::fidl_next::Method>::Response:
23196 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23197
23198 <symlink::RemoveExtendedAttribute as ::fidl_next::Method>::Response:
23199 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23200
23201 <symlink::Describe as ::fidl_next::Method>::Response:
23202 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23203{
23204 fn on_event(
23205 handler: &mut ___H,
23206 sender: &::fidl_next::ClientSender<___T, Self>,
23207 ordinal: u64,
23208 buffer: ___T::RecvBuffer,
23209 ) {
23210 match ordinal {
23211 9207534335756671346 => match ::fidl_next::DecoderExt::decode(buffer) {
23212 Ok(decoded) => handler.on_open(sender, decoded),
23213 Err(e) => {
23214 sender.close();
23215 }
23216 },
23217
23218 6679970090861613324 => match ::fidl_next::DecoderExt::decode(buffer) {
23219 Ok(decoded) => handler.on_representation(sender, decoded),
23220 Err(e) => {
23221 sender.close();
23222 }
23223 },
23224
23225 ordinal => handler.on_unknown_interaction(sender, ordinal),
23226 }
23227 }
23228}
23229
23230pub trait SymlinkServerSender {
23232 type Transport: ::fidl_next::Transport;
23233
23234 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
23235
23236 fn on_open<___R>(
23237 &self,
23238 request: ___R,
23239 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
23240 where
23241 ___R: ::fidl_next::Encode<
23242 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23243 Encoded = <symlink::OnOpen as ::fidl_next::Method>::Response,
23244 >;
23245
23246 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
23247
23248 fn on_representation<___R>(
23249 &self,
23250 request: ___R,
23251 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
23252 where
23253 ___R: ::fidl_next::Encode<
23254 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23255 Encoded = <symlink::OnRepresentation as ::fidl_next::Method>::Response,
23256 >;
23257}
23258
23259impl<___T> SymlinkServerSender for ::fidl_next::ServerSender<___T, Symlink>
23260where
23261 ___T: ::fidl_next::Transport,
23262{
23263 type Transport = ___T;
23264
23265 #[doc = " An event produced eagerly by a FIDL server if requested by `OpenFlags.DESCRIBE`.\n\n Indicates the success or failure of the open operation, and optionally describes the\n object. If the status is `ZX_OK`, `info` contains descriptive information about the object\n (the same as would be returned by `Describe`).\n"]
23266
23267 fn on_open<___R>(
23268 &self,
23269 request: ___R,
23270 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
23271 where
23272 ___R: ::fidl_next::Encode<
23273 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23274 Encoded = <symlink::OnOpen as ::fidl_next::Method>::Response,
23275 >,
23276 {
23277 self.as_untyped().send_event(9207534335756671346, request)
23278 }
23279
23280 #[doc = " An event produced eagerly by the server if requested by [`Flags.FLAG_SEND_REPRESENTATION`].\n This event will be sent as the first message from the server, and is sent exactly once.\n\n The active variant corresponds to the negotiated protocol for the target node (i.e. the\n protocol which this channel now speaks). Additionally, auxiliary handles and requested\n attributes are also returned in the event.\n"]
23281
23282 fn on_representation<___R>(
23283 &self,
23284 request: ___R,
23285 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
23286 where
23287 ___R: ::fidl_next::Encode<
23288 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
23289 Encoded = <symlink::OnRepresentation as ::fidl_next::Method>::Response,
23290 >,
23291 {
23292 self.as_untyped().send_event(6679970090861613324, request)
23293 }
23294}
23295
23296pub trait SymlinkServerHandler<___T: ::fidl_next::Transport> {
23300 #[doc = " Creates a link to this this object with name `dst` in the directory represented by\n `dst_parent_token`.\n\n `dst` must be a resolved object name. Including \"/\" in the string will return\n `ZX_ERR_INVALID_ARGS`.\n\n This method requires the maximal set of rights supported by the filesystem for this object.\n For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],\n [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also\n support the [`Rights.EXECUTE`] right. Insufficient rights will result in\n `ZX_ERR_ACCESS_DENIED`.\n\n If this object has no links and is *NOT* an unnamed temporary object (objects opened with\n `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`), it will fail with `ZX_ERR_NOT_FOUND`.\n\n For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,\n the object will be permanently linked to the filesystem. Requires that the unnamed temporary\n object is linkable, if not, it will fail with `ZX_ERR_NOT_FOUND`.\n\n This method does not have the same atomicity properties has the `Directory::Link` method,\n which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`\n because `LinkInto` will not prevent the source from being renamed or unlinked.\n"]
23301 fn link_into(
23302 &mut self,
23303 sender: &::fidl_next::ServerSender<___T, Symlink>,
23304
23305 request: ::fidl_next::Request<___T, symlink::LinkInto>,
23306
23307 responder: ::fidl_next::Responder<symlink::LinkInto>,
23308 );
23309
23310 fn clone(
23311 &mut self,
23312 sender: &::fidl_next::ServerSender<___T, Symlink>,
23313
23314 request: ::fidl_next::Request<___T, symlink::Clone>,
23315 );
23316
23317 #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
23318 fn close(
23319 &mut self,
23320 sender: &::fidl_next::ServerSender<___T, Symlink>,
23321
23322 responder: ::fidl_next::Responder<symlink::Close>,
23323 );
23324
23325 fn query(
23326 &mut self,
23327 sender: &::fidl_next::ServerSender<___T, Symlink>,
23328
23329 responder: ::fidl_next::Responder<symlink::Query>,
23330 );
23331
23332 #[doc = " DEPRECATED - Use `fuchsia.unknown/Cloneable.Clone` instead.\n"]
23333 fn deprecated_clone(
23334 &mut self,
23335 sender: &::fidl_next::ServerSender<___T, Symlink>,
23336
23337 request: ::fidl_next::Request<___T, symlink::DeprecatedClone>,
23338 );
23339
23340 #[doc = " Acquires information about the node.\n\n This method does not require any rights.\n"]
23341 fn get_attr(
23342 &mut self,
23343 sender: &::fidl_next::ServerSender<___T, Symlink>,
23344
23345 responder: ::fidl_next::Responder<symlink::GetAttr>,
23346 );
23347
23348 #[doc = " Updates information about the node.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if any attributes specified by [`flags`] are not supported.\n\n This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns\n `ZX_ERR_BAD_HANDLE`.\n"]
23349 fn set_attr(
23350 &mut self,
23351 sender: &::fidl_next::ServerSender<___T, Symlink>,
23352
23353 request: ::fidl_next::Request<___T, symlink::SetAttr>,
23354
23355 responder: ::fidl_next::Responder<symlink::SetAttr>,
23356 );
23357
23358 #[doc = " [DEPRECATED - Use new GetFlags method instead.]\n"]
23359 fn deprecated_get_flags(
23360 &mut self,
23361 sender: &::fidl_next::ServerSender<___T, Symlink>,
23362
23363 responder: ::fidl_next::Responder<symlink::DeprecatedGetFlags>,
23364 );
23365
23366 #[doc = " [DEPRECATED - Use new SetFlags method instead.]\n"]
23367 fn deprecated_set_flags(
23368 &mut self,
23369 sender: &::fidl_next::ServerSender<___T, Symlink>,
23370
23371 request: ::fidl_next::Request<___T, symlink::DeprecatedSetFlags>,
23372
23373 responder: ::fidl_next::Responder<symlink::DeprecatedSetFlags>,
23374 );
23375
23376 #[doc = " Queries the flags that apply to this node after it has been opened/created. This method does\n not require any rights.\n\n Note that the final set of flags that apply to the connection may differ from those\n specified with the `fuchsia.io/Directory.Open` request used to create it:\n - `Flags.PERM_INHERIT_*`: Only applies when determining connection rights.\n - `Flags.PROTOCOL_*`: Only the protocol of the connection will be present.\n - `Flags.FLAG_*`: Only applies when opening the resource, not part of the connection.\n"]
23377 fn get_flags(
23378 &mut self,
23379 sender: &::fidl_next::ServerSender<___T, Symlink>,
23380
23381 responder: ::fidl_next::Responder<symlink::GetFlags>,
23382 );
23383
23384 #[doc = " Sets the flags that apply to this node after it has been opened. This method does not\n require any rights.\n\n Only `Flags.FILE_APPEND` is currently supported. Calling this method without any flags will\n clear append mode.\n\n Errors:\n - `ZX_ERR_NOT_SUPPORTED`: The object does not support this feature or the specified flags.\n - `ZX_ERR_INVALID_ARGS`: `flags` other than `Flags.FILE_APPEND` were specified.\n"]
23385 fn set_flags(
23386 &mut self,
23387 sender: &::fidl_next::ServerSender<___T, Symlink>,
23388
23389 request: ::fidl_next::Request<___T, symlink::SetFlags>,
23390
23391 responder: ::fidl_next::Responder<symlink::SetFlags>,
23392 );
23393
23394 #[doc = " Query the filesystem for filesystem-specific information.\n"]
23395 fn query_filesystem(
23396 &mut self,
23397 sender: &::fidl_next::ServerSender<___T, Symlink>,
23398
23399 responder: ::fidl_next::Responder<symlink::QueryFilesystem>,
23400 );
23401
23402 #[doc = " Acquires information about the connection.\n\n This method does not require any rights.\n"]
23403 fn get_connection_info(
23404 &mut self,
23405 sender: &::fidl_next::ServerSender<___T, Symlink>,
23406
23407 responder: ::fidl_next::Responder<symlink::GetConnectionInfo>,
23408 );
23409
23410 #[doc = " Acquires information about the node.\n\n The attributes of a node should be stable, independent of the\n specific protocol used to access it.\n\n If a particular attribute is not applicable or not supported,\n filesystems should leave the corresponding field absent.\n\n + `query` a bit-mask specifying which attributes to fetch. The server\n should not return more than necessary.\n - `attributes` the returned attributes.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
23411 fn get_attributes(
23412 &mut self,
23413 sender: &::fidl_next::ServerSender<___T, Symlink>,
23414
23415 request: ::fidl_next::Request<___T, symlink::GetAttributes>,
23416
23417 responder: ::fidl_next::Responder<symlink::GetAttributes>,
23418 );
23419
23420 #[doc = " Updates information about the node.\n\n + `attributes` the presence of a table field in `attributes` indicates\n the intent to update the corresponding attribute.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the node does not support any of the specified attributes.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
23421 fn update_attributes(
23422 &mut self,
23423 sender: &::fidl_next::ServerSender<___T, Symlink>,
23424
23425 request: ::fidl_next::Request<___T, symlink::UpdateAttributes>,
23426
23427 responder: ::fidl_next::Responder<symlink::UpdateAttributes>,
23428 );
23429
23430 #[doc = " Synchronizes updates to the node to the underlying media, if it exists.\n\n This method will return when the filesystem server has flushed the\n relevant updates to the underlying media, but does not guarantee the\n underlying media has persisted the information, nor that any information\n is committed to hardware. Clients may use `Sync` to ensure ordering\n between operations.\n\n This method does not require any rights.\n"]
23431 fn sync(
23432 &mut self,
23433 sender: &::fidl_next::ServerSender<___T, Symlink>,
23434
23435 responder: ::fidl_next::Responder<symlink::Sync>,
23436 );
23437
23438 #[doc = " Creates an iterator over all the extended attribute names associated\n with this node. If an error occurs it is returned as an epitaph on the\n iterator request channel, and then the channel is closed.\n\n GetExtendedAttributes can be used with any of these names to retrieve\n the associated value.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
23439 fn list_extended_attributes(
23440 &mut self,
23441 sender: &::fidl_next::ServerSender<___T, Symlink>,
23442
23443 request: ::fidl_next::Request<___T, symlink::ListExtendedAttributes>,
23444 );
23445
23446 #[doc = " Get the value associated with the given attribute `name` for this node.\n\n Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No\n particular structure is imposed on them.\n\n This method requires the [`Rights.GET_ATTRIBUTES`] right.\n"]
23447 fn get_extended_attribute(
23448 &mut self,
23449 sender: &::fidl_next::ServerSender<___T, Symlink>,
23450
23451 request: ::fidl_next::Request<___T, symlink::GetExtendedAttribute>,
23452
23453 responder: ::fidl_next::Responder<symlink::GetExtendedAttribute>,
23454 );
23455
23456 #[doc = " Set the value for the given attribute `name` to `value` for this node.\n\n The attribute name may exist, in which case the attribute is updated.\n If the attribute doesn\'t exist, it is created. The name should have no\n null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
23457 fn set_extended_attribute(
23458 &mut self,
23459 sender: &::fidl_next::ServerSender<___T, Symlink>,
23460
23461 request: ::fidl_next::Request<___T, symlink::SetExtendedAttribute>,
23462
23463 responder: ::fidl_next::Responder<symlink::SetExtendedAttribute>,
23464 );
23465
23466 #[doc = " Remove the specified extended attribute.\n\n If the attribute doesn\'t exist, ZX_ERR_NOT_FOUND is returned.\n\n This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.\n"]
23467 fn remove_extended_attribute(
23468 &mut self,
23469 sender: &::fidl_next::ServerSender<___T, Symlink>,
23470
23471 request: ::fidl_next::Request<___T, symlink::RemoveExtendedAttribute>,
23472
23473 responder: ::fidl_next::Responder<symlink::RemoveExtendedAttribute>,
23474 );
23475
23476 fn describe(
23477 &mut self,
23478 sender: &::fidl_next::ServerSender<___T, Symlink>,
23479
23480 responder: ::fidl_next::Responder<symlink::Describe>,
23481 );
23482
23483 fn on_unknown_interaction(
23484 &mut self,
23485 sender: &::fidl_next::ServerSender<___T, Symlink>,
23486 ordinal: u64,
23487 ) {
23488 sender.close();
23489 }
23490}
23491
23492impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Symlink
23493where
23494 ___T: ::fidl_next::Transport,
23495 ___H: SymlinkServerHandler<___T>,
23496
23497 crate::WireLinkableLinkIntoRequest:
23498 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23499
23500 ::fidl_next_fuchsia_unknown::WireCloneableCloneRequest:
23501 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23502
23503 crate::WireNodeDeprecatedCloneRequest:
23504 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23505
23506 crate::WireNodeSetAttrRequest:
23507 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23508
23509 crate::WireNodeDeprecatedSetFlagsRequest:
23510 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23511
23512 crate::WireNodeSetFlagsRequest:
23513 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23514
23515 crate::WireNodeGetAttributesRequest:
23516 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23517
23518 crate::WireMutableNodeAttributes:
23519 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23520
23521 crate::WireNodeListExtendedAttributesRequest:
23522 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23523
23524 crate::WireNodeGetExtendedAttributeRequest:
23525 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23526
23527 crate::WireNodeSetExtendedAttributeRequest:
23528 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23529
23530 crate::WireNodeRemoveExtendedAttributeRequest:
23531 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
23532{
23533 fn on_one_way(
23534 handler: &mut ___H,
23535 sender: &::fidl_next::ServerSender<___T, Self>,
23536 ordinal: u64,
23537 buffer: ___T::RecvBuffer,
23538 ) {
23539 match ordinal {
23540 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
23541 Ok(decoded) => handler.clone(sender, decoded),
23542 Err(e) => {
23543 sender.close();
23544 }
23545 },
23546
23547 6512600400724287855 => match ::fidl_next::DecoderExt::decode(buffer) {
23548 Ok(decoded) => handler.deprecated_clone(sender, decoded),
23549 Err(e) => {
23550 sender.close();
23551 }
23552 },
23553
23554 5431626189872037072 => match ::fidl_next::DecoderExt::decode(buffer) {
23555 Ok(decoded) => handler.list_extended_attributes(sender, decoded),
23556 Err(e) => {
23557 sender.close();
23558 }
23559 },
23560
23561 ordinal => handler.on_unknown_interaction(sender, ordinal),
23562 }
23563 }
23564
23565 fn on_two_way(
23566 handler: &mut ___H,
23567 sender: &::fidl_next::ServerSender<___T, Self>,
23568 ordinal: u64,
23569 buffer: ___T::RecvBuffer,
23570 responder: ::fidl_next::protocol::Responder,
23571 ) {
23572 match ordinal {
23573 6121399674497678964 => {
23574 let responder = ::fidl_next::Responder::from_untyped(responder);
23575
23576 match ::fidl_next::DecoderExt::decode(buffer) {
23577 Ok(decoded) => handler.link_into(sender, decoded, responder),
23578 Err(e) => {
23579 sender.close();
23580 }
23581 }
23582 }
23583
23584 6540867515453498750 => {
23585 let responder = ::fidl_next::Responder::from_untyped(responder);
23586
23587 handler.close(sender, responder);
23588 }
23589
23590 2763219980499352582 => {
23591 let responder = ::fidl_next::Responder::from_untyped(responder);
23592
23593 handler.query(sender, responder);
23594 }
23595
23596 8689798978500614909 => {
23597 let responder = ::fidl_next::Responder::from_untyped(responder);
23598
23599 handler.get_attr(sender, responder);
23600 }
23601
23602 4721673413776871238 => {
23603 let responder = ::fidl_next::Responder::from_untyped(responder);
23604
23605 match ::fidl_next::DecoderExt::decode(buffer) {
23606 Ok(decoded) => handler.set_attr(sender, decoded, responder),
23607 Err(e) => {
23608 sender.close();
23609 }
23610 }
23611 }
23612
23613 6595803110182632097 => {
23614 let responder = ::fidl_next::Responder::from_untyped(responder);
23615
23616 handler.deprecated_get_flags(sender, responder);
23617 }
23618
23619 5950864159036794675 => {
23620 let responder = ::fidl_next::Responder::from_untyped(responder);
23621
23622 match ::fidl_next::DecoderExt::decode(buffer) {
23623 Ok(decoded) => handler.deprecated_set_flags(sender, decoded, responder),
23624 Err(e) => {
23625 sender.close();
23626 }
23627 }
23628 }
23629
23630 105530239381466147 => {
23631 let responder = ::fidl_next::Responder::from_untyped(responder);
23632
23633 handler.get_flags(sender, responder);
23634 }
23635
23636 6172186066099445416 => {
23637 let responder = ::fidl_next::Responder::from_untyped(responder);
23638
23639 match ::fidl_next::DecoderExt::decode(buffer) {
23640 Ok(decoded) => handler.set_flags(sender, decoded, responder),
23641 Err(e) => {
23642 sender.close();
23643 }
23644 }
23645 }
23646
23647 8013111122914313744 => {
23648 let responder = ::fidl_next::Responder::from_untyped(responder);
23649
23650 handler.query_filesystem(sender, responder);
23651 }
23652
23653 6362521381364198667 => {
23654 let responder = ::fidl_next::Responder::from_untyped(responder);
23655
23656 handler.get_connection_info(sender, responder);
23657 }
23658
23659 4414537700416816443 => {
23660 let responder = ::fidl_next::Responder::from_untyped(responder);
23661
23662 match ::fidl_next::DecoderExt::decode(buffer) {
23663 Ok(decoded) => handler.get_attributes(sender, decoded, responder),
23664 Err(e) => {
23665 sender.close();
23666 }
23667 }
23668 }
23669
23670 3677402239314018056 => {
23671 let responder = ::fidl_next::Responder::from_untyped(responder);
23672
23673 match ::fidl_next::DecoderExt::decode(buffer) {
23674 Ok(decoded) => handler.update_attributes(sender, decoded, responder),
23675 Err(e) => {
23676 sender.close();
23677 }
23678 }
23679 }
23680
23681 3196473584242777161 => {
23682 let responder = ::fidl_next::Responder::from_untyped(responder);
23683
23684 handler.sync(sender, responder);
23685 }
23686
23687 5043930208506967771 => {
23688 let responder = ::fidl_next::Responder::from_untyped(responder);
23689
23690 match ::fidl_next::DecoderExt::decode(buffer) {
23691 Ok(decoded) => handler.get_extended_attribute(sender, decoded, responder),
23692 Err(e) => {
23693 sender.close();
23694 }
23695 }
23696 }
23697
23698 5374223046099989052 => {
23699 let responder = ::fidl_next::Responder::from_untyped(responder);
23700
23701 match ::fidl_next::DecoderExt::decode(buffer) {
23702 Ok(decoded) => handler.set_extended_attribute(sender, decoded, responder),
23703 Err(e) => {
23704 sender.close();
23705 }
23706 }
23707 }
23708
23709 8794297771444732717 => {
23710 let responder = ::fidl_next::Responder::from_untyped(responder);
23711
23712 match ::fidl_next::DecoderExt::decode(buffer) {
23713 Ok(decoded) => handler.remove_extended_attribute(sender, decoded, responder),
23714 Err(e) => {
23715 sender.close();
23716 }
23717 }
23718 }
23719
23720 8371117097481679347 => {
23721 let responder = ::fidl_next::Responder::from_untyped(responder);
23722
23723 handler.describe(sender, responder);
23724 }
23725
23726 ordinal => handler.on_unknown_interaction(sender, ordinal),
23727 }
23728 }
23729}
23730
23731#[doc = " Alias for directory permission alias w*\n"]
23732pub const W_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(485);
23733
23734#[derive(Clone, Copy, Debug, PartialEq, Eq)]
23735#[repr(u8)]
23736pub enum WatchEvent {
23737 Deleted = 0,
23738 Added = 1,
23739 Removed = 2,
23740 Existing = 3,
23741 Idle = 4,
23742}
23743
23744impl ::fidl_next::Encodable for WatchEvent {
23745 type Encoded = WireWatchEvent;
23746}
23747impl ::std::convert::TryFrom<u8> for WatchEvent {
23748 type Error = ::fidl_next::UnknownStrictEnumMemberError;
23749 fn try_from(value: u8) -> Result<Self, Self::Error> {
23750 match value {
23751 0 => Ok(Self::Deleted),
23752 1 => Ok(Self::Added),
23753 2 => Ok(Self::Removed),
23754 3 => Ok(Self::Existing),
23755 4 => Ok(Self::Idle),
23756
23757 _ => Err(Self::Error::new(value.into())),
23758 }
23759 }
23760}
23761
23762unsafe impl<___E> ::fidl_next::Encode<___E> for WatchEvent
23763where
23764 ___E: ?Sized,
23765{
23766 #[inline]
23767 fn encode(
23768 self,
23769 encoder: &mut ___E,
23770 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23771 ) -> Result<(), ::fidl_next::EncodeError> {
23772 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
23773 }
23774}
23775
23776unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WatchEvent
23777where
23778 ___E: ?Sized,
23779{
23780 #[inline]
23781 fn encode_ref(
23782 &self,
23783 encoder: &mut ___E,
23784 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23785 ) -> Result<(), ::fidl_next::EncodeError> {
23786 ::fidl_next::munge!(let WireWatchEvent { value } = out);
23787 let _ = value.write(u8::from(match *self {
23788 Self::Deleted => 0,
23789
23790 Self::Added => 1,
23791
23792 Self::Removed => 2,
23793
23794 Self::Existing => 3,
23795
23796 Self::Idle => 4,
23797 }));
23798
23799 Ok(())
23800 }
23801}
23802
23803impl ::core::convert::From<WireWatchEvent> for WatchEvent {
23804 fn from(wire: WireWatchEvent) -> Self {
23805 match u8::from(wire.value) {
23806 0 => Self::Deleted,
23807
23808 1 => Self::Added,
23809
23810 2 => Self::Removed,
23811
23812 3 => Self::Existing,
23813
23814 4 => Self::Idle,
23815
23816 _ => unsafe { ::core::hint::unreachable_unchecked() },
23817 }
23818 }
23819}
23820
23821impl ::fidl_next::TakeFrom<WireWatchEvent> for WatchEvent {
23822 #[inline]
23823 fn take_from(from: &WireWatchEvent) -> Self {
23824 Self::from(*from)
23825 }
23826}
23827
23828#[derive(Clone, Copy, Debug, PartialEq, Eq)]
23830#[repr(transparent)]
23831pub struct WireWatchEvent {
23832 value: u8,
23833}
23834
23835unsafe impl ::fidl_next::ZeroPadding for WireWatchEvent {
23836 #[inline]
23837 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
23838 }
23840}
23841
23842impl WireWatchEvent {
23843 pub const DELETED: WireWatchEvent = WireWatchEvent { value: 0 };
23844
23845 pub const ADDED: WireWatchEvent = WireWatchEvent { value: 1 };
23846
23847 pub const REMOVED: WireWatchEvent = WireWatchEvent { value: 2 };
23848
23849 pub const EXISTING: WireWatchEvent = WireWatchEvent { value: 3 };
23850
23851 pub const IDLE: WireWatchEvent = WireWatchEvent { value: 4 };
23852}
23853
23854unsafe impl<___D> ::fidl_next::Decode<___D> for WireWatchEvent
23855where
23856 ___D: ?Sized,
23857{
23858 fn decode(
23859 slot: ::fidl_next::Slot<'_, Self>,
23860 _: &mut ___D,
23861 ) -> Result<(), ::fidl_next::DecodeError> {
23862 ::fidl_next::munge!(let Self { value } = slot);
23863
23864 match u8::from(*value) {
23865 0 | 1 | 2 | 3 | 4 => (),
23866 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
23867 }
23868
23869 Ok(())
23870 }
23871}
23872
23873impl ::core::convert::From<WatchEvent> for WireWatchEvent {
23874 fn from(natural: WatchEvent) -> Self {
23875 match natural {
23876 WatchEvent::Deleted => WireWatchEvent::DELETED,
23877
23878 WatchEvent::Added => WireWatchEvent::ADDED,
23879
23880 WatchEvent::Removed => WireWatchEvent::REMOVED,
23881
23882 WatchEvent::Existing => WireWatchEvent::EXISTING,
23883
23884 WatchEvent::Idle => WireWatchEvent::IDLE,
23885 }
23886 }
23887}
23888
23889#[doc = " Alias for directory permission alias x*\n"]
23890pub const X_STAR_DIR: crate::Operations = crate::Operations::from_bits_retain(201);
23891
23892pub mod compat {
23894
23895 impl ::fidl_next::TakeFrom<crate::WireOperations> for ::fidl_fuchsia_io::Operations {
23896 #[inline]
23897 fn take_from(from: &crate::WireOperations) -> Self {
23898 Self::from_bits_retain(from.value.into())
23899 }
23900 }
23901
23902 impl ::fidl_next::TakeFrom<crate::WireSeekOrigin> for ::fidl_fuchsia_io::SeekOrigin {
23903 #[inline]
23904 fn take_from(from: &crate::WireSeekOrigin) -> Self {
23905 match crate::SeekOrigin::from(*from) {
23906 crate::SeekOrigin::Start => Self::Start,
23907
23908 crate::SeekOrigin::Current => Self::Current,
23909
23910 crate::SeekOrigin::End => Self::End,
23911 }
23912 }
23913 }
23914
23915 impl ::fidl_next::TakeFrom<crate::WireAdvisoryLockRange> for ::fidl_fuchsia_io::AdvisoryLockRange {
23916 #[inline]
23917 fn take_from(from: &crate::WireAdvisoryLockRange) -> Self {
23918 Self {
23919 origin: ::fidl_next::TakeFrom::take_from(&from.origin),
23920
23921 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
23922
23923 length: ::fidl_next::TakeFrom::take_from(&from.length),
23924 }
23925 }
23926 }
23927
23928 impl ::fidl_next::TakeFrom<crate::WireAdvisoryLockType> for ::fidl_fuchsia_io::AdvisoryLockType {
23929 #[inline]
23930 fn take_from(from: &crate::WireAdvisoryLockType) -> Self {
23931 match crate::AdvisoryLockType::from(*from) {
23932 crate::AdvisoryLockType::Read => Self::Read,
23933
23934 crate::AdvisoryLockType::Write => Self::Write,
23935
23936 crate::AdvisoryLockType::Unlock => Self::Unlock,
23937 }
23938 }
23939 }
23940
23941 impl ::fidl_next::TakeFrom<crate::WireAdvisoryLockRequest>
23942 for ::fidl_fuchsia_io::AdvisoryLockRequest
23943 {
23944 #[inline]
23945 fn take_from(from: &crate::WireAdvisoryLockRequest) -> Self {
23946 Self {
23947 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
23948
23949 range: from.range().map(::fidl_next::TakeFrom::take_from),
23950
23951 wait: from.wait().map(::fidl_next::TakeFrom::take_from),
23952
23953 __source_breaking: ::fidl::marker::SourceBreaking,
23954 }
23955 }
23956 }
23957
23958 impl ::fidl_next::TakeFrom<crate::WireAdvisoryLockingAdvisoryLockRequest>
23959 for ::fidl_fuchsia_io::AdvisoryLockingAdvisoryLockRequest
23960 {
23961 #[inline]
23962 fn take_from(from: &crate::WireAdvisoryLockingAdvisoryLockRequest) -> Self {
23963 Self { request: ::fidl_next::TakeFrom::take_from(&from.request) }
23964 }
23965 }
23966
23967 #[cfg(target_os = "fuchsia")]
23968 pub type AdvisoryLockingProxy =
23971 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::AdvisoryLocking>;
23972
23973 impl ::fidl_next::TakeFrom<crate::AdvisoryLocking> for ::fidl_fuchsia_io::AdvisoryLockingMarker {
23974 #[inline]
23975 fn take_from(from: &crate::AdvisoryLocking) -> Self {
23976 Self
23977 }
23978 }
23979
23980 impl ::fidl_next::TakeFrom<crate::WireAllocateMode> for ::fidl_fuchsia_io::AllocateMode {
23981 #[inline]
23982 fn take_from(from: &crate::WireAllocateMode) -> Self {
23983 Self::from_bits_retain(from.value.into())
23984 }
23985 }
23986
23987 impl ::fidl_next::TakeFrom<crate::WireConnectionInfo> for ::fidl_fuchsia_io::ConnectionInfo {
23988 #[inline]
23989 fn take_from(from: &crate::WireConnectionInfo) -> Self {
23990 Self {
23991 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
23992
23993 __source_breaking: ::fidl::marker::SourceBreaking,
23994 }
23995 }
23996 }
23997
23998 impl ::fidl_next::TakeFrom<crate::WireOpenFlags> for ::fidl_fuchsia_io::OpenFlags {
23999 #[inline]
24000 fn take_from(from: &crate::WireOpenFlags) -> Self {
24001 Self::from_bits_retain(from.value.into())
24002 }
24003 }
24004
24005 impl ::fidl_next::TakeFrom<crate::WireNodeAttributes> for ::fidl_fuchsia_io::NodeAttributes {
24006 #[inline]
24007 fn take_from(from: &crate::WireNodeAttributes) -> Self {
24008 Self {
24009 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
24010
24011 id: ::fidl_next::TakeFrom::take_from(&from.id),
24012
24013 content_size: ::fidl_next::TakeFrom::take_from(&from.content_size),
24014
24015 storage_size: ::fidl_next::TakeFrom::take_from(&from.storage_size),
24016
24017 link_count: ::fidl_next::TakeFrom::take_from(&from.link_count),
24018
24019 creation_time: ::fidl_next::TakeFrom::take_from(&from.creation_time),
24020
24021 modification_time: ::fidl_next::TakeFrom::take_from(&from.modification_time),
24022 }
24023 }
24024 }
24025
24026 impl ::fidl_next::TakeFrom<crate::WireNodeGetAttrResponse>
24027 for ::fidl_fuchsia_io::NodeGetAttrResponse
24028 {
24029 #[inline]
24030 fn take_from(from: &crate::WireNodeGetAttrResponse) -> Self {
24031 Self {
24032 s: ::fidl_next::TakeFrom::take_from(&from.s),
24033
24034 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
24035 }
24036 }
24037 }
24038
24039 impl ::fidl_next::TakeFrom<crate::WireNodeAttributeFlags>
24040 for ::fidl_fuchsia_io::NodeAttributeFlags
24041 {
24042 #[inline]
24043 fn take_from(from: &crate::WireNodeAttributeFlags) -> Self {
24044 Self::from_bits_retain(from.value.into())
24045 }
24046 }
24047
24048 impl ::fidl_next::TakeFrom<crate::WireNodeSetAttrRequest>
24049 for ::fidl_fuchsia_io::NodeSetAttrRequest
24050 {
24051 #[inline]
24052 fn take_from(from: &crate::WireNodeSetAttrRequest) -> Self {
24053 Self {
24054 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
24055
24056 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
24057 }
24058 }
24059 }
24060
24061 impl ::fidl_next::TakeFrom<crate::WireNodeSetAttrResponse>
24062 for ::fidl_fuchsia_io::NodeSetAttrResponse
24063 {
24064 #[inline]
24065 fn take_from(from: &crate::WireNodeSetAttrResponse) -> Self {
24066 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
24067 }
24068 }
24069
24070 impl ::fidl_next::TakeFrom<crate::WireNodeQueryFilesystemResponse>
24071 for ::fidl_fuchsia_io::NodeQueryFilesystemResponse
24072 {
24073 #[inline]
24074 fn take_from(from: &crate::WireNodeQueryFilesystemResponse) -> Self {
24075 Self {
24076 s: ::fidl_next::TakeFrom::take_from(&from.s),
24077
24078 info: ::fidl_next::TakeFrom::take_from(&from.info),
24079 }
24080 }
24081 }
24082
24083 impl ::fidl_next::TakeFrom<crate::WireModeType> for ::fidl_fuchsia_io::ModeType {
24084 #[inline]
24085 fn take_from(from: &crate::WireModeType) -> Self {
24086 Self::from_bits_retain(from.value.into())
24087 }
24088 }
24089
24090 impl ::fidl_next::TakeFrom<crate::WireDirectoryReadDirentsRequest>
24091 for ::fidl_fuchsia_io::DirectoryReadDirentsRequest
24092 {
24093 #[inline]
24094 fn take_from(from: &crate::WireDirectoryReadDirentsRequest) -> Self {
24095 Self { max_bytes: ::fidl_next::TakeFrom::take_from(&from.max_bytes) }
24096 }
24097 }
24098
24099 impl ::fidl_next::TakeFrom<crate::WireDirectoryReadDirentsResponse>
24100 for ::fidl_fuchsia_io::DirectoryReadDirentsResponse
24101 {
24102 #[inline]
24103 fn take_from(from: &crate::WireDirectoryReadDirentsResponse) -> Self {
24104 Self {
24105 s: ::fidl_next::TakeFrom::take_from(&from.s),
24106
24107 dirents: ::fidl_next::TakeFrom::take_from(&from.dirents),
24108 }
24109 }
24110 }
24111
24112 impl ::fidl_next::TakeFrom<crate::WireDirectoryRewindResponse>
24113 for ::fidl_fuchsia_io::DirectoryRewindResponse
24114 {
24115 #[inline]
24116 fn take_from(from: &crate::WireDirectoryRewindResponse) -> Self {
24117 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
24118 }
24119 }
24120
24121 impl ::fidl_next::TakeFrom<crate::WireDirectoryGetTokenResponse>
24122 for ::fidl_fuchsia_io::DirectoryGetTokenResponse
24123 {
24124 #[inline]
24125 fn take_from(from: &crate::WireDirectoryGetTokenResponse) -> Self {
24126 Self {
24127 s: ::fidl_next::TakeFrom::take_from(&from.s),
24128
24129 token: ::fidl_next::TakeFrom::take_from(&from.token),
24130 }
24131 }
24132 }
24133
24134 impl ::fidl_next::TakeFrom<crate::WireDirectoryLinkRequest>
24135 for ::fidl_fuchsia_io::DirectoryLinkRequest
24136 {
24137 #[inline]
24138 fn take_from(from: &crate::WireDirectoryLinkRequest) -> Self {
24139 Self {
24140 src: ::fidl_next::TakeFrom::take_from(&from.src),
24141
24142 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
24143
24144 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
24145 }
24146 }
24147 }
24148
24149 impl ::fidl_next::TakeFrom<crate::WireDirectoryLinkResponse>
24150 for ::fidl_fuchsia_io::DirectoryLinkResponse
24151 {
24152 #[inline]
24153 fn take_from(from: &crate::WireDirectoryLinkResponse) -> Self {
24154 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
24155 }
24156 }
24157
24158 impl ::fidl_next::TakeFrom<crate::WireUnlinkFlags> for ::fidl_fuchsia_io::UnlinkFlags {
24159 #[inline]
24160 fn take_from(from: &crate::WireUnlinkFlags) -> Self {
24161 Self::from_bits_retain(from.value.into())
24162 }
24163 }
24164
24165 impl ::fidl_next::TakeFrom<crate::WireUnlinkOptions> for ::fidl_fuchsia_io::UnlinkOptions {
24166 #[inline]
24167 fn take_from(from: &crate::WireUnlinkOptions) -> Self {
24168 Self {
24169 flags: from.flags().map(::fidl_next::TakeFrom::take_from),
24170
24171 __source_breaking: ::fidl::marker::SourceBreaking,
24172 }
24173 }
24174 }
24175
24176 impl ::fidl_next::TakeFrom<crate::WireDirectoryUnlinkRequest>
24177 for ::fidl_fuchsia_io::DirectoryUnlinkRequest
24178 {
24179 #[inline]
24180 fn take_from(from: &crate::WireDirectoryUnlinkRequest) -> Self {
24181 Self {
24182 name: ::fidl_next::TakeFrom::take_from(&from.name),
24183
24184 options: ::fidl_next::TakeFrom::take_from(&from.options),
24185 }
24186 }
24187 }
24188
24189 impl ::fidl_next::TakeFrom<crate::WireDirectoryRenameRequest>
24190 for ::fidl_fuchsia_io::DirectoryRenameRequest
24191 {
24192 #[inline]
24193 fn take_from(from: &crate::WireDirectoryRenameRequest) -> Self {
24194 Self {
24195 src: ::fidl_next::TakeFrom::take_from(&from.src),
24196
24197 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
24198
24199 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
24200 }
24201 }
24202 }
24203
24204 impl ::fidl_next::TakeFrom<crate::WireWatchMask> for ::fidl_fuchsia_io::WatchMask {
24205 #[inline]
24206 fn take_from(from: &crate::WireWatchMask) -> Self {
24207 Self::from_bits_retain(from.value.into())
24208 }
24209 }
24210
24211 impl ::fidl_next::TakeFrom<crate::WireDirectoryWatchRequest>
24212 for ::fidl_fuchsia_io::DirectoryWatchRequest
24213 {
24214 #[inline]
24215 fn take_from(from: &crate::WireDirectoryWatchRequest) -> Self {
24216 Self {
24217 mask: ::fidl_next::TakeFrom::take_from(&from.mask),
24218
24219 options: ::fidl_next::TakeFrom::take_from(&from.options),
24220
24221 watcher: ::fidl_next::TakeFrom::take_from(&from.watcher),
24222 }
24223 }
24224 }
24225
24226 impl ::fidl_next::TakeFrom<crate::WireDirectoryWatchResponse>
24227 for ::fidl_fuchsia_io::DirectoryWatchResponse
24228 {
24229 #[inline]
24230 fn take_from(from: &crate::WireDirectoryWatchResponse) -> Self {
24231 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
24232 }
24233 }
24234
24235 impl ::fidl_next::TakeFrom<crate::WireNodeOnOpenRequest> for ::fidl_fuchsia_io::NodeOnOpenRequest {
24236 #[inline]
24237 fn take_from(from: &crate::WireNodeOnOpenRequest) -> Self {
24238 Self {
24239 s: ::fidl_next::TakeFrom::take_from(&from.s),
24240
24241 info: ::fidl_next::TakeFrom::take_from(&from.info),
24242 }
24243 }
24244 }
24245
24246 impl ::fidl_next::TakeFrom<crate::WireNodeListExtendedAttributesRequest>
24247 for ::fidl_fuchsia_io::NodeListExtendedAttributesRequest
24248 {
24249 #[inline]
24250 fn take_from(from: &crate::WireNodeListExtendedAttributesRequest) -> Self {
24251 Self { iterator: ::fidl_next::TakeFrom::take_from(&from.iterator) }
24252 }
24253 }
24254
24255 impl ::fidl_next::TakeFrom<crate::WireNodeGetExtendedAttributeRequest>
24256 for ::fidl_fuchsia_io::NodeGetExtendedAttributeRequest
24257 {
24258 #[inline]
24259 fn take_from(from: &crate::WireNodeGetExtendedAttributeRequest) -> Self {
24260 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
24261 }
24262 }
24263
24264 impl ::fidl_next::TakeFrom<crate::WireExtendedAttributeValue>
24265 for ::fidl_fuchsia_io::ExtendedAttributeValue
24266 {
24267 #[inline]
24268 fn take_from(from: &crate::WireExtendedAttributeValue) -> Self {
24269 match from.as_ref() {
24270 crate::extended_attribute_value::Ref::Bytes(value) => {
24271 Self::Bytes(::fidl_next::TakeFrom::take_from(value))
24272 }
24273
24274 crate::extended_attribute_value::Ref::Buffer(value) => {
24275 Self::Buffer(::fidl_next::TakeFrom::take_from(value))
24276 }
24277
24278 crate::extended_attribute_value::Ref::UnknownOrdinal_(unknown_ordinal) => {
24279 Self::__SourceBreaking { unknown_ordinal }
24280 }
24281 }
24282 }
24283 }
24284
24285 impl ::fidl_next::TakeFrom<crate::WireOptionalExtendedAttributeValue>
24286 for Option<Box<::fidl_fuchsia_io::ExtendedAttributeValue>>
24287 {
24288 #[inline]
24289 fn take_from(from: &crate::WireOptionalExtendedAttributeValue) -> Self {
24290 if let Some(inner) = from.as_ref() {
24291 Some(::fidl_next::TakeFrom::take_from(inner))
24292 } else {
24293 None
24294 }
24295 }
24296 }
24297
24298 impl ::fidl_next::TakeFrom<crate::WireSetExtendedAttributeMode>
24299 for ::fidl_fuchsia_io::SetExtendedAttributeMode
24300 {
24301 #[inline]
24302 fn take_from(from: &crate::WireSetExtendedAttributeMode) -> Self {
24303 match crate::SetExtendedAttributeMode::from(*from) {
24304 crate::SetExtendedAttributeMode::Set => Self::Set,
24305
24306 crate::SetExtendedAttributeMode::Create => Self::Create,
24307
24308 crate::SetExtendedAttributeMode::Replace => Self::Replace,
24309 }
24310 }
24311 }
24312
24313 impl ::fidl_next::TakeFrom<crate::WireNodeSetExtendedAttributeRequest>
24314 for ::fidl_fuchsia_io::NodeSetExtendedAttributeRequest
24315 {
24316 #[inline]
24317 fn take_from(from: &crate::WireNodeSetExtendedAttributeRequest) -> Self {
24318 Self {
24319 name: ::fidl_next::TakeFrom::take_from(&from.name),
24320
24321 value: ::fidl_next::TakeFrom::take_from(&from.value),
24322
24323 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
24324 }
24325 }
24326 }
24327
24328 impl ::fidl_next::TakeFrom<crate::WireNodeRemoveExtendedAttributeRequest>
24329 for ::fidl_fuchsia_io::NodeRemoveExtendedAttributeRequest
24330 {
24331 #[inline]
24332 fn take_from(from: &crate::WireNodeRemoveExtendedAttributeRequest) -> Self {
24333 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
24334 }
24335 }
24336
24337 impl ::fidl_next::TakeFrom<crate::WireNodeDeprecatedCloneRequest>
24338 for ::fidl_fuchsia_io::NodeDeprecatedCloneRequest
24339 {
24340 #[inline]
24341 fn take_from(from: &crate::WireNodeDeprecatedCloneRequest) -> Self {
24342 Self {
24343 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
24344
24345 object: ::fidl_next::TakeFrom::take_from(&from.object),
24346 }
24347 }
24348 }
24349
24350 impl ::fidl_next::TakeFrom<crate::WireNodeDeprecatedGetFlagsResponse>
24351 for ::fidl_fuchsia_io::NodeDeprecatedGetFlagsResponse
24352 {
24353 #[inline]
24354 fn take_from(from: &crate::WireNodeDeprecatedGetFlagsResponse) -> Self {
24355 Self {
24356 s: ::fidl_next::TakeFrom::take_from(&from.s),
24357
24358 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
24359 }
24360 }
24361 }
24362
24363 impl ::fidl_next::TakeFrom<crate::WireNodeDeprecatedSetFlagsRequest>
24364 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsRequest
24365 {
24366 #[inline]
24367 fn take_from(from: &crate::WireNodeDeprecatedSetFlagsRequest) -> Self {
24368 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
24369 }
24370 }
24371
24372 impl ::fidl_next::TakeFrom<crate::WireNodeDeprecatedSetFlagsResponse>
24373 for ::fidl_fuchsia_io::NodeDeprecatedSetFlagsResponse
24374 {
24375 #[inline]
24376 fn take_from(from: &crate::WireNodeDeprecatedSetFlagsResponse) -> Self {
24377 Self { s: ::fidl_next::TakeFrom::take_from(&from.s) }
24378 }
24379 }
24380
24381 impl ::fidl_next::TakeFrom<crate::WireFlags> for ::fidl_fuchsia_io::Flags {
24382 #[inline]
24383 fn take_from(from: &crate::WireFlags) -> Self {
24384 Self::from_bits_retain(from.value.into())
24385 }
24386 }
24387
24388 impl ::fidl_next::TakeFrom<crate::WireNodeGetFlagsResponse>
24389 for ::fidl_fuchsia_io::NodeGetFlagsResponse
24390 {
24391 #[inline]
24392 fn take_from(from: &crate::WireNodeGetFlagsResponse) -> Self {
24393 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
24394 }
24395 }
24396
24397 impl ::fidl_next::TakeFrom<crate::WireNodeSetFlagsRequest>
24398 for ::fidl_fuchsia_io::NodeSetFlagsRequest
24399 {
24400 #[inline]
24401 fn take_from(from: &crate::WireNodeSetFlagsRequest) -> Self {
24402 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
24403 }
24404 }
24405
24406 impl ::fidl_next::TakeFrom<crate::WireEmptyStruct> for ::fidl_fuchsia_io::EmptyStruct {
24407 #[inline]
24408 fn take_from(from: &crate::WireEmptyStruct) -> Self {
24409 Self {}
24410 }
24411 }
24412
24413 impl ::fidl_next::TakeFrom<crate::WireSelinuxContext> for ::fidl_fuchsia_io::SelinuxContext {
24414 #[inline]
24415 fn take_from(from: &crate::WireSelinuxContext) -> Self {
24416 match from.as_ref() {
24417 crate::selinux_context::Ref::Data(value) => {
24418 Self::Data(::fidl_next::TakeFrom::take_from(value))
24419 }
24420
24421 crate::selinux_context::Ref::UseExtendedAttributes(value) => {
24422 Self::UseExtendedAttributes(::fidl_next::TakeFrom::take_from(value))
24423 }
24424
24425 crate::selinux_context::Ref::UnknownOrdinal_(unknown_ordinal) => {
24426 Self::__SourceBreaking { unknown_ordinal }
24427 }
24428 }
24429 }
24430 }
24431
24432 impl ::fidl_next::TakeFrom<crate::WireOptionalSelinuxContext>
24433 for Option<Box<::fidl_fuchsia_io::SelinuxContext>>
24434 {
24435 #[inline]
24436 fn take_from(from: &crate::WireOptionalSelinuxContext) -> Self {
24437 if let Some(inner) = from.as_ref() {
24438 Some(::fidl_next::TakeFrom::take_from(inner))
24439 } else {
24440 None
24441 }
24442 }
24443 }
24444
24445 impl ::fidl_next::TakeFrom<crate::WireMutableNodeAttributes>
24446 for ::fidl_fuchsia_io::MutableNodeAttributes
24447 {
24448 #[inline]
24449 fn take_from(from: &crate::WireMutableNodeAttributes) -> Self {
24450 Self {
24451 creation_time: from.creation_time().map(::fidl_next::TakeFrom::take_from),
24452
24453 modification_time: from.modification_time().map(::fidl_next::TakeFrom::take_from),
24454
24455 mode: from.mode().map(::fidl_next::TakeFrom::take_from),
24456
24457 uid: from.uid().map(::fidl_next::TakeFrom::take_from),
24458
24459 gid: from.gid().map(::fidl_next::TakeFrom::take_from),
24460
24461 rdev: from.rdev().map(::fidl_next::TakeFrom::take_from),
24462
24463 access_time: from.access_time().map(::fidl_next::TakeFrom::take_from),
24464
24465 casefold: from.casefold().map(::fidl_next::TakeFrom::take_from),
24466
24467 selinux_context: from.selinux_context().map(::fidl_next::TakeFrom::take_from),
24468
24469 wrapping_key_id: from.wrapping_key_id().map(::fidl_next::TakeFrom::take_from),
24470
24471 __source_breaking: ::fidl::marker::SourceBreaking,
24472 }
24473 }
24474 }
24475
24476 impl ::fidl_next::TakeFrom<crate::WireNodeProtocolKinds> for ::fidl_fuchsia_io::NodeProtocolKinds {
24477 #[inline]
24478 fn take_from(from: &crate::WireNodeProtocolKinds) -> Self {
24479 Self::from_bits_retain(from.value.into())
24480 }
24481 }
24482
24483 impl ::fidl_next::TakeFrom<crate::WireHashAlgorithm> for ::fidl_fuchsia_io::HashAlgorithm {
24484 #[inline]
24485 fn take_from(from: &crate::WireHashAlgorithm) -> Self {
24486 match crate::HashAlgorithm::from(*from) {
24487 crate::HashAlgorithm::Sha256 => Self::Sha256,
24488
24489 crate::HashAlgorithm::Sha512 => Self::Sha512,
24490
24491 crate::HashAlgorithm::UnknownOrdinal_(value) => {
24492 Self::__SourceBreaking { unknown_ordinal: value }
24493 }
24494 }
24495 }
24496 }
24497
24498 impl ::fidl_next::TakeFrom<crate::WireVerificationOptions>
24499 for ::fidl_fuchsia_io::VerificationOptions
24500 {
24501 #[inline]
24502 fn take_from(from: &crate::WireVerificationOptions) -> Self {
24503 Self {
24504 hash_algorithm: from.hash_algorithm().map(::fidl_next::TakeFrom::take_from),
24505
24506 salt: from.salt().map(::fidl_next::TakeFrom::take_from),
24507
24508 __source_breaking: ::fidl::marker::SourceBreaking,
24509 }
24510 }
24511 }
24512
24513 impl ::fidl_next::TakeFrom<crate::WireImmutableNodeAttributes>
24514 for ::fidl_fuchsia_io::ImmutableNodeAttributes
24515 {
24516 #[inline]
24517 fn take_from(from: &crate::WireImmutableNodeAttributes) -> Self {
24518 Self {
24519 protocols: from.protocols().map(::fidl_next::TakeFrom::take_from),
24520
24521 abilities: from.abilities().map(::fidl_next::TakeFrom::take_from),
24522
24523 content_size: from.content_size().map(::fidl_next::TakeFrom::take_from),
24524
24525 storage_size: from.storage_size().map(::fidl_next::TakeFrom::take_from),
24526
24527 link_count: from.link_count().map(::fidl_next::TakeFrom::take_from),
24528
24529 id: from.id().map(::fidl_next::TakeFrom::take_from),
24530
24531 change_time: from.change_time().map(::fidl_next::TakeFrom::take_from),
24532
24533 options: from.options().map(::fidl_next::TakeFrom::take_from),
24534
24535 root_hash: from.root_hash().map(::fidl_next::TakeFrom::take_from),
24536
24537 verity_enabled: from.verity_enabled().map(::fidl_next::TakeFrom::take_from),
24538
24539 __source_breaking: ::fidl::marker::SourceBreaking,
24540 }
24541 }
24542 }
24543
24544 impl ::fidl_next::TakeFrom<crate::WireNodeAttributes2> for ::fidl_fuchsia_io::NodeAttributes2 {
24545 #[inline]
24546 fn take_from(from: &crate::WireNodeAttributes2) -> Self {
24547 Self {
24548 mutable_attributes: ::fidl_next::TakeFrom::take_from(&from.mutable_attributes),
24549
24550 immutable_attributes: ::fidl_next::TakeFrom::take_from(&from.immutable_attributes),
24551 }
24552 }
24553 }
24554
24555 impl ::fidl_next::TakeFrom<crate::WireNodeInfo> for ::fidl_fuchsia_io::NodeInfo {
24556 #[inline]
24557 fn take_from(from: &crate::WireNodeInfo) -> Self {
24558 Self {
24559 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
24560
24561 __source_breaking: ::fidl::marker::SourceBreaking,
24562 }
24563 }
24564 }
24565
24566 impl ::fidl_next::TakeFrom<crate::WireDirectoryInfo> for ::fidl_fuchsia_io::DirectoryInfo {
24567 #[inline]
24568 fn take_from(from: &crate::WireDirectoryInfo) -> Self {
24569 Self {
24570 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
24571
24572 __source_breaking: ::fidl::marker::SourceBreaking,
24573 }
24574 }
24575 }
24576
24577 impl ::fidl_next::TakeFrom<crate::WireFileInfo> for ::fidl_fuchsia_io::FileInfo {
24578 #[inline]
24579 fn take_from(from: &crate::WireFileInfo) -> Self {
24580 Self {
24581 is_append: from.is_append().map(::fidl_next::TakeFrom::take_from),
24582
24583 observer: from.observer().map(::fidl_next::TakeFrom::take_from),
24584
24585 stream: from.stream().map(::fidl_next::TakeFrom::take_from),
24586
24587 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
24588
24589 __source_breaking: ::fidl::marker::SourceBreaking,
24590 }
24591 }
24592 }
24593
24594 impl ::fidl_next::TakeFrom<crate::WireSymlinkInfo> for ::fidl_fuchsia_io::SymlinkInfo {
24595 #[inline]
24596 fn take_from(from: &crate::WireSymlinkInfo) -> Self {
24597 Self {
24598 target: from.target().map(::fidl_next::TakeFrom::take_from),
24599
24600 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
24601
24602 __source_breaking: ::fidl::marker::SourceBreaking,
24603 }
24604 }
24605 }
24606
24607 impl ::fidl_next::TakeFrom<crate::WireRepresentation> for ::fidl_fuchsia_io::Representation {
24608 #[inline]
24609 fn take_from(from: &crate::WireRepresentation) -> Self {
24610 match from.as_ref() {
24611 crate::representation::Ref::Node(value) => {
24612 Self::Node(::fidl_next::TakeFrom::take_from(value))
24613 }
24614
24615 crate::representation::Ref::Directory(value) => {
24616 Self::Directory(::fidl_next::TakeFrom::take_from(value))
24617 }
24618
24619 crate::representation::Ref::File(value) => {
24620 Self::File(::fidl_next::TakeFrom::take_from(value))
24621 }
24622
24623 crate::representation::Ref::Symlink(value) => {
24624 Self::Symlink(::fidl_next::TakeFrom::take_from(value))
24625 }
24626
24627 crate::representation::Ref::UnknownOrdinal_(unknown_ordinal) => {
24628 Self::__SourceBreaking { unknown_ordinal }
24629 }
24630 }
24631 }
24632 }
24633
24634 impl ::fidl_next::TakeFrom<crate::WireOptionalRepresentation>
24635 for Option<Box<::fidl_fuchsia_io::Representation>>
24636 {
24637 #[inline]
24638 fn take_from(from: &crate::WireOptionalRepresentation) -> Self {
24639 if let Some(inner) = from.as_ref() {
24640 Some(::fidl_next::TakeFrom::take_from(inner))
24641 } else {
24642 None
24643 }
24644 }
24645 }
24646
24647 impl ::fidl_next::TakeFrom<crate::WireNodeAttributesQuery>
24648 for ::fidl_fuchsia_io::NodeAttributesQuery
24649 {
24650 #[inline]
24651 fn take_from(from: &crate::WireNodeAttributesQuery) -> Self {
24652 Self::from_bits_retain(from.value.into())
24653 }
24654 }
24655
24656 impl ::fidl_next::TakeFrom<crate::WireNodeGetAttributesRequest>
24657 for ::fidl_fuchsia_io::NodeGetAttributesRequest
24658 {
24659 #[inline]
24660 fn take_from(from: &crate::WireNodeGetAttributesRequest) -> Self {
24661 Self { query: ::fidl_next::TakeFrom::take_from(&from.query) }
24662 }
24663 }
24664
24665 #[cfg(target_os = "fuchsia")]
24666 pub type NodeProxy = ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Node>;
24669
24670 impl ::fidl_next::TakeFrom<crate::Node> for ::fidl_fuchsia_io::NodeMarker {
24671 #[inline]
24672 fn take_from(from: &crate::Node) -> Self {
24673 Self
24674 }
24675 }
24676
24677 impl ::fidl_next::TakeFrom<crate::WireDirectoryDeprecatedOpenRequest>
24678 for ::fidl_fuchsia_io::DirectoryDeprecatedOpenRequest
24679 {
24680 #[inline]
24681 fn take_from(from: &crate::WireDirectoryDeprecatedOpenRequest) -> Self {
24682 Self {
24683 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
24684
24685 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
24686
24687 path: ::fidl_next::TakeFrom::take_from(&from.path),
24688
24689 object: ::fidl_next::TakeFrom::take_from(&from.object),
24690 }
24691 }
24692 }
24693
24694 impl ::fidl_next::TakeFrom<crate::WireOptions> for ::fidl_fuchsia_io::Options {
24695 #[inline]
24696 fn take_from(from: &crate::WireOptions) -> Self {
24697 Self {
24698 attributes: from.attributes().map(::fidl_next::TakeFrom::take_from),
24699
24700 create_attributes: from.create_attributes().map(::fidl_next::TakeFrom::take_from),
24701
24702 __source_breaking: ::fidl::marker::SourceBreaking,
24703 }
24704 }
24705 }
24706
24707 impl ::fidl_next::TakeFrom<crate::WireDirectoryOpenRequest>
24708 for ::fidl_fuchsia_io::DirectoryOpenRequest
24709 {
24710 #[inline]
24711 fn take_from(from: &crate::WireDirectoryOpenRequest) -> Self {
24712 Self {
24713 path: ::fidl_next::TakeFrom::take_from(&from.path),
24714
24715 flags: ::fidl_next::TakeFrom::take_from(&from.flags),
24716
24717 options: ::fidl_next::TakeFrom::take_from(&from.options),
24718
24719 object: ::fidl_next::TakeFrom::take_from(&from.object),
24720 }
24721 }
24722 }
24723
24724 impl ::fidl_next::TakeFrom<crate::WireDirectoryCreateSymlinkRequest>
24725 for ::fidl_fuchsia_io::DirectoryCreateSymlinkRequest
24726 {
24727 #[inline]
24728 fn take_from(from: &crate::WireDirectoryCreateSymlinkRequest) -> Self {
24729 Self {
24730 name: ::fidl_next::TakeFrom::take_from(&from.name),
24731
24732 target: ::fidl_next::TakeFrom::take_from(&from.target),
24733
24734 connection: ::fidl_next::TakeFrom::take_from(&from.connection),
24735 }
24736 }
24737 }
24738
24739 #[cfg(target_os = "fuchsia")]
24740 pub type DirectoryProxy =
24743 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Directory>;
24744
24745 impl ::fidl_next::TakeFrom<crate::Directory> for ::fidl_fuchsia_io::DirectoryMarker {
24746 #[inline]
24747 fn take_from(from: &crate::Directory) -> Self {
24748 Self
24749 }
24750 }
24751
24752 impl ::fidl_next::TakeFrom<crate::WireDirectoryObject> for ::fidl_fuchsia_io::DirectoryObject {
24753 #[inline]
24754 fn take_from(from: &crate::WireDirectoryObject) -> Self {
24755 Self {}
24756 }
24757 }
24758
24759 #[cfg(target_os = "fuchsia")]
24760 pub type DirectoryWatcherProxy =
24763 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirectoryWatcher>;
24764
24765 impl ::fidl_next::TakeFrom<crate::DirectoryWatcher> for ::fidl_fuchsia_io::DirectoryWatcherMarker {
24766 #[inline]
24767 fn take_from(from: &crate::DirectoryWatcher) -> Self {
24768 Self
24769 }
24770 }
24771
24772 impl ::fidl_next::TakeFrom<crate::WireDirentType> for ::fidl_fuchsia_io::DirentType {
24773 #[inline]
24774 fn take_from(from: &crate::WireDirentType) -> Self {
24775 match crate::DirentType::from(*from) {
24776 crate::DirentType::Unknown => Self::Unknown,
24777
24778 crate::DirentType::Directory => Self::Directory,
24779
24780 crate::DirentType::BlockDevice => Self::BlockDevice,
24781
24782 crate::DirentType::File => Self::File,
24783
24784 crate::DirentType::Symlink => Self::Symlink,
24785
24786 crate::DirentType::Service => Self::Service,
24787
24788 crate::DirentType::UnknownOrdinal_(value) => {
24789 Self::__SourceBreaking { unknown_ordinal: value }
24790 }
24791 }
24792 }
24793 }
24794
24795 impl ::fidl_next::TakeFrom<crate::WireExtendedAttributeIteratorGetNextResponse>
24796 for ::fidl_fuchsia_io::ExtendedAttributeIteratorGetNextResponse
24797 {
24798 #[inline]
24799 fn take_from(from: &crate::WireExtendedAttributeIteratorGetNextResponse) -> Self {
24800 Self {
24801 attributes: ::fidl_next::TakeFrom::take_from(&from.attributes),
24802
24803 last: ::fidl_next::TakeFrom::take_from(&from.last),
24804 }
24805 }
24806 }
24807
24808 #[cfg(target_os = "fuchsia")]
24809 pub type ExtendedAttributeIteratorProxy = ::fidl_next::ClientSender<
24812 ::fidl_next::fuchsia::zx::Channel,
24813 crate::ExtendedAttributeIterator,
24814 >;
24815
24816 impl ::fidl_next::TakeFrom<crate::ExtendedAttributeIterator>
24817 for ::fidl_fuchsia_io::ExtendedAttributeIteratorMarker
24818 {
24819 #[inline]
24820 fn take_from(from: &crate::ExtendedAttributeIterator) -> Self {
24821 Self
24822 }
24823 }
24824
24825 impl ::fidl_next::TakeFrom<crate::WireReadableReadRequest>
24826 for ::fidl_fuchsia_io::ReadableReadRequest
24827 {
24828 #[inline]
24829 fn take_from(from: &crate::WireReadableReadRequest) -> Self {
24830 Self { count: ::fidl_next::TakeFrom::take_from(&from.count) }
24831 }
24832 }
24833
24834 impl ::fidl_next::TakeFrom<crate::WireReadableReadResponse>
24835 for ::fidl_fuchsia_io::ReadableReadResponse
24836 {
24837 #[inline]
24838 fn take_from(from: &crate::WireReadableReadResponse) -> Self {
24839 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
24840 }
24841 }
24842
24843 #[cfg(target_os = "fuchsia")]
24844 pub type ReadableProxy =
24847 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Readable>;
24848
24849 impl ::fidl_next::TakeFrom<crate::Readable> for ::fidl_fuchsia_io::ReadableMarker {
24850 #[inline]
24851 fn take_from(from: &crate::Readable) -> Self {
24852 Self
24853 }
24854 }
24855
24856 impl ::fidl_next::TakeFrom<crate::WireWritableWriteRequest>
24857 for ::fidl_fuchsia_io::WritableWriteRequest
24858 {
24859 #[inline]
24860 fn take_from(from: &crate::WireWritableWriteRequest) -> Self {
24861 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
24862 }
24863 }
24864
24865 impl ::fidl_next::TakeFrom<crate::WireWritableWriteResponse>
24866 for ::fidl_fuchsia_io::WritableWriteResponse
24867 {
24868 #[inline]
24869 fn take_from(from: &crate::WireWritableWriteResponse) -> Self {
24870 Self { actual_count: ::fidl_next::TakeFrom::take_from(&from.actual_count) }
24871 }
24872 }
24873
24874 #[cfg(target_os = "fuchsia")]
24875 pub type WritableProxy =
24878 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Writable>;
24879
24880 impl ::fidl_next::TakeFrom<crate::Writable> for ::fidl_fuchsia_io::WritableMarker {
24881 #[inline]
24882 fn take_from(from: &crate::Writable) -> Self {
24883 Self
24884 }
24885 }
24886
24887 impl ::fidl_next::TakeFrom<crate::WireFileSeekRequest> for ::fidl_fuchsia_io::FileSeekRequest {
24888 #[inline]
24889 fn take_from(from: &crate::WireFileSeekRequest) -> Self {
24890 Self {
24891 origin: ::fidl_next::TakeFrom::take_from(&from.origin),
24892
24893 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
24894 }
24895 }
24896 }
24897
24898 impl ::fidl_next::TakeFrom<crate::WireFileSeekResponse> for ::fidl_fuchsia_io::FileSeekResponse {
24899 #[inline]
24900 fn take_from(from: &crate::WireFileSeekResponse) -> Self {
24901 Self { offset_from_start: ::fidl_next::TakeFrom::take_from(&from.offset_from_start) }
24902 }
24903 }
24904
24905 impl ::fidl_next::TakeFrom<crate::WireFileReadAtRequest> for ::fidl_fuchsia_io::FileReadAtRequest {
24906 #[inline]
24907 fn take_from(from: &crate::WireFileReadAtRequest) -> Self {
24908 Self {
24909 count: ::fidl_next::TakeFrom::take_from(&from.count),
24910
24911 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
24912 }
24913 }
24914 }
24915
24916 impl ::fidl_next::TakeFrom<crate::WireFileReadAtResponse>
24917 for ::fidl_fuchsia_io::FileReadAtResponse
24918 {
24919 #[inline]
24920 fn take_from(from: &crate::WireFileReadAtResponse) -> Self {
24921 Self { data: ::fidl_next::TakeFrom::take_from(&from.data) }
24922 }
24923 }
24924
24925 impl ::fidl_next::TakeFrom<crate::WireFileWriteAtRequest>
24926 for ::fidl_fuchsia_io::FileWriteAtRequest
24927 {
24928 #[inline]
24929 fn take_from(from: &crate::WireFileWriteAtRequest) -> Self {
24930 Self {
24931 data: ::fidl_next::TakeFrom::take_from(&from.data),
24932
24933 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
24934 }
24935 }
24936 }
24937
24938 impl ::fidl_next::TakeFrom<crate::WireFileWriteAtResponse>
24939 for ::fidl_fuchsia_io::FileWriteAtResponse
24940 {
24941 #[inline]
24942 fn take_from(from: &crate::WireFileWriteAtResponse) -> Self {
24943 Self { actual_count: ::fidl_next::TakeFrom::take_from(&from.actual_count) }
24944 }
24945 }
24946
24947 impl ::fidl_next::TakeFrom<crate::WireFileResizeRequest> for ::fidl_fuchsia_io::FileResizeRequest {
24948 #[inline]
24949 fn take_from(from: &crate::WireFileResizeRequest) -> Self {
24950 Self { length: ::fidl_next::TakeFrom::take_from(&from.length) }
24951 }
24952 }
24953
24954 impl ::fidl_next::TakeFrom<crate::WireVmoFlags> for ::fidl_fuchsia_io::VmoFlags {
24955 #[inline]
24956 fn take_from(from: &crate::WireVmoFlags) -> Self {
24957 Self::from_bits_retain(from.value.into())
24958 }
24959 }
24960
24961 impl ::fidl_next::TakeFrom<crate::WireFileGetBackingMemoryRequest>
24962 for ::fidl_fuchsia_io::FileGetBackingMemoryRequest
24963 {
24964 #[inline]
24965 fn take_from(from: &crate::WireFileGetBackingMemoryRequest) -> Self {
24966 Self { flags: ::fidl_next::TakeFrom::take_from(&from.flags) }
24967 }
24968 }
24969
24970 impl ::fidl_next::TakeFrom<crate::WireFileGetBackingMemoryResponse>
24971 for ::fidl_fuchsia_io::FileGetBackingMemoryResponse
24972 {
24973 #[inline]
24974 fn take_from(from: &crate::WireFileGetBackingMemoryResponse) -> Self {
24975 Self { vmo: ::fidl_next::TakeFrom::take_from(&from.vmo) }
24976 }
24977 }
24978
24979 impl ::fidl_next::TakeFrom<crate::WireLinkableLinkIntoRequest>
24980 for ::fidl_fuchsia_io::LinkableLinkIntoRequest
24981 {
24982 #[inline]
24983 fn take_from(from: &crate::WireLinkableLinkIntoRequest) -> Self {
24984 Self {
24985 dst_parent_token: ::fidl_next::TakeFrom::take_from(&from.dst_parent_token),
24986
24987 dst: ::fidl_next::TakeFrom::take_from(&from.dst),
24988 }
24989 }
24990 }
24991
24992 #[cfg(target_os = "fuchsia")]
24993 pub type LinkableProxy =
24996 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Linkable>;
24997
24998 impl ::fidl_next::TakeFrom<crate::Linkable> for ::fidl_fuchsia_io::LinkableMarker {
24999 #[inline]
25000 fn take_from(from: &crate::Linkable) -> Self {
25001 Self
25002 }
25003 }
25004
25005 impl ::fidl_next::TakeFrom<crate::WireFileAllocateRequest>
25006 for ::fidl_fuchsia_io::FileAllocateRequest
25007 {
25008 #[inline]
25009 fn take_from(from: &crate::WireFileAllocateRequest) -> Self {
25010 Self {
25011 offset: ::fidl_next::TakeFrom::take_from(&from.offset),
25012
25013 length: ::fidl_next::TakeFrom::take_from(&from.length),
25014
25015 mode: ::fidl_next::TakeFrom::take_from(&from.mode),
25016 }
25017 }
25018 }
25019
25020 impl ::fidl_next::TakeFrom<crate::WireFileEnableVerityRequest>
25021 for ::fidl_fuchsia_io::FileEnableVerityRequest
25022 {
25023 #[inline]
25024 fn take_from(from: &crate::WireFileEnableVerityRequest) -> Self {
25025 Self { options: ::fidl_next::TakeFrom::take_from(&from.options) }
25026 }
25027 }
25028
25029 #[cfg(target_os = "fuchsia")]
25030 pub type FileProxy = ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::File>;
25033
25034 impl ::fidl_next::TakeFrom<crate::File> for ::fidl_fuchsia_io::FileMarker {
25035 #[inline]
25036 fn take_from(from: &crate::File) -> Self {
25037 Self
25038 }
25039 }
25040
25041 impl ::fidl_next::TakeFrom<crate::WireFileObject> for ::fidl_fuchsia_io::FileObject {
25042 #[inline]
25043 fn take_from(from: &crate::WireFileObject) -> Self {
25044 Self {
25045 event: ::fidl_next::TakeFrom::take_from(&from.event),
25046
25047 stream: ::fidl_next::TakeFrom::take_from(&from.stream),
25048 }
25049 }
25050 }
25051
25052 impl ::fidl_next::TakeFrom<crate::WireFileSignal> for ::fidl_fuchsia_io::FileSignal {
25053 #[inline]
25054 fn take_from(from: &crate::WireFileSignal) -> Self {
25055 Self::from_bits_retain(from.value.into())
25056 }
25057 }
25058
25059 impl ::fidl_next::TakeFrom<crate::WireFilesystemInfo> for ::fidl_fuchsia_io::FilesystemInfo {
25060 #[inline]
25061 fn take_from(from: &crate::WireFilesystemInfo) -> Self {
25062 Self {
25063 total_bytes: ::fidl_next::TakeFrom::take_from(&from.total_bytes),
25064
25065 used_bytes: ::fidl_next::TakeFrom::take_from(&from.used_bytes),
25066
25067 total_nodes: ::fidl_next::TakeFrom::take_from(&from.total_nodes),
25068
25069 used_nodes: ::fidl_next::TakeFrom::take_from(&from.used_nodes),
25070
25071 free_shared_pool_bytes: ::fidl_next::TakeFrom::take_from(
25072 &from.free_shared_pool_bytes,
25073 ),
25074
25075 fs_id: ::fidl_next::TakeFrom::take_from(&from.fs_id),
25076
25077 block_size: ::fidl_next::TakeFrom::take_from(&from.block_size),
25078
25079 max_filename_size: ::fidl_next::TakeFrom::take_from(&from.max_filename_size),
25080
25081 fs_type: ::fidl_next::TakeFrom::take_from(&from.fs_type),
25082
25083 padding: ::fidl_next::TakeFrom::take_from(&from.padding),
25084
25085 name: ::fidl_next::TakeFrom::take_from(&from.name),
25086 }
25087 }
25088 }
25089
25090 impl ::fidl_next::TakeFrom<crate::WireService> for ::fidl_fuchsia_io::Service {
25091 #[inline]
25092 fn take_from(from: &crate::WireService) -> Self {
25093 Self {}
25094 }
25095 }
25096
25097 impl ::fidl_next::TakeFrom<crate::WireSymlinkObject> for ::fidl_fuchsia_io::SymlinkObject {
25098 #[inline]
25099 fn take_from(from: &crate::WireSymlinkObject) -> Self {
25100 Self { target: ::fidl_next::TakeFrom::take_from(&from.target) }
25101 }
25102 }
25103
25104 impl ::fidl_next::TakeFrom<crate::WireNodeInfoDeprecated>
25105 for ::fidl_fuchsia_io::NodeInfoDeprecated
25106 {
25107 #[inline]
25108 fn take_from(from: &crate::WireNodeInfoDeprecated) -> Self {
25109 match from.as_ref() {
25110 crate::node_info_deprecated::Ref::Service(value) => {
25111 Self::Service(::fidl_next::TakeFrom::take_from(value))
25112 }
25113
25114 crate::node_info_deprecated::Ref::File(value) => {
25115 Self::File(::fidl_next::TakeFrom::take_from(value))
25116 }
25117
25118 crate::node_info_deprecated::Ref::Directory(value) => {
25119 Self::Directory(::fidl_next::TakeFrom::take_from(value))
25120 }
25121
25122 crate::node_info_deprecated::Ref::Symlink(value) => {
25123 Self::Symlink(::fidl_next::TakeFrom::take_from(value))
25124 }
25125 }
25126 }
25127 }
25128
25129 impl ::fidl_next::TakeFrom<crate::WireOptionalNodeInfoDeprecated>
25130 for Option<Box<::fidl_fuchsia_io::NodeInfoDeprecated>>
25131 {
25132 #[inline]
25133 fn take_from(from: &crate::WireOptionalNodeInfoDeprecated) -> Self {
25134 if let Some(inner) = from.as_ref() {
25135 Some(::fidl_next::TakeFrom::take_from(inner))
25136 } else {
25137 None
25138 }
25139 }
25140 }
25141
25142 #[cfg(target_os = "fuchsia")]
25143 pub type SymlinkProxy =
25146 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Symlink>;
25147
25148 impl ::fidl_next::TakeFrom<crate::Symlink> for ::fidl_fuchsia_io::SymlinkMarker {
25149 #[inline]
25150 fn take_from(from: &crate::Symlink) -> Self {
25151 Self
25152 }
25153 }
25154
25155 impl ::fidl_next::TakeFrom<crate::WireWatchEvent> for ::fidl_fuchsia_io::WatchEvent {
25156 #[inline]
25157 fn take_from(from: &crate::WireWatchEvent) -> Self {
25158 match crate::WatchEvent::from(*from) {
25159 crate::WatchEvent::Deleted => Self::Deleted,
25160
25161 crate::WatchEvent::Added => Self::Added,
25162
25163 crate::WatchEvent::Removed => Self::Removed,
25164
25165 crate::WatchEvent::Existing => Self::Existing,
25166
25167 crate::WatchEvent::Idle => Self::Idle,
25168 }
25169 }
25170 }
25171}