referrerpolicy=no-referrer-when-downgrade

OpaqueKeys

Trait OpaqueKeys 

pub trait OpaqueKeys: Clone {
    type KeyTypeIdProviders;

    // Required methods
    fn key_ids() -> &'static [KeyTypeId];
    fn get_raw(&self, i: KeyTypeId) -> &[u8] ;
    fn ownership_proof_is_valid(&self, owner: &[u8], proof: &[u8]) -> bool;

    // Provided method
    fn get<T>(&self, i: KeyTypeId) -> Option<T>
       where T: Decode { ... }
}
Expand description

Opaque data type that may be destructured into a series of raw byte slices (which represent individual keys).

Required Associated Types§

type KeyTypeIdProviders

The types that are bound to the KeyTypeIds.

They can be seen as the ones working with the keys associated to the KeyTypeIds.

Required Methods§

fn key_ids() -> &'static [KeyTypeId]

Return the key-type IDs supported by this set.

fn get_raw(&self, i: KeyTypeId) -> &[u8]

Get the raw bytes of key with key-type ID i.

fn ownership_proof_is_valid(&self, owner: &[u8], proof: &[u8]) -> bool

Proof the ownership of owner over the keys using proof.

Provided Methods§

fn get<T>(&self, i: KeyTypeId) -> Option<T>
where T: Decode,

Get the decoded key with key-type ID i.

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.

Implementors§

§

impl OpaqueKeys for UintAuthorityId