[−][src]Function rust_storage_interface_library::ssvm_storage::store::store
pub fn store<V: Clone + Serialize>(v: V) -> i32
Store String
ⓘThis example is not tested
let my_string = String::from("A string to store"); let storage_key: i32 = ssvm_storage::store::store(my_string);
Store Struct
Please note, you must implement the serde features as show below. For example the Default feature is used when re-loading this data back from storage.
ⓘThis example is not tested
#[derive(Serialize, Deserialize, PartialEq, Debug, Default)] struct TestStruct { a_vec: Vec<u8>, a_i32: i32, a_u8: u8, a_bool: bool, }