pub struct WorkspaceEvent {
pub core: CoreId,
pub event_type: EventType,
pub salience: Salience,
pub payload: Value,
pub timestamp: Instant,
}Expand description
A workspace event published by a cognitive core.
Each event carries a salience score that determines its priority in the spotlight arbitration. The payload is a JSON value containing core-specific data.
Fields§
§core: CoreIdThe core that produced this event.
event_type: EventTypeThe type of event.
salience: SalienceSalience score (urgency × novelty × confidence).
payload: ValueCore-specific payload data.
timestamp: InstantWhen the event was created.
Implementations§
Source§impl WorkspaceEvent
impl WorkspaceEvent
Sourcepub fn new(
core: CoreId,
event_type: EventType,
salience: Salience,
payload: Value,
) -> Self
pub fn new( core: CoreId, event_type: EventType, salience: Salience, payload: Value, ) -> Self
Create a new workspace event with the given salience.
Sourcepub fn with_default_urgency(
core: CoreId,
event_type: EventType,
novelty: f32,
confidence: f32,
payload: Value,
) -> Self
pub fn with_default_urgency( core: CoreId, event_type: EventType, novelty: f32, confidence: f32, payload: Value, ) -> Self
Create a new event with default urgency based on event type.
Sourcepub fn composite_salience(&self) -> f32
pub fn composite_salience(&self) -> f32
Get the composite salience score.
Sourcepub fn should_preempt(&self) -> bool
pub fn should_preempt(&self) -> bool
Check if this event should preempt the current spotlight.
Trait Implementations§
Source§impl Clone for WorkspaceEvent
impl Clone for WorkspaceEvent
Source§impl Debug for WorkspaceEvent
impl Debug for WorkspaceEvent
Source§impl<'de> Deserialize<'de> for WorkspaceEvent
impl<'de> Deserialize<'de> for WorkspaceEvent
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 WorkspaceEvent
impl RefUnwindSafe for WorkspaceEvent
impl Send for WorkspaceEvent
impl Sync for WorkspaceEvent
impl Unpin for WorkspaceEvent
impl UnsafeUnpin for WorkspaceEvent
impl UnwindSafe for WorkspaceEvent
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