OpaqueKeys

Trait OpaqueKeys 

Source
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: Decode>(&self, i: KeyTypeId) -> Option<T> { ... }
}
Expand description

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

Required Associated Types§

Source

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§

Source

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

Return the key-type IDs supported by this set.

Source

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

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

Source

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

Proof the ownership of owner over the keys using proof.

Provided Methods§

Source

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

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§