pub struct VersionArg(/* private fields */);Expand description
Validated crate version token (latest, channel, or SemVer without v prefix).
Implementations§
Source§impl VersionArg
impl VersionArg
Sourcepub fn parse_opt(raw: Option<&str>) -> AppResult<Self>
pub fn parse_opt(raw: Option<&str>) -> AppResult<Self>
Parse optional CLI version; empty/None → latest.
§Errors
Propagates crate::error::ErrorKind::InvalidInput from Self::parse when the
provided token is present and invalid.
Sourcepub fn parse(v: &str) -> AppResult<Self>
pub fn parse(v: &str) -> AppResult<Self>
Parses a non-optional version token.
§Errors
Returns crate::error::ErrorKind::InvalidInput for unknown channels, v-prefixed
SemVer, build metadata, or malformed versions.
§Panics
Panics only if the hardcoded semver-ish regex fails to compile inside its
std::sync::LazyLock. The pattern is a compile-time literal well under
the bounded size_limit / dfa_size_limit, so no runtime input can reach
this path.
Sourcepub fn stdlib_channel(&self) -> &str
pub fn stdlib_channel(&self) -> &str
Map to rustdoc channel for stdlib paths (latest → stable).
Single source of truth for channel mapping (TYPE-L-010).
Trait Implementations§
Source§impl AsRef<str> for VersionArg
impl AsRef<str> for VersionArg
Source§impl Clone for VersionArg
impl Clone for VersionArg
Source§impl Debug for VersionArg
impl Debug for VersionArg
Source§impl Display for VersionArg
impl Display for VersionArg
impl Eq for VersionArg
Source§impl FromStr for VersionArg
impl FromStr for VersionArg
Source§impl Hash for VersionArg
impl Hash for VersionArg
Source§impl PartialEq for VersionArg
impl PartialEq for VersionArg
impl StructuralPartialEq for VersionArg
Auto Trait Implementations§
impl Freeze for VersionArg
impl RefUnwindSafe for VersionArg
impl Send for VersionArg
impl Sync for VersionArg
impl Unpin for VersionArg
impl UnsafeUnpin for VersionArg
impl UnwindSafe for VersionArg
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.