View Source Kvasir.Key behaviour (kvasir v0.0.18)

Link to this section Summary

Link to this section Callbacks

@callback describe(value :: term()) :: String.t()
@callback doc() :: String.t()

Key documentation.

@callback dump(value :: term()) :: {:ok, term()} | {:error, atom()}
@callback dump(value :: term(), opts :: Keyword.t()) :: {:ok, term()} | {:error, atom()}
@callback name() :: String.t()

Key descriptive name.

@callback obfuscate(value :: term()) :: {:ok, term()} | :obfuscate | {:error, atom()}
@callback obfuscate(value :: term(), opts :: Keyword.t()) ::
  {:ok, term()} | :obfuscate | {:error, atom()}
@callback parse(value :: any()) :: {:ok, term()} | {:error, atom()}
@callback parse(value :: any(), opts :: Keyword.t()) :: {:ok, term()} | {:error, atom()}
Link to this callback

partition(value, partitions)

View Source
@callback partition(value :: term(), partitions :: pos_integer()) ::
  {:ok, non_neg_integer()} | {:error, atom()}