| // DO NOT EDIT: This file is machine-generated by fidlgen |
| #![warn(clippy::all)] |
| #![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)] |
| |
| pub mod natural { |
| |
| #[derive(PartialEq, Clone, Debug)] |
| pub struct SuperFooRequest { |
| pub s: ::std::string::String, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SuperFooRequest<'static>, ___E> |
| for SuperFooRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooRequest { |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.s, encoder_, s, 4294967295)?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) }; |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SuperFooRequest<'static>, ___E> |
| for &'a SuperFooRequest |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooRequest { |
| |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.s, encoder_, s, 4294967295)?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) }; |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooRequest<'static>>, |
| ___E, |
| > for SuperFooRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| SuperFooRequest: ::fidl_next::Encode<crate::wire::SuperFooRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooRequest<'static>>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooRequest<'static>>, |
| ___E, |
| > for &'a SuperFooRequest |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a SuperFooRequest: ::fidl_next::Encode<crate::wire::SuperFooRequest<'static>, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooRequest<'static>>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWire<crate::wire::SuperFooRequest<'de>> for SuperFooRequest { |
| #[inline] |
| fn from_wire(wire: crate::wire::SuperFooRequest<'de>) -> Self { |
| Self { s: ::fidl_next::FromWire::from_wire(wire.s) } |
| } |
| } |
| |
| impl<'de> ::fidl_next::FromWireRef<crate::wire::SuperFooRequest<'de>> for SuperFooRequest { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::SuperFooRequest<'de>) -> Self { |
| Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) } |
| } |
| } |
| |
| #[derive(PartialEq, Clone, Debug)] |
| #[repr(C)] |
| pub struct SuperFooResponse { |
| pub y: i64, |
| } |
| |
| unsafe impl<___E> ::fidl_next::Encode<crate::wire::SuperFooResponse, ___E> for SuperFooResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| Self, |
| crate::wire::SuperFooResponse, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <i64 as ::fidl_next::Encode<::fidl_next::WireI64, ___E>>::COPY_OPTIMIZATION |
| .is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooResponse { |
| y, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.y, encoder_, y, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(y.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SuperFooResponse, ___E> |
| for &'a SuperFooResponse |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooResponse { |
| |
| y, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(&self.y, encoder_, y, ())?; |
| |
| let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(y.as_mut_ptr()) }; |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooResponse>, |
| ___E, |
| > for SuperFooResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| SuperFooResponse: ::fidl_next::Encode<crate::wire::SuperFooResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooResponse>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| unsafe impl<'a, ___E> |
| ::fidl_next::EncodeOption< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooResponse>, |
| ___E, |
| > for &'a SuperFooResponse |
| where |
| ___E: ::fidl_next::Encoder + ?Sized, |
| &'a SuperFooResponse: ::fidl_next::Encode<crate::wire::SuperFooResponse, ___E>, |
| { |
| #[inline] |
| fn encode_option( |
| this: ::core::option::Option<Self>, |
| encoder: &mut ___E, |
| out: &mut ::core::mem::MaybeUninit< |
| ::fidl_next::WireBox<'static, crate::wire::SuperFooResponse>, |
| >, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| if let Some(inner) = this { |
| ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?; |
| ::fidl_next::WireBox::encode_present(out); |
| } else { |
| ::fidl_next::WireBox::encode_absent(out); |
| } |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::FromWire<crate::wire::SuperFooResponse> for SuperFooResponse { |
| const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization< |
| crate::wire::SuperFooResponse, |
| Self, |
| > = unsafe { |
| ::fidl_next::CopyOptimization::enable_if( |
| true && <i64 as ::fidl_next::FromWire<::fidl_next::WireI64>>::COPY_OPTIMIZATION |
| .is_enabled(), |
| ) |
| }; |
| |
| #[inline] |
| fn from_wire(wire: crate::wire::SuperFooResponse) -> Self { |
| Self { y: ::fidl_next::FromWire::from_wire(wire.y) } |
| } |
| } |
| |
| impl ::fidl_next::FromWireRef<crate::wire::SuperFooResponse> for SuperFooResponse { |
| #[inline] |
| fn from_wire_ref(wire: &crate::wire::SuperFooResponse) -> Self { |
| Self { y: ::fidl_next::FromWireRef::from_wire_ref(&wire.y) } |
| } |
| } |
| } |
| |
| pub mod wire { |
| |
| /// The wire type corresponding to [`SuperFooRequest`]. |
| #[derive(Debug)] |
| #[repr(C)] |
| pub struct SuperFooRequest<'de> { |
| pub s: ::fidl_next::WireString<'de>, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<SuperFooRequest<'_>>(), 16); |
| static_assertions::const_assert_eq!(std::mem::align_of::<SuperFooRequest<'_>>(), 8); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(SuperFooRequest<'_>, s), 0); |
| |
| unsafe impl ::fidl_next::Wire for SuperFooRequest<'static> { |
| type Owned<'de> = SuperFooRequest<'de>; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| s, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(s); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for SuperFooRequest<'static> |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| ___D: ::fidl_next::Decoder, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut s, |
| |
| } = slot_; |
| } |
| |
| let _field = s.as_mut(); |
| ::fidl_next::Constrained::validate(_field, 4294967295)?; |
| ::fidl_next::Decode::decode(s.as_mut(), decoder_, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl<'de> ::fidl_next::IntoNatural for SuperFooRequest<'de> { |
| type Natural = crate::natural::SuperFooRequest; |
| } |
| |
| impl ::fidl_next::Unconstrained for SuperFooRequest<'static> {} |
| |
| /// The wire type corresponding to [`SuperFooResponse`]. |
| #[derive(Clone, Debug)] |
| #[repr(C)] |
| pub struct SuperFooResponse { |
| pub y: ::fidl_next::WireI64, |
| } |
| |
| static_assertions::const_assert_eq!(std::mem::size_of::<SuperFooResponse>(), 8); |
| static_assertions::const_assert_eq!(std::mem::align_of::<SuperFooResponse>(), 8); |
| |
| static_assertions::const_assert_eq!(std::mem::offset_of!(SuperFooResponse, y), 0); |
| |
| unsafe impl ::fidl_next::Wire for SuperFooResponse { |
| type Owned<'de> = SuperFooResponse; |
| |
| #[inline] |
| fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) { |
| ::fidl_next::munge! { |
| let Self { |
| |
| y, |
| |
| } = &mut *out_; |
| } |
| |
| ::fidl_next::Wire::zero_padding(y); |
| } |
| } |
| |
| unsafe impl<___D> ::fidl_next::Decode<___D> for SuperFooResponse |
| where |
| ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized, |
| { |
| fn decode( |
| slot_: ::fidl_next::Slot<'_, Self>, |
| decoder_: &mut ___D, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::DecodeError> { |
| ::fidl_next::munge! { |
| let Self { |
| |
| mut y, |
| |
| } = slot_; |
| } |
| |
| let _field = y.as_mut(); |
| |
| ::fidl_next::Decode::decode(y.as_mut(), decoder_, ())?; |
| |
| Ok(()) |
| } |
| } |
| |
| impl ::fidl_next::IntoNatural for SuperFooResponse { |
| type Natural = crate::natural::SuperFooResponse; |
| } |
| |
| impl ::fidl_next::Unconstrained for SuperFooResponse {} |
| } |
| |
| pub mod wire_optional {} |
| |
| pub mod generic { |
| |
| pub struct SuperFooRequest<T0> { |
| pub s: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SuperFooRequest<'static>, ___E> |
| for SuperFooRequest<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| ___E: ::fidl_next::Encoder, |
| T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooRequest<'static>>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooRequest { |
| |
| s, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.s, encoder_, s, 4294967295)?; |
| |
| Ok(()) |
| } |
| } |
| |
| pub struct SuperFooResponse<T0> { |
| pub y: T0, |
| } |
| |
| unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SuperFooResponse, ___E> |
| for SuperFooResponse<T0> |
| where |
| ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized, |
| T0: ::fidl_next::Encode<::fidl_next::WireI64, ___E>, |
| { |
| #[inline] |
| fn encode( |
| self, |
| encoder_: &mut ___E, |
| out_: &mut ::core::mem::MaybeUninit<crate::wire::SuperFooResponse>, |
| _: (), |
| ) -> ::core::result::Result<(), ::fidl_next::EncodeError> { |
| ::fidl_next::munge! { |
| let crate::wire::SuperFooResponse { |
| |
| y, |
| |
| } = out_; |
| } |
| |
| ::fidl_next::Encode::encode(self.y, encoder_, y, ())?; |
| |
| Ok(()) |
| } |
| } |
| } |
| |
| pub use self::natural::*; |
| |
| /// The type corresponding to the super protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct Super; |
| |
| #[cfg(target_os = "fuchsia")] |
| impl ::fidl_next::HasTransport for Super { |
| type Transport = ::fidl_next::fuchsia::zx::Channel; |
| } |
| |
| pub mod super_ { |
| pub mod prelude { |
| pub use crate::{Super, SuperClientHandler, SuperServerHandler, super_}; |
| |
| pub use crate::natural::SuperFooRequest; |
| |
| pub use crate::natural::SuperFooResponse; |
| } |
| |
| pub struct Foo; |
| |
| impl ::fidl_next::Method for Foo { |
| const ORDINAL: u64 = 7540745593380780216; |
| const FLEXIBILITY: ::fidl_next::protocol::Flexibility = |
| ::fidl_next::protocol::Flexibility::Strict; |
| |
| type Protocol = crate::Super; |
| |
| type Request = crate::wire::SuperFooRequest<'static>; |
| } |
| |
| impl ::fidl_next::TwoWayMethod for Foo { |
| type Response = crate::wire::SuperFooResponse; |
| } |
| |
| impl<___R> ::fidl_next::Respond<___R> for Foo { |
| type Output = crate::generic::SuperFooResponse<___R>; |
| |
| fn respond(response: ___R) -> Self::Output { |
| crate::generic::SuperFooResponse { y: response } |
| } |
| } |
| |
| mod ___detail { |
| unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Super |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = SuperClient<___T>; |
| type Server = SuperServer<___T>; |
| } |
| |
| /// The client for the `super` protocol. |
| #[repr(transparent)] |
| pub struct SuperClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> SuperClient<___T> |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| pub fn foo( |
| &self, |
| |
| s: impl ::fidl_next::Encode< |
| ::fidl_next::WireString<'static>, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::Foo, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder, |
| { |
| self.foo_with(crate::generic::SuperFooRequest { s }) |
| } |
| |
| pub fn foo_with<___R>( |
| &self, |
| request: ___R, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::Foo, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| crate::wire::SuperFooRequest<'static>, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| { |
| ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way( |
| 7540745593380780216, |
| <super::Foo as ::fidl_next::Method>::FLEXIBILITY, |
| request, |
| )) |
| } |
| } |
| |
| /// The server for the `super` protocol. |
| #[repr(transparent)] |
| pub struct SuperServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> SuperServer<___T> where ___T: ::fidl_next::Transport {} |
| } |
| } |
| |
| /// A client handler for the super protocol. |
| /// |
| /// See [`Super`] for more details. |
| pub trait SuperClientHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| } |
| |
| impl<___T> SuperClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {} |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Super |
| where |
| ___H: SuperClientHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| { |
| async fn on_event( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> { |
| match ordinal { |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// A server handler for the super protocol. |
| /// |
| /// See [`Super`] for more details. |
| pub trait SuperServerHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| fn foo( |
| &mut self, |
| |
| request: ::fidl_next::Request<super_::Foo, ___T>, |
| |
| responder: ::fidl_next::Responder<super_::Foo, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Super |
| where |
| ___H: SuperServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <super_::Foo as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_one_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| |
| async fn on_two_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| responder: ::fidl_next::protocol::Responder<___T>, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| 7540745593380780216 => { |
| let responder = ::fidl_next::Responder::from_untyped(responder); |
| |
| match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => { |
| handler.foo(::fidl_next::Request::from_decoded(decoded), responder).await; |
| Ok(()) |
| } |
| Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage { |
| ordinal: 7540745593380780216, |
| error, |
| }), |
| } |
| } |
| |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// The type corresponding to the sub protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct Sub; |
| |
| #[cfg(target_os = "fuchsia")] |
| impl ::fidl_next::HasTransport for Sub { |
| type Transport = ::fidl_next::fuchsia::zx::Channel; |
| } |
| |
| pub mod sub { |
| pub mod prelude { |
| pub use crate::{Sub, SubClientHandler, SubServerHandler, sub}; |
| |
| pub use crate::natural::SuperFooRequest; |
| |
| pub use crate::natural::SuperFooResponse; |
| } |
| |
| pub struct Foo; |
| |
| impl ::fidl_next::Method for Foo { |
| const ORDINAL: u64 = 7540745593380780216; |
| const FLEXIBILITY: ::fidl_next::protocol::Flexibility = |
| ::fidl_next::protocol::Flexibility::Strict; |
| |
| type Protocol = crate::Sub; |
| |
| type Request = crate::wire::SuperFooRequest<'static>; |
| } |
| |
| impl ::fidl_next::TwoWayMethod for Foo { |
| type Response = crate::wire::SuperFooResponse; |
| } |
| |
| impl<___R> ::fidl_next::Respond<___R> for Foo { |
| type Output = crate::generic::SuperFooResponse<___R>; |
| |
| fn respond(response: ___R) -> Self::Output { |
| crate::generic::SuperFooResponse { y: response } |
| } |
| } |
| |
| mod ___detail { |
| unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Sub |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = SubClient<___T>; |
| type Server = SubServer<___T>; |
| } |
| |
| /// The client for the `sub` protocol. |
| #[repr(transparent)] |
| pub struct SubClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> SubClient<___T> |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| pub fn foo( |
| &self, |
| |
| s: impl ::fidl_next::Encode< |
| ::fidl_next::WireString<'static>, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::Foo, ___T> |
| where |
| <___T as ::fidl_next::Transport>::SendBuffer: |
| ::fidl_next::encoder::InternalHandleEncoder, |
| <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder, |
| { |
| self.foo_with(crate::generic::SuperFooRequest { s }) |
| } |
| |
| pub fn foo_with<___R>( |
| &self, |
| request: ___R, |
| ) -> ::fidl_next::TwoWayFuture<'_, super::Foo, ___T> |
| where |
| ___R: ::fidl_next::Encode< |
| crate::wire::SuperFooRequest<'static>, |
| <___T as ::fidl_next::Transport>::SendBuffer, |
| >, |
| { |
| ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way( |
| 7540745593380780216, |
| <super::Foo as ::fidl_next::Method>::FLEXIBILITY, |
| request, |
| )) |
| } |
| } |
| |
| /// The server for the `sub` protocol. |
| #[repr(transparent)] |
| pub struct SubServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> SubServer<___T> where ___T: ::fidl_next::Transport {} |
| } |
| } |
| |
| /// A client handler for the sub protocol. |
| /// |
| /// See [`Sub`] for more details. |
| pub trait SubClientHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| } |
| |
| impl<___T> SubClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {} |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Sub |
| where |
| ___H: SubClientHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| { |
| async fn on_event( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> { |
| match ordinal { |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// A server handler for the sub protocol. |
| /// |
| /// See [`Sub`] for more details. |
| pub trait SubServerHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| fn foo( |
| &mut self, |
| |
| request: ::fidl_next::Request<sub::Foo, ___T>, |
| |
| responder: ::fidl_next::Responder<sub::Foo, ___T>, |
| ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send; |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Sub |
| where |
| ___H: SubServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| <sub::Foo as ::fidl_next::Method>::Request: |
| ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>, |
| { |
| async fn on_one_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| |
| async fn on_two_way( |
| handler: &mut ___H, |
| ordinal: u64, |
| flexibility: ::fidl_next::protocol::Flexibility, |
| buffer: ___T::RecvBuffer, |
| responder: ::fidl_next::protocol::Responder<___T>, |
| ) -> ::core::result::Result< |
| (), |
| ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>, |
| > { |
| match ordinal { |
| 7540745593380780216 => { |
| let responder = ::fidl_next::Responder::from_untyped(responder); |
| |
| match ::fidl_next::DecoderExt::decode(buffer) { |
| Ok(decoded) => { |
| handler.foo(::fidl_next::Request::from_decoded(decoded), responder).await; |
| Ok(()) |
| } |
| Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage { |
| ordinal: 7540745593380780216, |
| error, |
| }), |
| } |
| } |
| |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| impl ::fidl_next::CompatFrom<crate::SuperFooRequest> for ::fidl_test_inheritance::SuperFooRequest { |
| #[inline] |
| fn compat_from(value: crate::SuperFooRequest) -> Self { |
| Self { s: ::fidl_next::CompatFrom::compat_from(value.s) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_inheritance::SuperFooRequest> for crate::SuperFooRequest { |
| #[inline] |
| fn compat_from(value: ::fidl_test_inheritance::SuperFooRequest) -> Self { |
| Self { s: ::fidl_next::CompatFrom::compat_from(value.s) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<crate::SuperFooResponse> |
| for ::fidl_test_inheritance::SuperFooResponse |
| { |
| #[inline] |
| fn compat_from(value: crate::SuperFooResponse) -> Self { |
| Self { y: ::fidl_next::CompatFrom::compat_from(value.y) } |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_inheritance::SuperFooResponse> |
| for crate::SuperFooResponse |
| { |
| #[inline] |
| fn compat_from(value: ::fidl_test_inheritance::SuperFooResponse) -> Self { |
| Self { y: ::fidl_next::CompatFrom::compat_from(value.y) } |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `Super` |
| /// protocol. |
| pub type SuperProxy = ::fidl_next::Client<crate::Super>; |
| |
| impl ::fidl_next::CompatFrom<crate::Super> for ::fidl_test_inheritance::Super_Marker { |
| fn compat_from(_: crate::Super) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_inheritance::Super_Marker> for crate::Super { |
| fn compat_from(_: ::fidl_test_inheritance::Super_Marker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_inheritance::Super_Proxy> for crate::Super { |
| fn client_compat_from( |
| proxy: ::fidl_test_inheritance::Super_Proxy, |
| ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> { |
| let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel(); |
| let client_end = ::fidl_next::ClientEnd::from_untyped(channel); |
| ::fidl_next::ClientDispatcher::new(client_end) |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `Sub` |
| /// protocol. |
| pub type SubProxy = ::fidl_next::Client<crate::Sub>; |
| |
| impl ::fidl_next::CompatFrom<crate::Sub> for ::fidl_test_inheritance::SubMarker { |
| fn compat_from(_: crate::Sub) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_inheritance::SubMarker> for crate::Sub { |
| fn compat_from(_: ::fidl_test_inheritance::SubMarker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_inheritance::SubProxy> for crate::Sub { |
| fn client_compat_from( |
| proxy: ::fidl_test_inheritance::SubProxy, |
| ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> { |
| let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel(); |
| let client_end = ::fidl_next::ClientEnd::from_untyped(channel); |
| ::fidl_next::ClientDispatcher::new(client_end) |
| } |
| } |
| } |