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.
source§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
source§impl Encode for TrackedStorageKey
impl Encode for TrackedStorageKey
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 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.
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
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 for TrackedStorageKey
impl PartialEq 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 for TrackedStorageKey
impl PartialOrd 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 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> 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