dope_sys/probe/session/pending.rs
1use crate::probe::{
2 Stopped,
3 session::{Failure, Session, Stage},
4};
5
6type Cancelled<S> = Result<S, Stopped<Stage<S>, Failure<S>>>;
7
8/// A live session permits cancellation without exposing mutable owner access.
9pub trait Pending: Sized {
10 type Session: Session<Pending = Self>;
11
12 /// Reports the prior failure before acknowledging its exact unread completion.
13 fn resume(
14 stopped: Stopped<Self, Failure<Self::Session>>,
15 report: impl FnMut(Failure<Self::Session>),
16 ) -> Result<Self, Stopped<Self, Failure<Self::Session>>>;
17
18 fn cancel(self) -> Cancelled<Self::Session>;
19}