Enum sp_storage::ChildType
source · #[repr(u32)]
pub enum ChildType {
ParentKeyId,
}
Expand description
Type of child. It does not strictly define different child type, it can also be related to technical consideration or api variant.
Variants§
ParentKeyId
If runtime module ensures that the child key is a unique id that will only be used once, its parent key is used as a child trie unique id.
Implementations§
source§impl ChildType
impl ChildType
sourcepub fn new(repr: u32) -> Option<ChildType>
pub fn new(repr: u32) -> Option<ChildType>
Try to get a child type from its u32
representation.
sourcepub fn from_prefixed_key<'a>(
storage_key: &'a PrefixedStorageKey
) -> Option<(Self, &'a [u8])>
pub fn from_prefixed_key<'a>( storage_key: &'a PrefixedStorageKey ) -> Option<(Self, &'a [u8])>
Transform a prefixed key into a tuple of the child type and the unprefixed representation of the key.
sourcepub fn parent_prefix(&self) -> &'static [u8] ⓘ
pub fn parent_prefix(&self) -> &'static [u8] ⓘ
Returns the location reserved for this child trie in their parent trie if there is one.