pub fn do_read<S: Storage, Q: Querier>(ctx: &mut Ctx, key_ptr: u32) -> VmResult<u32> {
    let key = read_region(ctx, key_ptr, MAX_LENGTH_DB_KEY)?;

    let (result, gas_info) =
        with_storage_from_context::<S, Q, _, _>(ctx, |store| Ok(store.get(&key)))?;
    process_gas_info::<S, Q>(ctx, gas_info)?;
    let value = result?;

    let out_data = match value {
        Some(data) => data,
        None => return Ok(0),
    };
    write_to_contract::<S, Q>(ctx, &out_data)
}
/// Reads a storage entry from the VM's storage into Wasm memory
Reads a storage entry from the VM's storage into Wasm memory
Reads a storage entry from the VM ' s storage into Wasm memory
pub fn do_read<S: Storage, Q: Querier>(ctx: &mut Ctx, key_ptr: u32) -> VmResult<u32> {
    let key = read_region(ctx, key_ptr, MAX_LENGTH_DB_KEY)?;
    let (result, gas_info) =
        with_storage_from_context::<S, Q, _, _>(ctx, |store| Ok(store.get(&key)))?;
    process_gas_info::<S, Q>(ctx, gas_info)?;
    let value = result?;
    let out_data = match value {
        Some(data) => data,
        None => return Ok(0),
    };
    write_to_contract::<S, Q>(ctx, &out_data)
}
pub fn do_read < S : Storage , Q : Querier > ( ctx : & mut Ctx , key_ptr : u32 ) -> VmResult < u32 > { let key = read_region ( ctx , key_ptr , MAX_LENGTH_DB_KEY ) ? ; let ( result , gas_info ) = with_storage_from_context :: < S , Q , _ , _ > ( ctx , | store | Ok ( store . get ( & key ) ) ) ? ; process_gas_info :: < S , Q > ( ctx , gas_info ) ? ; let value = result ? ; let out_data = match value { Some ( data ) => data , None => return Ok ( 0 ) , } ; write_to_contract :: < S , Q > ( ctx , & out_data ) }
Reads a storage entry from the VM's storage into Wasm memory
Reads a storage entry from the VM ' s storage into Wasm memory
ctx
&mut Ctx
key_ptr
u32
ctx
&mut Ctx
key_ptr
u32