Skip to content

Commit

Permalink
Wire up the Strategy trait with the new tags
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull committed Apr 5, 2023
1 parent a7e74b2 commit a8c3aa7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions strategy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ pub trait Strategy<'a> {
type Future: Future + 'a;

/// Poll the event listener until it is ready.
fn poll(
fn poll<T>(
&mut self,
event_listener: Pin<&mut EventListener>,
event_listener: Pin<&mut EventListener<T>>,
context: &mut Self::Context,
) -> Poll<()>;
) -> Poll<T>;

/// Wait for the event listener to become ready.
fn wait(&mut self, evl: Pin<&'a mut EventListener>) -> Self::Future;
Expand All @@ -363,11 +363,11 @@ impl<'a, 'evl> Strategy<'evl> for NonBlocking<'a> {
}

#[inline]
fn poll(
fn poll<T>(
&mut self,
event_listener: Pin<&mut EventListener>,
event_listener: Pin<&mut EventListener<T>>,
context: &mut Self::Context,
) -> Poll<()> {
) -> Poll<T> {
event_listener.poll(context)
}
}
Expand All @@ -391,13 +391,13 @@ impl<'evl> Strategy<'evl> for Blocking {
}

#[inline]
fn poll(
fn poll<T>(
&mut self,
event_listener: Pin<&mut EventListener>,
event_listener: Pin<&mut EventListener<T>>,
_context: &mut Self::Context,
) -> Poll<()> {
event_listener.wait();
Poll::Ready(())
) -> Poll<T> {
let result = event_listener.wait();
Poll::Ready(result)
}
}

Expand Down

0 comments on commit a8c3aa7

Please sign in to comment.