pub struct Deadman { /* private fields */ }
Expand description
A deadman switch that can be used to detect when it is dropped.
§Example
use async_deadman::Deadman;
#[tokio::main] // does not have to be tokio
async fn main() {
let (deadman, receiver) = Deadman::new();
tokio::spawn(async move {
receiver.await;
println!("Deadman was dropped");
});
drop(deadman);
}
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Deadman
impl !RefUnwindSafe for Deadman
impl Send for Deadman
impl Sync for Deadman
impl Unpin for Deadman
impl !UnwindSafe for Deadman
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