use std::{ffi::OsStr, io, time::Duration};
use tokio_util::sync::CancellationToken;
const OPEN_TIMEOUT: Duration = Duration::from_secs(3);
pub async fn open(target: &OsStr) -> io::Result<()> {
open_cancellable(target, &CancellationToken::new()).await
}
pub async fn open_within(target: &OsStr, deadline: Duration) -> io::Result<()> {
crate::platform::open_desktop(target, deadline, &CancellationToken::new()).await
}
pub async fn open_cancellable(target: &OsStr, cancellation: &CancellationToken) -> io::Result<()> {
crate::platform::open_desktop(target, OPEN_TIMEOUT, cancellation).await
}