fixed moved reference to json -> update
This commit is contained in:
parent
22272a320d
commit
de865e9b7b
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,8 @@ use std::{sync::mpsc, time::Duration};
|
||||||
use modules::{socket_handler::Socket, stream_states::stream_states_class::StreamState, message_handler::{MessageHandler, StateMessage}};
|
use modules::{socket_handler::Socket, stream_states::stream_states_class::StreamState, message_handler::{MessageHandler, StateMessage}};
|
||||||
use workctl::sync_flag;
|
use workctl::sync_flag;
|
||||||
|
|
||||||
|
use crate::modules::stream_states::state_update::StateUpdate;
|
||||||
|
|
||||||
mod tests;
|
mod tests;
|
||||||
mod modules;
|
mod modules;
|
||||||
|
|
||||||
|
@ -27,7 +29,8 @@ fn main() {
|
||||||
match from_socket_rx.recv_timeout(Duration::from_millis(100)) {
|
match from_socket_rx.recv_timeout(Duration::from_millis(100)) {
|
||||||
Ok(message) => {
|
Ok(message) => {
|
||||||
println!("{}", message);
|
println!("{}", message);
|
||||||
let update = <StreamState as MessageHandler>::create_update_from_string(message);
|
let json = serde_json::from_str(&message[1..]).unwrap();
|
||||||
|
let update = StateUpdate::json_to_state_update(json);
|
||||||
},
|
},
|
||||||
Err(_) => {continue},
|
Err(_) => {continue},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue