| // 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 {} |
| |
| pub mod wire {} |
| |
| pub mod wire_optional {} |
| |
| pub mod generic {} |
| |
| pub use self::natural::*; |
| |
| /// The type corresponding to the Child protocol. |
| #[derive(PartialEq, Debug)] |
| pub struct Child; |
| |
| #[cfg(target_os = "fuchsia")] |
| impl ::fidl_next::HasTransport for Child { |
| type Transport = ::fidl_next::fuchsia::zx::Channel; |
| } |
| |
| pub mod child { |
| pub mod prelude { |
| pub use crate::{Child, ChildClientHandler, ChildServerHandler, child}; |
| } |
| |
| mod ___detail { |
| unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Child |
| where |
| ___T: ::fidl_next::Transport, |
| { |
| type Client = ChildClient<___T>; |
| type Server = ChildServer<___T>; |
| } |
| |
| /// The client for the `Child` protocol. |
| #[repr(transparent)] |
| pub struct ChildClient<___T: ::fidl_next::Transport> { |
| #[allow(dead_code)] |
| client: ::fidl_next::protocol::Client<___T>, |
| } |
| |
| impl<___T> ChildClient<___T> where ___T: ::fidl_next::Transport {} |
| |
| /// The server for the `Child` protocol. |
| #[repr(transparent)] |
| pub struct ChildServer<___T: ::fidl_next::Transport> { |
| server: ::fidl_next::protocol::Server<___T>, |
| } |
| |
| impl<___T> ChildServer<___T> where ___T: ::fidl_next::Transport {} |
| } |
| } |
| |
| /// A client handler for the Child protocol. |
| /// |
| /// See [`Child`] for more details. |
| pub trait ChildClientHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| } |
| |
| impl<___T> ChildClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {} |
| |
| impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Child |
| where |
| ___H: ChildClientHandler<___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 Child protocol. |
| /// |
| /// See [`Child`] for more details. |
| pub trait ChildServerHandler< |
| #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel, |
| #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport, |
| > |
| { |
| } |
| |
| impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Child |
| where |
| ___H: ChildServerHandler<___T> + ::core::marker::Send, |
| ___T: ::fidl_next::Transport, |
| { |
| 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 { |
| ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)), |
| } |
| } |
| } |
| |
| /// Compatibility shims which mimic some API surfaces of the current Rust bindings. |
| pub mod compat { |
| |
| #[cfg(target_os = "fuchsia")] |
| /// An alias for a client over `zx::Channel` for the `Child` |
| /// protocol. |
| pub type ChildProxy = ::fidl_next::Client<crate::Child>; |
| |
| impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_test_protocolrequest::ChildMarker { |
| fn compat_from(_: crate::Child) -> Self { |
| Self |
| } |
| } |
| |
| impl ::fidl_next::CompatFrom<::fidl_test_protocolrequest::ChildMarker> for crate::Child { |
| fn compat_from(_: ::fidl_test_protocolrequest::ChildMarker) -> Self { |
| Self |
| } |
| } |
| |
| #[cfg(target_os = "fuchsia")] |
| |
| impl ::fidl_next::ClientCompatFrom<::fidl_test_protocolrequest::ChildProxy> for crate::Child { |
| fn client_compat_from( |
| proxy: ::fidl_test_protocolrequest::ChildProxy, |
| ) -> ::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) |
| } |
| } |
| } |