pub struct RouteRuntimeAggregate { /* private fields */ }Implementations§
Source§impl RouteRuntimeAggregate
impl RouteRuntimeAggregate
pub fn new(route_id: impl Into<String>) -> Self
Sourcepub fn register(route_id: impl Into<String>) -> (Self, Vec<RuntimeEvent>)
pub fn register(route_id: impl Into<String>) -> (Self, Vec<RuntimeEvent>)
Constructor that returns both the aggregate and the initial RouteRegistered event.
Used by command handlers — avoids duplicating event construction outside the domain.
pub fn from_snapshot( route_id: impl Into<String>, state: RouteRuntimeState, version: u64, ) -> Self
pub fn state(&self) -> &RouteRuntimeState
pub fn version(&self) -> u64
pub fn route_id(&self) -> &str
Sourcepub fn state_from_event(event: &RuntimeEvent) -> Option<RouteRuntimeState>
pub fn state_from_event(event: &RuntimeEvent) -> Option<RouteRuntimeState>
Map a persisted RuntimeEvent to the resulting RouteRuntimeState. Used for event replay — avoids duplicating the state machine outside the domain.
pub fn apply_command( &mut self, cmd: RouteLifecycleCommand, ) -> Result<Vec<RuntimeEvent>, DomainError>
Sourcepub fn begin_start(&mut self) -> Result<Vec<RuntimeEvent>, DomainError>
pub fn begin_start(&mut self) -> Result<Vec<RuntimeEvent>, DomainError>
Phase 1 of two-phase start: transition to Starting. Idempotent if already Starting or Started.
Sourcepub fn confirm_start(&mut self) -> Result<Vec<RuntimeEvent>, DomainError>
pub fn confirm_start(&mut self) -> Result<Vec<RuntimeEvent>, DomainError>
Phase 2 of two-phase start: transition from Starting to Started. Idempotent if already Started.
Sourcepub fn fail(&mut self, error: String) -> Vec<RuntimeEvent>
pub fn fail(&mut self, error: String) -> Vec<RuntimeEvent>
Transition to Failed state from any state. Increments version to stay consistent with event replay (the replay path increments version for RouteFailed events).
Sourcepub fn state_label(&self) -> &'static str
pub fn state_label(&self) -> &'static str
Human-readable label for the current lifecycle state.
Trait Implementations§
Source§impl Clone for RouteRuntimeAggregate
impl Clone for RouteRuntimeAggregate
Source§fn clone(&self) -> RouteRuntimeAggregate
fn clone(&self) -> RouteRuntimeAggregate
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 moreAuto Trait Implementations§
impl Freeze for RouteRuntimeAggregate
impl RefUnwindSafe for RouteRuntimeAggregate
impl Send for RouteRuntimeAggregate
impl Sync for RouteRuntimeAggregate
impl Unpin for RouteRuntimeAggregate
impl UnsafeUnpin for RouteRuntimeAggregate
impl UnwindSafe for RouteRuntimeAggregate
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