Trait sov_state::codec::EncodeKeyLike
source · pub trait EncodeKeyLike<Ref: ?Sized, Target> {
// Required method
fn encode_key_like(&self, borrowed: &Ref) -> Vec<u8>;
}Expand description
A trait for codecs which know how to serialize a type Ref as if it were
some other type Target.
A good example of this is BorshCodec, which knows how to serialize a
[T;N] as if it were a Vec<T> even though the two types have different
encodings by default.
Required Methods§
sourcefn encode_key_like(&self, borrowed: &Ref) -> Vec<u8>
fn encode_key_like(&self, borrowed: &Ref) -> Vec<u8>
Encodes a reference to Ref as if it were a reference to Target.