OcppModel (ocpp_model v0.3.0) View Source
OcppModel Module: Contains helper functions
Link to this section Summary
Functions
Transforms the payload into a struct and calls the implemented behaviour function and returns the response back into a map the implemented behaviour can alter the state if it wants to
same as to_map!()
but takes an {{:ok, struct()}, state}
and returns an {{:ok, map()}, state}
Converts a struct into a map including any nested structs
Converts a Map into a struct of the given kind
Link to this section Functions
Transforms the payload into a struct and calls the implemented behaviour function and returns the response back into a map the implemented behaviour can alter the state if it wants to
Specs
to_map({{:ok, struct()}, any()} | {{:error, atom(), String.t()}, any()}) :: {{:ok, map()}, any()} | {{:error, atom(), String.t()}, any()}
same as to_map!()
but takes an {{:ok, struct()}, state}
and returns an {{:ok, map()}, state}
in case of een {{:error, atom(), String.t()}, state}
argument it will let it pass through
Converts a struct into a map including any nested structs
Specs
Converts a Map into a struct of the given kind