blob: f293fc1632748b33eef9b721b545d9621b2d13d5 [file] [log] [blame]
// 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 use fidl_next_common_test_transitivedependenciescompose::natural::*;
}
pub mod wire {
pub use fidl_next_common_test_transitivedependenciescompose::wire::*;
}
pub mod wire_optional {
pub use fidl_next_common_test_transitivedependenciescompose::wire_optional::*;
}
pub mod generic {
pub use fidl_next_common_test_transitivedependenciescompose::generic::*;
}
pub use self::natural::*;
/// The type corresponding to the Top protocol.
#[derive(PartialEq, Debug)]
pub struct Top;
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::HasTransport for Top {
type Transport = ::fidl_next::fuchsia::zx::Channel;
}
pub mod top {
pub mod prelude {
pub use crate::{Top, TopClientHandler, TopServerHandler, top};
pub use ::fidl_next_test_bottom::natural::BottomGetFooResponse;
}
pub struct GetFoo;
impl ::fidl_next::Method for GetFoo {
const ORDINAL: u64 = 2618685789258237543;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::Top;
type Request = ();
}
impl ::fidl_next::TwoWayMethod for GetFoo {
type Response = ::fidl_next_test_bottom::wire::BottomGetFooResponse;
}
impl<___R> ::fidl_next::Respond<___R> for GetFoo {
type Output = ::fidl_next_test_bottom::generic::BottomGetFooResponse<___R>;
fn respond(response: ___R) -> Self::Output {
::fidl_next_test_bottom::generic::BottomGetFooResponse { foo: response }
}
}
mod ___detail {
unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Top
where
___T: ::fidl_next::Transport,
{
type Client = TopClient<___T>;
type Server = TopServer<___T>;
}
/// The client for the `Top` protocol.
#[repr(transparent)]
pub struct TopClient<___T: ::fidl_next::Transport> {
#[allow(dead_code)]
client: ::fidl_next::protocol::Client<___T>,
}
impl<___T> TopClient<___T>
where
___T: ::fidl_next::Transport,
{
pub fn get_foo(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetFoo, ___T> {
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2618685789258237543,
<super::GetFoo as ::fidl_next::Method>::FLEXIBILITY,
(),
))
}
}
/// The server for the `Top` protocol.
#[repr(transparent)]
pub struct TopServer<___T: ::fidl_next::Transport> {
server: ::fidl_next::protocol::Server<___T>,
}
impl<___T> TopServer<___T> where ___T: ::fidl_next::Transport {}
}
}
/// A client handler for the Top protocol.
///
/// See [`Top`] for more details.
pub trait TopClientHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
}
impl<___T> TopClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Top
where
___H: TopClientHandler<___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 Top protocol.
///
/// See [`Top`] for more details.
pub trait TopServerHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
fn get_foo(
&mut self,
responder: ::fidl_next::Responder<top::GetFoo, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
}
impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Top
where
___H: TopServerHandler<___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 {
2618685789258237543 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
handler.get_foo(responder).await;
Ok(())
}
ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
}
}
}
pub use fidl_next_common_test_transitivedependenciescompose::*;
/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
pub mod compat {
pub use fidl_next_common_test_transitivedependenciescompose::compat::*;
#[cfg(target_os = "fuchsia")]
/// An alias for a client over `zx::Channel` for the `Top`
/// protocol.
pub type TopProxy = ::fidl_next::Client<crate::Top>;
impl ::fidl_next::CompatFrom<crate::Top> for ::fidl_test_transitivedependenciescompose::TopMarker {
fn compat_from(_: crate::Top) -> Self {
Self
}
}
impl ::fidl_next::CompatFrom<::fidl_test_transitivedependenciescompose::TopMarker> for crate::Top {
fn compat_from(_: ::fidl_test_transitivedependenciescompose::TopMarker) -> Self {
Self
}
}
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::ClientCompatFrom<::fidl_test_transitivedependenciescompose::TopProxy>
for crate::Top
{
fn client_compat_from(
proxy: ::fidl_test_transitivedependenciescompose::TopProxy,
) -> ::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)
}
}
}