What is the difference between Ecto.Type's cast and dump?

cast and load transform data.
dump is a guard guard clause.

eg: atom_to_string and reverse…

defmodule Whatever.Atom do
  @behaviour Ecto.Type
  def type, do: :binary
  
  def cast(atom) when is_atom(atom), do: {:ok, to_string(atom)}
  def cast(string) when is_binary(string), do: {:ok, string}
  def cast(_), do: :error
  
  def load(string) when is_binary(string), do: {:ok, String.to_atom(string)}
  def load(_), do: :error
  
  def dump(string) when is_binary(string), do: {:ok, string}
  def dump(_), do: :error
end