1 2 3 4 5 6 7 8 9 10 11 12 13 14
#[derive(Serialize, Deserialize, Debug)] pub struct Ship { pub name : String, pub location : (isize, isize, isize), } impl Ship { pub fn new(name : &str) -> Ship { Ship { name : String::from(name), location : (0,0,0), } } }