pub struct CsiEvent {
pub event_id: EventId,
pub kind: CsiEventKind,
pub session_id: SessionId,
pub source_id: SourceId,
pub timestamp_ns: u64,
pub confidence: f32,
pub evidence_window_ids: Vec<WindowId>,
pub calibration_version: Option<String>,
pub metadata_json: String,
}Expand description
A detected event with confidence and the evidence windows that justify it.
Invariant: evidence_window_ids is non-empty and 0.0 <= confidence <= 1.0.
Fields§
§event_id: EventIdEvent id.
kind: CsiEventKindWhat happened.
session_id: SessionIdOwning session.
source_id: SourceIdSource that produced the evidence.
timestamp_ns: u64When the event was detected (ns).
confidence: f32Confidence in [0.0, 1.0].
evidence_window_ids: Vec<WindowId>Windows that justify this event (at least one).
calibration_version: Option<String>Calibration version detection ran against, if any.
metadata_json: StringFree-form JSON metadata (motion energy, estimated rate, …).
Implementations§
Source§impl CsiEvent
impl CsiEvent
Sourcepub fn new(
event_id: EventId,
kind: CsiEventKind,
session_id: SessionId,
source_id: SourceId,
timestamp_ns: u64,
confidence: f32,
evidence_window_ids: Vec<WindowId>,
) -> Self
pub fn new( event_id: EventId, kind: CsiEventKind, session_id: SessionId, source_id: SourceId, timestamp_ns: u64, confidence: f32, evidence_window_ids: Vec<WindowId>, ) -> Self
Minimal constructor; sets metadata_json to "{}".
Sourcepub fn with_calibration(self, version: impl Into<String>) -> Self
pub fn with_calibration(self, version: impl Into<String>) -> Self
Attach a calibration version.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CsiEvent
impl<'de> Deserialize<'de> for CsiEvent
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
impl StructuralPartialEq for CsiEvent
Auto Trait Implementations§
impl Freeze for CsiEvent
impl RefUnwindSafe for CsiEvent
impl Send for CsiEvent
impl Sync for CsiEvent
impl Unpin for CsiEvent
impl UnsafeUnpin for CsiEvent
impl UnwindSafe for CsiEvent
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