(event: PlayerEvent)
| 20 | |
| 21 | #[tracing::instrument(level = "debug", skip(event))] |
| 22 | pub fn event_to_map(event: PlayerEvent) -> HashMap<String, String> { |
| 23 | let mut map = HashMap::new(); |
| 24 | |
| 25 | match event { |
| 26 | PlayerEvent::PlayRequestIdChanged { play_request_id } => { |
| 27 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 28 | map.insert("event".to_string(), "PlayRequestIdChanged".to_string()); |
| 29 | } |
| 30 | PlayerEvent::Stopped { |
| 31 | play_request_id, |
| 32 | track_id, |
| 33 | } => { |
| 34 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 35 | map.insert("track_id".to_string(), track_id.to_string()); |
| 36 | map.insert("event".to_string(), "Stopped".to_string()); |
| 37 | } |
| 38 | PlayerEvent::Loading { |
| 39 | play_request_id, |
| 40 | track_id, |
| 41 | position_ms, |
| 42 | } => { |
| 43 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 44 | map.insert("track_id".to_string(), track_id.to_string()); |
| 45 | map.insert("position_ms".to_string(), position_ms.to_string()); |
| 46 | map.insert("event".to_string(), "Loading".to_string()); |
| 47 | } |
| 48 | PlayerEvent::Playing { |
| 49 | play_request_id, |
| 50 | track_id, |
| 51 | position_ms, |
| 52 | } => { |
| 53 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 54 | map.insert("track_id".to_string(), track_id.to_string()); |
| 55 | map.insert("position_ms".to_string(), position_ms.to_string()); |
| 56 | map.insert("event".to_string(), "Playing".to_string()); |
| 57 | } |
| 58 | PlayerEvent::Paused { |
| 59 | play_request_id, |
| 60 | track_id, |
| 61 | position_ms, |
| 62 | } => { |
| 63 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 64 | map.insert("track_id".to_string(), track_id.to_string()); |
| 65 | map.insert("position_ms".to_string(), position_ms.to_string()); |
| 66 | map.insert("event".to_string(), "Paused".to_string()); |
| 67 | } |
| 68 | PlayerEvent::TimeToPreloadNextTrack { |
| 69 | play_request_id, |
| 70 | track_id, |
| 71 | } => { |
| 72 | map.insert("play_request_id".to_string(), play_request_id.to_string()); |
| 73 | map.insert("track_id".to_string(), track_id.to_string()); |
| 74 | map.insert("event".to_string(), "TimeToPreloadNextTrack".to_string()); |
| 75 | } |
| 76 | PlayerEvent::EndOfTrack { |
| 77 | play_request_id, |
| 78 | track_id, |
| 79 | } => { |
no outgoing calls
no test coverage detected