Noizu.Entity.Store.Amnesia.Entity.FieldProtocol protocol (NoizuLabs Entities v0.2.1)
This is the protocol used to pack/unpack individual fields (if the fields have a type implementation.) to and from storage.
Summary
Types
Context Record
An Entity That Implements the Entity.FieldProtocol
Valid field name for storage mechanism
Entity Settings Record
Options Keyword List
Persistence Settings
An Amnesia Record
All the types that implement this protocol.
Types
@type context() :: any()
Context Record
@type field() :: any()
An Entity That Implements the Entity.FieldProtocol
@type field_name() :: any()
Valid field name for storage mechanism
@type field_settings() :: Noizu.Entity.Meta.Field.field_settings()
Entity Settings Record
@type options() :: nil | list()
Options Keyword List
@type persistence_settings() :: Noizu.Entity.Meta.Persistence.persistence_settings()
Persistence Settings
@type record() :: any()
An Amnesia Record
@type t() :: term()
All the types that implement this protocol.
Functions
@spec field_as_record( field(), field_settings(), persistence_settings(), context(), options() ) :: {:ok, {field_name(), any()}} | {:error, any()}
Convert field to record format.
@spec field_from_record( field(), record(), field_settings(), persistence_settings(), context(), options() ) :: {:ok, any()} | {:error, any()}
Extract field from record.