pub trait OffchainApiKey {
// Provided methods
fn fetch_api_key_for_request(key: &str) -> Result<String, &'static str> { ... }
fn do_fetch_local(key: &str) -> Option<String> { ... }
fn store_api_key(key: &str, value: &str) { ... }
}Expand description
A trait representing a way to fetch an API key for offchain calls.
Provided Methods§
Sourcefn fetch_api_key_for_request(key: &str) -> Result<String, &'static str>
fn fetch_api_key_for_request(key: &str) -> Result<String, &'static str>
Fetch the API key for a given key.
Sourcefn do_fetch_local(key: &str) -> Option<String>
fn do_fetch_local(key: &str) -> Option<String>
Fetch the raw key string from local offchain storage.
Sourcefn store_api_key(key: &str, value: &str)
fn store_api_key(key: &str, value: &str)
Store an API key in local offchain storage for a given key.
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.