Rust 编译错误

use std::sync::Arc;

use axum::Json;

use dashmap::{DashMap};

use lazy_static::lazy_static;

use serde_json::{json, Value};

pub trait  testServer {
 fn  getOneBronAndCamp(&mut  self) ->Json<Value>;
}

pub  struct  RoomServer{
 pub  BattleTime:f32,
 pub  sceneId:String,
}

impl  testServer  for  RoomServer{

 fn  getOneBronAndCamp(&mut  self) ->Json<Value> {

 Json(json!({ "camp": 1, "pos":{"x":30.0, "y":self.BattleTime, "z":60.5}, "index":2}))

    }

}

lazy_static!{

 pub  static  ref  roomList:Arc<DashMap<String, RoomServer>> =  Arc::new(DashMap::new());

}

fn  main() {

 roomList.insert(String::from("1") , RoomServer { BattleTime: 10.5, sceneId: String::from("852963") });

 roomList.insert(String::from("2") , RoomServer { BattleTime: 10.7, sceneId: String::from("741852") });

 roomList.insert(String::from("3") , RoomServer { BattleTime: 10.6, sceneId: String::from("753159") });

 for  item  in  roomList.iter() {

 println!("{}", item.value().sceneId);

    }

 let  v  =  roomList.get("1");

 let  binding  =  v.unwrap();

 let  roomServer  =  binding.value();

 let  info  =  roomServer.getOneBronAndCamp();

 loop {

    }

}

编译出错,哪位大佬帮忙看一下么

本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
1
粉丝
0
喜欢
0
收藏
0
排名:3722
访问:17
私信
所有博文
博客标签
社区赞助商