1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Storage flags: the locks a transaction requests for the keys it writes.
//!
//! A key's flags belong to the transaction's pending write to that key, not to
//! any single write. Writes never change them: [`set_storage_flags`] adds
//! flags and [`clear_storage_flags`] removes them all. `ExclusiveLock` is the
//! only flag today.
//!
//! Flags follow frames: changes made in a frame that aborts are discarded with
//! that frame's writes.
//!
//! These routines are thin wrappers around VM syscalls. They return
//! [`Result<T, E>`](core::result::Result) where `E` is a
//! [`SysErr`](crate::sys::SysErr) containing an error code in the case of a
//! syscall failure. The syscalls carry flags as the unsigned
//! [`StorageDeltaFlagSet`]; these wrappers convert to and from
//! [`StorageDeltaFlags`] without changing the bits.
use crate;
use crateStorageKey;
use ;
/// Returns the flags the current transaction requests for `key`, as seen by
/// the current call frame. A key with no pending write has none.
/// Adds `flags` (a bitwise OR) to the flags the current transaction requests
/// for `key`.
///
/// A write to `key` must be pending in the current call frame: one made
/// earlier in this frame, or one inherited from a caller or a successful
/// callee. A pending deletion qualifies; a value that only exists from an
/// earlier block does not. Otherwise, or if `flags` holds an unknown flag,
/// this returns
/// [`kSyscallErrorCodeInvalidSyscallInput`](sys::SyscallErrorCode::kSyscallErrorCodeInvalidSyscallInput).
/// Removes every flag the current transaction requests for `key`, as seen by
/// the current call frame. Does nothing if no write to `key` is pending.