Files
physical/macros/node-poll-variants/tests/generate.rs
2023-06-23 16:55:33 -07:00

31 lines
594 B
Rust

#![feature(async_fn_in_trait, impl_trait_projections)]
use node_poll_variants::PollVariants;
use physical_node::CriticalError;
use physical_node::transducer::input::Poll;
#[derive(PollVariants)]
#[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) -> Result<Self::Value, CriticalError> {
Ok(self.second)
}
}
fn main() {}