use crate::workspace::lifecycle::ReuseLease;
#[must_use = "dropping the guard unregisters the tap and may wait for an in-flight callback"]
pub struct AgentEventTapGuard {
_registration: ObserverRegistration,
}
struct ObserverRegistration {
_tap: mentra::agent::AgentEventTapGuard,
_lifecycle_lease: Option<ReuseLease>,
}
impl AgentEventTapGuard {
pub(super) fn new(
tap: mentra::agent::AgentEventTapGuard,
lifecycle_lease: Option<ReuseLease>,
) -> Self {
Self {
_registration: ObserverRegistration {
_tap: tap,
_lifecycle_lease: lifecycle_lease,
},
}
}
}