~/bend-docscommunity

ordinary_recovery_capture.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.5/ordinary_recovery_capture.bend as Ordinary_recovery_capture

10 imports
import Base
import ./recovery_use.bend as Use
import ./world.bend as W
import ./owner_product.bend as Product
import ./ordinary_recovery_declaration.bend as D
import ./ordinary_recoverable_array_resource.bend as F
import ./ordinary_recoverable_component_capture.bend as Existing
import ./recoverable_array.bend as A
import ./recoverable_array_owner.bend as AO
import ./recovery_journal.bend as Journal

Templates

template Ops source · line 15 · raw

@-Q:Type -> @H:Type -> Type

Canonical capture target and generated recovery path; no caller inverse. Recoverable retained Array<Q> capture capability family: whole-array replace and bounded element swap. Q may be affine Type; arbitrary capture mutation outside these declared operations is not automatically reversible.

template empty source · line 16 · raw

@-Q:Type -> @unit:Unit -> List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>

template replaced source · line 17 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> @-All:Type -> @-Rest:Type -> @-path:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<All, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Rest> -> @result:Pair(0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recovery_journal.Action(0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All)>) -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All>

template replace source · line 24 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> @-All:Type -> @-Rest:Type -> @-path:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<All, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Rest> -> @frame:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All> -> @incoming:Array<Q> -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All>

Replace retained Array<Q> capture, recording its displaced owner in the shared recovery journal. Commit returns the displaced array; rollback restores it and returns the replacement through the recovery accumulator. World remains the retained sibling of capture.

template swapped source · line 27 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> @-All:Type -> @-Rest:Type -> @-path:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<All, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Rest> -> @result:0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array_owner.Attempt<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All, Q> -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Attempt<0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All>, Q>

template swap source · line 34 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> @-All:Type -> @-Rest:Type -> @-path:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<All, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Rest> -> @frame:0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All> -> @index:U32 -> @incoming:Q -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Attempt<0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All>, Q>

Attempt a bounded capture element replacement. Refused retains frame and incoming Q without extending the journal; accepted records the old element for commit/rollback recovery. Does not copy either affine element.

template grant source · line 40 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> @-All:Type -> @-Rest:Type -> @-path:0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Lens<All, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Rest> -> @unit:Unit -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_component_capture.CaptureWrite<Q, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recoverable_array_resource.Frame<0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, All>>

Advanced canonical builder selecting the capture and generated recovery path inside the complete product. Raw indices are trusted setup; the body sees only its closed replace/swap operations.

template declaration source · line 45 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-Q:Type -> 0x2a0aaf4f2cb3f416a9b91fd887916a5d/ordinary_recovery_declaration.Declaration<S, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/owner_product.Owner<0x2a0aaf4f2cb3f416a9b91fd887916a5d/world.World<S, C, R, E>, Array<Q>>, List<&1, 0x2a0aaf4f2cb3f416a9b91fd887916a5d/recoverable_array.Record<Q>>, Ops(Q), grant(S, C, R, E, Q)>

Declare canonical Array<Q> capture recovery with complete typed Capture use metadata and no fabricated World access key. Compose with component/ resource declarations through ordinary-recovery-declaration.both. Does not execute a body or make host IO reversible; see docs/parity/recovery.md.