1use super::{state, Prover, ProverControl, ProverError};
4use futures::Future;
5use std::pin::Pin;
6
7pub struct ProverFuture {
9 #[allow(clippy::type_complexity)]
10 pub(crate) fut: Pin<
11 Box<dyn Future<Output = Result<Prover<state::Committed>, ProverError>> + Send + 'static>,
12 >,
13 pub(crate) ctrl: ProverControl,
14}
15
16impl ProverFuture {
17 pub fn control(&self) -> ProverControl {
19 self.ctrl.clone()
20 }
21}
22
23impl Future for ProverFuture {
24 type Output = Result<Prover<state::Committed>, ProverError>;
25
26 fn poll(
27 mut self: Pin<&mut Self>,
28 cx: &mut std::task::Context<'_>,
29 ) -> std::task::Poll<Self::Output> {
30 self.fut.as_mut().poll(cx)
31 }
32}