TypedStructor.Plugins.Accessible (TypedStructor v0.1.4)
This plugin implements the Access
behavior for the struct
by delegating the fetch/2
, get_and_update/3
, and pop/2
functions to the Map
module.
Destructive operations
These operations are not allowed for the struct:
- update
:__struct__
key- pop a key
The functions will raise an
ArgumentError
if called. To enable these functionalities, override theget_and_update/3
andpop/2
functions.
Usage
typed_structor do
plugin TypedStructor.Plugins.Accessible
# fields
end