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
Object Safety§
This trait is not object safe.