2025-07-21 22:02:05 +02:00
|
|
|
// This Source Code Form is subject to the terms of
|
|
|
|
|
// the Mozilla Public License, v. 2.0. If a copy of the
|
|
|
|
|
// MPL was not distributed with this file, You can
|
|
|
|
|
// obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
|
|
2025-07-26 10:34:45 +02:00
|
|
|
use super::{
|
|
|
|
|
PackageContents, PackageInfo, PublisherInfo, ReadableRepository, RepositoryConfig,
|
2025-07-26 15:33:39 +02:00
|
|
|
RepositoryError, RepositoryInfo, RepositoryVersion, Result, WritableRepository,
|
2025-07-26 10:34:45 +02:00
|
|
|
};
|
2025-07-21 22:02:05 +02:00
|
|
|
|
|
|
|
|
/// Repository implementation that uses a REST API
|
|
|
|
|
pub struct RestBackend {
|
|
|
|
|
pub uri: String,
|
|
|
|
|
pub config: RepositoryConfig,
|
|
|
|
|
pub local_cache_path: Option<PathBuf>,
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-26 10:34:45 +02:00
|
|
|
impl WritableRepository for RestBackend {
|
2025-07-21 22:02:05 +02:00
|
|
|
/// Create a new repository at the specified URI
|
|
|
|
|
fn create<P: AsRef<Path>>(uri: P, version: RepositoryVersion) -> Result<Self> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to create the repository
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
let uri_str = uri.as_ref().to_string_lossy().to_string();
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Create the repository configuration
|
|
|
|
|
let config = RepositoryConfig {
|
|
|
|
|
version,
|
|
|
|
|
..Default::default()
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Create the repository structure
|
|
|
|
|
let repo = RestBackend {
|
|
|
|
|
uri: uri_str,
|
|
|
|
|
config,
|
|
|
|
|
local_cache_path: None,
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// In a real implementation, we would make a REST API call to create the repository structure
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
Ok(repo)
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
/// Save the repository configuration
|
|
|
|
|
fn save_config(&self) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to save the repository configuration
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// For now, just return Ok
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
/// Add a publisher to the repository
|
|
|
|
|
fn add_publisher(&mut self, publisher: &str) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to add the publisher
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
if !self.config.publishers.contains(&publisher.to_string()) {
|
|
|
|
|
self.config.publishers.push(publisher.to_string());
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// In a real implementation, we would make a REST API call to create publisher-specific resources
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Save the updated configuration
|
|
|
|
|
self.save_config()?;
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
Ok(())
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
/// Remove a publisher from the repository
|
|
|
|
|
fn remove_publisher(&mut self, publisher: &str, dry_run: bool) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to remove the publisher
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
if let Some(pos) = self.config.publishers.iter().position(|p| p == publisher) {
|
|
|
|
|
if !dry_run {
|
|
|
|
|
self.config.publishers.remove(pos);
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// In a real implementation, we would make a REST API call to remove publisher-specific resources
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Save the updated configuration
|
|
|
|
|
self.save_config()?;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
Ok(())
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-27 13:43:56 +02:00
|
|
|
/// Set a repository property
|
|
|
|
|
fn set_property(&mut self, property: &str, value: &str) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to set the property
|
|
|
|
|
|
|
|
|
|
self.config
|
|
|
|
|
.properties
|
|
|
|
|
.insert(property.to_string(), value.to_string());
|
|
|
|
|
self.save_config()?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Set a publisher property
|
|
|
|
|
fn set_publisher_property(
|
|
|
|
|
&mut self,
|
|
|
|
|
publisher: &str,
|
|
|
|
|
property: &str,
|
|
|
|
|
value: &str,
|
|
|
|
|
) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to set the publisher property
|
|
|
|
|
|
|
|
|
|
// Check if the publisher exists
|
|
|
|
|
if !self.config.publishers.contains(&publisher.to_string()) {
|
|
|
|
|
return Err(RepositoryError::PublisherNotFound(publisher.to_string()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create the property key in the format "publisher/property"
|
|
|
|
|
let key = format!("{}/{}", publisher, property);
|
|
|
|
|
|
|
|
|
|
// Set the property
|
|
|
|
|
self.config.properties.insert(key, value.to_string());
|
|
|
|
|
|
|
|
|
|
// Save the updated configuration
|
|
|
|
|
self.save_config()?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-26 10:34:45 +02:00
|
|
|
/// Rebuild repository metadata
|
2025-07-27 13:43:56 +02:00
|
|
|
fn rebuild(&self, publisher: Option<&str>, no_catalog: bool, no_index: bool) -> Result<()> {
|
2025-07-21 22:02:05 +02:00
|
|
|
// This is a stub implementation
|
2025-07-27 13:43:56 +02:00
|
|
|
// In a real implementation; we would make a REST API call to rebuild metadata
|
2025-07-26 10:34:45 +02:00
|
|
|
|
|
|
|
|
// Filter publishers if specified
|
|
|
|
|
let publishers = if let Some(pub_name) = publisher {
|
|
|
|
|
if !self.config.publishers.contains(&pub_name.to_string()) {
|
2025-07-26 15:33:39 +02:00
|
|
|
return Err(RepositoryError::PublisherNotFound(pub_name.to_string()));
|
2025-07-26 10:34:45 +02:00
|
|
|
}
|
|
|
|
|
vec![pub_name.to_string()]
|
|
|
|
|
} else {
|
|
|
|
|
self.config.publishers.clone()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// For each publisher, rebuild metadata
|
|
|
|
|
for pub_name in publishers {
|
|
|
|
|
println!("Rebuilding metadata for publisher: {}", pub_name);
|
|
|
|
|
|
|
|
|
|
if !no_catalog {
|
|
|
|
|
println!("Rebuilding catalog...");
|
|
|
|
|
// In a real implementation, we would make a REST API call to rebuild the catalog
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !no_index {
|
|
|
|
|
println!("Rebuilding search index...");
|
|
|
|
|
// In a real implementation, we would make a REST API call to rebuild the search index
|
|
|
|
|
}
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Refresh repository metadata
|
2025-07-27 13:43:56 +02:00
|
|
|
fn refresh(&self, publisher: Option<&str>, no_catalog: bool, no_index: bool) -> Result<()> {
|
2025-07-26 10:34:45 +02:00
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to refresh metadata
|
|
|
|
|
|
|
|
|
|
// Filter publishers if specified
|
|
|
|
|
let publishers = if let Some(pub_name) = publisher {
|
|
|
|
|
if !self.config.publishers.contains(&pub_name.to_string()) {
|
2025-07-26 15:33:39 +02:00
|
|
|
return Err(RepositoryError::PublisherNotFound(pub_name.to_string()));
|
2025-07-26 10:34:45 +02:00
|
|
|
}
|
|
|
|
|
vec![pub_name.to_string()]
|
|
|
|
|
} else {
|
|
|
|
|
self.config.publishers.clone()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// For each publisher, refresh metadata
|
|
|
|
|
for pub_name in publishers {
|
|
|
|
|
println!("Refreshing metadata for publisher: {}", pub_name);
|
|
|
|
|
|
|
|
|
|
if !no_catalog {
|
|
|
|
|
println!("Refreshing catalog...");
|
|
|
|
|
// In a real implementation, we would make a REST API call to refresh the catalog
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !no_index {
|
|
|
|
|
println!("Refreshing search index...");
|
|
|
|
|
// In a real implementation, we would make a REST API call to refresh the search index
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok(())
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
|
|
|
|
/// Set the default publisher for the repository
|
|
|
|
|
fn set_default_publisher(&mut self, publisher: &str) -> Result<()> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to set the default publisher
|
|
|
|
|
|
|
|
|
|
// Check if the publisher exists
|
|
|
|
|
if !self.config.publishers.contains(&publisher.to_string()) {
|
2025-07-26 15:33:39 +02:00
|
|
|
return Err(RepositoryError::PublisherNotFound(publisher.to_string()));
|
2025-07-26 10:34:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the default publisher
|
|
|
|
|
self.config.default_publisher = Some(publisher.to_string());
|
|
|
|
|
|
|
|
|
|
// Save the updated configuration
|
|
|
|
|
self.save_config()?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ReadableRepository for RestBackend {
|
|
|
|
|
/// Open an existing repository
|
|
|
|
|
fn open<P: AsRef<Path>>(uri: P) -> Result<Self> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to get the repository configuration
|
|
|
|
|
|
|
|
|
|
let uri_str = uri.as_ref().to_string_lossy().to_string();
|
|
|
|
|
|
|
|
|
|
// In a real implementation, we would fetch the repository configuration from the REST API
|
|
|
|
|
// For now, we'll just create a default configuration
|
|
|
|
|
let config = RepositoryConfig::default();
|
|
|
|
|
|
|
|
|
|
Ok(RestBackend {
|
|
|
|
|
uri: uri_str,
|
|
|
|
|
config,
|
|
|
|
|
local_cache_path: None,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Get repository information
|
|
|
|
|
fn get_info(&self) -> Result<RepositoryInfo> {
|
|
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to get repository information
|
|
|
|
|
|
|
|
|
|
let mut publishers = Vec::new();
|
|
|
|
|
|
|
|
|
|
for publisher_name in &self.config.publishers {
|
|
|
|
|
// In a real implementation, we would get this information from the REST API
|
|
|
|
|
let package_count = 0;
|
|
|
|
|
let status = "online".to_string();
|
|
|
|
|
let updated = "2025-07-21T18:46:00.000000Z".to_string();
|
|
|
|
|
|
|
|
|
|
// Create a PublisherInfo struct and add it to the list
|
|
|
|
|
publishers.push(PublisherInfo {
|
|
|
|
|
name: publisher_name.clone(),
|
|
|
|
|
package_count,
|
|
|
|
|
status,
|
|
|
|
|
updated,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create and return a RepositoryInfo struct
|
|
|
|
|
Ok(RepositoryInfo { publishers })
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
/// List packages in the repository
|
2025-07-26 10:34:45 +02:00
|
|
|
fn list_packages(
|
|
|
|
|
&self,
|
|
|
|
|
publisher: Option<&str>,
|
2025-07-26 18:04:58 +02:00
|
|
|
_pattern: Option<&str>,
|
2025-07-26 10:34:45 +02:00
|
|
|
) -> Result<Vec<PackageInfo>> {
|
2025-07-21 22:02:05 +02:00
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to list packages
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-26 18:04:58 +02:00
|
|
|
let packages = Vec::new();
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Filter publishers if specified
|
|
|
|
|
let publishers = if let Some(pub_name) = publisher {
|
|
|
|
|
if !self.config.publishers.contains(&pub_name.to_string()) {
|
2025-07-26 15:33:39 +02:00
|
|
|
return Err(RepositoryError::PublisherNotFound(pub_name.to_string()));
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
|
|
|
|
vec![pub_name.to_string()]
|
|
|
|
|
} else {
|
|
|
|
|
self.config.publishers.clone()
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// For each publisher, list packages
|
2025-07-26 18:04:58 +02:00
|
|
|
for _pub_name in publishers {
|
2025-07-22 11:57:24 +02:00
|
|
|
// In a real implementation, we would make a REST API call to get package information
|
|
|
|
|
// The API call would return a list of packages with their names, versions, and other metadata
|
|
|
|
|
// We would then parse this information and create PackageInfo structs
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-22 11:57:24 +02:00
|
|
|
// For now, we return an empty list since we don't want to return placeholder data
|
|
|
|
|
// and we don't have a real API to call
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-22 11:57:24 +02:00
|
|
|
// If pattern filtering is needed, it would be applied here to the results from the API
|
|
|
|
|
// When implementing, use the regex crate to handle user-provided regexp patterns properly,
|
|
|
|
|
// similar to the implementation in file_backend.rs
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
Ok(packages)
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
/// Show contents of packages
|
2025-07-26 10:34:45 +02:00
|
|
|
fn show_contents(
|
|
|
|
|
&self,
|
|
|
|
|
publisher: Option<&str>,
|
|
|
|
|
pattern: Option<&str>,
|
|
|
|
|
action_types: Option<&[String]>,
|
|
|
|
|
) -> Result<Vec<PackageContents>> {
|
2025-07-21 22:02:05 +02:00
|
|
|
// This is a stub implementation
|
|
|
|
|
// In a real implementation, we would make a REST API call to get package contents
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-21 22:02:05 +02:00
|
|
|
// Get the list of packages
|
|
|
|
|
let packages = self.list_packages(publisher, pattern)?;
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// For each package, create a PackageContents struct
|
|
|
|
|
let mut package_contents = Vec::new();
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-22 11:57:24 +02:00
|
|
|
for pkg_info in packages {
|
2025-07-21 22:02:05 +02:00
|
|
|
// In a real implementation, we would get this information from the REST API
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-22 14:10:37 +02:00
|
|
|
// Format the package identifier using the FMRI
|
2025-07-24 00:28:33 +02:00
|
|
|
let version = pkg_info.fmri.version();
|
|
|
|
|
let pkg_id = if !version.is_empty() {
|
|
|
|
|
format!("{}@{}", pkg_info.fmri.stem(), version)
|
2025-07-22 14:10:37 +02:00
|
|
|
} else {
|
2025-07-24 00:28:33 +02:00
|
|
|
pkg_info.fmri.stem().to_string()
|
2025-07-22 14:10:37 +02:00
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Example content for each type
|
|
|
|
|
// In a real implementation, we would get this information from the REST API
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Files
|
2025-07-26 10:34:45 +02:00
|
|
|
let files = if action_types.is_none()
|
|
|
|
|
|| action_types.as_ref().unwrap().contains(&"file".to_string())
|
|
|
|
|
{
|
2025-07-23 22:39:49 +02:00
|
|
|
Some(vec![
|
|
|
|
|
"/usr/bin/example".to_string(),
|
|
|
|
|
"/usr/lib/example.so".to_string(),
|
|
|
|
|
])
|
|
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Directories
|
2025-07-26 10:34:45 +02:00
|
|
|
let directories = if action_types.is_none()
|
|
|
|
|
|| action_types.as_ref().unwrap().contains(&"dir".to_string())
|
|
|
|
|
{
|
2025-07-23 22:39:49 +02:00
|
|
|
Some(vec![
|
|
|
|
|
"/usr/share/doc/example".to_string(),
|
|
|
|
|
"/usr/share/man/man1".to_string(),
|
|
|
|
|
])
|
|
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Links
|
2025-07-26 10:34:45 +02:00
|
|
|
let links = if action_types.is_none()
|
|
|
|
|
|| action_types.as_ref().unwrap().contains(&"link".to_string())
|
|
|
|
|
{
|
|
|
|
|
Some(vec!["/usr/bin/example-link".to_string()])
|
2025-07-21 22:02:05 +02:00
|
|
|
} else {
|
2025-07-23 22:39:49 +02:00
|
|
|
None
|
2025-07-21 22:02:05 +02:00
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Dependencies
|
2025-07-26 10:34:45 +02:00
|
|
|
let dependencies = if action_types.is_none()
|
|
|
|
|
|| action_types
|
|
|
|
|
.as_ref()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.contains(&"depend".to_string())
|
|
|
|
|
{
|
|
|
|
|
Some(vec!["pkg:/system/library@0.5.11".to_string()])
|
2025-07-23 22:39:49 +02:00
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Licenses
|
2025-07-26 10:34:45 +02:00
|
|
|
let licenses = if action_types.is_none()
|
|
|
|
|
|| action_types
|
|
|
|
|
.as_ref()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.contains(&"license".to_string())
|
|
|
|
|
{
|
|
|
|
|
Some(vec!["/usr/share/licenses/example/LICENSE".to_string()])
|
2025-07-23 22:39:49 +02:00
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
};
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
// Add the package contents to the result
|
|
|
|
|
package_contents.push(PackageContents {
|
|
|
|
|
package_id: pkg_id,
|
|
|
|
|
files,
|
|
|
|
|
directories,
|
|
|
|
|
links,
|
|
|
|
|
dependencies,
|
|
|
|
|
licenses,
|
|
|
|
|
});
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
|
2025-07-23 22:39:49 +02:00
|
|
|
Ok(package_contents)
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
2025-07-23 23:22:24 +02:00
|
|
|
|
2025-07-26 10:34:45 +02:00
|
|
|
fn search(
|
|
|
|
|
&self,
|
2025-07-26 18:04:58 +02:00
|
|
|
_query: &str,
|
|
|
|
|
_publisher: Option<&str>,
|
|
|
|
|
_limit: Option<usize>,
|
2025-07-26 10:34:45 +02:00
|
|
|
) -> Result<Vec<PackageInfo>> {
|
2025-07-23 23:22:24 +02:00
|
|
|
todo!()
|
|
|
|
|
}
|
2025-07-21 22:02:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl RestBackend {
|
|
|
|
|
/// Set the local cache path
|
|
|
|
|
pub fn set_local_cache_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
|
|
|
|
|
self.local_cache_path = Some(path.as_ref().to_path_buf());
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
2025-07-26 10:34:45 +02:00
|
|
|
}
|