pub enum UnresolvedVersionSpec {
Canary,
Alias(String),
Req(VersionReq),
ReqAny(Vec<VersionReq>),
Version(Version),
}
Expand description
Represents an unresolved version or alias that must be resolved to a fully-qualified and semantic result.
Variants§
Canary
A special canary target.
Alias(String)
An alias that is used as a map to a version.
Req(VersionReq)
A partial version, requirement, or range (^
, ~
, etc).
ReqAny(Vec<VersionReq>)
A list of requirements to match any against (joined by ||
).
Version(Version)
A fully-qualified semantic version.
Implementations§
source§impl UnresolvedVersionSpec
impl UnresolvedVersionSpec
sourcepub fn parse<T>(value: T) -> Result<UnresolvedVersionSpec, Error>
pub fn parse<T>(value: T) -> Result<UnresolvedVersionSpec, Error>
Parse the provided string into an unresolved 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
. - If contains
||
, split and parse each item withVersionReq
, and map asReqAny
. - If contains
,
orVersionReq
, and map asReq
. - If starts with
=
,^
,~
,>
,<
, or*
, parse withVersionReq
, and map asReq
. - 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_resolved_spec(&self) -> VersionSpec
pub fn to_resolved_spec(&self) -> VersionSpec
Convert the current unresolved specification to a resolved specification.
Note that this does not actually resolve or validate against a manifest,
and instead simply constructs the VersionSpec
.
Furthermore, the Req
and ReqAny
variants will panic, as they are not
resolved or valid versions.
Trait Implementations§
source§impl AsRef<UnresolvedVersionSpec> for UnresolvedVersionSpec
impl AsRef<UnresolvedVersionSpec> for UnresolvedVersionSpec
source§fn as_ref(&self) -> &UnresolvedVersionSpec
fn as_ref(&self) -> &UnresolvedVersionSpec
source§impl Clone for UnresolvedVersionSpec
impl Clone for UnresolvedVersionSpec
source§fn clone(&self) -> UnresolvedVersionSpec
fn clone(&self) -> UnresolvedVersionSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UnresolvedVersionSpec
impl Debug for UnresolvedVersionSpec
source§impl Default for UnresolvedVersionSpec
impl Default for UnresolvedVersionSpec
source§fn default() -> UnresolvedVersionSpec
fn default() -> UnresolvedVersionSpec
Returns a latest
alias.
source§impl<'de> Deserialize<'de> for UnresolvedVersionSpec
impl<'de> Deserialize<'de> for UnresolvedVersionSpec
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<UnresolvedVersionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<UnresolvedVersionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Display for UnresolvedVersionSpec
impl Display for UnresolvedVersionSpec
source§impl FromStr for UnresolvedVersionSpec
impl FromStr for UnresolvedVersionSpec
source§impl Hash for UnresolvedVersionSpec
impl Hash for UnresolvedVersionSpec
source§impl Into<String> for UnresolvedVersionSpec
impl Into<String> for UnresolvedVersionSpec
source§impl PartialEq<VersionSpec> for UnresolvedVersionSpec
impl PartialEq<VersionSpec> for UnresolvedVersionSpec
source§fn eq(&self, other: &VersionSpec) -> bool
fn eq(&self, other: &VersionSpec) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for UnresolvedVersionSpec
impl PartialEq for UnresolvedVersionSpec
source§fn eq(&self, other: &UnresolvedVersionSpec) -> bool
fn eq(&self, other: &UnresolvedVersionSpec) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Schematic for UnresolvedVersionSpec
impl Schematic for UnresolvedVersionSpec
source§fn generate_schema() -> SchemaType
fn generate_schema() -> SchemaType
source§impl Serialize for UnresolvedVersionSpec
impl Serialize for UnresolvedVersionSpec
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,
source§impl TryFrom<String> for UnresolvedVersionSpec
impl TryFrom<String> for UnresolvedVersionSpec
impl Eq for UnresolvedVersionSpec
impl StructuralEq for UnresolvedVersionSpec
impl StructuralPartialEq for UnresolvedVersionSpec
Auto Trait Implementations§
impl RefUnwindSafe for UnresolvedVersionSpec
impl Send for UnresolvedVersionSpec
impl Sync for UnresolvedVersionSpec
impl Unpin for UnresolvedVersionSpec
impl UnwindSafe for UnresolvedVersionSpec
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self
file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
]. Read more