pub enum PublishRegime {
FirstPublish,
Update,
}Expand description
Classification of a publish operation, used by the runtime to make registry-aware decisions (backoff windows, duration estimation, per-regime telemetry).
Preflight already determines whether a crate has ever been published
by querying the registry; that answer is captured here and propagated
through the ReleasePlan so the publish retry loop does not have
to re-query the registry to recover it.
§Variants
PublishRegime::FirstPublish: the crate has never been published. Triggers the documented crates.io new-crate rate-limit window.PublishRegime::Update: the crate already exists; this is a new version upload.
§Example
ⓘ
use shipper::types::PublishRegime;
let regime = PublishRegime::FirstPublish;
assert_eq!(regime.is_new_crate(), true);Variants§
FirstPublish
Crate has never been published to this registry.
Update
Crate exists; publishing a new version.
Implementations§
Source§impl PublishRegime
impl PublishRegime
Sourcepub fn is_new_crate(self) -> bool
pub fn is_new_crate(self) -> bool
Convenience: true iff this is a first-publish regime.
Equivalent to the preflight is_new_crate boolean, but carried
through the plan so later phases do not have to re-query.
Trait Implementations§
Source§impl Clone for PublishRegime
impl Clone for PublishRegime
Source§fn clone(&self) -> PublishRegime
fn clone(&self) -> PublishRegime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PublishRegime
impl Debug for PublishRegime
Source§impl<'de> Deserialize<'de> for PublishRegime
impl<'de> Deserialize<'de> for PublishRegime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PublishRegime
impl PartialEq for PublishRegime
Source§fn eq(&self, other: &PublishRegime) -> bool
fn eq(&self, other: &PublishRegime) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PublishRegime
impl Serialize for PublishRegime
impl Copy for PublishRegime
impl Eq for PublishRegime
impl StructuralPartialEq for PublishRegime
Auto Trait Implementations§
impl Freeze for PublishRegime
impl RefUnwindSafe for PublishRegime
impl Send for PublishRegime
impl Sync for PublishRegime
impl Unpin for PublishRegime
impl UnsafeUnpin for PublishRegime
impl UnwindSafe for PublishRegime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.