Skip to main content

VersionState

Struct VersionState 

Source
pub struct VersionState {
    pub tag_version: Option<String>,
    pub config_version: Option<String>,
    pub consistent: bool,
    pub config_files: Vec<(String, Option<String>)>,
}
Expand description

契约模块 — 适配层,委托给 quanttide-devops toolkit。 版本信息快照(State):记录两个事实源的版本信息及一致性结论。

调用 verify_version 后得到一个快照,consistent 字段是核心判断结果。 之所以不叫 VersionStatus,是因为结构体包含多个字段(版本信息), 而不只是一个单一布尔值。consistent 字段才是真正的状态值。

Fields§

§tag_version: Option<String>

最新 git tag 的版本号(已标准化,去 v 前缀和 scope 前缀)。

§config_version: Option<String>

配置文件中找到的第一个非空版本号。

§consistent: bool

tag 与所有配置文件版本是否一致。

§config_files: Vec<(String, Option<String>)>

所有配置文件的版本号明细。

Trait Implementations§

Source§

impl Debug for VersionState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.