mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
committed by
Ivan Petkov
parent
524e66314f
commit
cd73951130
@@ -404,6 +404,16 @@ impl Signal {
|
||||
}
|
||||
}
|
||||
|
||||
cfg_stream! {
|
||||
impl futures_core::Stream for Signal {
|
||||
type Item = ();
|
||||
|
||||
fn poll_next(mut self: std::pin::Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<()>> {
|
||||
self.poll_recv(cx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn ctrl_c() -> io::Result<Signal> {
|
||||
signal(SignalKind::interrupt())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user