mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
V15 Metadata: Support accessing custom types (#1106)
* work in progress * add custom types access * nit * custom values client * adjust light client * adjust doc comments * adjust book for custom values in code gen * format and check docs * use ignore in docs in book
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
use crate::dynamic::DecodedValueThunk;
|
||||
use crate::metadata::DecodeWithMetadata;
|
||||
|
||||
/// This represents the address of a custom value in in the metadata.
|
||||
/// Anything, that implements the [CustomValueAddress] trait can be used, to fetch
|
||||
/// custom values from the metadata.
|
||||
pub trait CustomValueAddress {
|
||||
/// The type of the custom value.
|
||||
type Target: DecodeWithMetadata;
|
||||
|
||||
/// the name (key) by which the custom value can be accessed in the metadata.
|
||||
fn name(&self) -> &str;
|
||||
}
|
||||
|
||||
impl CustomValueAddress for str {
|
||||
type Target = DecodedValueThunk;
|
||||
|
||||
fn name(&self) -> &str {
|
||||
self
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user