Schema
Use this reference to inspect fields, methods, accepted values and failure outcomes. For setup and working examples, start with the API guide.
Definition: abstraction.storage.lend
Service Lending [DEF-S1]
Storage lending implemented by a provider and mediated by the runtime. The provider listens on the shared identity-bound transport and admits designated runtime executables of its own account. A call whose peer identity could not be obtained fails with caller_unavailable; insufficient program proof fails with identity_required; another account or program reads not_permitted. The runtime decides the application caller's right before forwarding. Providers keep a ledger of their placements and preserve source files. Symbolic and hard links require no model-byte reads; an explicitly requested copy reads the source bytes.
Wire identity: abstraction.storage/lend@1
Handler error codes, declared by lending_error_codes: caller_unavailable, identity_required. Generated bindings name each as a ServiceErrorCode member beside the dispatcher's own codes.
Frames carry version, service, method and typed arguments. Transport owns framing, associated exchanges, deadlines and connections. Unknown version/service/method and malformed arguments are rejected before invoking a handler. One-way WriteFrame success means local submission, not remote acceptance or persistence.
Request-response methods use ExchangeFrame. Replies carry version, service, method, ok and payload; success payload contains typed value (or an empty object for void). Error payload contains nonempty code and message, which may be empty. ServiceError preserves unknown codes. Unexpected handler failures become handler_error without private details; invalid results become invalid_result. Clients validate reply identity and result before exposing it. A malformed frame or transport failure remains a local error; the transport must associate each response with its exchange. C++ dispatchers are pure protocol bindings, not listening servers.
Place the named object in the engine's own directory by link, so that engine serves it. store and object are the inventory's naming: object is a manifest id, the name the store gives that manifest, or an object locator, and never a path. engine is a declared host name this provider supports. copy true asks for a copy where a link cannot be made and is counted as a copy; false refuses with link_refused instead. Gated by abstraction.storage/lend on resource engine:<name>, admitted through the runtime's first-use question. An object this provider's stores do not hold is unknown_object; an engine it does not support, or one whose own configuration cannot be pointed at the lent directory without a person editing its configuration file, is unsupported_engine; a link neither the operating system nor the volume allows is link_refused; an object already lent to that engine is already_lent with the entry in force. The original is never moved, renamed or deleted.
Lend
request-response LendResult
- Argument 1:
string store (required, including zero/false/empty)
- Argument 2:
string object (required, including zero/false/empty)
- Argument 3:
string engine (required, including zero/false/empty)
- Argument 4:
bool copy (required, including zero/false/empty)
Remove exactly the link this entry created and the directories this provider made for it, and drop the entry. The source file is untouched. Gated by abstraction.storage/lend on the entry's own engine:<name>. The engine's own list may keep naming the model until that engine's idle-unload timer fires; the ledger is the answer to whether the lend is in force.
Unlend
request-response UnlendResult
- Argument 1:
string entry (required, including zero/false/empty)
The ledger. limit is 1..256. Continuations are at most 256 bytes and name a retained page position; an unknown one is invalid.
Lends
request-response LendPage
- Argument 1:
string continuation (required, including zero/false/empty)
- Argument 2:
i64 limit (required, including zero/false/empty)
Encoding [DEF-E1]
| setting | value | rule |
escape | minimal | [DEF-E2] |
indent | 2 | [DEF-E3] |
map_keys | utf8-bytes | [DEF-E4] |
numbers | integer-decimal | [DEF-E5] |
opaque | verbatim | [DEF-E6] |
terminator | newline | [DEF-E7] |
duplicate_keys | refuse | [DEF-E8] |
depth_limit | 64 | [DEF-E9] |
Types
| kind | types |
| built in | LendOutcome LendsOutcome Link UnlendOutcome bool i64 string |
| declared below | Lend |
| repeated record [DEF-A9] | list<Lend> |
Named types [DEF-T2]
One spelling is written [DEF-G2] and a wider set is read [DEF-G1]; the width between them is the interoperability guarantee.
| name | is | written | read |
timestamp | string | rfc3339-micros | rfc3339-wide |
Structs [DEF-T1]
A field is required, or says when it is omitted [DEF-A4]. Each struct says on its own what it does with a field name it has never heard of [DEF-A7]. A wire name never moves; where a language must spell it differently the field says so [DEF-A2].
Lend
unknown fields refuse
| id | field | type | presence | named elsewhere |
| 1 | id | string | required | — |
| 2 | engine | string | required | — |
| 3 | store | string | required | — |
| 4 | object | string | required | — |
| 5 | name | string | required | — |
| 6 | link | string | required | — |
| 7 | kind | Link | required | — |
| 8 | size | i64 | required | — |
| 9 | created | timestamp | required | — |
LendResult
the document [DEF-A1] · unknown fields refuse
| id | field | type | presence | named elsewhere |
| 1 | outcome | LendOutcome | required | — |
| 2 | lend | Lend | optional · omitted when absent | — |
| 3 | detail | string | required | — |
UnlendResult
unknown fields refuse
| id | field | type | presence | named elsewhere |
| 1 | outcome | UnlendOutcome | required | — |
| 2 | detail | string | required | — |
LendPage
unknown fields refuse
| id | field | type | presence | named elsewhere |
| 1 | outcome | LendsOutcome | required | — |
| 2 | lends | list<Lend> | required | — |
| 3 | continuation | string | required | — |
| 4 | complete | bool | required | — |
Enumerations [DEF-T5]
Enum fields carry JSON strings containing exact member wire spellings, never numeric IDs. Unknown names are preserved with grant and refused as bad_enum with refuse on read and write. Optional absent fields preserve presence separately from an empty string.
An enumeration is a closed vocabulary of wire names, and each one says on its own what a reader does with a member it has never heard of [DEF-A5].
Link
a member this reader does not know is refuse
| id | member | wire |
| 1 | symbolic | symbolic |
| 2 | hard | hard |
| 3 | copy | copy |
LendOutcome
a member this reader does not know is refuse
| id | member | wire |
| 1 | lent | lent |
| 2 | not_permitted | not_permitted |
| 3 | unsupported_engine | unsupported_engine |
| 4 | link_refused | link_refused |
| 5 | already_lent | already_lent |
| 6 | unknown_object | unknown_object |
| 7 | invalid | invalid |
| 8 | unavailable | unavailable |
UnlendOutcome
a member this reader does not know is refuse
| id | member | wire |
| 1 | unlent | unlent |
| 2 | not_permitted | not_permitted |
| 3 | unknown | unknown |
| 4 | invalid | invalid |
| 5 | unavailable | unavailable |
LendsOutcome
a member this reader does not know is refuse
| id | member | wire |
| 1 | page | page |
| 2 | not_permitted | not_permitted |
| 3 | invalid | invalid |
| 4 | unavailable | unavailable |
Constants [DEF-A6]
| name | type | value |
lending_error_codes | list<string> | caller_unavailable, identity_required |
Refusal words [DEF-R1]
| order | word | stage |
| 1 | malformed | grammar |
| 2 | bad_string | grammar |
| 3 | number_spelling | grammar |
| 4 | wrong_type | grammar |
| 5 | bad_timestamp | grammar |
| 6 | depth_exceeded | grammar |
| 7 | duplicate_key | grammar |
| 8 | duplicate_field | structure |
| 9 | unknown_field | structure |
| 10 | missing_field | structure |
| 11 | bad_enum | structure |
| 12 | trailing_bytes | document |