Struct sp_storage::TrackedStorageKey
source · pub struct TrackedStorageKey {
pub key: Vec<u8>,
pub reads: u32,
pub writes: u32,
pub whitelisted: bool,
}
Expand description
Storage key with read/write tracking information.
Fields§
§key: Vec<u8>
§reads: u32
§writes: u32
§whitelisted: bool
Implementations§
source§impl TrackedStorageKey
impl TrackedStorageKey
sourcepub 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.
sourcepub 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.
Trait Implementations§
source§impl Clone for TrackedStorageKey
impl Clone for TrackedStorageKey
source§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 moresource§impl Debug for TrackedStorageKey
impl Debug for TrackedStorageKey
source§impl Decode for TrackedStorageKey
impl Decode for TrackedStorageKey
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from 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,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
source§impl Encode for TrackedStorageKey
impl Encode for TrackedStorageKey
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
§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.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl Hash for TrackedStorageKey
impl Hash for TrackedStorageKey
source§impl Ord for TrackedStorageKey
impl Ord for TrackedStorageKey
source§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
source§impl PartialEq<TrackedStorageKey> for TrackedStorageKey
impl PartialEq<TrackedStorageKey> for TrackedStorageKey
source§fn eq(&self, other: &TrackedStorageKey) -> bool
fn eq(&self, other: &TrackedStorageKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TrackedStorageKey> for TrackedStorageKey
impl PartialOrd<TrackedStorageKey> for TrackedStorageKey
source§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 moreimpl 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§
§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>
Decode
Self
and consume all of the given input data. Read more