pub struct PolicyConfigDiff {
pub workspace_registries_changed: bool,
pub nuget_user_profile_sources_changed: bool,
pub gitlab_instance_host_changed: bool,
}Expand description
Which leaf fields differ between two PolicyConfig snapshots, at the exact granularity
deps-lsp::config::reparse_scope classifies them at.
Deliberately not #[non_exhaustive], unlike every section struct above:
deps-lsp::config::reparse_scope destructures this exhaustively (no ..) to guarantee
every leaf field is mapped to a ReparseScope decision. Only registries’s three fields
are individually parse-affecting today (each scopes a different set of ecosystems), so this
carries one bool per leaf field of that section rather than one bool per section — see
PolicyConfig::diff’s doc for why the other six sections have no fields here at all.
§The E0027 mechanism this design relies on (issue #1064, NFR-004)
PolicyConfig::diff destructures every section of PolicyConfig exhaustively — no ..
rest pattern at any level — so a field added to any of the 8 policy section structs without
also naming it in that destructuring fails to compile (rustc E0027), exactly as
deps-lsp::config::reparse_scope used to enforce directly before issue #592’s guarantee
moved here. The doctest below only illustrates that underlying Rust language mechanism on a
synthetic, unrelated struct — an exhaustive struct-destructure pattern (no ..) fails to
compile once the struct gains a field the pattern does not name. It does not itself
re-verify that PolicyConfig::diff’s or reparse_scope’s real destructuring stays
..-free (it would keep passing even if a .. crept into either); a CI grep step
(.github/workflows/ci.yml’s doc-and-hygiene job, mirroring that job’s existing
test-util leak guard) asserts that instead, on every PR.
struct Example {
a: bool,
b: bool,
// A hypothetical field added later without updating the destructure below — the same
// shape as adding a field to, say, `SupplyChainConfig` without updating
// `PolicyConfig::diff`'s destructure of it.
c: bool,
}
let e = Example { a: true, b: false, c: true };
// Missing `c` here fails with E0027.
let Example { a: _, b: _ } = e;Fields§
§workspace_registries_changed: boolWhether RegistriesConfig::workspace_registries changed.
nuget_user_profile_sources_changed: boolWhether RegistriesConfig::nuget_user_profile_sources changed.
gitlab_instance_host_changed: boolWhether RegistriesConfig::gitlab_instance_host changed.
Trait Implementations§
Source§impl Clone for PolicyConfigDiff
impl Clone for PolicyConfigDiff
impl Copy for PolicyConfigDiff
Source§impl Debug for PolicyConfigDiff
impl Debug for PolicyConfigDiff
Source§impl Default for PolicyConfigDiff
impl Default for PolicyConfigDiff
impl Eq for PolicyConfigDiff
Source§impl PartialEq for PolicyConfigDiff
impl PartialEq for PolicyConfigDiff
impl StructuralPartialEq for PolicyConfigDiff
Auto Trait Implementations§
impl Freeze for PolicyConfigDiff
impl RefUnwindSafe for PolicyConfigDiff
impl Send for PolicyConfigDiff
impl Sync for PolicyConfigDiff
impl Unpin for PolicyConfigDiff
impl UnsafeUnpin for PolicyConfigDiff
impl UnwindSafe for PolicyConfigDiff
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.