~/bend-docscommunity

capabilities.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.2/capabilities.bend as Capabilities

2 imports
import Base
import component.bend as Cmp

Types

type Read source · line 8 · raw

@-H:Type -> @-V:Data -> Type

Closed declaration bundles contain operations, never runtime-owned storage. Gameplay specializes field projections while threading one abstract owner. Component read capability: threads opaque owner H and returns Access<V>. V is detached Data; no affine payload owner or setter is exposed.

type Write source · line 13 · raw

@-H:Type -> @-C:Type -> @-V:Data -> Type

Component read/replacement capability. set consumes payload C and returns H; it does not itself return rejected C. The bound operation defines error recording and rollback. Raw constructors are trusted operation adapters.

type Bundle source · line 17 · raw

@-A:Type -> @-B:Type -> Type

Heterogeneous pair of grants for the same application capability shape. Contains operations, not live World storage; nest for additional grants.

type ValueRead source · line 21 · raw

@-H:Type -> @-V:Data -> Type

Read capability returning a detached Data value without component Access wrapping. The supplied operation defines missing-value representation.

type ValueWrite source · line 25 · raw

@-H:Type -> @-C:Type -> @-V:Data -> Type

Read/replace capability for a Data view V and potentially affine input C. set consumes C and returns H; no automatic refusal receipt is added here.

type Send source · line 29 · raw

@-H:Type -> @-C:Type -> Type

Publication capability consuming C and returning opaque H. The supplied operation determines staging/refusal/ownership; this wrapper adds no rollback.

type Action source · line 32 · raw

@-H:Type -> Type

No-argument operation capability threading one affine opaque owner H.

type Request source · line 36 · raw

@-H:Type -> @-C:Type -> @-V:Data -> Type

Operation capability consuming C and returning H plus detached Data V. Use OwnedRequest when the result must itself retain affine owners.

type OwnedRequest source · line 139 · raw

@-H:Type -> @-Input:Type -> @-Output:Type -> Type

Additive owned input/result capability; existing Data APIs are unchanged. Operation consuming an affine Input and returning H with affine Output. Operation-specific results can preserve refused payloads; the wrapper does not invent recovery or change their ownership semantics.

Templates

template first source · line 40 · raw

@-A:Type -> @-B:Type -> @cap:Bundle<A, B> -> A

Extract the first closed grant from a capability bundle, consuming it.

template second source · line 44 · raw

@-A:Type -> @-B:Type -> @cap:Bundle<A, B> -> B

Extract the second closed grant from a capability bundle, consuming it.

template read_field source · line 49 · raw

@-H:Type -> @-V:Data -> @cap:Read<H, V> -> @_:H -> Pair(H, 0xb2b0f04555daca474f0f77d0966945c9/component.Access<V>)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template write_read_field source · line 54 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @cap:Write<H, C, V> -> @_:H -> Pair(H, 0xb2b0f04555daca474f0f77d0966945c9/component.Access<V>)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template write_field source · line 59 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @cap:Write<H, C, V> -> @_:H -> @_:C -> H

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template read source · line 64 · raw

@-H:Type -> @-V:Data -> @-cap:Read<H, V> -> @ctx:H -> Pair(H, 0xb2b0f04555daca474f0f77d0966945c9/component.Access<V>)

Invoke a declared component read, returning the owner and Access<V>. No extra validation is added beyond the bound get operation.

template get source · line 68 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @-cap:Write<H, C, V> -> @ctx:H -> Pair(H, 0xb2b0f04555daca474f0f77d0966945c9/component.Access<V>)

Read the detached view through a write-capable component grant, returning H and Access<V>. Does not consume or expose the stored affine C.

template set source · line 73 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @-cap:Write<H, C, V> -> @ctx:H -> @value:C -> H

Invoke replacement with consumed C, returning the opaque owner. Refusal results are determined by the bound operation; rejected C is not returned by this signature. Canonical grants record errors for enclosing execution.

template value_read_field source · line 78 · raw

@-H:Type -> @-V:Data -> @cap:ValueRead<H, V> -> @_:H -> Pair(H, V)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template value_write_read_field source · line 83 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @cap:ValueWrite<H, C, V> -> @_:H -> Pair(H, V)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template value_write_field source · line 88 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @cap:ValueWrite<H, C, V> -> @_:H -> @_:C -> H

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template value_read source · line 92 · raw

@-H:Type -> @-V:Data -> @-cap:ValueRead<H, V> -> @ctx:H -> Pair(H, V)

Read detached V through ValueRead while returning its opaque owner.

template value_get source · line 95 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @-cap:ValueWrite<H, C, V> -> @ctx:H -> Pair(H, V)

Read detached V through ValueWrite without replacing its stored value.

template value_set source · line 99 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @-cap:ValueWrite<H, C, V> -> @ctx:H -> @value:C -> H

Consume replacement C through ValueWrite and return the opaque owner. The bound setter defines transaction/refusal behavior; this adds no receipt.

template send_field source · line 103 · raw

@-H:Type -> @-C:Type -> @cap:Send<H, C> -> @_:H -> @_:C -> H

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template send source · line 108 · raw

@-H:Type -> @-C:Type -> @-cap:Send<H, C> -> @ctx:H -> @value:C -> H

Consume input C through a declared send operation and return H. Publication timing and failure behavior belong to the supplied operation.

template action_field source · line 112 · raw

@-H:Type -> @cap:Action<H> -> @_:H -> H

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template action source · line 116 · raw

@-H:Type -> @-cap:Action<H> -> @ctx:H -> H

Execute a declared no-argument action, consuming and returning H once.

template request_field source · line 120 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @cap:Request<H, C, V> -> @_:H -> @_:C -> Pair(H, V)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template request source · line 125 · raw

@-H:Type -> @-C:Type -> @-V:Data -> @-cap:Request<H, C, V> -> @ctx:H -> @value:C -> Pair(H, V)

Execute a request with consumed input C, returning H and Data result V. This is not the affine-output variant; use owned_request for Type results.

template invoke source · line 132 · raw

@-Ops:(@_:Type -> Type) -> @-A:Data -> @-U:Type -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:A -> @_:H -> Pair(H, U)) -> @-H:Type -> @-caps:Ops(H) -> @args:A -> @ctx:H -> Pair(H, U)

One executor for every caller-authored finite capability shape. Invoke a reusable universally quantified body with Data arguments and declared Ops(H). H remains opaque to the body; closed caps must implement the intended operations. This dispatcher adds no transaction or World checks.

template owned_request_field source · line 143 · raw

@-H:Type -> @-Input:Type -> @-Output:Type -> @cap:OwnedRequest<H, Input, Output> -> @_:H -> @_:Input -> Pair(H, Output)

Advanced setup projection extracting the closed operation from its grant. Does not invoke it, access World or grant capabilities beyond that value.

template owned_request source · line 148 · raw

@-H:Type -> @-Input:Type -> @-Output:Type -> @-cap:OwnedRequest<H, Input, Output> -> @ctx:H -> @input:Input -> Pair(H, Output)

Execute with affine input and return H plus the operation's affine result. Branch on that result to handle payload recovery or refusal.

template invoke_owned source · line 154 · raw

@-Ops:(@_:Type -> Type) -> @-A:Type -> @-U:Type -> @-body:(@-H:Type -> @-caps:Ops(H) -> @_:A -> @_:H -> Pair(H, U)) -> @-H:Type -> @-caps:Ops(H) -> @args:A -> @ctx:H -> Pair(H, U)

Args and output are fixed before opaque H; no Data restriction on owners. Invoke the universally quantified body with affine arguments/output. The callback consumes/returns H and consumes A exactly according to its signature; any error/recovery branches belong to its own output contract.