act_zero/utils.rs
1use std::future::Future;
2
3use futures::future::FutureExt;
4
5use crate::Produces;
6
7/// A future which completes upon termination of an actor.
8#[derive(Debug)]
9pub struct Termination(pub(crate) Produces<()>);
10
11impl Future for Termination {
12 type Output = ();
13
14 fn poll(
15 mut self: std::pin::Pin<&mut Self>,
16 cx: &mut std::task::Context<'_>,
17 ) -> std::task::Poll<Self::Output> {
18 self.0.poll_unpin(cx).map(|_| ())
19 }
20}