pub enum DomainEvent {
Show 16 variants
SessionActivated {
session_id: SessionId,
timestamp: DateTime<Utc>,
},
SessionClosed {
session_id: SessionId,
timestamp: DateTime<Utc>,
},
SessionExpired {
session_id: SessionId,
timestamp: DateTime<Utc>,
},
SessionTimedOut {
session_id: SessionId,
original_state: SessionState,
timeout_duration: u64,
timestamp: DateTime<Utc>,
},
SessionTimeoutExtended {
session_id: SessionId,
additional_seconds: u64,
new_expires_at: DateTime<Utc>,
timestamp: DateTime<Utc>,
},
StreamCreated {
session_id: SessionId,
stream_id: StreamId,
timestamp: DateTime<Utc>,
},
StreamStarted {
session_id: SessionId,
stream_id: StreamId,
timestamp: DateTime<Utc>,
},
StreamCompleted {
session_id: SessionId,
stream_id: StreamId,
timestamp: DateTime<Utc>,
},
StreamFailed {
session_id: SessionId,
stream_id: StreamId,
error: String,
timestamp: DateTime<Utc>,
},
StreamCancelled {
session_id: SessionId,
stream_id: StreamId,
timestamp: DateTime<Utc>,
},
SkeletonGenerated {
session_id: SessionId,
stream_id: StreamId,
frame_size_bytes: u64,
timestamp: DateTime<Utc>,
},
PatchFramesGenerated {
session_id: SessionId,
stream_id: StreamId,
frame_count: usize,
total_bytes: u64,
highest_priority: u8,
timestamp: DateTime<Utc>,
},
FramesBatched {
session_id: SessionId,
frame_count: usize,
timestamp: DateTime<Utc>,
},
PriorityThresholdAdjusted {
session_id: SessionId,
old_threshold: u8,
new_threshold: u8,
reason: String,
timestamp: DateTime<Utc>,
},
StreamConfigUpdated {
session_id: SessionId,
stream_id: StreamId,
timestamp: DateTime<Utc>,
},
PerformanceMetricsRecorded {
session_id: SessionId,
metrics: PerformanceMetrics,
timestamp: DateTime<Utc>,
},
}Expand description
Domain events that represent business-relevant state changes
Variants§
SessionActivated
Session was activated and is ready to accept streams
Fields
SessionClosed
Session was closed gracefully
Fields
SessionExpired
Session expired due to timeout
Fields
SessionTimedOut
Session was forcefully closed due to timeout
Fields
original_state: SessionStateState the session was in before timeout
SessionTimeoutExtended
Session timeout was extended
Fields
StreamCreated
New stream was created in the session
Fields
StreamStarted
Stream started sending data
Fields
StreamCompleted
Stream completed successfully
Fields
StreamFailed
Stream failed with error
Fields
StreamCancelled
Stream was cancelled
Fields
SkeletonGenerated
Skeleton frame was generated for a stream
Fields
PatchFramesGenerated
Patch frames were generated for a stream
Fields
FramesBatched
Multiple frames were batched for efficient sending
Fields
PriorityThresholdAdjusted
Priority threshold was adjusted for adaptive streaming
Fields
StreamConfigUpdated
Stream configuration was updated
Fields
PerformanceMetricsRecorded
Performance metrics were recorded
Implementations§
Source§impl DomainEvent
impl DomainEvent
Sourcepub fn session_id(&self) -> SessionId
pub fn session_id(&self) -> SessionId
Get the session ID associated with this event
Sourcepub fn stream_id(&self) -> Option<StreamId>
pub fn stream_id(&self) -> Option<StreamId>
Get the stream ID if this is a stream-specific event
Sourcepub fn event_type(&self) -> &'static str
pub fn event_type(&self) -> &'static str
Get the event type as a string
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Check if this is a critical event that requires immediate attention
Sourcepub fn is_completion(&self) -> bool
pub fn is_completion(&self) -> bool
Check if this is a completion event
Source§impl DomainEvent
Extension methods for DomainEvent
impl DomainEvent
Extension methods for DomainEvent
Trait Implementations§
Source§impl Clone for DomainEvent
impl Clone for DomainEvent
Source§fn clone(&self) -> DomainEvent
fn clone(&self) -> DomainEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DomainEvent
impl Debug for DomainEvent
Source§impl<'de> Deserialize<'de> for DomainEvent
impl<'de> Deserialize<'de> for DomainEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DomainEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DomainEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<DomainEvent> for DomainEventDto
impl From<DomainEvent> for DomainEventDto
Source§fn from(event: DomainEvent) -> Self
fn from(event: DomainEvent) -> Self
Source§impl FromDto<DomainEventDto> for DomainEvent
impl FromDto<DomainEventDto> for DomainEvent
type Error = DomainError
fn from_dto(dto: DomainEventDto) -> Result<Self, Self::Error>
Source§impl PartialEq for DomainEvent
impl PartialEq for DomainEvent
Source§impl Serialize for DomainEvent
impl Serialize for DomainEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToDto<DomainEventDto> for DomainEvent
impl ToDto<DomainEventDto> for DomainEvent
fn to_dto(self) -> DomainEventDto
impl StructuralPartialEq for DomainEvent
Auto Trait Implementations§
impl Freeze for DomainEvent
impl RefUnwindSafe for DomainEvent
impl Send for DomainEvent
impl Sync for DomainEvent
impl Unpin for DomainEvent
impl UnwindSafe for DomainEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more