openlegends-server 0.3.0

OpenLegends Game Server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::Log;
use serde::Serialize;

#[derive(Serialize)]
struct Response {
    message: String,
}

pub fn from_string(message: String, log: &Log) -> String {
    log.warning(format!("Request error: `{message}`"));
    serde_json::to_string(&Response { message }).unwrap() // @TODO handle
}