Enum proto_pdk_api::VersionSpec
source · pub enum VersionSpec {
Canary,
Alias(String),
Version(Version),
}
Expand description
Represents a resolved version or alias.
Variants§
Canary
A special canary target.
Alias(String)
An alias that is used as a map to a version.
Version(Version)
A fully-qualified semantic version.
Implementations§
source§impl VersionSpec
impl VersionSpec
sourcepub fn parse<T>(value: T) -> Result<VersionSpec, Error>
pub fn parse<T>(value: T) -> Result<VersionSpec, Error>
Parse the provided string into a resolved specification based on the following rules, in order:
- If the value “canary”, map as
Canary
variant. - If an alpha-numeric value that starts with a character, map as
Alias
. - Else parse with
Version
, and map asVersion
.
sourcepub fn is_alias<A>(&self, name: A) -> bool
pub fn is_alias<A>(&self, name: A) -> bool
Return true if the provided alias matches the current specification.
sourcepub fn is_latest(&self) -> bool
pub fn is_latest(&self) -> bool
Return true if the current specification is the “latest” alias.
sourcepub fn to_unresolved_spec(&self) -> UnresolvedVersionSpec
pub fn to_unresolved_spec(&self) -> UnresolvedVersionSpec
Convert the current resolved specification to an unresolved specification.
Trait Implementations§
source§impl AsRef<VersionSpec> for VersionSpec
impl AsRef<VersionSpec> for VersionSpec
source§fn as_ref(&self) -> &VersionSpec
fn as_ref(&self) -> &VersionSpec
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for VersionSpec
impl Clone for VersionSpec
source§fn clone(&self) -> VersionSpec
fn clone(&self) -> VersionSpec
Returns a copy of the value. Read more
1.0.0 · 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 VersionSpec
impl Debug for VersionSpec
source§impl Default for VersionSpec
impl Default for VersionSpec
source§fn default() -> VersionSpec
fn default() -> VersionSpec
Returns a latest
alias.
source§impl<'de> Deserialize<'de> for VersionSpec
impl<'de> Deserialize<'de> for VersionSpec
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<VersionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<VersionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for VersionSpec
impl Display for VersionSpec
source§impl FromStr for VersionSpec
impl FromStr for VersionSpec
source§impl Hash for VersionSpec
impl Hash for VersionSpec
source§impl Into<String> for VersionSpec
impl Into<String> for VersionSpec
source§impl Ord for VersionSpec
impl Ord for VersionSpec
source§fn cmp(&self, other: &VersionSpec) -> Ordering
fn cmp(&self, other: &VersionSpec) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<&str> for VersionSpec
impl PartialEq<&str> for VersionSpec
source§impl PartialEq<Version> for VersionSpec
impl PartialEq<Version> for VersionSpec
source§impl PartialEq<VersionSpec> for UnresolvedVersionSpec
impl PartialEq<VersionSpec> for UnresolvedVersionSpec
source§fn eq(&self, other: &VersionSpec) -> bool
fn eq(&self, other: &VersionSpec) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for VersionSpec
impl PartialEq for VersionSpec
source§fn eq(&self, other: &VersionSpec) -> bool
fn eq(&self, other: &VersionSpec) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for VersionSpec
impl PartialOrd for VersionSpec
source§fn partial_cmp(&self, other: &VersionSpec) -> Option<Ordering>
fn partial_cmp(&self, other: &VersionSpec) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for VersionSpec
impl Serialize for VersionSpec
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<String> for VersionSpec
impl TryFrom<String> for VersionSpec
impl Eq for VersionSpec
impl StructuralPartialEq for VersionSpec
Auto Trait Implementations§
impl Freeze for VersionSpec
impl RefUnwindSafe for VersionSpec
impl Send for VersionSpec
impl Sync for VersionSpec
impl Unpin for VersionSpec
impl UnwindSafe for VersionSpec
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