1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Registry API client for shipper.
//!
//! This crate provides API clients for interacting with crate registries
//! like crates.io, supporting version existence checks, sparse-index visibility
//! polling, ownership verification, and readiness backoff loops.
//!
//! # Modules
//!
//! - [`context`] — the primary [`RegistryClient`] that is `Registry`-aware.
//! Accepts a full [`shipper_types::Registry`] (name, api_base, index_base)
//! and exposes the complete registry surface used by the shipper library:
//! API existence checks, sparse-index visibility, owner queries,
//! `is_version_visible_with_backoff` with exponential-backoff evidence, etc.
//! - [`http`] — a lightweight HTTP client [`http::HttpRegistryClient`] that
//! takes a bare base-URL string. Intended for callers that do not need the
//! full `Registry` context (e.g. the parallel engine helper crate).
//!
//! # Example
//!
//! ```no_run
//! use shipper_registry::RegistryClient;
//! use shipper_types::Registry;
//!
//! let registry = Registry::crates_io();
//! let client = RegistryClient::new(registry).expect("client");
//! let visible = client.version_exists("serde", "1.0.0").unwrap_or(false);
//! ```
// Primary public API: the canonical, Registry-aware client.
pub use ;
// Lightweight HTTP client for callers that only have a base URL.
pub use HttpRegistryClient;
// Additional types useful to external callers.
pub use ;
/// Default API endpoint for crates.io
pub const CRATES_IO_API: &str = "https://crates.io";
/// Default timeout for API requests (used by [`HttpRegistryClient`]).
pub const DEFAULT_TIMEOUT_SECS: u64 = 30;
/// Default user agent for API requests.
pub const USER_AGENT: &str = concat!;
/// Compute the sparse-index path for a crate name.
/// Check if a crate version is visible on the registry via its API.
///
/// Convenience wrapper that constructs an [`HttpRegistryClient`] and calls
/// [`HttpRegistryClient::version_exists`].
/// Check if a crate exists on the registry via its API.
///
/// Convenience wrapper that constructs an [`HttpRegistryClient`] and calls
/// [`HttpRegistryClient::crate_exists`].