Enum sp_storage::ChildType
source · #[repr(u32)]pub enum ChildType {
ParentKeyId = 1,
}
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 = 1
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.
Trait Implementations§
source§impl PartialEq for ChildType
impl PartialEq for ChildType
impl Copy for ChildType
impl StructuralPartialEq for ChildType
Auto Trait Implementations§
impl Freeze for ChildType
impl RefUnwindSafe for ChildType
impl Send for ChildType
impl Sync for ChildType
impl Unpin for ChildType
impl UnwindSafe for ChildType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)