enum KvErrorKind
Why a store operation failed.
Example:
use std.kv { KvErrorKind }
fn advice(k: KvErrorKind) -> str {
match k {
.Conflict => "retry the transaction"
.CrossShardTx => "keep the keys on one shard"
.Lagged => "scan again and re-open the watch"
.Other => "give up"
}
}
fn main() io {
print(advice(KvErrorKind.Conflict))
}Вывод
retry the transaction
pub(api) enum KvErrorKindС версии. 1.0.0-beta
Варианты
Conflict | A compare-and-set or a transaction validation failed: the data changed (the transaction was retried and kept failing). |
CrossShardTx | The keys of a batch or transaction live on different shards. |
Lagged | A watch fell behind the retained events; scan again and re-open the watch. |
Other | Any other failure. |
Определено в: std/kv/kv.oxl:87