pub enum AutonomicEvent {
CostCharged {
amount_micro_credits: i64,
reason: CostReason,
balance_after: i64,
},
EconomicModeChanged {
from: EconomicMode,
to: EconomicMode,
reason: String,
},
GatingDecision {
session_id: String,
rationale: Vec<String>,
economic_mode: EconomicMode,
},
CreditDeposited {
amount_micro_credits: i64,
source: String,
balance_after: i64,
},
}Expand description
Autonomic-specific event types that wrap as EventKind::Custom.
Variants§
CostCharged
A cost was charged to the agent.
EconomicModeChanged
The economic mode changed.
GatingDecision
A gating decision was made by the controller.
CreditDeposited
Credits were deposited (revenue, grant, transfer).
Implementations§
Source§impl AutonomicEvent
impl AutonomicEvent
Sourcepub fn into_event_kind(self) -> EventKind
pub fn into_event_kind(self) -> EventKind
Convert this event into a canonical EventKind::Custom.
Sourcepub fn is_autonomic_event(event_type: &str) -> bool
pub fn is_autonomic_event(event_type: &str) -> bool
Check if a Custom event is an Autonomic event by its prefix.
Sourcepub fn from_custom(event_type: &str, data: &Value) -> Option<Self>
pub fn from_custom(event_type: &str, data: &Value) -> Option<Self>
Try to parse an EventKind::Custom back into an AutonomicEvent.
Trait Implementations§
Source§impl Clone for AutonomicEvent
impl Clone for AutonomicEvent
Source§fn clone(&self) -> AutonomicEvent
fn clone(&self) -> AutonomicEvent
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 AutonomicEvent
impl Debug for AutonomicEvent
Source§impl<'de> Deserialize<'de> for AutonomicEvent
impl<'de> Deserialize<'de> for AutonomicEvent
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 AutonomicEvent
impl RefUnwindSafe for AutonomicEvent
impl Send for AutonomicEvent
impl Sync for AutonomicEvent
impl Unpin for AutonomicEvent
impl UnsafeUnpin for AutonomicEvent
impl UnwindSafe for AutonomicEvent
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