Nostrum.Snowflake.cast

You're seeing just the function cast, go back to Nostrum.Snowflake module for more information.

Specs

cast(term()) :: {:ok, t() | nil} | :error

Attempts to convert a term into a snowflake.

Examples

iex> Nostrum.Snowflake.cast(200317799350927360)
{:ok, 200317799350927360}

iex> Nostrum.Snowflake.cast("200317799350927360")
{:ok, 200317799350927360}

iex> Nostrum.Snowflake.cast(nil)
{:ok, nil}

iex> Nostrum.Snowflake.cast(true)
:error

iex> Nostrum.Snowflake.cast(-1)
:error