pub struct RegistryClient { /* private fields */ }Expand description
Registry client for fetching and caching the plugin index.
Implementations§
Source§impl RegistryClient
impl RegistryClient
Sourcepub fn with_config(
registry_url: String,
cache_dir: PathBuf,
cache_ttl_secs: u64,
) -> Self
pub fn with_config( registry_url: String, cache_dir: PathBuf, cache_ttl_secs: u64, ) -> Self
Create a registry client with a custom URL and cache directory.
Sourcepub fn fetch_index(&self) -> Result<RegistryIndex, RegistryError>
pub fn fetch_index(&self) -> Result<RegistryIndex, RegistryError>
Fetch the registry index, using cache if available.
This is a blocking HTTP call. Returns the cached index if within TTL, otherwise fetches from the registry URL and updates the cache.
Sourcepub fn parse_index(json: &str) -> Result<RegistryIndex, RegistryError>
pub fn parse_index(json: &str) -> Result<RegistryIndex, RegistryError>
Load a registry index from a JSON string (for testing or offline use).
Sourcepub fn resolve(
&self,
index: &RegistryIndex,
plugin_name: &str,
version_constraint: &str,
platform: &str,
) -> Result<ResolvedPlugin, RegistryError>
pub fn resolve( &self, index: &RegistryIndex, plugin_name: &str, version_constraint: &str, platform: &str, ) -> Result<ResolvedPlugin, RegistryError>
Look up a plugin in the registry and find the best matching version for the given constraint and platform.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RegistryClient
impl RefUnwindSafe for RegistryClient
impl Send for RegistryClient
impl Sync for RegistryClient
impl Unpin for RegistryClient
impl UnsafeUnpin for RegistryClient
impl UnwindSafe for RegistryClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more