use std::{future::Future, path::Path, pin::Pin};

/// Boxed future returned by an injected game archive unpacker.
pub type UnpackFuture<'a> = Pin<Box<dyn Future<Output = eyre::Result<()>> + Send + 'a>>;

/// Extracts one archive into a staging directory.
///
/// The peer crate owns the install transaction while the shell-specific unrar
/// integration stays in the Tauri crate through this injected trait.
pub trait Unpacker: Send + Sync {
    fn unpack<'a>(&'a self, archive: &'a Path, dest: &'a Path) -> UnpackFuture<'a>;
}
