use std::path::PathBuf;
use crate::state::modal::{CascadeMode, PreflightAction, ServiceImpact};
use crate::state::types::PackageItem;
#[allow(clippy::type_complexity)]
pub(super) type DefaultServicesCacheState = (
Vec<ServiceImpact>,
bool,
PathBuf,
bool,
bool,
Option<u64>,
u64,
Option<(PreflightAction, Vec<String>)>,
Vec<ServiceImpact>,
);
#[allow(clippy::type_complexity)]
pub(super) type DefaultCacheRefreshState = (
Option<std::time::Instant>,
Option<std::time::Instant>,
Option<Vec<String>>,
Option<Vec<String>>,
);
#[allow(clippy::type_complexity)]
pub(super) type DefaultPreflightState = (
Option<(Vec<PackageItem>, PreflightAction)>,
Option<(Vec<PackageItem>, PreflightAction)>,
Option<Vec<PackageItem>>,
Option<Vec<PackageItem>>,
Option<Vec<PackageItem>>,
bool,
bool,
bool,
bool,
bool,
Option<(usize, bool, bool)>,
std::sync::Arc<std::sync::atomic::AtomicBool>,
);
pub(super) const fn default_cache_refresh_state() -> DefaultCacheRefreshState {
(None, None, None, None)
}
#[allow(clippy::missing_const_for_fn)]
pub(super) fn default_deps_cache_state(
deps_cache_path: PathBuf,
) -> (
Vec<crate::state::modal::DependencyInfo>,
Vec<crate::state::modal::ReverseRootSummary>,
CascadeMode,
bool,
PathBuf,
bool,
) {
(
Vec::new(),
Vec::new(),
CascadeMode::Basic,
false,
deps_cache_path,
false,
)
}
#[allow(clippy::missing_const_for_fn)]
pub(super) fn default_files_cache_state(
files_cache_path: PathBuf,
) -> (
Vec<crate::state::modal::PackageFileInfo>,
bool,
PathBuf,
bool,
) {
(Vec::new(), false, files_cache_path, false)
}
#[allow(clippy::missing_const_for_fn)]
pub(super) fn default_services_cache_state(
services_cache_path: PathBuf,
) -> DefaultServicesCacheState {
(
Vec::new(),
false,
services_cache_path,
false,
false,
None,
1,
None,
Vec::new(),
)
}
pub(super) fn default_sandbox_cache_state()
-> (Vec<crate::logic::sandbox::SandboxInfo>, bool, PathBuf, bool) {
(
Vec::new(),
false,
crate::theme::lists_dir().join("sandbox_cache.json"),
false,
)
}
pub(super) fn default_preflight_state() -> DefaultPreflightState {
(
None,
None,
None,
None,
None,
false,
false,
false,
false,
false,
None,
std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)),
)
}