Enum sp_core::offchain::StorageKind
source · #[repr(C)]
pub enum StorageKind {
PERSISTENT,
LOCAL,
}
Expand description
A type of supported crypto.
Variants§
PERSISTENT
Persistent storage is non-revertible and not fork-aware. It means that any value
set by the offchain worker triggered at block N(hash1)
is persisted even
if that block is reverted as non-canonical and is available for the worker
that is re-run at block N(hash2)
.
This storage can be used by offchain workers to handle forks
and coordinate offchain workers running on different forks.
LOCAL
Local storage is revertible and fork-aware. It means that any value
set by the offchain worker triggered at block N(hash1)
is reverted
if that block is reverted as non-canonical and is NOT available for the worker
that is re-run at block N(hash2)
.
Trait Implementations§
source§impl Clone for StorageKind
impl Clone for StorageKind
source§fn clone(&self) -> StorageKind
fn clone(&self) -> StorageKind
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 StorageKind
impl Debug for StorageKind
source§impl Decode for StorageKind
impl Decode for StorageKind
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<'de> Deserialize<'de> for StorageKind
impl<'de> Deserialize<'de> for StorageKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for StorageKind
impl Encode for StorageKind
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 From<StorageKind> for u32
impl From<StorageKind> for u32
source§fn from(c: StorageKind) -> Self
fn from(c: StorageKind) -> Self
Converts to this type from the input type.
source§impl From<StorageKind> for u8
impl From<StorageKind> for u8
source§fn from(var: StorageKind) -> u8
fn from(var: StorageKind) -> u8
Converts to this type from the input type.
source§impl PartialEq<StorageKind> for StorageKind
impl PartialEq<StorageKind> for StorageKind
source§fn eq(&self, other: &StorageKind) -> bool
fn eq(&self, other: &StorageKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PassBy for StorageKind
impl PassBy for StorageKind
§type PassBy = Enum<StorageKind>
type PassBy = Enum<StorageKind>
The strategy that should be used to pass the type.
source§impl Serialize for StorageKind
impl Serialize for StorageKind
source§impl TryFrom<u32> for StorageKind
impl TryFrom<u32> for StorageKind
source§impl TryFrom<u8> for StorageKind
impl TryFrom<u8> for StorageKind
impl Copy for StorageKind
impl EncodeLike<StorageKind> for StorageKind
impl Eq for StorageKind
impl StructuralEq for StorageKind
impl StructuralPartialEq for StorageKind
Auto Trait Implementations§
impl RefUnwindSafe for StorageKind
impl Send for StorageKind
impl Sync for StorageKind
impl Unpin for StorageKind
impl UnwindSafe for StorageKind
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§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
source§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.source§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>
source§impl<T> IntoFFIValue for Twhere
T: PassBy,
impl<T> IntoFFIValue for Twhere T: PassBy,
source§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> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
source§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
.