pub trait ProtocolKeyCodec<T: Serialize + DeserializeOwned + TryToBytes + TryFromBytes>: 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.
Encodes to json hex and decodes from json hex or bytes 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.