def replace
import bendvy-ecs-core@0.1.0.3/component.bend as Componentimport Base
import column.bend as Col
import world.bend as W
157# Ordinary writes require a live entity. Foreign handles are rejected before
158# any column access, size computation, allocation or owned replacement move.
159# Immediately insert/replace with Some(C), or remove with None, on a live handle.
160# Return displaced C on success and incoming C on rejection; capacity errors
161# remain explicit. This operation is not deferred and has no automatic undo journal.
162def replace(~S: Data,~Store: Type,~R: Type,~E: Data,~Rest: Type,~C: Type,~V: Data,~Token: Data,~take: Store -> Rest & Col.Column<S,C>,~put: Rest -> Col.Column<S,C> -> Store,~project: C -> C & V,family: Family<S,Store,Rest,C,V,Token,take,put,project>,world: W.World<S,Store,R,E>,+handle: W.Handle<S>,incoming: Maybe<&1,C>) -> Replacement<W.World<S,Store,R,E>,C>:
163 replace_allowed(~S,~Store,~R,~E,~Rest,~C,~V,~Token,~take,~put,~project,W.valid(~S,~Store,~R,~E,world,handle),handle,incoming)
Uses (9)
Used by (0)
No other definition uses this definition.