pub trait JsonSerializeDeserialize: Serialize + for<'a> Deserialize<'a> {
// Provided methods
fn into_serialized(self) -> String { ... }
fn try_from_serialized(serialized_msg: &str) -> Result<Self, Error> { ... }
}Expand description
A trait for types that can be serialized to and deserialized from JSON format.
Implement using #[derive(JsonToFromZMQ)].
§Methods
into_serialized: Serializes the implementing type to a JSON stringString.try_from_serialized: Attempts to create an instance of the implementing type from a givenStringby deserializing the JSON contained within.
Provided Methods§
fn into_serialized(self) -> String
fn try_from_serialized(serialized_msg: &str) -> Result<Self, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.