|
2 | 2 | <ul> |
3 | 3 | <li>Imports: |
4 | 4 | <ul> |
5 | | -< li>interface < a href= "#wasi_keyvalue_store_0_2_0_draft2">< code>wasi:keyvalue/ [email protected]draft2</ code></ a></ li> |
6 | | -< li>interface < a href= "#wasi_keyvalue_atomics_0_2_0_draft2">< code>wasi:keyvalue/ [email protected]draft2</ code></ a></ li> |
7 | | -< li>interface < a href= "#wasi_keyvalue_batch_0_2_0_draft2">< code>wasi:keyvalue/ [email protected]draft2</ code></ a></ li> |
| 5 | +< li>interface < a href= "#wasi_keyvalue_store_0_2_0_draft3">< code>wasi:keyvalue/ [email protected]draft3</ code></ a></ li> |
| 6 | +< li>interface < a href= "#wasi_keyvalue_atomics_0_2_0_draft3">< code>wasi:keyvalue/ [email protected]draft3</ code></ a></ li> |
| 7 | +< li>interface < a href= "#wasi_keyvalue_batch_0_2_0_draft3">< code>wasi:keyvalue/ [email protected]draft3</ code></ a></ li> |
8 | 8 | </ul> |
9 | 9 | </li> |
10 | 10 | <li>Exports: |
11 | 11 | <ul> |
12 | | -< li>interface < a href= "#wasi_keyvalue_watcher_0_2_0_draft2">< code>wasi:keyvalue/ [email protected]draft2</ code></ a></ li> |
| 12 | +< li>interface < a href= "#wasi_keyvalue_watcher_0_2_0_draft3">< code>wasi:keyvalue/ [email protected]draft3</ code></ a></ li> |
13 | 13 | </ul> |
14 | 14 | </li> |
15 | 15 | </ul> |
16 | | -< h2>< a id= "wasi_keyvalue_store_0_2_0_draft2"></ a>Import interface wasi:keyvalue/ [email protected]draft2</ h2> |
| 16 | +< h2>< a id= "wasi_keyvalue_store_0_2_0_draft3"></ a>Import interface wasi:keyvalue/ [email protected]draft3</ h2> |
17 | 17 | <p>A keyvalue interface that provides eventually consistent key-value operations.</p> |
18 | 18 | <p>Each of these operations acts on a single key-value pair.</p> |
19 | 19 | <p>The value in the key-value pair is defined as a <code>u8</code> byte array and the intention is that it is |
@@ -176,7 +176,7 @@ for more information.</p> |
176 | 176 | <ul> |
177 | 177 | <li><a id="method_bucket_list_keys.0"></a> result<<a href="#key_response"><a href="#key_response"><code>key-response</code></a></a>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
178 | 178 | </ul> |
179 | | -< h2>< a id= "wasi_keyvalue_atomics_0_2_0_draft2"></ a>Import interface wasi:keyvalue/ [email protected]draft2</ h2> |
| 179 | +< h2>< a id= "wasi_keyvalue_atomics_0_2_0_draft3"></ a>Import interface wasi:keyvalue/ [email protected]draft3</ h2> |
180 | 180 | <p>A keyvalue interface that provides atomic operations.</p> |
181 | 181 | <p>Atomic operations are single, indivisible operations. When a fault causes an atomic operation to |
182 | 182 | fail, it will appear to the invoker of the atomic operation that the action either completed |
@@ -224,16 +224,17 @@ latest version or transaction. |
224 | 224 | <ul> |
225 | 225 | <li><a id="static_cas_new.0"></a> result<own<<a href="#cas"><a href="#cas"><code>cas</code></a></a>>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
226 | 226 | </ul> |
227 | | -<h4><a id="method_cas_current"></a><code>[method]cas.current: func</code></h4> |
228 | | -<p>Get the current value of the key (if it exists). This allows for avoiding reads if all |
229 | | -that is needed to ensure the atomicity of the operation</p> |
| 227 | +<h4><a id="static_cas_new_with_read"></a><code>[static]cas.new_with_read: func</code></h4> |
| 228 | +<p>Construct a new CAS operation returning the current value. Implementors can map the underlying functionality |
| 229 | +(transactions, versions, etc) as desired.</p> |
230 | 230 | <h5>Params</h5> |
231 | 231 | <ul> |
232 | | -<li><a id="method_cas_current.self"></a><code>self</code>: borrow<<a href="#cas"><a href="#cas"><code>cas</code></a></a>></li> |
| 232 | +<li><a id="static_cas_new_with_read.bucket"></a><a href="#bucket"><code>bucket</code></a>: borrow<<a href="#bucket"><a href="#bucket"><code>bucket</code></a></a>></li> |
| 233 | +<li><a id="static_cas_new_with_read.key"></a><code>key</code>: <code>string</code></li> |
233 | 234 | </ul> |
234 | 235 | <h5>Return values</h5> |
235 | 236 | <ul> |
236 | | -<li><a id="method_cas_current.0"></a> result<option<list<<code>u8</code>>>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
| 237 | +<li><a id="static_cas_new_with_read.0"></a> result<own<<a href="#cas"><a href="#cas"><code>cas</code></a></a>>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
237 | 238 | </ul> |
238 | 239 | <h4><a id="increment"></a><code>increment: func</code></h4> |
239 | 240 | <p>Atomically increment the value associated with the key in the store by the given delta. It |
@@ -263,7 +264,7 @@ the CAS operation failed.</p> |
263 | 264 | <ul> |
264 | 265 | <li><a id="swap.0"></a> result<_, <a href="#cas_error"><a href="#cas_error"><code>cas-error</code></a></a>></li> |
265 | 266 | </ul> |
266 | | -< h2>< a id= "wasi_keyvalue_batch_0_2_0_draft2"></ a>Import interface wasi:keyvalue/ [email protected]draft2</ h2> |
| 267 | +< h2>< a id= "wasi_keyvalue_batch_0_2_0_draft3"></ a>Import interface wasi:keyvalue/ [email protected]draft3</ h2> |
267 | 268 | <p>A keyvalue interface that provides batch operations.</p> |
268 | 269 | <p>A batch operation is an operation that operates on multiple keys at once.</p> |
269 | 270 | <p>Batch operations are useful for reducing network round-trip time. For example, if you want to |
@@ -342,7 +343,7 @@ fail.</p> |
342 | 343 | <ul> |
343 | 344 | <li><a id="delete_many.0"></a> result<_, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
344 | 345 | </ul> |
345 | | -< h2>< a id= "wasi_keyvalue_watcher_0_2_0_draft2"></ a>Export interface wasi:keyvalue/ [email protected]draft2</ h2> |
| 346 | +< h2>< a id= "wasi_keyvalue_watcher_0_2_0_draft3"></ a>Export interface wasi:keyvalue/ [email protected]draft3</ h2> |
346 | 347 | <hr /> |
347 | 348 | <h3>Types</h3> |
348 | 349 | <h4><a id="bucket"></a><code>type bucket</code></h4> |
|
0 commit comments