Skip to content

Commit

Permalink
FusedStream for IpcStream
Browse files Browse the repository at this point in the history
Implements `FusedStream` trait for `IpcStream`, so allow the usage of the `select!` macro: https://docs.rs/futures/0.3.18/futures/stream/trait.FusedStream.html
  • Loading branch information
negator committed Dec 9, 2021
1 parent f700ea3 commit 5582ad5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/asynch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,12 @@ where
}
}
}

impl<T> FusedStream for IpcStream<T>
where
T: for<'de> Deserialize<'de> + Serialize,
{
fn is_terminated(&self) -> bool {
self.0.is_terminated()
}
}

0 comments on commit 5582ad5

Please sign in to comment.