pub struct AsyncCtrlC { /* private fields */ }Expand description
A future which is fulfilled when the program receives the Ctrl+C signal.
Implementations§
Source§impl AsyncCtrlC
impl AsyncCtrlC
Sourcepub fn new<F>(user_handler: F) -> Result<Self>
pub fn new<F>(user_handler: F) -> Result<Self>
Creates a new AsyncCtrlC future.
There should be at most one AsyncCtrlC instance in the whole program. The
second call to AsyncCtrlC::new() would return an error.
The user_handler function is customizable and the return boolean value
is indicating whether the user agreed terminate the program or not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AsyncCtrlC
impl RefUnwindSafe for AsyncCtrlC
impl Send for AsyncCtrlC
impl Sync for AsyncCtrlC
impl Unpin for AsyncCtrlC
impl UnwindSafe for AsyncCtrlC
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more