- The value can only be set once.
- The value has to be set before getting.
Simplified Usage
$typeOn > $typeStore: $name_1, $name_n;$typeOn: The Type to implement the getter/setter methods in. $typeStore: The Type, stored in the cell. $names: The Type, stored in the cell.
use *;
type_cell!
Query Usage
Queries are the base of this crate, they consist of the following parts and are separated by | :
on $typeOn > store $typeStore | set $typeIn | get $typeOut | $name
on $typeOn > store $typeStore$typeOn: The Type to implement the getter/setter methods in. $typeStore: The Type, stored in the cell.set $typeIn[.methods(val:type)]$typeIn: Input-Parameter of the setter method. .methods(val:type): Methods applied on $typeIn to fit $typeStore. Parameters of those will be added to the setter method and forwarded.get $paramOut[.methods(val:type)]$typeOut: Output-Type of the getter method. .methods(val:type): Methods applied on $typeStore to fit $typeOut. Parameters of those will be added to the getter method and forwarded.$name$name: Name of the value, method names will be:get_$nameandset_$name.
Example 1:
Store bool on bool, set bool directly and get a reference to it.
use *;
type_cell!;
Example 2:
Store bool on bool, set bool directly and get a clone of it.
use *;
type_cell!;
Prefabs
Currently there are simplifications for Vec and HashMap indicated by a @:
use *;
type_cell!
use *;
use HashMap;
type_cell!
Mutability
Mutability can be achieved using Mutex, RwLock or other locks, just make sure you know what you're doing!