songbird/events/untimed.rs
1use super::*;
2
3/// Track and voice core events.
4///
5/// Untimed events persist while the `action` in [`EventData`]
6/// returns `None`.
7///
8/// [`EventData`]: EventData
9#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
10#[non_exhaustive]
11pub enum UntimedEvent {
12 /// Untimed events belonging to a track, such as state changes, end, or loops.
13 Track(TrackEvent),
14 /// Untimed events belonging to the global context, such as finished tracks,
15 /// client speaking updates, or RT(C)P voice and telemetry data.
16 Core(CoreEvent),
17}
18
19impl From<TrackEvent> for UntimedEvent {
20 fn from(evt: TrackEvent) -> Self {
21 UntimedEvent::Track(evt)
22 }
23}
24
25impl From<CoreEvent> for UntimedEvent {
26 fn from(evt: CoreEvent) -> Self {
27 UntimedEvent::Core(evt)
28 }
29}