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
51
//! Out-of-transaction range destruction: the optional backend capability that
//! drops a whole key range in one call instead of one write per key.
use Any;
use Range;
use Pin;
use Arc;
use Result;
use crateKey;
/// Boxed future returned by the capability, so the trait stays object-safe.
type BoxFut<'a, T> = ;
/// A backend's ability to drop every version of every key in a half-open range
/// **outside** any transaction.
///
/// Contract on the caller: the range must already be logically unreachable —
/// typically because a committed transaction removed the catalog entry that
/// named it — because the destruction bypasses MVCC and is invisible to
/// conflict detection. A transaction whose snapshot predates the destruction
/// can see the keys vanish, and a transaction that read a key inside the range
/// can still commit, because nothing here enters any transaction's read or
/// write tracking.
///
/// Contract on the implementor: idempotent, so a repeat call on an
/// already-empty range succeeds; and **not** atomic across the range, so a
/// failed call may leave the range partly destroyed and must be safe to repeat.
/// `expunge` semantics do not apply — every version in the range goes,
/// whichever way the caller asked for the keys to be removed.
///
/// A backend offers this only while it can actually perform it. Resolving the
/// capability and getting nothing back is the signal to fall back to a
/// transactional delete; it is never reported as a successful destruction.
/// The [`crate::TransactionBuilder::extension`] key under which a backend
/// publishes its [`DestroyRange`] implementation.
///
/// The newtype is what makes the capability recoverable: `Arc<dyn Any>`
/// downcasts only to a sized type, so a trait object cannot be recovered
/// directly and has to travel inside one.
;