pub struct ResidualEvent {
pub residual_id: String,
pub node_id: String,
pub generation: u32,
pub component: EnergyComponent,
pub class: ResidualClass,
pub severity: ResidualSeverity,
pub score: f64,
pub sensor: SensorRef,
pub evidence: EvidencePayload,
pub affected_paths: Vec<String>,
pub affected_symbols: Vec<SymbolRef>,
pub correction_directions: Vec<CorrectionDirection>,
}Expand description
A first-class residual event (PSP-8 System 6).
Fields§
§residual_id: String§node_id: String§generation: u32§component: EnergyComponent§class: ResidualClass§severity: ResidualSeverity§score: f64Raw non-negative magnitude r_e >= 0. The SDK squares and weights it.
sensor: SensorRef§evidence: EvidencePayload§affected_paths: Vec<String>§affected_symbols: Vec<SymbolRef>§correction_directions: Vec<CorrectionDirection>Implementations§
Source§impl ResidualEvent
impl ResidualEvent
Sourcepub fn new(
node_id: impl Into<String>,
generation: u32,
class: ResidualClass,
severity: ResidualSeverity,
score: f64,
sensor: SensorRef,
) -> Result<Self>
pub fn new( node_id: impl Into<String>, generation: u32, class: ResidualClass, severity: ResidualSeverity, score: f64, sensor: SensorRef, ) -> Result<Self>
Construct a residual, validating that the raw score is finite and non-negative. The component defaults to the class mapping but may be overridden afterward by a domain package.
pub fn with_evidence(self, evidence: EvidencePayload) -> Self
pub fn with_component(self, component: EnergyComponent) -> Self
pub fn with_paths(self, paths: Vec<String>) -> Self
pub fn with_correction(self, direction: CorrectionDirection) -> Self
Sourcepub fn is_admissibility_outcome(&self) -> bool
pub fn is_admissibility_outcome(&self) -> bool
Whether this residual is an admissibility outcome (blocked channel) and therefore excluded from the Lyapunov energy.
Trait Implementations§
Source§impl Clone for ResidualEvent
impl Clone for ResidualEvent
Source§fn clone(&self) -> ResidualEvent
fn clone(&self) -> ResidualEvent
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 ResidualEvent
impl Debug for ResidualEvent
Source§impl<'de> Deserialize<'de> for ResidualEvent
impl<'de> Deserialize<'de> for ResidualEvent
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
Source§impl PartialEq for ResidualEvent
impl PartialEq for ResidualEvent
Source§fn eq(&self, other: &ResidualEvent) -> bool
fn eq(&self, other: &ResidualEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResidualEvent
impl Serialize for ResidualEvent
impl StructuralPartialEq for ResidualEvent
Auto Trait Implementations§
impl Freeze for ResidualEvent
impl RefUnwindSafe for ResidualEvent
impl Send for ResidualEvent
impl Sync for ResidualEvent
impl Unpin for ResidualEvent
impl UnsafeUnpin for ResidualEvent
impl UnwindSafe for ResidualEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.