Struct cw_storage_plus::Map[][src]

pub struct Map<'a, K, T> { /* fields omitted */ }

Implementations

load will return an error if no data is set at the given key, or on parse error

may_load will parse the data stored at the key if present, returns Ok(None) if no data there. returns an error on issues parsing

has returns true or false if any data is at this key, without parsing or interpreting the contents.

Loads the data, perform the specified action, and store the result in the database. This is shorthand for some common sequences, which may be useful.

If the data exists, action(Some(value)) is called. Otherwise action(None) is called.

If you import the proper Map from the remote contract, this will let you read the data from a remote contract in a type-safe way using WasmQuery::RawQuery

while range assumes you set the prefix to one element and call range over the last one, prefix_range accepts bounds for the lowest and highest elements of the Prefix we wish to accept, and iterates over those. There are some issues that distinguish these to and blindly casting to Vec doesn’t solve them.

while range_de assumes you set the prefix to one element and call range over the last one, prefix_range_de accepts bounds for the lowest and highest elements of the Prefix we wish to accept, and iterates over those. There are some issues that distinguish these to and blindly casting to Vec doesn’t solve them.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.