#[non_exhaustive]pub struct Multikey {
pub encoded: String,
pub key: Ed25519PublicKey,
}Expand description
A FEP-521a Multikey, pairing the decoded VerifyingKey
with the original base58-btc encoded string.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.encoded: StringThe original z<base58-btc> encoded string.
key: Ed25519PublicKeyDecoded Ed25519 public key.
Implementations§
Source§impl Multikey
impl Multikey
Sourcepub fn encode_ed25519(key: &Ed25519PublicKey) -> String
pub fn encode_ed25519(key: &Ed25519PublicKey) -> String
Encodes an Ed25519 public key as a z<base58-btc> Multikey string.
Sourcepub fn decode(encoded: &str) -> Result<Self, Error>
pub fn decode(encoded: &str) -> Result<Self, Error>
Decodes a Multikey string into its components.
§Errors
Returns Error::InvalidMultibase on bad multibase encoding,
Error::InvalidMultikeyPrefix when the varint prefix is missing,
Error::UnsupportedAlgorithm when the codec is not Ed25519,
and Error::InvalidMultikeyLength when the body is the wrong
length.
Trait Implementations§
impl Eq for Multikey
impl StructuralPartialEq for Multikey
Auto Trait Implementations§
impl Freeze for Multikey
impl RefUnwindSafe for Multikey
impl Send for Multikey
impl Sync for Multikey
impl Unpin for Multikey
impl UnsafeUnpin for Multikey
impl UnwindSafe for Multikey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.