JsonSerializeDeserialize

Trait JsonSerializeDeserialize 

Source
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 string String.
  • try_from_serialized: Attempts to create an instance of the implementing type from a given String by deserializing the JSON contained within.

Provided Methods§

Source

fn into_serialized(self) -> String

Source

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.

Implementors§