pub struct EdgeEvidence {
pub v: u8,
pub grade: EvidenceGrade,
pub by: Vec<Contribution>,
}Expand description
Serialized into Edge.metadata. Deliberately small and deterministic: no
timestamps, no source text, no paths beyond the edge’s own endpoints.
Several producers can derive the same edge; each keeps its own contribution, so a recompute or withdrawal by one never erases or downgrades what another one established.
Fields§
§v: u8Schema version of this record.
grade: EvidenceGradeStrongest contribution — what ranking and impact weight by.
by: Vec<Contribution>Every producer currently deriving the edge, sorted by origin.
Implementations§
Source§impl EdgeEvidence
impl EdgeEvidence
pub const VERSION: u8 = 1
Sourcepub fn new(
grade: EvidenceGrade,
origin: EvidenceOrigin,
backend: Option<String>,
sites: u32,
) -> Self
pub fn new( grade: EvidenceGrade, origin: EvidenceOrigin, backend: Option<String>, sites: u32, ) -> Self
Evidence from a single producer.
Sourcepub fn primary(&self) -> Option<&Contribution>
pub fn primary(&self) -> Option<&Contribution>
The strongest contribution (lowest origin on ties) — the one whose backend and site count describe the edge.
pub fn has(&self, origin: EvidenceOrigin) -> bool
Sourcepub fn merge(existing: Option<Self>, incoming: Self) -> Self
pub fn merge(existing: Option<Self>, incoming: Self) -> Self
incoming replaces the contributions of its own origins on top of
existing; every other producer’s contribution is kept as is. A
producer recomputing its edge is authoritative for its own part only.
Sourcepub fn without(self, origin: EvidenceOrigin) -> Option<Self>
pub fn without(self, origin: EvidenceOrigin) -> Option<Self>
Withdraws origin’s contribution. None when no producer derives the
edge any more (the edge should be deleted).
pub fn to_metadata(&self) -> String
Sourcepub fn from_metadata(metadata: Option<&str>) -> Option<Self>
pub fn from_metadata(metadata: Option<&str>) -> Option<Self>
Parses edge metadata written by this module; anything else (legacy
edges, other producers’ metadata) yields None.
Sourcepub fn weight_factor_of(metadata: Option<&str>) -> f64
pub fn weight_factor_of(metadata: Option<&str>) -> f64
Ranking factor for an edge’s metadata. Edges without evidence (legacy, non-call producers) keep their full kind weight — unchanged behaviour.
Trait Implementations§
Source§impl Clone for EdgeEvidence
impl Clone for EdgeEvidence
Source§impl Debug for EdgeEvidence
impl Debug for EdgeEvidence
Source§impl<'de> Deserialize<'de> for EdgeEvidence
impl<'de> Deserialize<'de> for EdgeEvidence
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 EdgeEvidence
Source§impl PartialEq for EdgeEvidence
impl PartialEq for EdgeEvidence
Source§impl Serialize for EdgeEvidence
impl Serialize for EdgeEvidence
impl StructuralPartialEq for EdgeEvidence
Auto Trait Implementations§
impl Forget for EdgeEvidence
impl Freeze for EdgeEvidence
impl Move for EdgeEvidence
impl RefUnwindSafe for EdgeEvidence
impl Send for EdgeEvidence
impl Sync for EdgeEvidence
impl Unpin for EdgeEvidence
impl UnsafeUnpin for EdgeEvidence
impl UnwindSafe for EdgeEvidence
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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