use std::path::PathBuf;
#[derive(Debug, Clone)]
pub enum InstallSource {
OfficialRelease,
Url(String),
Tarball(PathBuf),
}
impl Default for InstallSource {
fn default() -> Self {
InstallSource::OfficialRelease
}
}
#[derive(Debug, Clone, Default)]
pub struct InstallOptions {
pub(crate) cache_dir: Option<PathBuf>,
pub(crate) source: InstallSource,
pub(crate) force: bool,
}
impl InstallOptions {
pub fn cache_dir(mut self, path: impl Into<PathBuf>) -> Self {
self.cache_dir = Some(path.into());
self
}
pub fn source(mut self, source: InstallSource) -> Self {
self.source = source;
self
}
pub fn force(mut self, force: bool) -> Self {
self.force = force;
self
}
}