pub struct ProjectState {
pub baselines: BTreeMap<String, String>,
}Expand description
Per-project, per-environment sync baselines.
Fields§
§baselines: BTreeMap<String, String>kind-dir/name → checksum of the push-normalized JSON 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.
pub fn baseline(&self, r: &ResourceRef) -> Option<&str>
pub fn set_baseline(&mut self, r: &ResourceRef, kind_value: &Value)
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectState
impl Debug for ProjectState
Source§impl Default for ProjectState
impl Default for ProjectState
Source§fn default() -> ProjectState
fn default() -> ProjectState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProjectState
impl<'de> Deserialize<'de> for ProjectState
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 ProjectState
impl RefUnwindSafe for ProjectState
impl Send for ProjectState
impl Sync for ProjectState
impl Unpin for ProjectState
impl UnsafeUnpin for ProjectState
impl UnwindSafe for ProjectState
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