OcppModel (ocpp_model v0.2.3) View Source

OcppModel Module: Contains helper functions

Link to this section Summary

Functions

same as to_map!() but takes an {:ok, struct()} and returns an {:ok, map()}

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

Specs

to_map({:ok, struct()} | {:error, atom(), String.t()}) ::
  {:ok, map()} | {:error, atom(), String.t()}

same as to_map!() but takes an {:ok, struct()} and returns an {:ok, map()}

in case of een {:error, atom(), String.t()} argument it will let it pass through

Link to this function

to_map!(st, filter_empty \\ true)

View Source

Converts a struct into a map including any nested structs

Specs

to_struct(map(), atom() | struct()) :: struct()

Converts a Map into a struct of the given kind