pub struct ProjectState {
pub baselines: BTreeMap<String, Baseline>,
}Expand description
Per-project, per-environment sync baselines.
Fields§
§baselines: BTreeMap<String, Baseline>kind-dir/name → baseline captured at last sync.
Implementations§
Source§impl ProjectState
impl ProjectState
pub fn path(ws: &Workspace, env: &str, project: &str) -> PathBuf
pub fn load(ws: &Workspace, env: &str, project: &str) -> ProjectState
pub fn save(&self, ws: &Workspace, env: &str, project: &str) -> Result<()>
Sourcepub fn checksum(kind: ResourceKind, value: &Value) -> String
pub fn checksum(kind: ResourceKind, value: &Value) -> String
Checksum of the push-normalized form of a document.
The form is canonicalized (object keys sorted recursively, arrays of named objects sorted by name) so that server-side reordering between GET and PUT responses never reads as a change — matching the semantics of the order-insensitive diff.
Sourcepub fn has_baseline(&self, r: &ResourceRef) -> bool
pub fn has_baseline(&self, r: &ResourceRef) -> bool
Whether a baseline is recorded for this resource.
Sourcepub fn baseline_checksum(&self, r: &ResourceRef) -> Option<String>
pub fn baseline_checksum(&self, r: &ResourceRef) -> Option<String>
Checksum of the recorded baseline, recomputed under CURRENT
normalization rules for Doc entries — this is what lets a resource
self-heal when a rigg upgrade changes which fields are volatile.
Legacy Checksum entries are frozen and returned as-is.
Sourcepub fn baseline_document(&self, r: &ResourceRef) -> Option<&Value>
pub fn baseline_document(&self, r: &ResourceRef) -> Option<&Value>
The recorded baseline document, when one was stored (legacy checksum-only baselines have none).
Sourcepub fn set_baseline(&mut self, r: &ResourceRef, kind_value: &Value)
pub fn set_baseline(&mut self, r: &ResourceRef, kind_value: &Value)
Record a baseline. kind_value should be the document as it now
exists on disk — see baseline_doc, which merges the local file’s
write-only fields into a server echo that redacts them.
pub fn clear_baseline(&mut self, r: &ResourceRef)
Trait Implementations§
Source§impl Clone for ProjectState
impl Clone for ProjectState
Source§fn clone(&self) -> ProjectState
fn clone(&self) -> ProjectState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more