storage__immediate_get

Function storage__immediate_get 

Source
pub unsafe extern "C" fn storage__immediate_get(
    store: StoreHandle,
    key_ptr: *const u8,
    key_len: u32,
    __ark_byte_size: *mut u32,
) -> ErrorCode
Expand description

Get the value of a key, for a store opened in StoreMode::Sync mode.

This is a fast call, as a sync store synchronizes all the data in real-time in the background.

Using this method with a store opened in StoreMode::Async mode will block the main thread, waiting for the value to be downloaded if it is not present in the local cache. It is recommended to use async_get for such stores.

ยงReturn

If a key is found, will return a vector filled with the entry encoded as plain bytes. If a key is not found, will fail with NotFound.