pub trait ToEncodableKey: From<Self::KeyPair> {
type Key: EncodableItem + 'static + From<<Self::KeyPair as ToEncodableKey>::Key>;
type KeyPair: ToEncodableKey;
// Required methods
fn to_encodable_key(self) -> Self::Key;
fn from_encodable_key(key: Self::Key) -> Self;
}
Expand description
A key that can be converted to an EncodableItem
.
Required Associated Types§
Sourcetype Key: EncodableItem + 'static + From<<Self::KeyPair as ToEncodableKey>::Key>
type Key: EncodableItem + 'static + From<<Self::KeyPair as ToEncodableKey>::Key>
The key type this can be converted to/from.
Sourcetype KeyPair: ToEncodableKey
type KeyPair: ToEncodableKey
The KeyPair (secret+public) of which this key is a subset. For secret keys, this type is Self. For public keys, this type is the corresponding (secret) keypair.
The associated type constraint (where
) expresses the fact that a
public key is always derivable from its corresponding secret key.
Required Methods§
Sourcefn to_encodable_key(self) -> Self::Key
fn to_encodable_key(self) -> Self::Key
Convert this key to a type that implements EncodableItem
.
Sourcefn from_encodable_key(key: Self::Key) -> Self
fn from_encodable_key(key: Self::Key) -> Self
Convert an EncodableItem
to another key type.
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.