pub struct Contract {
pub stages: Stage,
pub platform: Platform,
pub sources: Source,
pub scopes: Vec<Scope>,
}Expand description
完整契约,对应 .quanttide/devops/contract.yaml。
按四维架构组织:Stage(时序)、Platform(载体)、Source(事实源)、Scope(边界)。
Fields§
§stages: Stage§platform: Platform§sources: Source§scopes: Vec<Scope>Implementations§
Source§impl Contract
impl Contract
Sourcepub fn scope_release<'a>(&'a self, scope: &'a Scope) -> &'a StageRelease
pub fn scope_release<'a>(&'a self, scope: &'a Scope) -> &'a StageRelease
获取 scope 的发布配置(scope 级覆盖 → 全局默认)。
Sourcepub fn scope_test_threshold(&self, scope: &Scope) -> f64
pub fn scope_test_threshold(&self, scope: &Scope) -> f64
获取 scope 的测试阈值。
Sourcepub fn find_scope_by_path(&self, current_dir: &Path) -> Option<&Scope>
pub fn find_scope_by_path(&self, current_dir: &Path) -> Option<&Scope>
根据路径查找匹配的 scope(最长前缀匹配)。
例如当前在 src/cli/sub 时,cli scope(dir: src/cli)
比 root scope(dir: .)优先级高。
Sourcepub fn resolve_language(&self, scope: &Scope, scope_dir: &Path) -> Language
pub fn resolve_language(&self, scope: &Scope, scope_dir: &Path) -> Language
语言探测:scope 声明了具体语言则返回,否则按目录文件推测。
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Contract
impl<'de> Deserialize<'de> for Contract
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Contract
impl RefUnwindSafe for Contract
impl Send for Contract
impl Sync for Contract
impl Unpin for Contract
impl UnsafeUnpin for Contract
impl UnwindSafe for Contract
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