1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_driver_framework_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct DriverStartRequest {
16 pub start_args: DriverStartArgs,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DriverStartRequest {}
20
21#[derive(Debug, PartialEq)]
22pub struct NodeAddChildRequest {
23 pub args: NodeAddArgs,
24 pub controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
25 pub node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeAddChildRequest {}
29
30#[derive(Debug, Default, PartialEq)]
31pub struct DevfsAddArgs {
32 pub connector: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>>,
36 pub class_name: Option<String>,
41 pub inspect: Option<fidl::Vmo>,
44 pub connector_supports: Option<fidl_fuchsia_device_fs::ConnectionType>,
49 pub controller_connector:
55 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>>,
56 #[doc(hidden)]
57 pub __source_breaking: fidl::marker::SourceBreaking,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DevfsAddArgs {}
61
62#[derive(Debug, Default, PartialEq)]
64pub struct DriverStartArgs {
65 pub node: Option<fidl::endpoints::ClientEnd<NodeMarker>>,
67 pub symbols: Option<Vec<NodeSymbol>>,
71 pub url: Option<String>,
74 pub program: Option<fidl_fuchsia_data::Dictionary>,
90 pub incoming: Option<Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>>,
92 pub outgoing_dir: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
94 pub config: Option<fidl::Vmo>,
96 pub node_name: Option<String>,
98 pub node_properties: Option<Vec<NodePropertyEntry>>,
107 pub node_offers: Option<Vec<Offer>>,
109 pub node_token: Option<fidl::Event>,
112 pub node_properties_2: Option<Vec<NodePropertyEntry2>>,
113 #[doc(hidden)]
114 pub __source_breaking: fidl::marker::SourceBreaking,
115}
116
117impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DriverStartArgs {}
118
119#[derive(Debug, Default, PartialEq)]
121pub struct NodeAddArgs {
122 pub name: Option<String>,
124 pub offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
128 pub symbols: Option<Vec<NodeSymbol>>,
130 pub properties: Option<Vec<NodeProperty>>,
133 pub devfs_args: Option<DevfsAddArgs>,
135 pub offers2: Option<Vec<Offer>>,
139 pub bus_info: Option<BusInfo>,
142 pub properties2: Option<Vec<NodeProperty2>>,
145 #[doc(hidden)]
146 pub __source_breaking: fidl::marker::SourceBreaking,
147}
148
149impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeAddArgs {}
150
151#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
152pub struct CompositeNodeManagerMarker;
153
154impl fidl::endpoints::ProtocolMarker for CompositeNodeManagerMarker {
155 type Proxy = CompositeNodeManagerProxy;
156 type RequestStream = CompositeNodeManagerRequestStream;
157 #[cfg(target_os = "fuchsia")]
158 type SynchronousProxy = CompositeNodeManagerSynchronousProxy;
159
160 const DEBUG_NAME: &'static str = "fuchsia.driver.framework.CompositeNodeManager";
161}
162impl fidl::endpoints::DiscoverableProtocolMarker for CompositeNodeManagerMarker {}
163pub type CompositeNodeManagerAddSpecResult = Result<(), CompositeNodeSpecError>;
164
165pub trait CompositeNodeManagerProxyInterface: Send + Sync {
166 type AddSpecResponseFut: std::future::Future<Output = Result<CompositeNodeManagerAddSpecResult, fidl::Error>>
167 + Send;
168 fn r#add_spec(&self, payload: &CompositeNodeSpec) -> Self::AddSpecResponseFut;
169}
170#[derive(Debug)]
171#[cfg(target_os = "fuchsia")]
172pub struct CompositeNodeManagerSynchronousProxy {
173 client: fidl::client::sync::Client,
174}
175
176#[cfg(target_os = "fuchsia")]
177impl fidl::endpoints::SynchronousProxy for CompositeNodeManagerSynchronousProxy {
178 type Proxy = CompositeNodeManagerProxy;
179 type Protocol = CompositeNodeManagerMarker;
180
181 fn from_channel(inner: fidl::Channel) -> Self {
182 Self::new(inner)
183 }
184
185 fn into_channel(self) -> fidl::Channel {
186 self.client.into_channel()
187 }
188
189 fn as_channel(&self) -> &fidl::Channel {
190 self.client.as_channel()
191 }
192}
193
194#[cfg(target_os = "fuchsia")]
195impl CompositeNodeManagerSynchronousProxy {
196 pub fn new(channel: fidl::Channel) -> Self {
197 let protocol_name =
198 <CompositeNodeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
199 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
200 }
201
202 pub fn into_channel(self) -> fidl::Channel {
203 self.client.into_channel()
204 }
205
206 pub fn wait_for_event(
209 &self,
210 deadline: zx::MonotonicInstant,
211 ) -> Result<CompositeNodeManagerEvent, fidl::Error> {
212 CompositeNodeManagerEvent::decode(self.client.wait_for_event(deadline)?)
213 }
214
215 pub fn r#add_spec(
217 &self,
218 mut payload: &CompositeNodeSpec,
219 ___deadline: zx::MonotonicInstant,
220 ) -> Result<CompositeNodeManagerAddSpecResult, fidl::Error> {
221 let _response =
222 self.client
223 .send_query::<CompositeNodeSpec, fidl::encoding::FlexibleResultType<
224 fidl::encoding::EmptyStruct,
225 CompositeNodeSpecError,
226 >>(
227 payload,
228 0x524e353c8130cc74,
229 fidl::encoding::DynamicFlags::FLEXIBLE,
230 ___deadline,
231 )?
232 .into_result::<CompositeNodeManagerMarker>("add_spec")?;
233 Ok(_response.map(|x| x))
234 }
235}
236
237#[cfg(target_os = "fuchsia")]
238impl From<CompositeNodeManagerSynchronousProxy> for zx::Handle {
239 fn from(value: CompositeNodeManagerSynchronousProxy) -> Self {
240 value.into_channel().into()
241 }
242}
243
244#[cfg(target_os = "fuchsia")]
245impl From<fidl::Channel> for CompositeNodeManagerSynchronousProxy {
246 fn from(value: fidl::Channel) -> Self {
247 Self::new(value)
248 }
249}
250
251#[derive(Debug, Clone)]
252pub struct CompositeNodeManagerProxy {
253 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
254}
255
256impl fidl::endpoints::Proxy for CompositeNodeManagerProxy {
257 type Protocol = CompositeNodeManagerMarker;
258
259 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
260 Self::new(inner)
261 }
262
263 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
264 self.client.into_channel().map_err(|client| Self { client })
265 }
266
267 fn as_channel(&self) -> &::fidl::AsyncChannel {
268 self.client.as_channel()
269 }
270}
271
272impl CompositeNodeManagerProxy {
273 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
275 let protocol_name =
276 <CompositeNodeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
277 Self { client: fidl::client::Client::new(channel, protocol_name) }
278 }
279
280 pub fn take_event_stream(&self) -> CompositeNodeManagerEventStream {
286 CompositeNodeManagerEventStream { event_receiver: self.client.take_event_receiver() }
287 }
288
289 pub fn r#add_spec(
291 &self,
292 mut payload: &CompositeNodeSpec,
293 ) -> fidl::client::QueryResponseFut<
294 CompositeNodeManagerAddSpecResult,
295 fidl::encoding::DefaultFuchsiaResourceDialect,
296 > {
297 CompositeNodeManagerProxyInterface::r#add_spec(self, payload)
298 }
299}
300
301impl CompositeNodeManagerProxyInterface for CompositeNodeManagerProxy {
302 type AddSpecResponseFut = fidl::client::QueryResponseFut<
303 CompositeNodeManagerAddSpecResult,
304 fidl::encoding::DefaultFuchsiaResourceDialect,
305 >;
306 fn r#add_spec(&self, mut payload: &CompositeNodeSpec) -> Self::AddSpecResponseFut {
307 fn _decode(
308 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
309 ) -> Result<CompositeNodeManagerAddSpecResult, fidl::Error> {
310 let _response = fidl::client::decode_transaction_body::<
311 fidl::encoding::FlexibleResultType<
312 fidl::encoding::EmptyStruct,
313 CompositeNodeSpecError,
314 >,
315 fidl::encoding::DefaultFuchsiaResourceDialect,
316 0x524e353c8130cc74,
317 >(_buf?)?
318 .into_result::<CompositeNodeManagerMarker>("add_spec")?;
319 Ok(_response.map(|x| x))
320 }
321 self.client.send_query_and_decode::<CompositeNodeSpec, CompositeNodeManagerAddSpecResult>(
322 payload,
323 0x524e353c8130cc74,
324 fidl::encoding::DynamicFlags::FLEXIBLE,
325 _decode,
326 )
327 }
328}
329
330pub struct CompositeNodeManagerEventStream {
331 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
332}
333
334impl std::marker::Unpin for CompositeNodeManagerEventStream {}
335
336impl futures::stream::FusedStream for CompositeNodeManagerEventStream {
337 fn is_terminated(&self) -> bool {
338 self.event_receiver.is_terminated()
339 }
340}
341
342impl futures::Stream for CompositeNodeManagerEventStream {
343 type Item = Result<CompositeNodeManagerEvent, fidl::Error>;
344
345 fn poll_next(
346 mut self: std::pin::Pin<&mut Self>,
347 cx: &mut std::task::Context<'_>,
348 ) -> std::task::Poll<Option<Self::Item>> {
349 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
350 &mut self.event_receiver,
351 cx
352 )?) {
353 Some(buf) => std::task::Poll::Ready(Some(CompositeNodeManagerEvent::decode(buf))),
354 None => std::task::Poll::Ready(None),
355 }
356 }
357}
358
359#[derive(Debug)]
360pub enum CompositeNodeManagerEvent {
361 #[non_exhaustive]
362 _UnknownEvent {
363 ordinal: u64,
365 },
366}
367
368impl CompositeNodeManagerEvent {
369 fn decode(
371 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
372 ) -> Result<CompositeNodeManagerEvent, fidl::Error> {
373 let (bytes, _handles) = buf.split_mut();
374 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
375 debug_assert_eq!(tx_header.tx_id, 0);
376 match tx_header.ordinal {
377 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
378 Ok(CompositeNodeManagerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
379 }
380 _ => Err(fidl::Error::UnknownOrdinal {
381 ordinal: tx_header.ordinal,
382 protocol_name:
383 <CompositeNodeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
384 }),
385 }
386 }
387}
388
389pub struct CompositeNodeManagerRequestStream {
391 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
392 is_terminated: bool,
393}
394
395impl std::marker::Unpin for CompositeNodeManagerRequestStream {}
396
397impl futures::stream::FusedStream for CompositeNodeManagerRequestStream {
398 fn is_terminated(&self) -> bool {
399 self.is_terminated
400 }
401}
402
403impl fidl::endpoints::RequestStream for CompositeNodeManagerRequestStream {
404 type Protocol = CompositeNodeManagerMarker;
405 type ControlHandle = CompositeNodeManagerControlHandle;
406
407 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
408 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
409 }
410
411 fn control_handle(&self) -> Self::ControlHandle {
412 CompositeNodeManagerControlHandle { inner: self.inner.clone() }
413 }
414
415 fn into_inner(
416 self,
417 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
418 {
419 (self.inner, self.is_terminated)
420 }
421
422 fn from_inner(
423 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
424 is_terminated: bool,
425 ) -> Self {
426 Self { inner, is_terminated }
427 }
428}
429
430impl futures::Stream for CompositeNodeManagerRequestStream {
431 type Item = Result<CompositeNodeManagerRequest, fidl::Error>;
432
433 fn poll_next(
434 mut self: std::pin::Pin<&mut Self>,
435 cx: &mut std::task::Context<'_>,
436 ) -> std::task::Poll<Option<Self::Item>> {
437 let this = &mut *self;
438 if this.inner.check_shutdown(cx) {
439 this.is_terminated = true;
440 return std::task::Poll::Ready(None);
441 }
442 if this.is_terminated {
443 panic!("polled CompositeNodeManagerRequestStream after completion");
444 }
445 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
446 |bytes, handles| {
447 match this.inner.channel().read_etc(cx, bytes, handles) {
448 std::task::Poll::Ready(Ok(())) => {}
449 std::task::Poll::Pending => return std::task::Poll::Pending,
450 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
451 this.is_terminated = true;
452 return std::task::Poll::Ready(None);
453 }
454 std::task::Poll::Ready(Err(e)) => {
455 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
456 e.into(),
457 ))))
458 }
459 }
460
461 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
463
464 std::task::Poll::Ready(Some(match header.ordinal {
465 0x524e353c8130cc74 => {
466 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
467 let mut req = fidl::new_empty!(CompositeNodeSpec, fidl::encoding::DefaultFuchsiaResourceDialect);
468 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeNodeSpec>(&header, _body_bytes, handles, &mut req)?;
469 let control_handle = CompositeNodeManagerControlHandle {
470 inner: this.inner.clone(),
471 };
472 Ok(CompositeNodeManagerRequest::AddSpec {payload: req,
473 responder: CompositeNodeManagerAddSpecResponder {
474 control_handle: std::mem::ManuallyDrop::new(control_handle),
475 tx_id: header.tx_id,
476 },
477 })
478 }
479 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
480 Ok(CompositeNodeManagerRequest::_UnknownMethod {
481 ordinal: header.ordinal,
482 control_handle: CompositeNodeManagerControlHandle { inner: this.inner.clone() },
483 method_type: fidl::MethodType::OneWay,
484 })
485 }
486 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
487 this.inner.send_framework_err(
488 fidl::encoding::FrameworkErr::UnknownMethod,
489 header.tx_id,
490 header.ordinal,
491 header.dynamic_flags(),
492 (bytes, handles),
493 )?;
494 Ok(CompositeNodeManagerRequest::_UnknownMethod {
495 ordinal: header.ordinal,
496 control_handle: CompositeNodeManagerControlHandle { inner: this.inner.clone() },
497 method_type: fidl::MethodType::TwoWay,
498 })
499 }
500 _ => Err(fidl::Error::UnknownOrdinal {
501 ordinal: header.ordinal,
502 protocol_name: <CompositeNodeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
503 }),
504 }))
505 },
506 )
507 }
508}
509
510#[derive(Debug)]
516pub enum CompositeNodeManagerRequest {
517 AddSpec { payload: CompositeNodeSpec, responder: CompositeNodeManagerAddSpecResponder },
519 #[non_exhaustive]
521 _UnknownMethod {
522 ordinal: u64,
524 control_handle: CompositeNodeManagerControlHandle,
525 method_type: fidl::MethodType,
526 },
527}
528
529impl CompositeNodeManagerRequest {
530 #[allow(irrefutable_let_patterns)]
531 pub fn into_add_spec(
532 self,
533 ) -> Option<(CompositeNodeSpec, CompositeNodeManagerAddSpecResponder)> {
534 if let CompositeNodeManagerRequest::AddSpec { payload, responder } = self {
535 Some((payload, responder))
536 } else {
537 None
538 }
539 }
540
541 pub fn method_name(&self) -> &'static str {
543 match *self {
544 CompositeNodeManagerRequest::AddSpec { .. } => "add_spec",
545 CompositeNodeManagerRequest::_UnknownMethod {
546 method_type: fidl::MethodType::OneWay,
547 ..
548 } => "unknown one-way method",
549 CompositeNodeManagerRequest::_UnknownMethod {
550 method_type: fidl::MethodType::TwoWay,
551 ..
552 } => "unknown two-way method",
553 }
554 }
555}
556
557#[derive(Debug, Clone)]
558pub struct CompositeNodeManagerControlHandle {
559 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
560}
561
562impl fidl::endpoints::ControlHandle for CompositeNodeManagerControlHandle {
563 fn shutdown(&self) {
564 self.inner.shutdown()
565 }
566 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
567 self.inner.shutdown_with_epitaph(status)
568 }
569
570 fn is_closed(&self) -> bool {
571 self.inner.channel().is_closed()
572 }
573 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
574 self.inner.channel().on_closed()
575 }
576
577 #[cfg(target_os = "fuchsia")]
578 fn signal_peer(
579 &self,
580 clear_mask: zx::Signals,
581 set_mask: zx::Signals,
582 ) -> Result<(), zx_status::Status> {
583 use fidl::Peered;
584 self.inner.channel().signal_peer(clear_mask, set_mask)
585 }
586}
587
588impl CompositeNodeManagerControlHandle {}
589
590#[must_use = "FIDL methods require a response to be sent"]
591#[derive(Debug)]
592pub struct CompositeNodeManagerAddSpecResponder {
593 control_handle: std::mem::ManuallyDrop<CompositeNodeManagerControlHandle>,
594 tx_id: u32,
595}
596
597impl std::ops::Drop for CompositeNodeManagerAddSpecResponder {
601 fn drop(&mut self) {
602 self.control_handle.shutdown();
603 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
605 }
606}
607
608impl fidl::endpoints::Responder for CompositeNodeManagerAddSpecResponder {
609 type ControlHandle = CompositeNodeManagerControlHandle;
610
611 fn control_handle(&self) -> &CompositeNodeManagerControlHandle {
612 &self.control_handle
613 }
614
615 fn drop_without_shutdown(mut self) {
616 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
618 std::mem::forget(self);
620 }
621}
622
623impl CompositeNodeManagerAddSpecResponder {
624 pub fn send(self, mut result: Result<(), CompositeNodeSpecError>) -> Result<(), fidl::Error> {
628 let _result = self.send_raw(result);
629 if _result.is_err() {
630 self.control_handle.shutdown();
631 }
632 self.drop_without_shutdown();
633 _result
634 }
635
636 pub fn send_no_shutdown_on_err(
638 self,
639 mut result: Result<(), CompositeNodeSpecError>,
640 ) -> Result<(), fidl::Error> {
641 let _result = self.send_raw(result);
642 self.drop_without_shutdown();
643 _result
644 }
645
646 fn send_raw(&self, mut result: Result<(), CompositeNodeSpecError>) -> Result<(), fidl::Error> {
647 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
648 fidl::encoding::EmptyStruct,
649 CompositeNodeSpecError,
650 >>(
651 fidl::encoding::FlexibleResult::new(result),
652 self.tx_id,
653 0x524e353c8130cc74,
654 fidl::encoding::DynamicFlags::FLEXIBLE,
655 )
656 }
657}
658
659#[cfg(feature = "driver")]
660#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
661pub struct DriverMarker;
662
663#[cfg(feature = "driver")]
664impl fidl_driver::endpoints::DriverProtocolMarker for DriverMarker {
665 const DEBUG_NAME: &'static str = "(anonymous) Driver";
666}
667pub type DriverStartResult = Result<(), i32>;
668
669#[cfg(feature = "driver")]
677#[derive(Debug)]
678pub enum DriverRequest {
679 Start { start_args: DriverStartArgs, responder: DriverStartResponder },
693 Stop {},
698 #[non_exhaustive]
700 _UnknownMethod {
701 ordinal: u64,
703 method_type: fidl::MethodType,
704 },
705}
706
707#[cfg(feature = "driver")]
708impl DriverRequest {
709 #[allow(irrefutable_let_patterns)]
710 pub fn into_start(self) -> Option<(DriverStartArgs, DriverStartResponder)> {
711 if let DriverRequest::Start { start_args, responder } = self {
712 Some((start_args, responder))
713 } else {
714 None
715 }
716 }
717
718 #[allow(irrefutable_let_patterns)]
719 pub fn into_stop(self) -> Option<()> {
720 if let DriverRequest::Stop {} = self {
721 Some(())
722 } else {
723 None
724 }
725 }
726
727 pub fn new_start(self, start_args: DriverStartArgs, tx_id: u32) -> Self {
728 Self::Start { start_args, responder: DriverStartResponder { tx_id } }
729 }
730
731 pub fn new_stop(self) -> Self {
732 Self::Stop {}
733 }
734
735 pub fn r#start_as_message(
736 arena: fdf::Arena,
737 mut start_args: DriverStartArgs,
738 tx_id: u32,
739 ) -> Result<fdf::Message<[u8]>, fidl::Error> {
740 let ordinal = 0x27be00ae42aa60c2;
741 let dynamic_flags = fidl::encoding::DynamicFlags::FLEXIBLE;
742 let body = (&mut start_args,);
743 let msg = fidl::encoding::TransactionMessage {
744 header: fidl::encoding::TransactionHeader::new(tx_id, ordinal, dynamic_flags),
745 body,
746 };
747 fidl::encoding::with_tls_encoded::<
748 fidl::encoding::TransactionMessageType<DriverStartRequest>,
749 fidl::encoding::DefaultFuchsiaResourceDialect,
750 fdf::Message<[u8]>,
751 >(msg, |bytes, mut handles| {
752 let handles = arena.insert_from_iter(
753 std::mem::take(handles)
754 .into_iter()
755 .map(fidl_driver::encoding::mixed_from_handle_disposition),
756 );
757 Ok(fdf::Message::new(&arena, Some(arena.insert_slice(bytes)), Some(handles)))
758 })
759 }
760
761 pub fn r#stop_as_message(arena: fdf::Arena) -> Result<fdf::Message<[u8]>, fidl::Error> {
762 let tx_id = 0;
763 let ordinal = 0x4b96c67e29b3843d;
764 let dynamic_flags = fidl::encoding::DynamicFlags::FLEXIBLE;
765 let body = ();
766 let msg = fidl::encoding::TransactionMessage {
767 header: fidl::encoding::TransactionHeader::new(tx_id, ordinal, dynamic_flags),
768 body,
769 };
770 fidl::encoding::with_tls_encoded::<
771 fidl::encoding::TransactionMessageType<fidl::encoding::EmptyPayload>,
772 fidl::encoding::DefaultFuchsiaResourceDialect,
773 fdf::Message<[u8]>,
774 >(msg, |bytes, mut handles| {
775 let handles = arena.insert_from_iter(
776 std::mem::take(handles)
777 .into_iter()
778 .map(fidl_driver::encoding::mixed_from_handle_disposition),
779 );
780 Ok(fdf::Message::new(&arena, Some(arena.insert_slice(bytes)), Some(handles)))
781 })
782 }
783
784 #[allow(irrefutable_let_patterns)]
785 pub fn read_from(bytes: &[u8], _handles: &mut [zx::HandleInfo]) -> Result<Self, fidl::Error> {
786 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
787
788 match header.ordinal {
789 0x27be00ae42aa60c2 => {
790 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
791 let mut req = fidl::new_empty!(
792 DriverStartRequest,
793 fidl::encoding::DefaultFuchsiaResourceDialect
794 );
795 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DriverStartRequest>(&header, _body_bytes, _handles, &mut req)?;
796 Ok(DriverRequest::Start {
797 start_args: req.start_args,
798
799 responder: DriverStartResponder { tx_id: header.tx_id },
800 })
801 }
802 0x4b96c67e29b3843d => {
803 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
804 let mut req = fidl::new_empty!(
805 fidl::encoding::EmptyPayload,
806 fidl::encoding::DefaultFuchsiaResourceDialect
807 );
808 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, _handles, &mut req)?;
809 Ok(DriverRequest::Stop {})
810 }
811 _ if header.tx_id == 0
812 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
813 {
814 Ok(DriverRequest::_UnknownMethod {
815 ordinal: header.ordinal,
816 method_type: fidl::MethodType::OneWay,
817 })
818 }
819 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
820 Ok(DriverRequest::_UnknownMethod {
821 ordinal: header.ordinal,
822 method_type: fidl::MethodType::TwoWay,
823 })
824 }
825 _ => Err(fidl::Error::UnknownOrdinal {
826 ordinal: header.ordinal,
827 protocol_name:
828 <DriverMarker as fidl_driver::endpoints::DriverProtocolMarker>::DEBUG_NAME,
829 }),
830 }
831 }
832
833 pub fn read_from_message(
834 mut message: fdf::Message<[u8]>,
835 ) -> Result<(fdf::Arena, Self), fidl::Error> {
836 let (arena, Some(body), Some(handles)) = message.take_arena_boxes() else {
837 return Err(fidl::Error::Invalid);
838 };
839 let mut handles = arena.try_insert_from_iter(
840 handles
841 .into_iter()
842 .map(|handle| unsafe { fidl_driver::encoding::mixed_into_handle_info(handle) }),
843 );
844 let res = match handles {
845 Ok(ref mut handles) => Self::read_from(&*body, handles)?,
846 Err(_) => return Err(fidl::Error::Invalid),
847 };
848 std::mem::drop((body, handles));
849 Ok((message.take_arena(), res))
850 }
851
852 pub fn method_name(&self) -> &'static str {
854 match *self {
855 DriverRequest::Start { .. } => "start",
856 DriverRequest::Stop { .. } => "stop",
857 DriverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
858 "unknown one-way method"
859 }
860 DriverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
861 "unknown two-way method"
862 }
863 }
864 }
865}
866
867#[cfg(feature = "driver")]
869impl std::convert::TryFrom<fdf::Message<[u8]>> for DriverRequest {
870 type Error = fidl::Error;
871 fn try_from(msg: fdf::Message<[u8]>) -> Result<DriverRequest, fidl::Error> {
872 Ok(DriverRequest::read_from_message(msg)?.1)
873 }
874}
875
876#[must_use = "FIDL methods require a response to be sent"]
877#[cfg(feature = "driver")]
878#[derive(Debug)]
879pub struct DriverStartResponder {
880 tx_id: u32,
881}
882
883#[cfg(feature = "driver")]
884impl DriverStartResponder {
885 pub fn send_response(
886 &self,
887 server_handle: &fdf::Channel<[u8]>,
888 mut result: Result<(), i32>,
889 ) -> Result<(), fidl::Error> {
890 let msg = fidl::encoding::TransactionMessage {
891 header: fidl::encoding::TransactionHeader::new(
892 self.tx_id,
893 0x27be00ae42aa60c2,
894 fidl::encoding::DynamicFlags::FLEXIBLE,
895 ),
896 body: fidl::encoding::FlexibleResult::new(result),
897 };
898 fidl::encoding::with_tls_encoded::<
899 fidl::encoding::TransactionMessageType<
900 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
901 >,
902 fidl::encoding::DefaultFuchsiaResourceDialect,
903 (),
904 >(msg, |body, _handles| {
905 server_handle
906 .write_with_data(fdf::Arena::new(), |arena| arena.insert_slice(&body))
907 .unwrap();
908 Ok(())
909 })
910 }
911}
912
913#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
914pub struct NodeMarker;
915
916impl fidl::endpoints::ProtocolMarker for NodeMarker {
917 type Proxy = NodeProxy;
918 type RequestStream = NodeRequestStream;
919 #[cfg(target_os = "fuchsia")]
920 type SynchronousProxy = NodeSynchronousProxy;
921
922 const DEBUG_NAME: &'static str = "(anonymous) Node";
923}
924pub type NodeAddChildResult = Result<(), NodeError>;
925
926pub trait NodeProxyInterface: Send + Sync {
927 type AddChildResponseFut: std::future::Future<Output = Result<NodeAddChildResult, fidl::Error>>
928 + Send;
929 fn r#add_child(
930 &self,
931 args: NodeAddArgs,
932 controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
933 node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
934 ) -> Self::AddChildResponseFut;
935}
936#[derive(Debug)]
937#[cfg(target_os = "fuchsia")]
938pub struct NodeSynchronousProxy {
939 client: fidl::client::sync::Client,
940}
941
942#[cfg(target_os = "fuchsia")]
943impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
944 type Proxy = NodeProxy;
945 type Protocol = NodeMarker;
946
947 fn from_channel(inner: fidl::Channel) -> Self {
948 Self::new(inner)
949 }
950
951 fn into_channel(self) -> fidl::Channel {
952 self.client.into_channel()
953 }
954
955 fn as_channel(&self) -> &fidl::Channel {
956 self.client.as_channel()
957 }
958}
959
960#[cfg(target_os = "fuchsia")]
961impl NodeSynchronousProxy {
962 pub fn new(channel: fidl::Channel) -> Self {
963 let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
964 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
965 }
966
967 pub fn into_channel(self) -> fidl::Channel {
968 self.client.into_channel()
969 }
970
971 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
974 NodeEvent::decode(self.client.wait_for_event(deadline)?)
975 }
976
977 pub fn r#add_child(
983 &self,
984 mut args: NodeAddArgs,
985 mut controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
986 mut node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
987 ___deadline: zx::MonotonicInstant,
988 ) -> Result<NodeAddChildResult, fidl::Error> {
989 let _response = self.client.send_query::<
990 NodeAddChildRequest,
991 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, NodeError>,
992 >(
993 (&mut args, controller, node,),
994 0x77d10dff3c1ea129,
995 fidl::encoding::DynamicFlags::FLEXIBLE,
996 ___deadline,
997 )?
998 .into_result::<NodeMarker>("add_child")?;
999 Ok(_response.map(|x| x))
1000 }
1001}
1002
1003#[cfg(target_os = "fuchsia")]
1004impl From<NodeSynchronousProxy> for zx::Handle {
1005 fn from(value: NodeSynchronousProxy) -> Self {
1006 value.into_channel().into()
1007 }
1008}
1009
1010#[cfg(target_os = "fuchsia")]
1011impl From<fidl::Channel> for NodeSynchronousProxy {
1012 fn from(value: fidl::Channel) -> Self {
1013 Self::new(value)
1014 }
1015}
1016
1017#[derive(Debug, Clone)]
1018pub struct NodeProxy {
1019 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1020}
1021
1022impl fidl::endpoints::Proxy for NodeProxy {
1023 type Protocol = NodeMarker;
1024
1025 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1026 Self::new(inner)
1027 }
1028
1029 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1030 self.client.into_channel().map_err(|client| Self { client })
1031 }
1032
1033 fn as_channel(&self) -> &::fidl::AsyncChannel {
1034 self.client.as_channel()
1035 }
1036}
1037
1038impl NodeProxy {
1039 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1041 let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1042 Self { client: fidl::client::Client::new(channel, protocol_name) }
1043 }
1044
1045 pub fn take_event_stream(&self) -> NodeEventStream {
1051 NodeEventStream { event_receiver: self.client.take_event_receiver() }
1052 }
1053
1054 pub fn r#add_child(
1060 &self,
1061 mut args: NodeAddArgs,
1062 mut controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
1063 mut node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
1064 ) -> fidl::client::QueryResponseFut<
1065 NodeAddChildResult,
1066 fidl::encoding::DefaultFuchsiaResourceDialect,
1067 > {
1068 NodeProxyInterface::r#add_child(self, args, controller, node)
1069 }
1070}
1071
1072impl NodeProxyInterface for NodeProxy {
1073 type AddChildResponseFut = fidl::client::QueryResponseFut<
1074 NodeAddChildResult,
1075 fidl::encoding::DefaultFuchsiaResourceDialect,
1076 >;
1077 fn r#add_child(
1078 &self,
1079 mut args: NodeAddArgs,
1080 mut controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
1081 mut node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
1082 ) -> Self::AddChildResponseFut {
1083 fn _decode(
1084 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1085 ) -> Result<NodeAddChildResult, fidl::Error> {
1086 let _response = fidl::client::decode_transaction_body::<
1087 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, NodeError>,
1088 fidl::encoding::DefaultFuchsiaResourceDialect,
1089 0x77d10dff3c1ea129,
1090 >(_buf?)?
1091 .into_result::<NodeMarker>("add_child")?;
1092 Ok(_response.map(|x| x))
1093 }
1094 self.client.send_query_and_decode::<NodeAddChildRequest, NodeAddChildResult>(
1095 (&mut args, controller, node),
1096 0x77d10dff3c1ea129,
1097 fidl::encoding::DynamicFlags::FLEXIBLE,
1098 _decode,
1099 )
1100 }
1101}
1102
1103pub struct NodeEventStream {
1104 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1105}
1106
1107impl std::marker::Unpin for NodeEventStream {}
1108
1109impl futures::stream::FusedStream for NodeEventStream {
1110 fn is_terminated(&self) -> bool {
1111 self.event_receiver.is_terminated()
1112 }
1113}
1114
1115impl futures::Stream for NodeEventStream {
1116 type Item = Result<NodeEvent, fidl::Error>;
1117
1118 fn poll_next(
1119 mut self: std::pin::Pin<&mut Self>,
1120 cx: &mut std::task::Context<'_>,
1121 ) -> std::task::Poll<Option<Self::Item>> {
1122 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1123 &mut self.event_receiver,
1124 cx
1125 )?) {
1126 Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
1127 None => std::task::Poll::Ready(None),
1128 }
1129 }
1130}
1131
1132#[derive(Debug)]
1133pub enum NodeEvent {
1134 #[non_exhaustive]
1135 _UnknownEvent {
1136 ordinal: u64,
1138 },
1139}
1140
1141impl NodeEvent {
1142 fn decode(
1144 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1145 ) -> Result<NodeEvent, fidl::Error> {
1146 let (bytes, _handles) = buf.split_mut();
1147 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1148 debug_assert_eq!(tx_header.tx_id, 0);
1149 match tx_header.ordinal {
1150 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1151 Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1152 }
1153 _ => Err(fidl::Error::UnknownOrdinal {
1154 ordinal: tx_header.ordinal,
1155 protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1156 }),
1157 }
1158 }
1159}
1160
1161pub struct NodeRequestStream {
1163 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1164 is_terminated: bool,
1165}
1166
1167impl std::marker::Unpin for NodeRequestStream {}
1168
1169impl futures::stream::FusedStream for NodeRequestStream {
1170 fn is_terminated(&self) -> bool {
1171 self.is_terminated
1172 }
1173}
1174
1175impl fidl::endpoints::RequestStream for NodeRequestStream {
1176 type Protocol = NodeMarker;
1177 type ControlHandle = NodeControlHandle;
1178
1179 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1180 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1181 }
1182
1183 fn control_handle(&self) -> Self::ControlHandle {
1184 NodeControlHandle { inner: self.inner.clone() }
1185 }
1186
1187 fn into_inner(
1188 self,
1189 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1190 {
1191 (self.inner, self.is_terminated)
1192 }
1193
1194 fn from_inner(
1195 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1196 is_terminated: bool,
1197 ) -> Self {
1198 Self { inner, is_terminated }
1199 }
1200}
1201
1202impl futures::Stream for NodeRequestStream {
1203 type Item = Result<NodeRequest, fidl::Error>;
1204
1205 fn poll_next(
1206 mut self: std::pin::Pin<&mut Self>,
1207 cx: &mut std::task::Context<'_>,
1208 ) -> std::task::Poll<Option<Self::Item>> {
1209 let this = &mut *self;
1210 if this.inner.check_shutdown(cx) {
1211 this.is_terminated = true;
1212 return std::task::Poll::Ready(None);
1213 }
1214 if this.is_terminated {
1215 panic!("polled NodeRequestStream after completion");
1216 }
1217 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1218 |bytes, handles| {
1219 match this.inner.channel().read_etc(cx, bytes, handles) {
1220 std::task::Poll::Ready(Ok(())) => {}
1221 std::task::Poll::Pending => return std::task::Poll::Pending,
1222 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1223 this.is_terminated = true;
1224 return std::task::Poll::Ready(None);
1225 }
1226 std::task::Poll::Ready(Err(e)) => {
1227 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1228 e.into(),
1229 ))))
1230 }
1231 }
1232
1233 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1235
1236 std::task::Poll::Ready(Some(match header.ordinal {
1237 0x77d10dff3c1ea129 => {
1238 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1239 let mut req = fidl::new_empty!(
1240 NodeAddChildRequest,
1241 fidl::encoding::DefaultFuchsiaResourceDialect
1242 );
1243 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeAddChildRequest>(&header, _body_bytes, handles, &mut req)?;
1244 let control_handle = NodeControlHandle { inner: this.inner.clone() };
1245 Ok(NodeRequest::AddChild {
1246 args: req.args,
1247 controller: req.controller,
1248 node: req.node,
1249
1250 responder: NodeAddChildResponder {
1251 control_handle: std::mem::ManuallyDrop::new(control_handle),
1252 tx_id: header.tx_id,
1253 },
1254 })
1255 }
1256 _ if header.tx_id == 0
1257 && header
1258 .dynamic_flags()
1259 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1260 {
1261 Ok(NodeRequest::_UnknownMethod {
1262 ordinal: header.ordinal,
1263 control_handle: NodeControlHandle { inner: this.inner.clone() },
1264 method_type: fidl::MethodType::OneWay,
1265 })
1266 }
1267 _ if header
1268 .dynamic_flags()
1269 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1270 {
1271 this.inner.send_framework_err(
1272 fidl::encoding::FrameworkErr::UnknownMethod,
1273 header.tx_id,
1274 header.ordinal,
1275 header.dynamic_flags(),
1276 (bytes, handles),
1277 )?;
1278 Ok(NodeRequest::_UnknownMethod {
1279 ordinal: header.ordinal,
1280 control_handle: NodeControlHandle { inner: this.inner.clone() },
1281 method_type: fidl::MethodType::TwoWay,
1282 })
1283 }
1284 _ => Err(fidl::Error::UnknownOrdinal {
1285 ordinal: header.ordinal,
1286 protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1287 }),
1288 }))
1289 },
1290 )
1291 }
1292}
1293
1294#[derive(Debug)]
1302pub enum NodeRequest {
1303 AddChild {
1309 args: NodeAddArgs,
1310 controller: fidl::endpoints::ServerEnd<NodeControllerMarker>,
1311 node: Option<fidl::endpoints::ServerEnd<NodeMarker>>,
1312 responder: NodeAddChildResponder,
1313 },
1314 #[non_exhaustive]
1316 _UnknownMethod {
1317 ordinal: u64,
1319 control_handle: NodeControlHandle,
1320 method_type: fidl::MethodType,
1321 },
1322}
1323
1324impl NodeRequest {
1325 #[allow(irrefutable_let_patterns)]
1326 pub fn into_add_child(
1327 self,
1328 ) -> Option<(
1329 NodeAddArgs,
1330 fidl::endpoints::ServerEnd<NodeControllerMarker>,
1331 Option<fidl::endpoints::ServerEnd<NodeMarker>>,
1332 NodeAddChildResponder,
1333 )> {
1334 if let NodeRequest::AddChild { args, controller, node, responder } = self {
1335 Some((args, controller, node, responder))
1336 } else {
1337 None
1338 }
1339 }
1340
1341 pub fn method_name(&self) -> &'static str {
1343 match *self {
1344 NodeRequest::AddChild { .. } => "add_child",
1345 NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1346 "unknown one-way method"
1347 }
1348 NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1349 "unknown two-way method"
1350 }
1351 }
1352 }
1353}
1354
1355#[derive(Debug, Clone)]
1356pub struct NodeControlHandle {
1357 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1358}
1359
1360impl fidl::endpoints::ControlHandle for NodeControlHandle {
1361 fn shutdown(&self) {
1362 self.inner.shutdown()
1363 }
1364 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1365 self.inner.shutdown_with_epitaph(status)
1366 }
1367
1368 fn is_closed(&self) -> bool {
1369 self.inner.channel().is_closed()
1370 }
1371 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1372 self.inner.channel().on_closed()
1373 }
1374
1375 #[cfg(target_os = "fuchsia")]
1376 fn signal_peer(
1377 &self,
1378 clear_mask: zx::Signals,
1379 set_mask: zx::Signals,
1380 ) -> Result<(), zx_status::Status> {
1381 use fidl::Peered;
1382 self.inner.channel().signal_peer(clear_mask, set_mask)
1383 }
1384}
1385
1386impl NodeControlHandle {}
1387
1388#[must_use = "FIDL methods require a response to be sent"]
1389#[derive(Debug)]
1390pub struct NodeAddChildResponder {
1391 control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
1392 tx_id: u32,
1393}
1394
1395impl std::ops::Drop for NodeAddChildResponder {
1399 fn drop(&mut self) {
1400 self.control_handle.shutdown();
1401 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1403 }
1404}
1405
1406impl fidl::endpoints::Responder for NodeAddChildResponder {
1407 type ControlHandle = NodeControlHandle;
1408
1409 fn control_handle(&self) -> &NodeControlHandle {
1410 &self.control_handle
1411 }
1412
1413 fn drop_without_shutdown(mut self) {
1414 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1416 std::mem::forget(self);
1418 }
1419}
1420
1421impl NodeAddChildResponder {
1422 pub fn send(self, mut result: Result<(), NodeError>) -> Result<(), fidl::Error> {
1426 let _result = self.send_raw(result);
1427 if _result.is_err() {
1428 self.control_handle.shutdown();
1429 }
1430 self.drop_without_shutdown();
1431 _result
1432 }
1433
1434 pub fn send_no_shutdown_on_err(
1436 self,
1437 mut result: Result<(), NodeError>,
1438 ) -> Result<(), fidl::Error> {
1439 let _result = self.send_raw(result);
1440 self.drop_without_shutdown();
1441 _result
1442 }
1443
1444 fn send_raw(&self, mut result: Result<(), NodeError>) -> Result<(), fidl::Error> {
1445 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1446 fidl::encoding::EmptyStruct,
1447 NodeError,
1448 >>(
1449 fidl::encoding::FlexibleResult::new(result),
1450 self.tx_id,
1451 0x77d10dff3c1ea129,
1452 fidl::encoding::DynamicFlags::FLEXIBLE,
1453 )
1454 }
1455}
1456
1457#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1458pub struct NodeControllerMarker;
1459
1460impl fidl::endpoints::ProtocolMarker for NodeControllerMarker {
1461 type Proxy = NodeControllerProxy;
1462 type RequestStream = NodeControllerRequestStream;
1463 #[cfg(target_os = "fuchsia")]
1464 type SynchronousProxy = NodeControllerSynchronousProxy;
1465
1466 const DEBUG_NAME: &'static str = "(anonymous) NodeController";
1467}
1468pub type NodeControllerRequestBindResult = Result<(), i32>;
1469
1470pub trait NodeControllerProxyInterface: Send + Sync {
1471 fn r#remove(&self) -> Result<(), fidl::Error>;
1472 type RequestBindResponseFut: std::future::Future<Output = Result<NodeControllerRequestBindResult, fidl::Error>>
1473 + Send;
1474 fn r#request_bind(
1475 &self,
1476 payload: &NodeControllerRequestBindRequest,
1477 ) -> Self::RequestBindResponseFut;
1478}
1479#[derive(Debug)]
1480#[cfg(target_os = "fuchsia")]
1481pub struct NodeControllerSynchronousProxy {
1482 client: fidl::client::sync::Client,
1483}
1484
1485#[cfg(target_os = "fuchsia")]
1486impl fidl::endpoints::SynchronousProxy for NodeControllerSynchronousProxy {
1487 type Proxy = NodeControllerProxy;
1488 type Protocol = NodeControllerMarker;
1489
1490 fn from_channel(inner: fidl::Channel) -> Self {
1491 Self::new(inner)
1492 }
1493
1494 fn into_channel(self) -> fidl::Channel {
1495 self.client.into_channel()
1496 }
1497
1498 fn as_channel(&self) -> &fidl::Channel {
1499 self.client.as_channel()
1500 }
1501}
1502
1503#[cfg(target_os = "fuchsia")]
1504impl NodeControllerSynchronousProxy {
1505 pub fn new(channel: fidl::Channel) -> Self {
1506 let protocol_name = <NodeControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1507 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1508 }
1509
1510 pub fn into_channel(self) -> fidl::Channel {
1511 self.client.into_channel()
1512 }
1513
1514 pub fn wait_for_event(
1517 &self,
1518 deadline: zx::MonotonicInstant,
1519 ) -> Result<NodeControllerEvent, fidl::Error> {
1520 NodeControllerEvent::decode(self.client.wait_for_event(deadline)?)
1521 }
1522
1523 pub fn r#remove(&self) -> Result<(), fidl::Error> {
1525 self.client.send::<fidl::encoding::EmptyPayload>(
1526 (),
1527 0x54fa8b3dfe7bb341,
1528 fidl::encoding::DynamicFlags::FLEXIBLE,
1529 )
1530 }
1531
1532 pub fn r#request_bind(
1539 &self,
1540 mut payload: &NodeControllerRequestBindRequest,
1541 ___deadline: zx::MonotonicInstant,
1542 ) -> Result<NodeControllerRequestBindResult, fidl::Error> {
1543 let _response = self.client.send_query::<
1544 NodeControllerRequestBindRequest,
1545 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1546 >(
1547 payload,
1548 0x41b954726b13508f,
1549 fidl::encoding::DynamicFlags::FLEXIBLE,
1550 ___deadline,
1551 )?
1552 .into_result::<NodeControllerMarker>("request_bind")?;
1553 Ok(_response.map(|x| x))
1554 }
1555}
1556
1557#[cfg(target_os = "fuchsia")]
1558impl From<NodeControllerSynchronousProxy> for zx::Handle {
1559 fn from(value: NodeControllerSynchronousProxy) -> Self {
1560 value.into_channel().into()
1561 }
1562}
1563
1564#[cfg(target_os = "fuchsia")]
1565impl From<fidl::Channel> for NodeControllerSynchronousProxy {
1566 fn from(value: fidl::Channel) -> Self {
1567 Self::new(value)
1568 }
1569}
1570
1571#[derive(Debug, Clone)]
1572pub struct NodeControllerProxy {
1573 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1574}
1575
1576impl fidl::endpoints::Proxy for NodeControllerProxy {
1577 type Protocol = NodeControllerMarker;
1578
1579 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1580 Self::new(inner)
1581 }
1582
1583 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1584 self.client.into_channel().map_err(|client| Self { client })
1585 }
1586
1587 fn as_channel(&self) -> &::fidl::AsyncChannel {
1588 self.client.as_channel()
1589 }
1590}
1591
1592impl NodeControllerProxy {
1593 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1595 let protocol_name = <NodeControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1596 Self { client: fidl::client::Client::new(channel, protocol_name) }
1597 }
1598
1599 pub fn take_event_stream(&self) -> NodeControllerEventStream {
1605 NodeControllerEventStream { event_receiver: self.client.take_event_receiver() }
1606 }
1607
1608 pub fn r#remove(&self) -> Result<(), fidl::Error> {
1610 NodeControllerProxyInterface::r#remove(self)
1611 }
1612
1613 pub fn r#request_bind(
1620 &self,
1621 mut payload: &NodeControllerRequestBindRequest,
1622 ) -> fidl::client::QueryResponseFut<
1623 NodeControllerRequestBindResult,
1624 fidl::encoding::DefaultFuchsiaResourceDialect,
1625 > {
1626 NodeControllerProxyInterface::r#request_bind(self, payload)
1627 }
1628}
1629
1630impl NodeControllerProxyInterface for NodeControllerProxy {
1631 fn r#remove(&self) -> Result<(), fidl::Error> {
1632 self.client.send::<fidl::encoding::EmptyPayload>(
1633 (),
1634 0x54fa8b3dfe7bb341,
1635 fidl::encoding::DynamicFlags::FLEXIBLE,
1636 )
1637 }
1638
1639 type RequestBindResponseFut = fidl::client::QueryResponseFut<
1640 NodeControllerRequestBindResult,
1641 fidl::encoding::DefaultFuchsiaResourceDialect,
1642 >;
1643 fn r#request_bind(
1644 &self,
1645 mut payload: &NodeControllerRequestBindRequest,
1646 ) -> Self::RequestBindResponseFut {
1647 fn _decode(
1648 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1649 ) -> Result<NodeControllerRequestBindResult, fidl::Error> {
1650 let _response = fidl::client::decode_transaction_body::<
1651 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1652 fidl::encoding::DefaultFuchsiaResourceDialect,
1653 0x41b954726b13508f,
1654 >(_buf?)?
1655 .into_result::<NodeControllerMarker>("request_bind")?;
1656 Ok(_response.map(|x| x))
1657 }
1658 self.client.send_query_and_decode::<
1659 NodeControllerRequestBindRequest,
1660 NodeControllerRequestBindResult,
1661 >(
1662 payload,
1663 0x41b954726b13508f,
1664 fidl::encoding::DynamicFlags::FLEXIBLE,
1665 _decode,
1666 )
1667 }
1668}
1669
1670pub struct NodeControllerEventStream {
1671 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1672}
1673
1674impl std::marker::Unpin for NodeControllerEventStream {}
1675
1676impl futures::stream::FusedStream for NodeControllerEventStream {
1677 fn is_terminated(&self) -> bool {
1678 self.event_receiver.is_terminated()
1679 }
1680}
1681
1682impl futures::Stream for NodeControllerEventStream {
1683 type Item = Result<NodeControllerEvent, fidl::Error>;
1684
1685 fn poll_next(
1686 mut self: std::pin::Pin<&mut Self>,
1687 cx: &mut std::task::Context<'_>,
1688 ) -> std::task::Poll<Option<Self::Item>> {
1689 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1690 &mut self.event_receiver,
1691 cx
1692 )?) {
1693 Some(buf) => std::task::Poll::Ready(Some(NodeControllerEvent::decode(buf))),
1694 None => std::task::Poll::Ready(None),
1695 }
1696 }
1697}
1698
1699#[derive(Debug)]
1700pub enum NodeControllerEvent {
1701 OnBind {},
1702 #[non_exhaustive]
1703 _UnknownEvent {
1704 ordinal: u64,
1706 },
1707}
1708
1709impl NodeControllerEvent {
1710 #[allow(irrefutable_let_patterns)]
1711 pub fn into_on_bind(self) -> Option<()> {
1712 if let NodeControllerEvent::OnBind {} = self {
1713 Some(())
1714 } else {
1715 None
1716 }
1717 }
1718
1719 fn decode(
1721 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1722 ) -> Result<NodeControllerEvent, fidl::Error> {
1723 let (bytes, _handles) = buf.split_mut();
1724 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1725 debug_assert_eq!(tx_header.tx_id, 0);
1726 match tx_header.ordinal {
1727 0x51f4165bc5ea202a => {
1728 let mut out = fidl::new_empty!(
1729 fidl::encoding::EmptyPayload,
1730 fidl::encoding::DefaultFuchsiaResourceDialect
1731 );
1732 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
1733 Ok((NodeControllerEvent::OnBind {}))
1734 }
1735 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1736 Ok(NodeControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1737 }
1738 _ => Err(fidl::Error::UnknownOrdinal {
1739 ordinal: tx_header.ordinal,
1740 protocol_name:
1741 <NodeControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1742 }),
1743 }
1744 }
1745}
1746
1747pub struct NodeControllerRequestStream {
1749 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1750 is_terminated: bool,
1751}
1752
1753impl std::marker::Unpin for NodeControllerRequestStream {}
1754
1755impl futures::stream::FusedStream for NodeControllerRequestStream {
1756 fn is_terminated(&self) -> bool {
1757 self.is_terminated
1758 }
1759}
1760
1761impl fidl::endpoints::RequestStream for NodeControllerRequestStream {
1762 type Protocol = NodeControllerMarker;
1763 type ControlHandle = NodeControllerControlHandle;
1764
1765 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1766 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1767 }
1768
1769 fn control_handle(&self) -> Self::ControlHandle {
1770 NodeControllerControlHandle { inner: self.inner.clone() }
1771 }
1772
1773 fn into_inner(
1774 self,
1775 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1776 {
1777 (self.inner, self.is_terminated)
1778 }
1779
1780 fn from_inner(
1781 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1782 is_terminated: bool,
1783 ) -> Self {
1784 Self { inner, is_terminated }
1785 }
1786}
1787
1788impl futures::Stream for NodeControllerRequestStream {
1789 type Item = Result<NodeControllerRequest, fidl::Error>;
1790
1791 fn poll_next(
1792 mut self: std::pin::Pin<&mut Self>,
1793 cx: &mut std::task::Context<'_>,
1794 ) -> std::task::Poll<Option<Self::Item>> {
1795 let this = &mut *self;
1796 if this.inner.check_shutdown(cx) {
1797 this.is_terminated = true;
1798 return std::task::Poll::Ready(None);
1799 }
1800 if this.is_terminated {
1801 panic!("polled NodeControllerRequestStream after completion");
1802 }
1803 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1804 |bytes, handles| {
1805 match this.inner.channel().read_etc(cx, bytes, handles) {
1806 std::task::Poll::Ready(Ok(())) => {}
1807 std::task::Poll::Pending => return std::task::Poll::Pending,
1808 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1809 this.is_terminated = true;
1810 return std::task::Poll::Ready(None);
1811 }
1812 std::task::Poll::Ready(Err(e)) => {
1813 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1814 e.into(),
1815 ))))
1816 }
1817 }
1818
1819 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1821
1822 std::task::Poll::Ready(Some(match header.ordinal {
1823 0x54fa8b3dfe7bb341 => {
1824 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1825 let mut req = fidl::new_empty!(
1826 fidl::encoding::EmptyPayload,
1827 fidl::encoding::DefaultFuchsiaResourceDialect
1828 );
1829 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1830 let control_handle =
1831 NodeControllerControlHandle { inner: this.inner.clone() };
1832 Ok(NodeControllerRequest::Remove { control_handle })
1833 }
1834 0x41b954726b13508f => {
1835 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1836 let mut req = fidl::new_empty!(
1837 NodeControllerRequestBindRequest,
1838 fidl::encoding::DefaultFuchsiaResourceDialect
1839 );
1840 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeControllerRequestBindRequest>(&header, _body_bytes, handles, &mut req)?;
1841 let control_handle =
1842 NodeControllerControlHandle { inner: this.inner.clone() };
1843 Ok(NodeControllerRequest::RequestBind {
1844 payload: req,
1845 responder: NodeControllerRequestBindResponder {
1846 control_handle: std::mem::ManuallyDrop::new(control_handle),
1847 tx_id: header.tx_id,
1848 },
1849 })
1850 }
1851 _ if header.tx_id == 0
1852 && header
1853 .dynamic_flags()
1854 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1855 {
1856 Ok(NodeControllerRequest::_UnknownMethod {
1857 ordinal: header.ordinal,
1858 control_handle: NodeControllerControlHandle {
1859 inner: this.inner.clone(),
1860 },
1861 method_type: fidl::MethodType::OneWay,
1862 })
1863 }
1864 _ if header
1865 .dynamic_flags()
1866 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1867 {
1868 this.inner.send_framework_err(
1869 fidl::encoding::FrameworkErr::UnknownMethod,
1870 header.tx_id,
1871 header.ordinal,
1872 header.dynamic_flags(),
1873 (bytes, handles),
1874 )?;
1875 Ok(NodeControllerRequest::_UnknownMethod {
1876 ordinal: header.ordinal,
1877 control_handle: NodeControllerControlHandle {
1878 inner: this.inner.clone(),
1879 },
1880 method_type: fidl::MethodType::TwoWay,
1881 })
1882 }
1883 _ => Err(fidl::Error::UnknownOrdinal {
1884 ordinal: header.ordinal,
1885 protocol_name:
1886 <NodeControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1887 }),
1888 }))
1889 },
1890 )
1891 }
1892}
1893
1894#[derive(Debug)]
1896pub enum NodeControllerRequest {
1897 Remove { control_handle: NodeControllerControlHandle },
1899 RequestBind {
1906 payload: NodeControllerRequestBindRequest,
1907 responder: NodeControllerRequestBindResponder,
1908 },
1909 #[non_exhaustive]
1911 _UnknownMethod {
1912 ordinal: u64,
1914 control_handle: NodeControllerControlHandle,
1915 method_type: fidl::MethodType,
1916 },
1917}
1918
1919impl NodeControllerRequest {
1920 #[allow(irrefutable_let_patterns)]
1921 pub fn into_remove(self) -> Option<(NodeControllerControlHandle)> {
1922 if let NodeControllerRequest::Remove { control_handle } = self {
1923 Some((control_handle))
1924 } else {
1925 None
1926 }
1927 }
1928
1929 #[allow(irrefutable_let_patterns)]
1930 pub fn into_request_bind(
1931 self,
1932 ) -> Option<(NodeControllerRequestBindRequest, NodeControllerRequestBindResponder)> {
1933 if let NodeControllerRequest::RequestBind { payload, responder } = self {
1934 Some((payload, responder))
1935 } else {
1936 None
1937 }
1938 }
1939
1940 pub fn method_name(&self) -> &'static str {
1942 match *self {
1943 NodeControllerRequest::Remove { .. } => "remove",
1944 NodeControllerRequest::RequestBind { .. } => "request_bind",
1945 NodeControllerRequest::_UnknownMethod {
1946 method_type: fidl::MethodType::OneWay, ..
1947 } => "unknown one-way method",
1948 NodeControllerRequest::_UnknownMethod {
1949 method_type: fidl::MethodType::TwoWay, ..
1950 } => "unknown two-way method",
1951 }
1952 }
1953}
1954
1955#[derive(Debug, Clone)]
1956pub struct NodeControllerControlHandle {
1957 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1958}
1959
1960impl fidl::endpoints::ControlHandle for NodeControllerControlHandle {
1961 fn shutdown(&self) {
1962 self.inner.shutdown()
1963 }
1964 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1965 self.inner.shutdown_with_epitaph(status)
1966 }
1967
1968 fn is_closed(&self) -> bool {
1969 self.inner.channel().is_closed()
1970 }
1971 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1972 self.inner.channel().on_closed()
1973 }
1974
1975 #[cfg(target_os = "fuchsia")]
1976 fn signal_peer(
1977 &self,
1978 clear_mask: zx::Signals,
1979 set_mask: zx::Signals,
1980 ) -> Result<(), zx_status::Status> {
1981 use fidl::Peered;
1982 self.inner.channel().signal_peer(clear_mask, set_mask)
1983 }
1984}
1985
1986impl NodeControllerControlHandle {
1987 pub fn send_on_bind(&self) -> Result<(), fidl::Error> {
1988 self.inner.send::<fidl::encoding::EmptyPayload>(
1989 (),
1990 0,
1991 0x51f4165bc5ea202a,
1992 fidl::encoding::DynamicFlags::FLEXIBLE,
1993 )
1994 }
1995}
1996
1997#[must_use = "FIDL methods require a response to be sent"]
1998#[derive(Debug)]
1999pub struct NodeControllerRequestBindResponder {
2000 control_handle: std::mem::ManuallyDrop<NodeControllerControlHandle>,
2001 tx_id: u32,
2002}
2003
2004impl std::ops::Drop for NodeControllerRequestBindResponder {
2008 fn drop(&mut self) {
2009 self.control_handle.shutdown();
2010 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2012 }
2013}
2014
2015impl fidl::endpoints::Responder for NodeControllerRequestBindResponder {
2016 type ControlHandle = NodeControllerControlHandle;
2017
2018 fn control_handle(&self) -> &NodeControllerControlHandle {
2019 &self.control_handle
2020 }
2021
2022 fn drop_without_shutdown(mut self) {
2023 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2025 std::mem::forget(self);
2027 }
2028}
2029
2030impl NodeControllerRequestBindResponder {
2031 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2035 let _result = self.send_raw(result);
2036 if _result.is_err() {
2037 self.control_handle.shutdown();
2038 }
2039 self.drop_without_shutdown();
2040 _result
2041 }
2042
2043 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2045 let _result = self.send_raw(result);
2046 self.drop_without_shutdown();
2047 _result
2048 }
2049
2050 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2051 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2052 fidl::encoding::EmptyStruct,
2053 i32,
2054 >>(
2055 fidl::encoding::FlexibleResult::new(result),
2056 self.tx_id,
2057 0x41b954726b13508f,
2058 fidl::encoding::DynamicFlags::FLEXIBLE,
2059 )
2060 }
2061}
2062
2063mod internal {
2064 use super::*;
2065
2066 impl fidl::encoding::ResourceTypeMarker for DriverStartRequest {
2067 type Borrowed<'a> = &'a mut Self;
2068 fn take_or_borrow<'a>(
2069 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2070 ) -> Self::Borrowed<'a> {
2071 value
2072 }
2073 }
2074
2075 unsafe impl fidl::encoding::TypeMarker for DriverStartRequest {
2076 type Owned = Self;
2077
2078 #[inline(always)]
2079 fn inline_align(_context: fidl::encoding::Context) -> usize {
2080 8
2081 }
2082
2083 #[inline(always)]
2084 fn inline_size(_context: fidl::encoding::Context) -> usize {
2085 16
2086 }
2087 }
2088
2089 unsafe impl
2090 fidl::encoding::Encode<DriverStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2091 for &mut DriverStartRequest
2092 {
2093 #[inline]
2094 unsafe fn encode(
2095 self,
2096 encoder: &mut fidl::encoding::Encoder<
2097 '_,
2098 fidl::encoding::DefaultFuchsiaResourceDialect,
2099 >,
2100 offset: usize,
2101 _depth: fidl::encoding::Depth,
2102 ) -> fidl::Result<()> {
2103 encoder.debug_check_bounds::<DriverStartRequest>(offset);
2104 fidl::encoding::Encode::<
2106 DriverStartRequest,
2107 fidl::encoding::DefaultFuchsiaResourceDialect,
2108 >::encode(
2109 (<DriverStartArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2110 &mut self.start_args,
2111 ),),
2112 encoder,
2113 offset,
2114 _depth,
2115 )
2116 }
2117 }
2118 unsafe impl<
2119 T0: fidl::encoding::Encode<DriverStartArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
2120 >
2121 fidl::encoding::Encode<DriverStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2122 for (T0,)
2123 {
2124 #[inline]
2125 unsafe fn encode(
2126 self,
2127 encoder: &mut fidl::encoding::Encoder<
2128 '_,
2129 fidl::encoding::DefaultFuchsiaResourceDialect,
2130 >,
2131 offset: usize,
2132 depth: fidl::encoding::Depth,
2133 ) -> fidl::Result<()> {
2134 encoder.debug_check_bounds::<DriverStartRequest>(offset);
2135 self.0.encode(encoder, offset + 0, depth)?;
2139 Ok(())
2140 }
2141 }
2142
2143 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2144 for DriverStartRequest
2145 {
2146 #[inline(always)]
2147 fn new_empty() -> Self {
2148 Self {
2149 start_args: fidl::new_empty!(
2150 DriverStartArgs,
2151 fidl::encoding::DefaultFuchsiaResourceDialect
2152 ),
2153 }
2154 }
2155
2156 #[inline]
2157 unsafe fn decode(
2158 &mut self,
2159 decoder: &mut fidl::encoding::Decoder<
2160 '_,
2161 fidl::encoding::DefaultFuchsiaResourceDialect,
2162 >,
2163 offset: usize,
2164 _depth: fidl::encoding::Depth,
2165 ) -> fidl::Result<()> {
2166 decoder.debug_check_bounds::<Self>(offset);
2167 fidl::decode!(
2169 DriverStartArgs,
2170 fidl::encoding::DefaultFuchsiaResourceDialect,
2171 &mut self.start_args,
2172 decoder,
2173 offset + 0,
2174 _depth
2175 )?;
2176 Ok(())
2177 }
2178 }
2179
2180 impl fidl::encoding::ResourceTypeMarker for NodeAddChildRequest {
2181 type Borrowed<'a> = &'a mut Self;
2182 fn take_or_borrow<'a>(
2183 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2184 ) -> Self::Borrowed<'a> {
2185 value
2186 }
2187 }
2188
2189 unsafe impl fidl::encoding::TypeMarker for NodeAddChildRequest {
2190 type Owned = Self;
2191
2192 #[inline(always)]
2193 fn inline_align(_context: fidl::encoding::Context) -> usize {
2194 8
2195 }
2196
2197 #[inline(always)]
2198 fn inline_size(_context: fidl::encoding::Context) -> usize {
2199 24
2200 }
2201 }
2202
2203 unsafe impl
2204 fidl::encoding::Encode<NodeAddChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2205 for &mut NodeAddChildRequest
2206 {
2207 #[inline]
2208 unsafe fn encode(
2209 self,
2210 encoder: &mut fidl::encoding::Encoder<
2211 '_,
2212 fidl::encoding::DefaultFuchsiaResourceDialect,
2213 >,
2214 offset: usize,
2215 _depth: fidl::encoding::Depth,
2216 ) -> fidl::Result<()> {
2217 encoder.debug_check_bounds::<NodeAddChildRequest>(offset);
2218 fidl::encoding::Encode::<NodeAddChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2220 (
2221 <NodeAddArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
2222 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
2223 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.node),
2224 ),
2225 encoder, offset, _depth
2226 )
2227 }
2228 }
2229 unsafe impl<
2230 T0: fidl::encoding::Encode<NodeAddArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
2231 T1: fidl::encoding::Encode<
2232 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeControllerMarker>>,
2233 fidl::encoding::DefaultFuchsiaResourceDialect,
2234 >,
2235 T2: fidl::encoding::Encode<
2236 fidl::encoding::Optional<
2237 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
2238 >,
2239 fidl::encoding::DefaultFuchsiaResourceDialect,
2240 >,
2241 >
2242 fidl::encoding::Encode<NodeAddChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2243 for (T0, T1, T2)
2244 {
2245 #[inline]
2246 unsafe fn encode(
2247 self,
2248 encoder: &mut fidl::encoding::Encoder<
2249 '_,
2250 fidl::encoding::DefaultFuchsiaResourceDialect,
2251 >,
2252 offset: usize,
2253 depth: fidl::encoding::Depth,
2254 ) -> fidl::Result<()> {
2255 encoder.debug_check_bounds::<NodeAddChildRequest>(offset);
2256 self.0.encode(encoder, offset + 0, depth)?;
2260 self.1.encode(encoder, offset + 16, depth)?;
2261 self.2.encode(encoder, offset + 20, depth)?;
2262 Ok(())
2263 }
2264 }
2265
2266 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2267 for NodeAddChildRequest
2268 {
2269 #[inline(always)]
2270 fn new_empty() -> Self {
2271 Self {
2272 args: fidl::new_empty!(NodeAddArgs, fidl::encoding::DefaultFuchsiaResourceDialect),
2273 controller: fidl::new_empty!(
2274 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeControllerMarker>>,
2275 fidl::encoding::DefaultFuchsiaResourceDialect
2276 ),
2277 node: fidl::new_empty!(
2278 fidl::encoding::Optional<
2279 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
2280 >,
2281 fidl::encoding::DefaultFuchsiaResourceDialect
2282 ),
2283 }
2284 }
2285
2286 #[inline]
2287 unsafe fn decode(
2288 &mut self,
2289 decoder: &mut fidl::encoding::Decoder<
2290 '_,
2291 fidl::encoding::DefaultFuchsiaResourceDialect,
2292 >,
2293 offset: usize,
2294 _depth: fidl::encoding::Depth,
2295 ) -> fidl::Result<()> {
2296 decoder.debug_check_bounds::<Self>(offset);
2297 fidl::decode!(
2299 NodeAddArgs,
2300 fidl::encoding::DefaultFuchsiaResourceDialect,
2301 &mut self.args,
2302 decoder,
2303 offset + 0,
2304 _depth
2305 )?;
2306 fidl::decode!(
2307 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeControllerMarker>>,
2308 fidl::encoding::DefaultFuchsiaResourceDialect,
2309 &mut self.controller,
2310 decoder,
2311 offset + 16,
2312 _depth
2313 )?;
2314 fidl::decode!(
2315 fidl::encoding::Optional<
2316 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
2317 >,
2318 fidl::encoding::DefaultFuchsiaResourceDialect,
2319 &mut self.node,
2320 decoder,
2321 offset + 20,
2322 _depth
2323 )?;
2324 Ok(())
2325 }
2326 }
2327
2328 impl DevfsAddArgs {
2329 #[inline(always)]
2330 fn max_ordinal_present(&self) -> u64 {
2331 if let Some(_) = self.controller_connector {
2332 return 5;
2333 }
2334 if let Some(_) = self.connector_supports {
2335 return 4;
2336 }
2337 if let Some(_) = self.inspect {
2338 return 3;
2339 }
2340 if let Some(_) = self.class_name {
2341 return 2;
2342 }
2343 if let Some(_) = self.connector {
2344 return 1;
2345 }
2346 0
2347 }
2348 }
2349
2350 impl fidl::encoding::ResourceTypeMarker for DevfsAddArgs {
2351 type Borrowed<'a> = &'a mut Self;
2352 fn take_or_borrow<'a>(
2353 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2354 ) -> Self::Borrowed<'a> {
2355 value
2356 }
2357 }
2358
2359 unsafe impl fidl::encoding::TypeMarker for DevfsAddArgs {
2360 type Owned = Self;
2361
2362 #[inline(always)]
2363 fn inline_align(_context: fidl::encoding::Context) -> usize {
2364 8
2365 }
2366
2367 #[inline(always)]
2368 fn inline_size(_context: fidl::encoding::Context) -> usize {
2369 16
2370 }
2371 }
2372
2373 unsafe impl fidl::encoding::Encode<DevfsAddArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
2374 for &mut DevfsAddArgs
2375 {
2376 unsafe fn encode(
2377 self,
2378 encoder: &mut fidl::encoding::Encoder<
2379 '_,
2380 fidl::encoding::DefaultFuchsiaResourceDialect,
2381 >,
2382 offset: usize,
2383 mut depth: fidl::encoding::Depth,
2384 ) -> fidl::Result<()> {
2385 encoder.debug_check_bounds::<DevfsAddArgs>(offset);
2386 let max_ordinal: u64 = self.max_ordinal_present();
2388 encoder.write_num(max_ordinal, offset);
2389 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2390 if max_ordinal == 0 {
2392 return Ok(());
2393 }
2394 depth.increment()?;
2395 let envelope_size = 8;
2396 let bytes_len = max_ordinal as usize * envelope_size;
2397 #[allow(unused_variables)]
2398 let offset = encoder.out_of_line_offset(bytes_len);
2399 let mut _prev_end_offset: usize = 0;
2400 if 1 > max_ordinal {
2401 return Ok(());
2402 }
2403
2404 let cur_offset: usize = (1 - 1) * envelope_size;
2407
2408 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2410
2411 fidl::encoding::encode_in_envelope_optional::<
2416 fidl::encoding::Endpoint<
2417 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2418 >,
2419 fidl::encoding::DefaultFuchsiaResourceDialect,
2420 >(
2421 self.connector.as_mut().map(
2422 <fidl::encoding::Endpoint<
2423 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2424 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2425 ),
2426 encoder,
2427 offset + cur_offset,
2428 depth,
2429 )?;
2430
2431 _prev_end_offset = cur_offset + envelope_size;
2432 if 2 > max_ordinal {
2433 return Ok(());
2434 }
2435
2436 let cur_offset: usize = (2 - 1) * envelope_size;
2439
2440 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2442
2443 fidl::encoding::encode_in_envelope_optional::<
2448 fidl::encoding::BoundedString<255>,
2449 fidl::encoding::DefaultFuchsiaResourceDialect,
2450 >(
2451 self.class_name.as_ref().map(
2452 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
2453 ),
2454 encoder,
2455 offset + cur_offset,
2456 depth,
2457 )?;
2458
2459 _prev_end_offset = cur_offset + envelope_size;
2460 if 3 > max_ordinal {
2461 return Ok(());
2462 }
2463
2464 let cur_offset: usize = (3 - 1) * envelope_size;
2467
2468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2470
2471 fidl::encoding::encode_in_envelope_optional::<
2476 fidl::encoding::HandleType<
2477 fidl::Vmo,
2478 { fidl::ObjectType::VMO.into_raw() },
2479 2147483648,
2480 >,
2481 fidl::encoding::DefaultFuchsiaResourceDialect,
2482 >(
2483 self.inspect.as_mut().map(
2484 <fidl::encoding::HandleType<
2485 fidl::Vmo,
2486 { fidl::ObjectType::VMO.into_raw() },
2487 2147483648,
2488 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2489 ),
2490 encoder,
2491 offset + cur_offset,
2492 depth,
2493 )?;
2494
2495 _prev_end_offset = cur_offset + envelope_size;
2496 if 4 > max_ordinal {
2497 return Ok(());
2498 }
2499
2500 let cur_offset: usize = (4 - 1) * envelope_size;
2503
2504 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2506
2507 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_device_fs::ConnectionType, fidl::encoding::DefaultFuchsiaResourceDialect>(
2512 self.connector_supports.as_ref().map(<fidl_fuchsia_device_fs::ConnectionType as fidl::encoding::ValueTypeMarker>::borrow),
2513 encoder, offset + cur_offset, depth
2514 )?;
2515
2516 _prev_end_offset = cur_offset + envelope_size;
2517 if 5 > max_ordinal {
2518 return Ok(());
2519 }
2520
2521 let cur_offset: usize = (5 - 1) * envelope_size;
2524
2525 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2527
2528 fidl::encoding::encode_in_envelope_optional::<
2533 fidl::encoding::Endpoint<
2534 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2535 >,
2536 fidl::encoding::DefaultFuchsiaResourceDialect,
2537 >(
2538 self.controller_connector.as_mut().map(
2539 <fidl::encoding::Endpoint<
2540 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2541 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2542 ),
2543 encoder,
2544 offset + cur_offset,
2545 depth,
2546 )?;
2547
2548 _prev_end_offset = cur_offset + envelope_size;
2549
2550 Ok(())
2551 }
2552 }
2553
2554 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DevfsAddArgs {
2555 #[inline(always)]
2556 fn new_empty() -> Self {
2557 Self::default()
2558 }
2559
2560 unsafe fn decode(
2561 &mut self,
2562 decoder: &mut fidl::encoding::Decoder<
2563 '_,
2564 fidl::encoding::DefaultFuchsiaResourceDialect,
2565 >,
2566 offset: usize,
2567 mut depth: fidl::encoding::Depth,
2568 ) -> fidl::Result<()> {
2569 decoder.debug_check_bounds::<Self>(offset);
2570 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2571 None => return Err(fidl::Error::NotNullable),
2572 Some(len) => len,
2573 };
2574 if len == 0 {
2576 return Ok(());
2577 };
2578 depth.increment()?;
2579 let envelope_size = 8;
2580 let bytes_len = len * envelope_size;
2581 let offset = decoder.out_of_line_offset(bytes_len)?;
2582 let mut _next_ordinal_to_read = 0;
2584 let mut next_offset = offset;
2585 let end_offset = offset + bytes_len;
2586 _next_ordinal_to_read += 1;
2587 if next_offset >= end_offset {
2588 return Ok(());
2589 }
2590
2591 while _next_ordinal_to_read < 1 {
2593 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2594 _next_ordinal_to_read += 1;
2595 next_offset += envelope_size;
2596 }
2597
2598 let next_out_of_line = decoder.next_out_of_line();
2599 let handles_before = decoder.remaining_handles();
2600 if let Some((inlined, num_bytes, num_handles)) =
2601 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2602 {
2603 let member_inline_size = <fidl::encoding::Endpoint<
2604 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2605 > as fidl::encoding::TypeMarker>::inline_size(
2606 decoder.context
2607 );
2608 if inlined != (member_inline_size <= 4) {
2609 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2610 }
2611 let inner_offset;
2612 let mut inner_depth = depth.clone();
2613 if inlined {
2614 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2615 inner_offset = next_offset;
2616 } else {
2617 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2618 inner_depth.increment()?;
2619 }
2620 let val_ref = self.connector.get_or_insert_with(|| {
2621 fidl::new_empty!(
2622 fidl::encoding::Endpoint<
2623 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2624 >,
2625 fidl::encoding::DefaultFuchsiaResourceDialect
2626 )
2627 });
2628 fidl::decode!(
2629 fidl::encoding::Endpoint<
2630 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2631 >,
2632 fidl::encoding::DefaultFuchsiaResourceDialect,
2633 val_ref,
2634 decoder,
2635 inner_offset,
2636 inner_depth
2637 )?;
2638 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2639 {
2640 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2641 }
2642 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2643 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2644 }
2645 }
2646
2647 next_offset += envelope_size;
2648 _next_ordinal_to_read += 1;
2649 if next_offset >= end_offset {
2650 return Ok(());
2651 }
2652
2653 while _next_ordinal_to_read < 2 {
2655 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2656 _next_ordinal_to_read += 1;
2657 next_offset += envelope_size;
2658 }
2659
2660 let next_out_of_line = decoder.next_out_of_line();
2661 let handles_before = decoder.remaining_handles();
2662 if let Some((inlined, num_bytes, num_handles)) =
2663 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2664 {
2665 let member_inline_size =
2666 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
2667 decoder.context,
2668 );
2669 if inlined != (member_inline_size <= 4) {
2670 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2671 }
2672 let inner_offset;
2673 let mut inner_depth = depth.clone();
2674 if inlined {
2675 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2676 inner_offset = next_offset;
2677 } else {
2678 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2679 inner_depth.increment()?;
2680 }
2681 let val_ref = self.class_name.get_or_insert_with(|| {
2682 fidl::new_empty!(
2683 fidl::encoding::BoundedString<255>,
2684 fidl::encoding::DefaultFuchsiaResourceDialect
2685 )
2686 });
2687 fidl::decode!(
2688 fidl::encoding::BoundedString<255>,
2689 fidl::encoding::DefaultFuchsiaResourceDialect,
2690 val_ref,
2691 decoder,
2692 inner_offset,
2693 inner_depth
2694 )?;
2695 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2696 {
2697 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2698 }
2699 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2700 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2701 }
2702 }
2703
2704 next_offset += envelope_size;
2705 _next_ordinal_to_read += 1;
2706 if next_offset >= end_offset {
2707 return Ok(());
2708 }
2709
2710 while _next_ordinal_to_read < 3 {
2712 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2713 _next_ordinal_to_read += 1;
2714 next_offset += envelope_size;
2715 }
2716
2717 let next_out_of_line = decoder.next_out_of_line();
2718 let handles_before = decoder.remaining_handles();
2719 if let Some((inlined, num_bytes, num_handles)) =
2720 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2721 {
2722 let member_inline_size = <fidl::encoding::HandleType<
2723 fidl::Vmo,
2724 { fidl::ObjectType::VMO.into_raw() },
2725 2147483648,
2726 > as fidl::encoding::TypeMarker>::inline_size(
2727 decoder.context
2728 );
2729 if inlined != (member_inline_size <= 4) {
2730 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2731 }
2732 let inner_offset;
2733 let mut inner_depth = depth.clone();
2734 if inlined {
2735 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2736 inner_offset = next_offset;
2737 } else {
2738 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2739 inner_depth.increment()?;
2740 }
2741 let val_ref =
2742 self.inspect.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
2743 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
2744 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2745 {
2746 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2747 }
2748 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2749 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2750 }
2751 }
2752
2753 next_offset += envelope_size;
2754 _next_ordinal_to_read += 1;
2755 if next_offset >= end_offset {
2756 return Ok(());
2757 }
2758
2759 while _next_ordinal_to_read < 4 {
2761 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2762 _next_ordinal_to_read += 1;
2763 next_offset += envelope_size;
2764 }
2765
2766 let next_out_of_line = decoder.next_out_of_line();
2767 let handles_before = decoder.remaining_handles();
2768 if let Some((inlined, num_bytes, num_handles)) =
2769 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2770 {
2771 let member_inline_size = <fidl_fuchsia_device_fs::ConnectionType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2772 if inlined != (member_inline_size <= 4) {
2773 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2774 }
2775 let inner_offset;
2776 let mut inner_depth = depth.clone();
2777 if inlined {
2778 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2779 inner_offset = next_offset;
2780 } else {
2781 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2782 inner_depth.increment()?;
2783 }
2784 let val_ref = self.connector_supports.get_or_insert_with(|| {
2785 fidl::new_empty!(
2786 fidl_fuchsia_device_fs::ConnectionType,
2787 fidl::encoding::DefaultFuchsiaResourceDialect
2788 )
2789 });
2790 fidl::decode!(
2791 fidl_fuchsia_device_fs::ConnectionType,
2792 fidl::encoding::DefaultFuchsiaResourceDialect,
2793 val_ref,
2794 decoder,
2795 inner_offset,
2796 inner_depth
2797 )?;
2798 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2799 {
2800 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2801 }
2802 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2803 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2804 }
2805 }
2806
2807 next_offset += envelope_size;
2808 _next_ordinal_to_read += 1;
2809 if next_offset >= end_offset {
2810 return Ok(());
2811 }
2812
2813 while _next_ordinal_to_read < 5 {
2815 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2816 _next_ordinal_to_read += 1;
2817 next_offset += envelope_size;
2818 }
2819
2820 let next_out_of_line = decoder.next_out_of_line();
2821 let handles_before = decoder.remaining_handles();
2822 if let Some((inlined, num_bytes, num_handles)) =
2823 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2824 {
2825 let member_inline_size = <fidl::encoding::Endpoint<
2826 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2827 > as fidl::encoding::TypeMarker>::inline_size(
2828 decoder.context
2829 );
2830 if inlined != (member_inline_size <= 4) {
2831 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2832 }
2833 let inner_offset;
2834 let mut inner_depth = depth.clone();
2835 if inlined {
2836 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2837 inner_offset = next_offset;
2838 } else {
2839 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2840 inner_depth.increment()?;
2841 }
2842 let val_ref = self.controller_connector.get_or_insert_with(|| {
2843 fidl::new_empty!(
2844 fidl::encoding::Endpoint<
2845 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2846 >,
2847 fidl::encoding::DefaultFuchsiaResourceDialect
2848 )
2849 });
2850 fidl::decode!(
2851 fidl::encoding::Endpoint<
2852 fidl::endpoints::ClientEnd<fidl_fuchsia_device_fs::ConnectorMarker>,
2853 >,
2854 fidl::encoding::DefaultFuchsiaResourceDialect,
2855 val_ref,
2856 decoder,
2857 inner_offset,
2858 inner_depth
2859 )?;
2860 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2861 {
2862 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2863 }
2864 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2865 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2866 }
2867 }
2868
2869 next_offset += envelope_size;
2870
2871 while next_offset < end_offset {
2873 _next_ordinal_to_read += 1;
2874 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2875 next_offset += envelope_size;
2876 }
2877
2878 Ok(())
2879 }
2880 }
2881
2882 impl DriverStartArgs {
2883 #[inline(always)]
2884 fn max_ordinal_present(&self) -> u64 {
2885 if let Some(_) = self.node_properties_2 {
2886 return 12;
2887 }
2888 if let Some(_) = self.node_token {
2889 return 11;
2890 }
2891 if let Some(_) = self.node_offers {
2892 return 10;
2893 }
2894 if let Some(_) = self.node_properties {
2895 return 9;
2896 }
2897 if let Some(_) = self.node_name {
2898 return 8;
2899 }
2900 if let Some(_) = self.config {
2901 return 7;
2902 }
2903 if let Some(_) = self.outgoing_dir {
2904 return 6;
2905 }
2906 if let Some(_) = self.incoming {
2907 return 5;
2908 }
2909 if let Some(_) = self.program {
2910 return 4;
2911 }
2912 if let Some(_) = self.url {
2913 return 3;
2914 }
2915 if let Some(_) = self.symbols {
2916 return 2;
2917 }
2918 if let Some(_) = self.node {
2919 return 1;
2920 }
2921 0
2922 }
2923 }
2924
2925 impl fidl::encoding::ResourceTypeMarker for DriverStartArgs {
2926 type Borrowed<'a> = &'a mut Self;
2927 fn take_or_borrow<'a>(
2928 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2929 ) -> Self::Borrowed<'a> {
2930 value
2931 }
2932 }
2933
2934 unsafe impl fidl::encoding::TypeMarker for DriverStartArgs {
2935 type Owned = Self;
2936
2937 #[inline(always)]
2938 fn inline_align(_context: fidl::encoding::Context) -> usize {
2939 8
2940 }
2941
2942 #[inline(always)]
2943 fn inline_size(_context: fidl::encoding::Context) -> usize {
2944 16
2945 }
2946 }
2947
2948 unsafe impl
2949 fidl::encoding::Encode<DriverStartArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
2950 for &mut DriverStartArgs
2951 {
2952 unsafe fn encode(
2953 self,
2954 encoder: &mut fidl::encoding::Encoder<
2955 '_,
2956 fidl::encoding::DefaultFuchsiaResourceDialect,
2957 >,
2958 offset: usize,
2959 mut depth: fidl::encoding::Depth,
2960 ) -> fidl::Result<()> {
2961 encoder.debug_check_bounds::<DriverStartArgs>(offset);
2962 let max_ordinal: u64 = self.max_ordinal_present();
2964 encoder.write_num(max_ordinal, offset);
2965 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2966 if max_ordinal == 0 {
2968 return Ok(());
2969 }
2970 depth.increment()?;
2971 let envelope_size = 8;
2972 let bytes_len = max_ordinal as usize * envelope_size;
2973 #[allow(unused_variables)]
2974 let offset = encoder.out_of_line_offset(bytes_len);
2975 let mut _prev_end_offset: usize = 0;
2976 if 1 > max_ordinal {
2977 return Ok(());
2978 }
2979
2980 let cur_offset: usize = (1 - 1) * envelope_size;
2983
2984 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2986
2987 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<NodeMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
2992 self.node.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2993 encoder, offset + cur_offset, depth
2994 )?;
2995
2996 _prev_end_offset = cur_offset + envelope_size;
2997 if 2 > max_ordinal {
2998 return Ok(());
2999 }
3000
3001 let cur_offset: usize = (2 - 1) * envelope_size;
3004
3005 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3007
3008 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3013 self.symbols.as_ref().map(<fidl::encoding::Vector<NodeSymbol, 64> as fidl::encoding::ValueTypeMarker>::borrow),
3014 encoder, offset + cur_offset, depth
3015 )?;
3016
3017 _prev_end_offset = cur_offset + envelope_size;
3018 if 3 > max_ordinal {
3019 return Ok(());
3020 }
3021
3022 let cur_offset: usize = (3 - 1) * envelope_size;
3025
3026 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3028
3029 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3034 self.url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3035 encoder, offset + cur_offset, depth
3036 )?;
3037
3038 _prev_end_offset = cur_offset + envelope_size;
3039 if 4 > max_ordinal {
3040 return Ok(());
3041 }
3042
3043 let cur_offset: usize = (4 - 1) * envelope_size;
3046
3047 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3049
3050 fidl::encoding::encode_in_envelope_optional::<
3055 fidl_fuchsia_data::Dictionary,
3056 fidl::encoding::DefaultFuchsiaResourceDialect,
3057 >(
3058 self.program.as_ref().map(
3059 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
3060 ),
3061 encoder,
3062 offset + cur_offset,
3063 depth,
3064 )?;
3065
3066 _prev_end_offset = cur_offset + envelope_size;
3067 if 5 > max_ordinal {
3068 return Ok(());
3069 }
3070
3071 let cur_offset: usize = (5 - 1) * envelope_size;
3074
3075 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3077
3078 fidl::encoding::encode_in_envelope_optional::<
3083 fidl::encoding::Vector<fidl_fuchsia_component_runner::ComponentNamespaceEntry, 32>,
3084 fidl::encoding::DefaultFuchsiaResourceDialect,
3085 >(
3086 self.incoming.as_mut().map(
3087 <fidl::encoding::Vector<
3088 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
3089 32,
3090 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3091 ),
3092 encoder,
3093 offset + cur_offset,
3094 depth,
3095 )?;
3096
3097 _prev_end_offset = cur_offset + envelope_size;
3098 if 6 > max_ordinal {
3099 return Ok(());
3100 }
3101
3102 let cur_offset: usize = (6 - 1) * envelope_size;
3105
3106 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3108
3109 fidl::encoding::encode_in_envelope_optional::<
3114 fidl::encoding::Endpoint<
3115 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3116 >,
3117 fidl::encoding::DefaultFuchsiaResourceDialect,
3118 >(
3119 self.outgoing_dir.as_mut().map(
3120 <fidl::encoding::Endpoint<
3121 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3122 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3123 ),
3124 encoder,
3125 offset + cur_offset,
3126 depth,
3127 )?;
3128
3129 _prev_end_offset = cur_offset + envelope_size;
3130 if 7 > max_ordinal {
3131 return Ok(());
3132 }
3133
3134 let cur_offset: usize = (7 - 1) * envelope_size;
3137
3138 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3140
3141 fidl::encoding::encode_in_envelope_optional::<
3146 fidl::encoding::HandleType<
3147 fidl::Vmo,
3148 { fidl::ObjectType::VMO.into_raw() },
3149 2147483648,
3150 >,
3151 fidl::encoding::DefaultFuchsiaResourceDialect,
3152 >(
3153 self.config.as_mut().map(
3154 <fidl::encoding::HandleType<
3155 fidl::Vmo,
3156 { fidl::ObjectType::VMO.into_raw() },
3157 2147483648,
3158 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3159 ),
3160 encoder,
3161 offset + cur_offset,
3162 depth,
3163 )?;
3164
3165 _prev_end_offset = cur_offset + envelope_size;
3166 if 8 > max_ordinal {
3167 return Ok(());
3168 }
3169
3170 let cur_offset: usize = (8 - 1) * envelope_size;
3173
3174 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3176
3177 fidl::encoding::encode_in_envelope_optional::<
3182 fidl::encoding::UnboundedString,
3183 fidl::encoding::DefaultFuchsiaResourceDialect,
3184 >(
3185 self.node_name.as_ref().map(
3186 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3187 ),
3188 encoder,
3189 offset + cur_offset,
3190 depth,
3191 )?;
3192
3193 _prev_end_offset = cur_offset + envelope_size;
3194 if 9 > max_ordinal {
3195 return Ok(());
3196 }
3197
3198 let cur_offset: usize = (9 - 1) * envelope_size;
3201
3202 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3204
3205 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<NodePropertyEntry>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3210 self.node_properties.as_ref().map(<fidl::encoding::UnboundedVector<NodePropertyEntry> as fidl::encoding::ValueTypeMarker>::borrow),
3211 encoder, offset + cur_offset, depth
3212 )?;
3213
3214 _prev_end_offset = cur_offset + envelope_size;
3215 if 10 > max_ordinal {
3216 return Ok(());
3217 }
3218
3219 let cur_offset: usize = (10 - 1) * envelope_size;
3222
3223 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3225
3226 fidl::encoding::encode_in_envelope_optional::<
3231 fidl::encoding::Vector<Offer, 128>,
3232 fidl::encoding::DefaultFuchsiaResourceDialect,
3233 >(
3234 self.node_offers.as_ref().map(
3235 <fidl::encoding::Vector<Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow,
3236 ),
3237 encoder,
3238 offset + cur_offset,
3239 depth,
3240 )?;
3241
3242 _prev_end_offset = cur_offset + envelope_size;
3243 if 11 > max_ordinal {
3244 return Ok(());
3245 }
3246
3247 let cur_offset: usize = (11 - 1) * envelope_size;
3250
3251 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3253
3254 fidl::encoding::encode_in_envelope_optional::<
3259 fidl::encoding::HandleType<
3260 fidl::Event,
3261 { fidl::ObjectType::EVENT.into_raw() },
3262 2147483648,
3263 >,
3264 fidl::encoding::DefaultFuchsiaResourceDialect,
3265 >(
3266 self.node_token.as_mut().map(
3267 <fidl::encoding::HandleType<
3268 fidl::Event,
3269 { fidl::ObjectType::EVENT.into_raw() },
3270 2147483648,
3271 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3272 ),
3273 encoder,
3274 offset + cur_offset,
3275 depth,
3276 )?;
3277
3278 _prev_end_offset = cur_offset + envelope_size;
3279 if 12 > max_ordinal {
3280 return Ok(());
3281 }
3282
3283 let cur_offset: usize = (12 - 1) * envelope_size;
3286
3287 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3289
3290 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<NodePropertyEntry2>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3295 self.node_properties_2.as_ref().map(<fidl::encoding::UnboundedVector<NodePropertyEntry2> as fidl::encoding::ValueTypeMarker>::borrow),
3296 encoder, offset + cur_offset, depth
3297 )?;
3298
3299 _prev_end_offset = cur_offset + envelope_size;
3300
3301 Ok(())
3302 }
3303 }
3304
3305 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3306 for DriverStartArgs
3307 {
3308 #[inline(always)]
3309 fn new_empty() -> Self {
3310 Self::default()
3311 }
3312
3313 unsafe fn decode(
3314 &mut self,
3315 decoder: &mut fidl::encoding::Decoder<
3316 '_,
3317 fidl::encoding::DefaultFuchsiaResourceDialect,
3318 >,
3319 offset: usize,
3320 mut depth: fidl::encoding::Depth,
3321 ) -> fidl::Result<()> {
3322 decoder.debug_check_bounds::<Self>(offset);
3323 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3324 None => return Err(fidl::Error::NotNullable),
3325 Some(len) => len,
3326 };
3327 if len == 0 {
3329 return Ok(());
3330 };
3331 depth.increment()?;
3332 let envelope_size = 8;
3333 let bytes_len = len * envelope_size;
3334 let offset = decoder.out_of_line_offset(bytes_len)?;
3335 let mut _next_ordinal_to_read = 0;
3337 let mut next_offset = offset;
3338 let end_offset = offset + bytes_len;
3339 _next_ordinal_to_read += 1;
3340 if next_offset >= end_offset {
3341 return Ok(());
3342 }
3343
3344 while _next_ordinal_to_read < 1 {
3346 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3347 _next_ordinal_to_read += 1;
3348 next_offset += envelope_size;
3349 }
3350
3351 let next_out_of_line = decoder.next_out_of_line();
3352 let handles_before = decoder.remaining_handles();
3353 if let Some((inlined, num_bytes, num_handles)) =
3354 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3355 {
3356 let member_inline_size = <fidl::encoding::Endpoint<
3357 fidl::endpoints::ClientEnd<NodeMarker>,
3358 > as fidl::encoding::TypeMarker>::inline_size(
3359 decoder.context
3360 );
3361 if inlined != (member_inline_size <= 4) {
3362 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3363 }
3364 let inner_offset;
3365 let mut inner_depth = depth.clone();
3366 if inlined {
3367 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3368 inner_offset = next_offset;
3369 } else {
3370 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3371 inner_depth.increment()?;
3372 }
3373 let val_ref = self.node.get_or_insert_with(|| {
3374 fidl::new_empty!(
3375 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<NodeMarker>>,
3376 fidl::encoding::DefaultFuchsiaResourceDialect
3377 )
3378 });
3379 fidl::decode!(
3380 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<NodeMarker>>,
3381 fidl::encoding::DefaultFuchsiaResourceDialect,
3382 val_ref,
3383 decoder,
3384 inner_offset,
3385 inner_depth
3386 )?;
3387 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3388 {
3389 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3390 }
3391 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3392 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3393 }
3394 }
3395
3396 next_offset += envelope_size;
3397 _next_ordinal_to_read += 1;
3398 if next_offset >= end_offset {
3399 return Ok(());
3400 }
3401
3402 while _next_ordinal_to_read < 2 {
3404 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3405 _next_ordinal_to_read += 1;
3406 next_offset += envelope_size;
3407 }
3408
3409 let next_out_of_line = decoder.next_out_of_line();
3410 let handles_before = decoder.remaining_handles();
3411 if let Some((inlined, num_bytes, num_handles)) =
3412 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3413 {
3414 let member_inline_size = <fidl::encoding::Vector<NodeSymbol, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3415 if inlined != (member_inline_size <= 4) {
3416 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3417 }
3418 let inner_offset;
3419 let mut inner_depth = depth.clone();
3420 if inlined {
3421 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3422 inner_offset = next_offset;
3423 } else {
3424 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3425 inner_depth.increment()?;
3426 }
3427 let val_ref =
3428 self.symbols.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
3429 fidl::decode!(fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3430 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3431 {
3432 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3433 }
3434 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3435 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3436 }
3437 }
3438
3439 next_offset += envelope_size;
3440 _next_ordinal_to_read += 1;
3441 if next_offset >= end_offset {
3442 return Ok(());
3443 }
3444
3445 while _next_ordinal_to_read < 3 {
3447 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3448 _next_ordinal_to_read += 1;
3449 next_offset += envelope_size;
3450 }
3451
3452 let next_out_of_line = decoder.next_out_of_line();
3453 let handles_before = decoder.remaining_handles();
3454 if let Some((inlined, num_bytes, num_handles)) =
3455 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3456 {
3457 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3458 if inlined != (member_inline_size <= 4) {
3459 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3460 }
3461 let inner_offset;
3462 let mut inner_depth = depth.clone();
3463 if inlined {
3464 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3465 inner_offset = next_offset;
3466 } else {
3467 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3468 inner_depth.increment()?;
3469 }
3470 let val_ref = self.url.get_or_insert_with(|| {
3471 fidl::new_empty!(
3472 fidl::encoding::BoundedString<4096>,
3473 fidl::encoding::DefaultFuchsiaResourceDialect
3474 )
3475 });
3476 fidl::decode!(
3477 fidl::encoding::BoundedString<4096>,
3478 fidl::encoding::DefaultFuchsiaResourceDialect,
3479 val_ref,
3480 decoder,
3481 inner_offset,
3482 inner_depth
3483 )?;
3484 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3485 {
3486 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3487 }
3488 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3489 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3490 }
3491 }
3492
3493 next_offset += envelope_size;
3494 _next_ordinal_to_read += 1;
3495 if next_offset >= end_offset {
3496 return Ok(());
3497 }
3498
3499 while _next_ordinal_to_read < 4 {
3501 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3502 _next_ordinal_to_read += 1;
3503 next_offset += envelope_size;
3504 }
3505
3506 let next_out_of_line = decoder.next_out_of_line();
3507 let handles_before = decoder.remaining_handles();
3508 if let Some((inlined, num_bytes, num_handles)) =
3509 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3510 {
3511 let member_inline_size =
3512 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
3513 decoder.context,
3514 );
3515 if inlined != (member_inline_size <= 4) {
3516 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3517 }
3518 let inner_offset;
3519 let mut inner_depth = depth.clone();
3520 if inlined {
3521 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3522 inner_offset = next_offset;
3523 } else {
3524 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3525 inner_depth.increment()?;
3526 }
3527 let val_ref = self.program.get_or_insert_with(|| {
3528 fidl::new_empty!(
3529 fidl_fuchsia_data::Dictionary,
3530 fidl::encoding::DefaultFuchsiaResourceDialect
3531 )
3532 });
3533 fidl::decode!(
3534 fidl_fuchsia_data::Dictionary,
3535 fidl::encoding::DefaultFuchsiaResourceDialect,
3536 val_ref,
3537 decoder,
3538 inner_offset,
3539 inner_depth
3540 )?;
3541 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3542 {
3543 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3544 }
3545 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3546 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3547 }
3548 }
3549
3550 next_offset += envelope_size;
3551 _next_ordinal_to_read += 1;
3552 if next_offset >= end_offset {
3553 return Ok(());
3554 }
3555
3556 while _next_ordinal_to_read < 5 {
3558 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3559 _next_ordinal_to_read += 1;
3560 next_offset += envelope_size;
3561 }
3562
3563 let next_out_of_line = decoder.next_out_of_line();
3564 let handles_before = decoder.remaining_handles();
3565 if let Some((inlined, num_bytes, num_handles)) =
3566 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3567 {
3568 let member_inline_size = <fidl::encoding::Vector<
3569 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
3570 32,
3571 > as fidl::encoding::TypeMarker>::inline_size(
3572 decoder.context
3573 );
3574 if inlined != (member_inline_size <= 4) {
3575 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3576 }
3577 let inner_offset;
3578 let mut inner_depth = depth.clone();
3579 if inlined {
3580 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3581 inner_offset = next_offset;
3582 } else {
3583 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3584 inner_depth.increment()?;
3585 }
3586 let val_ref =
3587 self.incoming.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_runner::ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
3588 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_runner::ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3589 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3590 {
3591 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3592 }
3593 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3594 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3595 }
3596 }
3597
3598 next_offset += envelope_size;
3599 _next_ordinal_to_read += 1;
3600 if next_offset >= end_offset {
3601 return Ok(());
3602 }
3603
3604 while _next_ordinal_to_read < 6 {
3606 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3607 _next_ordinal_to_read += 1;
3608 next_offset += envelope_size;
3609 }
3610
3611 let next_out_of_line = decoder.next_out_of_line();
3612 let handles_before = decoder.remaining_handles();
3613 if let Some((inlined, num_bytes, num_handles)) =
3614 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3615 {
3616 let member_inline_size = <fidl::encoding::Endpoint<
3617 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3618 > as fidl::encoding::TypeMarker>::inline_size(
3619 decoder.context
3620 );
3621 if inlined != (member_inline_size <= 4) {
3622 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3623 }
3624 let inner_offset;
3625 let mut inner_depth = depth.clone();
3626 if inlined {
3627 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3628 inner_offset = next_offset;
3629 } else {
3630 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3631 inner_depth.increment()?;
3632 }
3633 let val_ref = self.outgoing_dir.get_or_insert_with(|| {
3634 fidl::new_empty!(
3635 fidl::encoding::Endpoint<
3636 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3637 >,
3638 fidl::encoding::DefaultFuchsiaResourceDialect
3639 )
3640 });
3641 fidl::decode!(
3642 fidl::encoding::Endpoint<
3643 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3644 >,
3645 fidl::encoding::DefaultFuchsiaResourceDialect,
3646 val_ref,
3647 decoder,
3648 inner_offset,
3649 inner_depth
3650 )?;
3651 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3652 {
3653 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3654 }
3655 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3656 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3657 }
3658 }
3659
3660 next_offset += envelope_size;
3661 _next_ordinal_to_read += 1;
3662 if next_offset >= end_offset {
3663 return Ok(());
3664 }
3665
3666 while _next_ordinal_to_read < 7 {
3668 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3669 _next_ordinal_to_read += 1;
3670 next_offset += envelope_size;
3671 }
3672
3673 let next_out_of_line = decoder.next_out_of_line();
3674 let handles_before = decoder.remaining_handles();
3675 if let Some((inlined, num_bytes, num_handles)) =
3676 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3677 {
3678 let member_inline_size = <fidl::encoding::HandleType<
3679 fidl::Vmo,
3680 { fidl::ObjectType::VMO.into_raw() },
3681 2147483648,
3682 > as fidl::encoding::TypeMarker>::inline_size(
3683 decoder.context
3684 );
3685 if inlined != (member_inline_size <= 4) {
3686 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3687 }
3688 let inner_offset;
3689 let mut inner_depth = depth.clone();
3690 if inlined {
3691 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3692 inner_offset = next_offset;
3693 } else {
3694 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3695 inner_depth.increment()?;
3696 }
3697 let val_ref =
3698 self.config.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
3699 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3700 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3701 {
3702 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3703 }
3704 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3705 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3706 }
3707 }
3708
3709 next_offset += envelope_size;
3710 _next_ordinal_to_read += 1;
3711 if next_offset >= end_offset {
3712 return Ok(());
3713 }
3714
3715 while _next_ordinal_to_read < 8 {
3717 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3718 _next_ordinal_to_read += 1;
3719 next_offset += envelope_size;
3720 }
3721
3722 let next_out_of_line = decoder.next_out_of_line();
3723 let handles_before = decoder.remaining_handles();
3724 if let Some((inlined, num_bytes, num_handles)) =
3725 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3726 {
3727 let member_inline_size =
3728 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3729 decoder.context,
3730 );
3731 if inlined != (member_inline_size <= 4) {
3732 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3733 }
3734 let inner_offset;
3735 let mut inner_depth = depth.clone();
3736 if inlined {
3737 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3738 inner_offset = next_offset;
3739 } else {
3740 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3741 inner_depth.increment()?;
3742 }
3743 let val_ref = self.node_name.get_or_insert_with(|| {
3744 fidl::new_empty!(
3745 fidl::encoding::UnboundedString,
3746 fidl::encoding::DefaultFuchsiaResourceDialect
3747 )
3748 });
3749 fidl::decode!(
3750 fidl::encoding::UnboundedString,
3751 fidl::encoding::DefaultFuchsiaResourceDialect,
3752 val_ref,
3753 decoder,
3754 inner_offset,
3755 inner_depth
3756 )?;
3757 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3758 {
3759 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3760 }
3761 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3762 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3763 }
3764 }
3765
3766 next_offset += envelope_size;
3767 _next_ordinal_to_read += 1;
3768 if next_offset >= end_offset {
3769 return Ok(());
3770 }
3771
3772 while _next_ordinal_to_read < 9 {
3774 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3775 _next_ordinal_to_read += 1;
3776 next_offset += envelope_size;
3777 }
3778
3779 let next_out_of_line = decoder.next_out_of_line();
3780 let handles_before = decoder.remaining_handles();
3781 if let Some((inlined, num_bytes, num_handles)) =
3782 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3783 {
3784 let member_inline_size = <fidl::encoding::UnboundedVector<NodePropertyEntry> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3785 if inlined != (member_inline_size <= 4) {
3786 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3787 }
3788 let inner_offset;
3789 let mut inner_depth = depth.clone();
3790 if inlined {
3791 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3792 inner_offset = next_offset;
3793 } else {
3794 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3795 inner_depth.increment()?;
3796 }
3797 let val_ref = self.node_properties.get_or_insert_with(|| {
3798 fidl::new_empty!(
3799 fidl::encoding::UnboundedVector<NodePropertyEntry>,
3800 fidl::encoding::DefaultFuchsiaResourceDialect
3801 )
3802 });
3803 fidl::decode!(
3804 fidl::encoding::UnboundedVector<NodePropertyEntry>,
3805 fidl::encoding::DefaultFuchsiaResourceDialect,
3806 val_ref,
3807 decoder,
3808 inner_offset,
3809 inner_depth
3810 )?;
3811 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3812 {
3813 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3814 }
3815 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3816 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3817 }
3818 }
3819
3820 next_offset += envelope_size;
3821 _next_ordinal_to_read += 1;
3822 if next_offset >= end_offset {
3823 return Ok(());
3824 }
3825
3826 while _next_ordinal_to_read < 10 {
3828 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3829 _next_ordinal_to_read += 1;
3830 next_offset += envelope_size;
3831 }
3832
3833 let next_out_of_line = decoder.next_out_of_line();
3834 let handles_before = decoder.remaining_handles();
3835 if let Some((inlined, num_bytes, num_handles)) =
3836 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3837 {
3838 let member_inline_size =
3839 <fidl::encoding::Vector<Offer, 128> as fidl::encoding::TypeMarker>::inline_size(
3840 decoder.context,
3841 );
3842 if inlined != (member_inline_size <= 4) {
3843 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3844 }
3845 let inner_offset;
3846 let mut inner_depth = depth.clone();
3847 if inlined {
3848 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3849 inner_offset = next_offset;
3850 } else {
3851 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3852 inner_depth.increment()?;
3853 }
3854 let val_ref =
3855 self.node_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
3856 fidl::decode!(fidl::encoding::Vector<Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3857 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3858 {
3859 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3860 }
3861 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3862 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3863 }
3864 }
3865
3866 next_offset += envelope_size;
3867 _next_ordinal_to_read += 1;
3868 if next_offset >= end_offset {
3869 return Ok(());
3870 }
3871
3872 while _next_ordinal_to_read < 11 {
3874 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3875 _next_ordinal_to_read += 1;
3876 next_offset += envelope_size;
3877 }
3878
3879 let next_out_of_line = decoder.next_out_of_line();
3880 let handles_before = decoder.remaining_handles();
3881 if let Some((inlined, num_bytes, num_handles)) =
3882 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3883 {
3884 let member_inline_size = <fidl::encoding::HandleType<
3885 fidl::Event,
3886 { fidl::ObjectType::EVENT.into_raw() },
3887 2147483648,
3888 > as fidl::encoding::TypeMarker>::inline_size(
3889 decoder.context
3890 );
3891 if inlined != (member_inline_size <= 4) {
3892 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3893 }
3894 let inner_offset;
3895 let mut inner_depth = depth.clone();
3896 if inlined {
3897 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3898 inner_offset = next_offset;
3899 } else {
3900 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3901 inner_depth.increment()?;
3902 }
3903 let val_ref =
3904 self.node_token.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
3905 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3906 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3907 {
3908 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3909 }
3910 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3911 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3912 }
3913 }
3914
3915 next_offset += envelope_size;
3916 _next_ordinal_to_read += 1;
3917 if next_offset >= end_offset {
3918 return Ok(());
3919 }
3920
3921 while _next_ordinal_to_read < 12 {
3923 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3924 _next_ordinal_to_read += 1;
3925 next_offset += envelope_size;
3926 }
3927
3928 let next_out_of_line = decoder.next_out_of_line();
3929 let handles_before = decoder.remaining_handles();
3930 if let Some((inlined, num_bytes, num_handles)) =
3931 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3932 {
3933 let member_inline_size = <fidl::encoding::UnboundedVector<NodePropertyEntry2> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3934 if inlined != (member_inline_size <= 4) {
3935 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3936 }
3937 let inner_offset;
3938 let mut inner_depth = depth.clone();
3939 if inlined {
3940 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3941 inner_offset = next_offset;
3942 } else {
3943 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3944 inner_depth.increment()?;
3945 }
3946 let val_ref = self.node_properties_2.get_or_insert_with(|| {
3947 fidl::new_empty!(
3948 fidl::encoding::UnboundedVector<NodePropertyEntry2>,
3949 fidl::encoding::DefaultFuchsiaResourceDialect
3950 )
3951 });
3952 fidl::decode!(
3953 fidl::encoding::UnboundedVector<NodePropertyEntry2>,
3954 fidl::encoding::DefaultFuchsiaResourceDialect,
3955 val_ref,
3956 decoder,
3957 inner_offset,
3958 inner_depth
3959 )?;
3960 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3961 {
3962 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3963 }
3964 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3965 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3966 }
3967 }
3968
3969 next_offset += envelope_size;
3970
3971 while next_offset < end_offset {
3973 _next_ordinal_to_read += 1;
3974 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3975 next_offset += envelope_size;
3976 }
3977
3978 Ok(())
3979 }
3980 }
3981
3982 impl NodeAddArgs {
3983 #[inline(always)]
3984 fn max_ordinal_present(&self) -> u64 {
3985 if let Some(_) = self.properties2 {
3986 return 8;
3987 }
3988 if let Some(_) = self.bus_info {
3989 return 7;
3990 }
3991 if let Some(_) = self.offers2 {
3992 return 6;
3993 }
3994 if let Some(_) = self.devfs_args {
3995 return 5;
3996 }
3997 if let Some(_) = self.properties {
3998 return 4;
3999 }
4000 if let Some(_) = self.symbols {
4001 return 3;
4002 }
4003 if let Some(_) = self.offers {
4004 return 2;
4005 }
4006 if let Some(_) = self.name {
4007 return 1;
4008 }
4009 0
4010 }
4011 }
4012
4013 impl fidl::encoding::ResourceTypeMarker for NodeAddArgs {
4014 type Borrowed<'a> = &'a mut Self;
4015 fn take_or_borrow<'a>(
4016 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4017 ) -> Self::Borrowed<'a> {
4018 value
4019 }
4020 }
4021
4022 unsafe impl fidl::encoding::TypeMarker for NodeAddArgs {
4023 type Owned = Self;
4024
4025 #[inline(always)]
4026 fn inline_align(_context: fidl::encoding::Context) -> usize {
4027 8
4028 }
4029
4030 #[inline(always)]
4031 fn inline_size(_context: fidl::encoding::Context) -> usize {
4032 16
4033 }
4034 }
4035
4036 unsafe impl fidl::encoding::Encode<NodeAddArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
4037 for &mut NodeAddArgs
4038 {
4039 unsafe fn encode(
4040 self,
4041 encoder: &mut fidl::encoding::Encoder<
4042 '_,
4043 fidl::encoding::DefaultFuchsiaResourceDialect,
4044 >,
4045 offset: usize,
4046 mut depth: fidl::encoding::Depth,
4047 ) -> fidl::Result<()> {
4048 encoder.debug_check_bounds::<NodeAddArgs>(offset);
4049 let max_ordinal: u64 = self.max_ordinal_present();
4051 encoder.write_num(max_ordinal, offset);
4052 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4053 if max_ordinal == 0 {
4055 return Ok(());
4056 }
4057 depth.increment()?;
4058 let envelope_size = 8;
4059 let bytes_len = max_ordinal as usize * envelope_size;
4060 #[allow(unused_variables)]
4061 let offset = encoder.out_of_line_offset(bytes_len);
4062 let mut _prev_end_offset: usize = 0;
4063 if 1 > max_ordinal {
4064 return Ok(());
4065 }
4066
4067 let cur_offset: usize = (1 - 1) * envelope_size;
4070
4071 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4073
4074 fidl::encoding::encode_in_envelope_optional::<
4079 fidl::encoding::BoundedString<128>,
4080 fidl::encoding::DefaultFuchsiaResourceDialect,
4081 >(
4082 self.name.as_ref().map(
4083 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
4084 ),
4085 encoder,
4086 offset + cur_offset,
4087 depth,
4088 )?;
4089
4090 _prev_end_offset = cur_offset + envelope_size;
4091 if 2 > max_ordinal {
4092 return Ok(());
4093 }
4094
4095 let cur_offset: usize = (2 - 1) * envelope_size;
4098
4099 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4101
4102 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4107 self.offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
4108 encoder, offset + cur_offset, depth
4109 )?;
4110
4111 _prev_end_offset = cur_offset + envelope_size;
4112 if 3 > max_ordinal {
4113 return Ok(());
4114 }
4115
4116 let cur_offset: usize = (3 - 1) * envelope_size;
4119
4120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4122
4123 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4128 self.symbols.as_ref().map(<fidl::encoding::Vector<NodeSymbol, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4129 encoder, offset + cur_offset, depth
4130 )?;
4131
4132 _prev_end_offset = cur_offset + envelope_size;
4133 if 4 > max_ordinal {
4134 return Ok(());
4135 }
4136
4137 let cur_offset: usize = (4 - 1) * envelope_size;
4140
4141 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4143
4144 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NodeProperty, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4149 self.properties.as_ref().map(<fidl::encoding::Vector<NodeProperty, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4150 encoder, offset + cur_offset, depth
4151 )?;
4152
4153 _prev_end_offset = cur_offset + envelope_size;
4154 if 5 > max_ordinal {
4155 return Ok(());
4156 }
4157
4158 let cur_offset: usize = (5 - 1) * envelope_size;
4161
4162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4164
4165 fidl::encoding::encode_in_envelope_optional::<
4170 DevfsAddArgs,
4171 fidl::encoding::DefaultFuchsiaResourceDialect,
4172 >(
4173 self.devfs_args
4174 .as_mut()
4175 .map(<DevfsAddArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4176 encoder,
4177 offset + cur_offset,
4178 depth,
4179 )?;
4180
4181 _prev_end_offset = cur_offset + envelope_size;
4182 if 6 > max_ordinal {
4183 return Ok(());
4184 }
4185
4186 let cur_offset: usize = (6 - 1) * envelope_size;
4189
4190 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4192
4193 fidl::encoding::encode_in_envelope_optional::<
4198 fidl::encoding::Vector<Offer, 128>,
4199 fidl::encoding::DefaultFuchsiaResourceDialect,
4200 >(
4201 self.offers2.as_ref().map(
4202 <fidl::encoding::Vector<Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow,
4203 ),
4204 encoder,
4205 offset + cur_offset,
4206 depth,
4207 )?;
4208
4209 _prev_end_offset = cur_offset + envelope_size;
4210 if 7 > max_ordinal {
4211 return Ok(());
4212 }
4213
4214 let cur_offset: usize = (7 - 1) * envelope_size;
4217
4218 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4220
4221 fidl::encoding::encode_in_envelope_optional::<
4226 BusInfo,
4227 fidl::encoding::DefaultFuchsiaResourceDialect,
4228 >(
4229 self.bus_info.as_ref().map(<BusInfo as fidl::encoding::ValueTypeMarker>::borrow),
4230 encoder,
4231 offset + cur_offset,
4232 depth,
4233 )?;
4234
4235 _prev_end_offset = cur_offset + envelope_size;
4236 if 8 > max_ordinal {
4237 return Ok(());
4238 }
4239
4240 let cur_offset: usize = (8 - 1) * envelope_size;
4243
4244 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4246
4247 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NodeProperty2, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4252 self.properties2.as_ref().map(<fidl::encoding::Vector<NodeProperty2, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4253 encoder, offset + cur_offset, depth
4254 )?;
4255
4256 _prev_end_offset = cur_offset + envelope_size;
4257
4258 Ok(())
4259 }
4260 }
4261
4262 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for NodeAddArgs {
4263 #[inline(always)]
4264 fn new_empty() -> Self {
4265 Self::default()
4266 }
4267
4268 unsafe fn decode(
4269 &mut self,
4270 decoder: &mut fidl::encoding::Decoder<
4271 '_,
4272 fidl::encoding::DefaultFuchsiaResourceDialect,
4273 >,
4274 offset: usize,
4275 mut depth: fidl::encoding::Depth,
4276 ) -> fidl::Result<()> {
4277 decoder.debug_check_bounds::<Self>(offset);
4278 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4279 None => return Err(fidl::Error::NotNullable),
4280 Some(len) => len,
4281 };
4282 if len == 0 {
4284 return Ok(());
4285 };
4286 depth.increment()?;
4287 let envelope_size = 8;
4288 let bytes_len = len * envelope_size;
4289 let offset = decoder.out_of_line_offset(bytes_len)?;
4290 let mut _next_ordinal_to_read = 0;
4292 let mut next_offset = offset;
4293 let end_offset = offset + bytes_len;
4294 _next_ordinal_to_read += 1;
4295 if next_offset >= end_offset {
4296 return Ok(());
4297 }
4298
4299 while _next_ordinal_to_read < 1 {
4301 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4302 _next_ordinal_to_read += 1;
4303 next_offset += envelope_size;
4304 }
4305
4306 let next_out_of_line = decoder.next_out_of_line();
4307 let handles_before = decoder.remaining_handles();
4308 if let Some((inlined, num_bytes, num_handles)) =
4309 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4310 {
4311 let member_inline_size =
4312 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
4313 decoder.context,
4314 );
4315 if inlined != (member_inline_size <= 4) {
4316 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4317 }
4318 let inner_offset;
4319 let mut inner_depth = depth.clone();
4320 if inlined {
4321 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4322 inner_offset = next_offset;
4323 } else {
4324 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4325 inner_depth.increment()?;
4326 }
4327 let val_ref = self.name.get_or_insert_with(|| {
4328 fidl::new_empty!(
4329 fidl::encoding::BoundedString<128>,
4330 fidl::encoding::DefaultFuchsiaResourceDialect
4331 )
4332 });
4333 fidl::decode!(
4334 fidl::encoding::BoundedString<128>,
4335 fidl::encoding::DefaultFuchsiaResourceDialect,
4336 val_ref,
4337 decoder,
4338 inner_offset,
4339 inner_depth
4340 )?;
4341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4342 {
4343 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4344 }
4345 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4346 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4347 }
4348 }
4349
4350 next_offset += envelope_size;
4351 _next_ordinal_to_read += 1;
4352 if next_offset >= end_offset {
4353 return Ok(());
4354 }
4355
4356 while _next_ordinal_to_read < 2 {
4358 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4359 _next_ordinal_to_read += 1;
4360 next_offset += envelope_size;
4361 }
4362
4363 let next_out_of_line = decoder.next_out_of_line();
4364 let handles_before = decoder.remaining_handles();
4365 if let Some((inlined, num_bytes, num_handles)) =
4366 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4367 {
4368 let member_inline_size = <fidl::encoding::Vector<
4369 fidl_fuchsia_component_decl::Offer,
4370 128,
4371 > as fidl::encoding::TypeMarker>::inline_size(
4372 decoder.context
4373 );
4374 if inlined != (member_inline_size <= 4) {
4375 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4376 }
4377 let inner_offset;
4378 let mut inner_depth = depth.clone();
4379 if inlined {
4380 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4381 inner_offset = next_offset;
4382 } else {
4383 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4384 inner_depth.increment()?;
4385 }
4386 let val_ref =
4387 self.offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
4388 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4389 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4390 {
4391 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4392 }
4393 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4394 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4395 }
4396 }
4397
4398 next_offset += envelope_size;
4399 _next_ordinal_to_read += 1;
4400 if next_offset >= end_offset {
4401 return Ok(());
4402 }
4403
4404 while _next_ordinal_to_read < 3 {
4406 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4407 _next_ordinal_to_read += 1;
4408 next_offset += envelope_size;
4409 }
4410
4411 let next_out_of_line = decoder.next_out_of_line();
4412 let handles_before = decoder.remaining_handles();
4413 if let Some((inlined, num_bytes, num_handles)) =
4414 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4415 {
4416 let member_inline_size = <fidl::encoding::Vector<NodeSymbol, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4417 if inlined != (member_inline_size <= 4) {
4418 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4419 }
4420 let inner_offset;
4421 let mut inner_depth = depth.clone();
4422 if inlined {
4423 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4424 inner_offset = next_offset;
4425 } else {
4426 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4427 inner_depth.increment()?;
4428 }
4429 let val_ref =
4430 self.symbols.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4431 fidl::decode!(fidl::encoding::Vector<NodeSymbol, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4433 {
4434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4435 }
4436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4438 }
4439 }
4440
4441 next_offset += envelope_size;
4442 _next_ordinal_to_read += 1;
4443 if next_offset >= end_offset {
4444 return Ok(());
4445 }
4446
4447 while _next_ordinal_to_read < 4 {
4449 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4450 _next_ordinal_to_read += 1;
4451 next_offset += envelope_size;
4452 }
4453
4454 let next_out_of_line = decoder.next_out_of_line();
4455 let handles_before = decoder.remaining_handles();
4456 if let Some((inlined, num_bytes, num_handles)) =
4457 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4458 {
4459 let member_inline_size = <fidl::encoding::Vector<NodeProperty, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4460 if inlined != (member_inline_size <= 4) {
4461 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4462 }
4463 let inner_offset;
4464 let mut inner_depth = depth.clone();
4465 if inlined {
4466 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4467 inner_offset = next_offset;
4468 } else {
4469 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4470 inner_depth.increment()?;
4471 }
4472 let val_ref =
4473 self.properties.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NodeProperty, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4474 fidl::decode!(fidl::encoding::Vector<NodeProperty, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4475 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4476 {
4477 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4478 }
4479 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4480 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4481 }
4482 }
4483
4484 next_offset += envelope_size;
4485 _next_ordinal_to_read += 1;
4486 if next_offset >= end_offset {
4487 return Ok(());
4488 }
4489
4490 while _next_ordinal_to_read < 5 {
4492 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4493 _next_ordinal_to_read += 1;
4494 next_offset += envelope_size;
4495 }
4496
4497 let next_out_of_line = decoder.next_out_of_line();
4498 let handles_before = decoder.remaining_handles();
4499 if let Some((inlined, num_bytes, num_handles)) =
4500 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4501 {
4502 let member_inline_size =
4503 <DevfsAddArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4504 if inlined != (member_inline_size <= 4) {
4505 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4506 }
4507 let inner_offset;
4508 let mut inner_depth = depth.clone();
4509 if inlined {
4510 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4511 inner_offset = next_offset;
4512 } else {
4513 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4514 inner_depth.increment()?;
4515 }
4516 let val_ref = self.devfs_args.get_or_insert_with(|| {
4517 fidl::new_empty!(DevfsAddArgs, fidl::encoding::DefaultFuchsiaResourceDialect)
4518 });
4519 fidl::decode!(
4520 DevfsAddArgs,
4521 fidl::encoding::DefaultFuchsiaResourceDialect,
4522 val_ref,
4523 decoder,
4524 inner_offset,
4525 inner_depth
4526 )?;
4527 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4528 {
4529 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4530 }
4531 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4532 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4533 }
4534 }
4535
4536 next_offset += envelope_size;
4537 _next_ordinal_to_read += 1;
4538 if next_offset >= end_offset {
4539 return Ok(());
4540 }
4541
4542 while _next_ordinal_to_read < 6 {
4544 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4545 _next_ordinal_to_read += 1;
4546 next_offset += envelope_size;
4547 }
4548
4549 let next_out_of_line = decoder.next_out_of_line();
4550 let handles_before = decoder.remaining_handles();
4551 if let Some((inlined, num_bytes, num_handles)) =
4552 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4553 {
4554 let member_inline_size =
4555 <fidl::encoding::Vector<Offer, 128> as fidl::encoding::TypeMarker>::inline_size(
4556 decoder.context,
4557 );
4558 if inlined != (member_inline_size <= 4) {
4559 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4560 }
4561 let inner_offset;
4562 let mut inner_depth = depth.clone();
4563 if inlined {
4564 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4565 inner_offset = next_offset;
4566 } else {
4567 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4568 inner_depth.increment()?;
4569 }
4570 let val_ref =
4571 self.offers2.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
4572 fidl::decode!(fidl::encoding::Vector<Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4573 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4574 {
4575 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4576 }
4577 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4578 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4579 }
4580 }
4581
4582 next_offset += envelope_size;
4583 _next_ordinal_to_read += 1;
4584 if next_offset >= end_offset {
4585 return Ok(());
4586 }
4587
4588 while _next_ordinal_to_read < 7 {
4590 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4591 _next_ordinal_to_read += 1;
4592 next_offset += envelope_size;
4593 }
4594
4595 let next_out_of_line = decoder.next_out_of_line();
4596 let handles_before = decoder.remaining_handles();
4597 if let Some((inlined, num_bytes, num_handles)) =
4598 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4599 {
4600 let member_inline_size =
4601 <BusInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4602 if inlined != (member_inline_size <= 4) {
4603 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4604 }
4605 let inner_offset;
4606 let mut inner_depth = depth.clone();
4607 if inlined {
4608 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4609 inner_offset = next_offset;
4610 } else {
4611 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4612 inner_depth.increment()?;
4613 }
4614 let val_ref = self.bus_info.get_or_insert_with(|| {
4615 fidl::new_empty!(BusInfo, fidl::encoding::DefaultFuchsiaResourceDialect)
4616 });
4617 fidl::decode!(
4618 BusInfo,
4619 fidl::encoding::DefaultFuchsiaResourceDialect,
4620 val_ref,
4621 decoder,
4622 inner_offset,
4623 inner_depth
4624 )?;
4625 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4626 {
4627 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4628 }
4629 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4630 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4631 }
4632 }
4633
4634 next_offset += envelope_size;
4635 _next_ordinal_to_read += 1;
4636 if next_offset >= end_offset {
4637 return Ok(());
4638 }
4639
4640 while _next_ordinal_to_read < 8 {
4642 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4643 _next_ordinal_to_read += 1;
4644 next_offset += envelope_size;
4645 }
4646
4647 let next_out_of_line = decoder.next_out_of_line();
4648 let handles_before = decoder.remaining_handles();
4649 if let Some((inlined, num_bytes, num_handles)) =
4650 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4651 {
4652 let member_inline_size = <fidl::encoding::Vector<NodeProperty2, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4653 if inlined != (member_inline_size <= 4) {
4654 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4655 }
4656 let inner_offset;
4657 let mut inner_depth = depth.clone();
4658 if inlined {
4659 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4660 inner_offset = next_offset;
4661 } else {
4662 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4663 inner_depth.increment()?;
4664 }
4665 let val_ref =
4666 self.properties2.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NodeProperty2, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4667 fidl::decode!(fidl::encoding::Vector<NodeProperty2, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4668 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4669 {
4670 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4671 }
4672 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4673 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4674 }
4675 }
4676
4677 next_offset += envelope_size;
4678
4679 while next_offset < end_offset {
4681 _next_ordinal_to_read += 1;
4682 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4683 next_offset += envelope_size;
4684 }
4685
4686 Ok(())
4687 }
4688 }
4689}