View Source DataSpecs.Cast.Extra (dataspecs v2.1.0)
Elixir types cast.
Summary
Functions
Type cast for Elixir Date.t(). Expect an iso8601 date string value, returns a Date.t().
Type cast for Elixir DateTime.t(). Expect an iso8601 datetime string value, returns a DateTime.t().
Type cast for Elixir MapSet.t(T). Expect an Enumarable value of type T, returns a MapSet.t(T).
All extra types casts.
Functions
@spec isodate(DataSpecs.Types.value(), DataSpecs.Types.custom_type_casts(), [ DataSpecs.Types.type_cast_fun() ]) :: {:error, DataSpecs.Types.reason()} | {:ok, DateTime.t()}
Type cast for Elixir Date.t(). Expect an iso8601 date string value, returns a Date.t().
@spec isodatetime(DataSpecs.Types.value(), DataSpecs.Types.custom_type_casts(), [ DataSpecs.Types.type_cast_fun() ]) :: {:error, DataSpecs.Types.reason()} | {:ok, DateTime.t()}
Type cast for Elixir DateTime.t(). Expect an iso8601 datetime string value, returns a DateTime.t().
@spec mapset(DataSpecs.Types.value(), DataSpecs.Types.custom_type_casts(), [ DataSpecs.Types.type_cast_fun() ]) :: {:error, DataSpecs.Types.reason()} | {:ok, MapSet.t()}
Type cast for Elixir MapSet.t(T). Expect an Enumarable value of type T, returns a MapSet.t(T).
@spec type_casts() :: DataSpecs.Types.custom_type_casts()
All extra types casts.
MyData.cast(value, DataSpecs.Cast.Extra.type_cast())