diff --git a/libraries/native_model/README.md b/libraries/native_model/README.md index 4fe34a3e..98282377 100644 --- a/libraries/native_model/README.md +++ b/libraries/native_model/README.md @@ -80,14 +80,17 @@ First, you need to set up your serialization format. You can use any serializati Just define the following functions, so they must be imported in the scope where you use the native model. ```rust,ignore -fn native_model_encode_body(obj: &T) -> Result, dyn Error> { +fn native_model_encode_body(obj: &T) -> Result, E> { ... } -fn native_model_decode_body(data: Vec) -> Result { +fn native_model_decode_body(data: Vec) -> Result { ... } ``` + +With `T` and `E` the type depending on the serialization format you use. Just `E` need to implement the `std::error::Error` trait. + Examples: - [bincode with encode/decode](./tests/example/encode_decode/bincode.rs) - [bincode with serde](./tests/example/encode_decode/bincode_serde.rs)