Device macro to generate stateful and publish variants of device specific poll inputs.

This commit is contained in:
Zachary Sunforge
2023-06-19 19:24:47 -07:00
parent 9ea0e69d92
commit 0c7839491d
8 changed files with 283 additions and 156 deletions

View File

@ -1,11 +1,29 @@
use node_poll_variants::{PollVariants};
#![feature(async_fn_in_trait, impl_trait_projections)]
use node_poll_variants::PollVariants;
use physical_node::transducer::input::Poll;
#[derive(PollVariants)]
struct ExamplePoll<'a, FirstT: Copy, SecondT> {
#[value_type = "SecondT"]
struct ExamplePoll<'a, FirstT, SecondT>
where
SecondT: Copy,
{
a: &'a i32,
b: i32,
first: FirstT,
second: SecondT,
}
impl<'a, FirstT, SecondT> Poll for ExamplePoll<'a, FirstT, SecondT>
where
SecondT: Copy,
{
type Value = SecondT;
async fn poll(&self) -> Self::Value {
self.second
}
}
fn main() {}