pub trait PaidAddressStore: Send + Sync {
// Required methods
fn contains(&self, store_key: &str, address: &str) -> bool;
fn record_success(&self, store_key: &str, address: &str);
fn has_used_nonce(&self, nonce: &str) -> bool;
fn record_nonce(&self, nonce: &str);
fn consume_nonce(&self, nonce: &str) -> bool;
}Available on crate features
server and siwx only.Expand description
Addresses that completed a successful settlement, plus consumed nonces.
Required Methods§
Sourcefn contains(&self, store_key: &str, address: &str) -> bool
fn contains(&self, store_key: &str, address: &str) -> bool
Whether address already paid for store_key.
Sourcefn record_success(&self, store_key: &str, address: &str)
fn record_success(&self, store_key: &str, address: &str)
Records a successful settlement. Failures and verifies are ignored.
Sourcefn has_used_nonce(&self, nonce: &str) -> bool
fn has_used_nonce(&self, nonce: &str) -> bool
Whether nonce is already in the used set.
Sourcefn record_nonce(&self, nonce: &str)
fn record_nonce(&self, nonce: &str)
Marks nonce as used. Idempotent.
Sourcefn consume_nonce(&self, nonce: &str) -> bool
fn consume_nonce(&self, nonce: &str) -> bool
Inserts nonce if absent. true means this caller consumed it.
Must be atomic. Callers must not delete a nonce after a failed consume (replay) or a later failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".