pub struct PatternCandidateId(/* private fields */);Expand description
Stable identifier for a PatternCandidate, analogous in spirit to how
FindingId identifies a Finding — but composed differently, since a
pattern candidate has no single file/line to anchor an id string to.
Deterministically hashed from (pattern, normalized scope, sorted evidence identities) (todo.md §16.5: “stabile ID aus Pattern,
normalisiertem Scope und Evidenzidentitäten bilden”).
Note on the hash function: the task brief for this module referenced
Finding ids as a b3:-style blake3 hash and assumed blake3 was already a
project dependency. Neither holds for this codebase: Finding ids are
plain descriptive rule:file:line:column strings (see
SlopVisitor::record in slop.rs), and blake3 is not in Cargo.toml.
Adding a new dependency for a single hash call isn’t justified, so this
uses a small hand-rolled, version-independent FNV-1a hash instead of
either blake3 or std::hash::DefaultHasher (whose algorithm is
explicitly not guaranteed stable across Rust releases — unsuitable for an
id meant to stay stable across judge upgrades).
Deserialize is derived alongside Serialize so a
crate::pattern_baseline::PatternBaseline JSON file can be loaded back,
not just saved.
Implementations§
Trait Implementations§
Source§impl Clone for PatternCandidateId
impl Clone for PatternCandidateId
Source§fn clone(&self) -> PatternCandidateId
fn clone(&self) -> PatternCandidateId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatternCandidateId
impl Debug for PatternCandidateId
Source§impl<'de> Deserialize<'de> for PatternCandidateId
impl<'de> Deserialize<'de> for PatternCandidateId
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>,
Source§impl Display for PatternCandidateId
impl Display for PatternCandidateId
impl Eq for PatternCandidateId
Source§impl Hash for PatternCandidateId
impl Hash for PatternCandidateId
Source§impl Ord for PatternCandidateId
impl Ord for PatternCandidateId
Source§fn cmp(&self, other: &PatternCandidateId) -> Ordering
fn cmp(&self, other: &PatternCandidateId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PatternCandidateId
impl PartialEq for PatternCandidateId
Source§impl PartialOrd for PatternCandidateId
impl PartialOrd for PatternCandidateId
Source§impl Serialize for PatternCandidateId
impl Serialize for PatternCandidateId
impl StructuralPartialEq for PatternCandidateId
Auto Trait Implementations§
impl Freeze for PatternCandidateId
impl RefUnwindSafe for PatternCandidateId
impl Send for PatternCandidateId
impl Sync for PatternCandidateId
impl Unpin for PatternCandidateId
impl UnsafeUnpin for PatternCandidateId
impl UnwindSafe for PatternCandidateId
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.