Moved the state out to a different file
This commit is contained in:
18
src/state.rs
Normal file
18
src/state.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct Object {
|
||||
pub name: String,
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct State {
|
||||
pub iteration: u64,
|
||||
pub objects: Vec<Object>
|
||||
}
|
||||
|
||||
pub type WrappedState = Arc<Mutex<State>>;
|
||||
Reference in New Issue
Block a user