mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-13 15:21:53 +01:00
18 lines
486 B
Cap'n Proto
18 lines
486 B
Cap'n Proto
|
@0xf6520578f143b471;
|
||
|
|
||
|
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`.
|
||
|
}
|