pub struct ResidualStream {
pub source: String,
pub samples: Vec<ResidualSample>,
}Expand description
A typed, time-ordered stream of residuals from a single source (one dataset, one engine, one observation window). Construction is the adapter’s responsibility; the stream is otherwise immutable.
Fields§
§source: StringSource label — dataset name, engine, version, subset.
samples: Vec<ResidualSample>Samples sorted by t ascending. Adapters MUST sort.
Implementations§
Source§impl ResidualStream
impl ResidualStream
pub fn new(source: impl Into<String>) -> Self
pub fn push(&mut self, s: ResidualSample)
pub fn sort(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn duration(&self) -> f64
Sourcepub fn iter_class(
&self,
class: ResidualClass,
) -> impl Iterator<Item = &ResidualSample> + '_
pub fn iter_class( &self, class: ResidualClass, ) -> impl Iterator<Item = &ResidualSample> + '_
View-only iterator over samples of a single class (used by the per-motif state machines).
Sourcepub fn fingerprint(&self) -> [u8; 32]
pub fn fingerprint(&self) -> [u8; 32]
Stable hash of the residual stream — used by the replay-determinism test to confirm bytewise identical runs.
Trait Implementations§
Source§impl Clone for ResidualStream
impl Clone for ResidualStream
Source§fn clone(&self) -> ResidualStream
fn clone(&self) -> ResidualStream
Returns a duplicate of the value. Read more
1.0.0 · 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 ResidualStream
impl Debug for ResidualStream
Source§impl Default for ResidualStream
impl Default for ResidualStream
Source§fn default() -> ResidualStream
fn default() -> ResidualStream
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResidualStream
impl<'de> Deserialize<'de> for ResidualStream
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
Auto Trait Implementations§
impl Freeze for ResidualStream
impl RefUnwindSafe for ResidualStream
impl Send for ResidualStream
impl Sync for ResidualStream
impl Unpin for ResidualStream
impl UnsafeUnpin for ResidualStream
impl UnwindSafe for ResidualStream
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