pub struct RegistryClient { /* private fields */ }Implementations§
Source§impl RegistryClient
impl RegistryClient
pub fn new(registry: Registry) -> Result<Self>
Sourcepub fn with_cache_dir(self, cache_dir: PathBuf) -> Self
pub fn with_cache_dir(self, cache_dir: PathBuf) -> Self
Set the cache directory for sparse index fragments
pub fn registry(&self) -> &Registry
pub fn version_exists(&self, crate_name: &str, version: &str) -> Result<bool>
pub fn crate_exists(&self, crate_name: &str) -> Result<bool>
pub fn list_owners( &self, crate_name: &str, token: &str, ) -> Result<OwnersResponse>
Sourcepub fn check_new_crate(&self, crate_name: &str) -> Result<bool>
pub fn check_new_crate(&self, crate_name: &str) -> Result<bool>
Check if a crate is new (doesn’t exist in the registry).
Returns true if the crate doesn’t exist, false if it does.
Sourcepub fn check_index_visibility(
&self,
crate_name: &str,
version: &str,
) -> Result<bool>
pub fn check_index_visibility( &self, crate_name: &str, version: &str, ) -> Result<bool>
Check if a crate version is visible via the sparse index.
Returns true if the version is found in the index, false otherwise. Parse errors and network errors are treated as “not visible” rather than failures.
Sourcepub fn verify_ownership(&self, crate_name: &str, token: &str) -> Result<bool>
pub fn verify_ownership(&self, crate_name: &str, token: &str) -> Result<bool>
Attempt ownership verification for a crate.
Returns true if ownership is verified, false if verification fails or endpoint is unavailable. This function implements graceful degradation - if the ownership check fails due to API limitations, it returns false rather than an error.
Sourcepub fn is_version_visible_with_backoff(
&self,
crate_name: &str,
version: &str,
config: &ReadinessConfig,
) -> Result<(bool, Vec<ReadinessEvidence>)>
pub fn is_version_visible_with_backoff( &self, crate_name: &str, version: &str, config: &ReadinessConfig, ) -> Result<(bool, Vec<ReadinessEvidence>)>
Check if a version is visible with exponential backoff and jitter.
Returns Ok((true, evidence)) if the version becomes visible within the timeout, Ok((false, evidence)) if the timeout is exceeded, or Err on other failures.
Trait Implementations§
Source§impl Clone for RegistryClient
impl Clone for RegistryClient
Source§fn clone(&self) -> RegistryClient
fn clone(&self) -> RegistryClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more