pub struct VersionOutput {
pub manifest_version: u32,
pub name: String,
pub version: String,
pub kind: ExecutableKind,
pub language: Language,
pub build_time: Option<String>,
pub git_sha: Option<String>,
pub git_dirty: Option<bool>,
pub target: Option<String>,
pub toolchain: Option<String>,
pub capabilities: Vec<String>,
pub product: Option<String>,
}Expand description
The structured JSON payload emitted by binary --version --json.
Fields§
§manifest_version: u32Schema version; always MANIFEST_VERSION.
name: StringStable binary name (lowercase alphanumeric + hyphens).
version: StringSemantic version of this binary build.
kind: ExecutableKindRole this binary plays.
language: LanguageImplementation language.
build_time: Option<String>ISO-8601 build timestamp, if embedded at build time.
git_sha: Option<String>Full git commit SHA, if embedded at build time.
git_dirty: Option<bool>Whether the working tree was dirty at build time.
target: Option<String>Rust target triple (e.g. x86_64-unknown-linux-gnu).
toolchain: Option<String>Rust toolchain channel (e.g. stable, 1.75.0).
capabilities: Vec<String>Optional feature flags or protocol extensions advertised by this binary.
product: Option<String>Owning product name, if this binary is product-specific.
Implementations§
Source§impl VersionOutput
impl VersionOutput
Sourcepub fn new(
name: impl Into<String>,
version: impl Into<String>,
kind: ExecutableKind,
language: Language,
) -> Result<Self, ManifestError>
pub fn new( name: impl Into<String>, version: impl Into<String>, kind: ExecutableKind, language: Language, ) -> Result<Self, ManifestError>
Construct a minimal VersionOutput, validating name and version.
§Errors
Returns ManifestError::InvalidName if name violates naming rules,
or ManifestError::InvalidVersion if version is not a valid semver.
Sourcepub fn with_product(
self,
product: impl Into<String>,
) -> Result<Self, ManifestError>
pub fn with_product( self, product: impl Into<String>, ) -> Result<Self, ManifestError>
Attach a product name, validating it against the naming rules.
§Errors
Returns ManifestError::InvalidName if product violates naming rules.
Sourcepub fn with_capability(self, capability: impl Into<String>) -> Self
pub fn with_capability(self, capability: impl Into<String>) -> Self
Append a capability string.
Trait Implementations§
Source§impl Clone for VersionOutput
impl Clone for VersionOutput
Source§fn clone(&self) -> VersionOutput
fn clone(&self) -> VersionOutput
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 VersionOutput
impl Debug for VersionOutput
Source§impl<'de> Deserialize<'de> for VersionOutput
impl<'de> Deserialize<'de> for VersionOutput
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>,
Source§impl PartialEq for VersionOutput
impl PartialEq for VersionOutput
Source§fn eq(&self, other: &VersionOutput) -> bool
fn eq(&self, other: &VersionOutput) -> bool
self and other values to be equal, and is used by ==.