use crate::error::Error as CtrlcError;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
pub type Error = std::io::Error;
#[derive(Debug)]
pub struct Signal {
}
#[derive(Debug, Default)]
pub struct WaitForCtrlC {
}
impl Future
for WaitForCtrlC {
type Output = Result<(), CtrlcError>;
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
Poll::Pending
}
}
#[allow(dead_code)]
#[inline]
pub fn init_os_handler() -> Result<WaitForCtrlC, Error>
{
let ret = WaitForCtrlC::default();
Ok(ret)
}