Enum sc_client_api::ChildInfo
source · pub enum ChildInfo {
ParentKeyId(ChildTrieParentKeyId),
}
Expand description
Information related to a child state.
Variants§
ParentKeyId(ChildTrieParentKeyId)
This is the one used by default.
Implementations§
source§impl ChildInfo
impl ChildInfo
sourcepub fn new_default(storage_key: &[u8]) -> ChildInfo
pub fn new_default(storage_key: &[u8]) -> ChildInfo
Instantiates child information for a default child trie
of kind ChildType::ParentKeyId
, using an unprefixed parent
storage key.
sourcepub fn new_default_from_vec(storage_key: Vec<u8, Global>) -> ChildInfo
pub fn new_default_from_vec(storage_key: Vec<u8, Global>) -> ChildInfo
Same as new_default
but with Vec<u8>
as input.
sourcepub fn try_update(&mut self, other: &ChildInfo) -> bool
pub fn try_update(&mut self, other: &ChildInfo) -> bool
Try to update with another instance, return false if both instance are not compatible.
sourcepub fn keyspace(&self) -> &[u8] ⓘ
pub fn keyspace(&self) -> &[u8] ⓘ
Returns byte sequence (keyspace) that can be use by underlying db to isolate keys.
This is a unique id of the child trie. The collision resistance of this value
depends on the type of child info use. For ChildInfo::Default
it is and need to be.
sourcepub fn storage_key(&self) -> &[u8] ⓘ
pub fn storage_key(&self) -> &[u8] ⓘ
Returns a reference to the location in the direct parent of this trie but without the common prefix for this kind of child trie.
sourcepub fn prefixed_storage_key(&self) -> PrefixedStorageKey
pub fn prefixed_storage_key(&self) -> PrefixedStorageKey
Return a the full location in the direct parent of this trie.
sourcepub fn into_prefixed_storage_key(self) -> PrefixedStorageKey
pub fn into_prefixed_storage_key(self) -> PrefixedStorageKey
Returns a the full location in the direct parent of this trie.
sourcepub fn child_type(&self) -> ChildType
pub fn child_type(&self) -> ChildType
Returns the type for this child info.
Trait Implementations§
source§impl Decode for ChildInfo
impl Decode for ChildInfo
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<ChildInfo, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<ChildInfo, Error>where __CodecInputEdqy: Input,
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl Encode for ChildInfo
impl Encode for ChildInfo
source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )where __CodecOutputEdqy: Output + ?Sized,
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl Ord for ChildInfo
impl Ord for ChildInfo
source§impl PartialEq<ChildInfo> for ChildInfo
impl PartialEq<ChildInfo> for ChildInfo
source§impl PartialOrd<ChildInfo> for ChildInfo
impl PartialOrd<ChildInfo> for ChildInfo
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl EncodeLike<ChildInfo> for ChildInfo
impl Eq for ChildInfo
impl StructuralEq for ChildInfo
impl StructuralPartialEq for ChildInfo
Auto Trait Implementations§
impl RefUnwindSafe for ChildInfo
impl Send for ChildInfo
impl Sync for ChildInfo
impl Unpin for ChildInfo
impl UnwindSafe for ChildInfo
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.