2024-03-01 15:39:30 +01:00
|
|
|
@0xf6520578f143b471;
|
|
|
|
|
2024-03-27 19:43:37 +01:00
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
|
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
|
2024-03-01 15:39:30 +01:00
|
|
|
using import "utils.capnp".UUID;
|
|
|
|
|
|
|
|
struct Cache(Value) {
|
|
|
|
id @0 :UUID;
|
|
|
|
key @1 :Data;
|
|
|
|
value @2 :Cacheable(Value);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Cacheable(Value) {
|
|
|
|
get @0 () -> (key :Data, value :Value);
|
|
|
|
# Access the cached value. This returns both the value and the associated
|
|
|
|
# key. A consumer MUST use the Key returned here instead of the one stored
|
|
|
|
# in `Cache`, as it might have changed between being sent the `Cache`
|
|
|
|
# struct and calling `get`.
|
|
|
|
}
|