pub struct ClientVersion {
pub client_id: String,
pub semver: String,
pub commit: String,
pub dirty: bool,
}Expand description
A parsed client_version, for the grammar round-trip in tests and for audit tooling. The
grammar is producer discipline only — a manifest carrying a nonconforming string still
verifies, so parsing is never a verify_asset gate.
Fields§
§client_id: StringThe client product / platform id (e.g. capsule-cli).
semver: StringThe client’s own semantic version (e.g. 0.1.0).
commit: StringThe git commit prefix (≥ 12 hex digits).
dirty: boolWhether the producing tree was modified (.dirty).
Implementations§
Source§impl ClientVersion
impl ClientVersion
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse a client_id "/" semver "+" commit [".dirty"] string, enforcing the normative
grammar: a non-empty client_id and semver, and a commit of ≥ 12 hex digits.
Returns None for a nonconforming value (audit-only; never a verify gate).
commit is split at the last + so a semver build-metadata + (e.g.
1.2.3+meta+abc123def456) never steals the commit boundary.
Trait Implementations§
Source§impl Clone for ClientVersion
impl Clone for ClientVersion
Source§fn clone(&self) -> ClientVersion
fn clone(&self) -> ClientVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientVersion
impl Debug for ClientVersion
Source§impl Display for ClientVersion
impl Display for ClientVersion
impl Eq for ClientVersion
Source§impl PartialEq for ClientVersion
impl PartialEq for ClientVersion
Source§fn eq(&self, other: &ClientVersion) -> bool
fn eq(&self, other: &ClientVersion) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClientVersion
Auto Trait Implementations§
impl Freeze for ClientVersion
impl RefUnwindSafe for ClientVersion
impl Send for ClientVersion
impl Sync for ClientVersion
impl Unpin for ClientVersion
impl UnsafeUnpin for ClientVersion
impl UnwindSafe for ClientVersion
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more