#[repr(u32)]pub enum StoreMode {
Sync = 0,
Async = 1,
}Expand description
Is this store sync or async?
Variants§
Sync = 0
All the store methods are sync. Upon creation, there’s an initial refresh of all the keys and values, spawned in the background. The first method call will block on this initial refresh being done.
As a matter of fact, this will fetch all the values, which can be quite slow for large
stores. It is recommended to only use this for small stores, and to request open them
as soon as possible in the applet’s life cycle, e.g. in the ark_initialize
entrypoint.
Individual values are expected to be obtained through immediate_get.
Using async_get on such a store will work fine, but add unnecessary overhead in terms
of performance and it will be more tedious.
Async = 1
The store provides an async get method, and all other methods are sync. Upon
creation, there’s an initial refresh of all the keys only, spawned in the background.
The first method call will block on this initial refresh being done.
Individual values are expected to be obtained through async_get. Using
immediate_get on such a store will block the main thread until the value is done
downloading.
Trait Implementations§
Source§impl CheckedBitPattern for StoreMode
impl CheckedBitPattern for StoreMode
Source§type Bits = u32
type Bits = u32
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
bits
as &Self.