restore_raw.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.6/restore_raw.bend as Restore_raw
5 imports
import Base import ./decode_data.bend as D import ./entity_key.bend as Key import ./snapshot_data.bend as Snapshot import ./restore_raw_number.bend as Number
Types
type Error source · line 9 · raw
Data
Detached structural parsing failure or unsupported raw version. Schema-specific name/value/construction errors are a later typed restore stage, not these errors.
Invalid@error:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Error -> Error
UnsupportedVersion@version:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Error
type Parsed source · line 14 · raw
Data
Accepted contains a structurally parsed typed Snapshot; it is not yet schema validated or applied. Rejected retains complete original Raw and parsing error.
Accepted@snapshot:0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot -> Parsed
Rejected@original:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @error:Error -> Parsed
type Decoded source · line 18 · raw
@T:Data -> Data
Internal parser step result, not a second public restore/admission outcome.
Value@T:Data -> @value:T -> Decoded<T>
Failed@T:Data -> @error:Error -> Decoded<T>
Definitions
def numeric_positive source · line 23 · raw
@path:String -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @positive:Bool -> @value:U32 -> @nonzero:Bool -> Decoded<U32>
def numeric_checked source · line 27 · raw
@+path:String -> @+raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @positive:Bool -> @result:0x14a72e1c180a5ab1f8a056d43822425c/restore_raw_number.Checked -> Decoded<U32>
def number source · line 31 · raw
@+path:String -> @+raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @positive:Bool -> Decoded<U32>
def key_generation source · line 33 · raw
@index:U32 -> @result:Decoded<U32> -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key>
def key_index source · line 37 · raw
@+path:String -> @+fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @result:Decoded<U32> -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key>
def key source · line 41 · raw
@+path:String -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key>
def entity_fields source · line 45 · raw
@saved:0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key -> @path:String -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>
def entity_key source · line 49 · raw
@+path:String -> @+fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @result:Decoded<0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key> -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>
def entity source · line 53 · raw
@+path:String -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>
def entities_tail source · line 57 · raw
@head:0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity -> @result:Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>> -> Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>>
def entities_head source · line 61 · raw
@next:(@_:Unit -> Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>>) -> @result:Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity> -> Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>>
def entities source · line 65 · raw
@values:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw> -> @+index:U32 -> Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>>
def resources source · line 69 · raw
@next:U32 -> @values:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity> -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def entities_checked source · line 73 · raw
@next:U32 -> @fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @result:Decoded<List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity>> -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def entity_array source · line 77 · raw
@next:U32 -> @fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def progress source · line 81 · raw
@+fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @result:Decoded<U32> -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def version_checked source · line 85 · raw
@+fields:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Field> -> @+raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @result:0x14a72e1c180a5ab1f8a056d43822425c/restore_raw_number.Checked -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def object source · line 89 · raw
@+raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot>
def finished source · line 93 · raw
@original:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> @result:Decoded<0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot> -> Parsed
def parse source · line 104 · raw
@+raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Parsed
Parse the four-field snapshot object into typed detached Data without touching World. Version must be 1; nextEntity is positive U32; saved index/generation accept full U32 including zero as opaque tokens, not target allocator slots. Exact numeric conversion rejects fractions/nonfinite/out-of-range input before narrowing. Entities/components/resources shapes are checked in authored order; D.field keeps existing first-match semantics, not a new duplicate-property rule. Complete-key duplicates, schema dispatch and capacity are checked by typed restore.
def saved_key source · line 105 · raw
@value:0x14a72e1c180a5ab1f8a056d43822425c/entity_key.Key -> 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw
def saved_entities source · line 108 · raw
@values:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Entity> -> List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw>
def encode source · line 115 · raw
@value:0x14a72e1c180a5ab1f8a056d43822425c/snapshot_data.Snapshot -> 0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw
Encode typed Snapshot to the four-field Raw representation preserving entity and field order. This is not schema validation, JSON serialization or a Runtime checkpoint; an arbitrary typed Snapshot may still be refused by restore.
Templates
template invalid source · line 21 · raw
@-T:Data -> @path:String -> @expected:String -> @raw:0x14a72e1c180a5ab1f8a056d43822425c/decode_data.Raw -> Decoded<T>