Skip to main content

PackageRegistry

Trait PackageRegistry 

Source
pub trait PackageRegistry {
    type Error: StdError + Send + Sync + 'static;

    // Required method
    async fn package_exists(
        &self,
        package: &str,
        version: &str,
    ) -> Result<bool, Self::Error>;

    // Provided method
    fn base_url(&self) -> Option<&Url> { ... }
}
Expand description

Remote services whose existence checks make retries safe.

Required Associated Types§

Source

type Error: StdError + Send + Sync + 'static

The failure of a registry lookup.

Required Methods§

Source

async fn package_exists( &self, package: &str, version: &str, ) -> Result<bool, Self::Error>

Whether version of package is already in the registry.

Provided Methods§

Source

fn base_url(&self) -> Option<&Url>

The registry base URL with a trailing slash, when the registry has one that packages can be published to.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: PackageRegistry + ?Sized> PackageRegistry for &T

Source§

type Error = <T as PackageRegistry>::Error

Source§

async fn package_exists( &self, package: &str, version: &str, ) -> Result<bool, Self::Error>

Source§

fn base_url(&self) -> Option<&Url>

Implementors§