pub trait ProtocolKeyCodec<T: Serialize + DeserializeOwned>: Sized {
// Provided methods
fn decode_key(encoded: &str) -> StdResult<ProtocolKey<T>> { ... }
fn encode_key(key: &T) -> StdResult<String> { ... }
}
Expand description
The codec used to serialize/deserialize a ProtocolKey.
Default to json hex.
Provided Methods§
Sourcefn decode_key(encoded: &str) -> StdResult<ProtocolKey<T>>
fn decode_key(encoded: &str) -> StdResult<ProtocolKey<T>>
Do the decoding of the given key
Sourcefn encode_key(key: &T) -> StdResult<String>
fn encode_key(key: &T) -> StdResult<String>
Do the encoding of the given key
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.