pub struct FindingsStore {
pub binding: String,
pub batches: Vec<FindingsBatch>,
}Expand description
One binding’s durable findings store (A1). Persisted at
.memstead/state/findings/<mem>/<name>.json, read fresh per call. Holds
findings grouped by the hash(D) they were recorded under so declaration
invalidation is mechanical: Self::current presents the current hash’s
batch — regardless of source head; Self::superseded surfaces everything
else, segregated (A3).
The on-disk shape predates the hash-alone re-key and is unchanged: a store
written when batches were keyed (hash(D), source_head) loads without loss.
Such a legacy store may hold several batches sharing one binding_hash
(recorded at different heads); the hash-alone view treats the
latest-recorded of them as current and the next Self::record collapses
them into one.
Fields§
§binding: StringThe canonical binding id <mem>/<stem> this store belongs to.
batches: Vec<FindingsBatch>Findings grouped by recording key, most-recent recording order not guaranteed — look up by key.
Implementations§
Source§impl FindingsStore
impl FindingsStore
Sourcepub fn record(
&mut self,
key: FindingKey,
recorded_at: String,
findings: Vec<Finding>,
)
pub fn record( &mut self, key: FindingKey, recorded_at: String, findings: Vec<Finding>, )
Record findings under key.binding_hash, replacing every prior
batch recorded under that hash (including legacy per-head siblings) and
leaving every other hash’s batch untouched (A3 segregation — a changed
hash(D) never overwrites the old batch).
Sourcepub fn current(&self, key: &FindingKey) -> &[Finding]
pub fn current(&self, key: &FindingKey) -> &[Finding]
The findings recorded under key.binding_hash — the only findings
ever presented as current (A3), regardless of key.source_head: an
open finding recorded at a previous head stays presented after the
source advances. Empty when nothing was recorded under this hash.
Sourcepub fn superseded(&self, key: &FindingKey) -> Vec<&Finding>
pub fn superseded(&self, key: &FindingKey) -> Vec<&Finding>
Every finding outside the current view of key.binding_hash —
superseded by a hash(D) change (or stranded in an older legacy
per-head batch of the same hash), segregated so a consumer can show
them as stale without mixing them into the current view (A3).
Trait Implementations§
Source§impl Clone for FindingsStore
impl Clone for FindingsStore
Source§fn clone(&self) -> FindingsStore
fn clone(&self) -> FindingsStore
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 FindingsStore
impl Debug for FindingsStore
Source§impl Default for FindingsStore
impl Default for FindingsStore
Source§fn default() -> FindingsStore
fn default() -> FindingsStore
Source§impl<'de> Deserialize<'de> for FindingsStore
impl<'de> Deserialize<'de> for FindingsStore
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>,
impl Eq for FindingsStore
Source§impl PartialEq for FindingsStore
impl PartialEq for FindingsStore
Source§impl Serialize for FindingsStore
impl Serialize for FindingsStore
impl StructuralPartialEq for FindingsStore
Auto Trait Implementations§
impl Freeze for FindingsStore
impl RefUnwindSafe for FindingsStore
impl Send for FindingsStore
impl Sync for FindingsStore
impl Unpin for FindingsStore
impl UnsafeUnpin for FindingsStore
impl UnwindSafe for FindingsStore
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more