Allow js to use pre-stored (de)serialize functions

This commit is contained in:
Tony
2024-10-03 16:46:06 +08:00
parent a3bef84382
commit 718f5dc90d
4 changed files with 65 additions and 8 deletions
+2 -2
View File
@@ -19,9 +19,9 @@ use tokio::{
time::sleep,
};
type SerializeFn =
pub type SerializeFn =
fn(&HashMap<String, JsonValue>) -> Result<Vec<u8>, Box<dyn std::error::Error + Send + Sync>>;
pub(crate) type DeserializeFn =
pub type DeserializeFn =
fn(&[u8]) -> Result<HashMap<String, JsonValue>, Box<dyn std::error::Error + Send + Sync>>;
fn default_serialize(