use super::{AlertHost, AlertOutcome, AlertSpec, PresentError, Sender};
pub(crate) struct Host;
impl AlertHost for Host {
fn show_alert(
_spec: AlertSpec,
_tx: Sender<AlertOutcome>,
_generation: u64,
) -> Result<(), PresentError> {
Err(PresentError::Unsupported)
}
fn dismiss(_generation: u64) {}
}
#[cfg(test)]
mod tests {
use super::super::{ActionRole, oneshot};
use super::*;
#[test]
fn every_show_is_refused_unsupported() {
let (tx, _rx) = oneshot::channel(u64::MAX);
let spec = AlertSpec::new("t", "m").with_action("ok", "OK", ActionRole::Default);
assert_eq!(
Host::show_alert(spec, tx, u64::MAX),
Err(PresentError::Unsupported)
);
Host::dismiss(u64::MAX);
}
}