pub struct ReadinessConfig {
pub enabled: bool,
pub method: ReadinessMethod,
pub initial_delay: Duration,
pub max_delay: Duration,
pub max_total_wait: Duration,
pub poll_interval: Duration,
pub jitter_factor: f64,
pub index_path: Option<PathBuf>,
pub prefer_index: bool,
}Expand description
Configuration for readiness verification after publishing.
Readiness verification confirms that a published crate is visible on the registry before Shipper considers the publish successful. This catches propagation delays and failed publishes early.
§Example
use std::time::Duration;
use shipper::types::{ReadinessConfig, ReadinessMethod};
// Default configuration
let config = ReadinessConfig::default();
// Custom configuration
let custom = ReadinessConfig {
enabled: true,
method: ReadinessMethod::Both,
initial_delay: Duration::from_secs(2),
max_delay: Duration::from_secs(120),
max_total_wait: Duration::from_secs(600), // 10 minutes
poll_interval: Duration::from_secs(5),
jitter_factor: 0.3,
index_path: None,
prefer_index: false,
};§Defaults
enabled:truemethod:ReadinessMethod::Apiinitial_delay: 1 secondmax_delay: 60 secondsmax_total_wait: 300 seconds (5 minutes)poll_interval: 2 secondsjitter_factor: 0.5 (±50%)
Fields§
§enabled: boolEnable readiness checks
When disabled, Shipper will not verify crate visibility after publishing. This speeds up publishing but may miss failures.
method: ReadinessMethodMethod for checking version visibility
initial_delay: DurationInitial delay before first poll
Most registries need a few seconds to propagate new versions. This delay allows the initial propagation to complete before starting to poll.
max_delay: DurationMaximum delay between polls (capped)
The poll interval starts at the initial_delay value and increases exponentially up to this maximum.
max_total_wait: DurationMaximum total time to wait for visibility
If the crate is not visible within this time, the publish is considered failed. This prevents waiting indefinitely.
poll_interval: DurationBase poll interval
The interval between readiness checks. This is the starting interval before jitter and exponential backoff are applied.
jitter_factor: f64Jitter factor (±50% means 0.5)
Adds randomness to poll intervals to reduce thundering herd when many clients are checking simultaneously. A value of 0.5 means the actual interval varies by ±50%.
index_path: Option<PathBuf>Custom index path for testing (optional)
When set, uses this local path instead of downloading from the remote index. Useful for testing with mock registries.
prefer_index: boolUse index as primary method when Both is selected
When ReadinessMethod::Both is used, this determines which
method is checked first. If true, the index is checked first.
Trait Implementations§
Source§impl Clone for ReadinessConfig
impl Clone for ReadinessConfig
Source§fn clone(&self) -> ReadinessConfig
fn clone(&self) -> ReadinessConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more