2022-12-17 05:03:41 +00:00
|
|
|
pub trait IStorage: Send + Sync {
|
2023-12-31 01:43:05 +00:00
|
|
|
fn plugins(&self, query: &str) -> decky_api::StorePluginList;
|
2022-12-10 02:10:14 +00:00
|
|
|
|
|
|
|
fn get_artifact(&self, _name: &str, _version: &str, _hash: &str) -> Result<bytes::Bytes, std::io::Error> {
|
|
|
|
Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, "Artifact downloading not supported"))
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_image(&self, _name: &str) -> Result<bytes::Bytes, std::io::Error> {
|
|
|
|
Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, "Image downloading not supported"))
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_statistics(&self) -> std::collections::HashMap<String, u64> {
|
|
|
|
std::collections::HashMap::with_capacity(0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct EmptyStorage;
|
|
|
|
|
|
|
|
impl IStorage for EmptyStorage {
|
2023-12-31 01:43:05 +00:00
|
|
|
fn plugins(&self, _query: &str) -> decky_api::StorePluginList {
|
2022-12-10 02:10:14 +00:00
|
|
|
Vec::new()
|
|
|
|
}
|
|
|
|
}
|