cultcache-rs: name, index and global lookups (C# parity) #15
Loading…
Reference in a new issue
No description provided.
Delete branch "libby/cultcache-rs-lookups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rust CultCache lookups parity with C#
GetByName/GetByIndex/GetGlobal(src/GameCult.Caching/CultCache.cs).#[cultcache(name)],#[cultcache(index)]/#[cultcache(index = "alias")]on fields,#[cultcache(global)]on the struct. A blank alias is the member name (C#ResolveIndexAlias). Two index members with one alias are a compile error (C# D10). Lookup attributes are refused onCultSlots.get_by_name,get_by_index,get_global. Empty name / blank index value are not found. Records of one type sharing a value find the smallest key (ordinal), live and after reopen; removing the holder finds the next.CultCacheSecondGlobalrefusal (C# message) on put, put_envelope, put_raw_envelope, put_prepared_batch, and on pull_all / load_soa; nothing is written.Deviations from C#, for review:
#[cultcache(name)]members: C# silently takes the first; Rust refuses at compile time.IsAssignableFromambiguity refusals) and no variants: Rust has neither.global:<schemaId>key: Rustputalways takes a key.Tests:
tests/lookups.rs(16), derive unit tests (+7). Ported from FirstCallTests, BackingStoreTests (HydratesPersistedGlobal), RetypeEvictionTests (global slot), VariantTests (duplicate-holder removal), StoreRouting (two globals refused). Each rule was mutated and a test failed.🤖 Generated with Claude Code