Struct frame_support::traits::TrackedStorageKey  
pub struct TrackedStorageKey {
    pub key: Vec<u8, Global>,
    pub reads: u32,
    pub writes: u32,
    pub whitelisted: bool,
}Expand description
Storage key with read/write tracking information.
Fields§
§key: Vec<u8, Global>§reads: u32§writes: u32§whitelisted: boolImplementations§
§impl TrackedStorageKey
 
impl TrackedStorageKey
pub fn new(key: Vec<u8, Global>) -> TrackedStorageKey
pub fn new(key: Vec<u8, Global>) -> TrackedStorageKey
Create a default TrackedStorageKey
pub fn has_been_read(&self) -> bool
pub fn has_been_read(&self) -> bool
Check if this key has been “read”, i.e. it exists in the memory overlay.
Can be true if the key has been read, has been written to, or has been whitelisted.
pub fn has_been_written(&self) -> bool
pub fn has_been_written(&self) -> bool
Check if this key has been “written”, i.e. a new value will be committed to the database.
Can be true if the key has been written to, or has been whitelisted.
pub fn add_read(&mut self)
pub fn add_read(&mut self)
Add a storage read to this key.
pub fn add_write(&mut self)
pub fn add_write(&mut self)
Add a storage write to this key.
pub fn whitelist(&mut self)
pub fn whitelist(&mut self)
Whitelist this key.
Trait Implementations§
§impl Clone for TrackedStorageKey
 
impl Clone for TrackedStorageKey
§fn clone(&self) -> TrackedStorageKey
 
fn clone(&self) -> TrackedStorageKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read more§impl Debug for TrackedStorageKey
 
impl Debug for TrackedStorageKey
§impl Decode for TrackedStorageKey
 
impl Decode for TrackedStorageKey
§fn decode<__CodecInputEdqy>(
    __codec_input_edqy: &mut __CodecInputEdqy
) -> Result<TrackedStorageKey, Error>where
    __CodecInputEdqy: Input,
 
fn decode<__CodecInputEdqy>(
    __codec_input_edqy: &mut __CodecInputEdqy
) -> Result<TrackedStorageKey, Error>where
    __CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§impl Encode for TrackedStorageKey
 
impl Encode for TrackedStorageKey
§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,
Convert self to a slice and append it to the destination.
source§fn size_hint(&self) -> usize
 
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§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,
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
 
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
§impl Hash for TrackedStorageKey
 
impl Hash for TrackedStorageKey
§impl Ord for TrackedStorageKey
 
impl Ord for TrackedStorageKey
§fn cmp(&self, other: &TrackedStorageKey) -> Ordering
 
fn cmp(&self, other: &TrackedStorageKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
§impl PartialEq<TrackedStorageKey> for TrackedStorageKey
 
impl PartialEq<TrackedStorageKey> for TrackedStorageKey
§fn eq(&self, other: &TrackedStorageKey) -> bool
 
fn eq(&self, other: &TrackedStorageKey) -> bool
§impl PartialOrd<TrackedStorageKey> for TrackedStorageKey
 
impl PartialOrd<TrackedStorageKey> for TrackedStorageKey
§fn partial_cmp(&self, other: &TrackedStorageKey) -> Option<Ordering>
 
fn partial_cmp(&self, other: &TrackedStorageKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read more§impl PassBy for TrackedStorageKey
 
impl PassBy for TrackedStorageKey
§type PassBy = Codec<TrackedStorageKey>
 
type PassBy = Codec<TrackedStorageKey>
The strategy that should be used to pass the type.
impl EncodeLike<TrackedStorageKey> for TrackedStorageKey
impl Eq for TrackedStorageKey
impl StructuralEq for TrackedStorageKey
impl StructuralPartialEq for TrackedStorageKey
Auto Trait Implementations§
impl RefUnwindSafe for TrackedStorageKey
impl Send for TrackedStorageKey
impl Sync for TrackedStorageKey
impl Unpin for TrackedStorageKey
impl UnwindSafe for TrackedStorageKey
Blanket Implementations§
source§impl<T> CheckedConversion for T
 
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
    T: Decode,
 
impl<T> DecodeLimit for Twhere
    T: Decode,
§impl<T> Downcast for Twhere
    T: Any,
 
impl<T> Downcast for Twhere
    T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
 
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert 
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
 
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert 
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more§fn as_any(&self) -> &(dyn Any + 'static)
 
fn as_any(&self) -> &(dyn Any + 'static)
Convert 
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
 
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert 
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moresource§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
Compare self to 
key and return true if they are equal.§impl<T> FromFFIValue for Twhere
    T: PassBy,
 
impl<T> FromFFIValue for Twhere
    T: PassBy,
§type SelfInstance = T
 
type SelfInstance = T
As 
Self can be an unsized type, it needs to be represented by a sized type at the host.
This SelfInstance is the sized type. Read more§fn from_ffi_value(
    context: &mut dyn FunctionContext,
    arg: <<T as PassBy>::PassBy as RIType>::FFIType
) -> Result<T, String>
 
fn from_ffi_value(
    context: &mut dyn FunctionContext,
    arg: <<T as PassBy>::PassBy as RIType>::FFIType
) -> Result<T, String>
Create 
SelfInstance from the givensource§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>
§impl<T> IntoFFIValue for Twhere
    T: PassBy,
 
impl<T> IntoFFIValue for Twhere
    T: PassBy,
§fn into_ffi_value(
    self,
    context: &mut dyn FunctionContext
) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
 
fn into_ffi_value(
    self,
    context: &mut dyn FunctionContext
) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
Convert 
self into a ffi value.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> RIType for Twhere
    T: PassBy,
 
impl<T> RIType for Twhere
    T: PassBy,
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>,
Consume self to return an equivalent value of 
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
The counterpart to 
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
Consume self to return an equivalent value of 
T.