runlet v1.0.0 Runlet.PID

Conversion functions between Runlet and Erlang PIDs

Link to this section Summary

Functions

Convert an Elixir PID to a number

Convert a representation of an Elixir PID.

Convert a Elixir PID to a string

Link to this section Types

Link to this type

t()

t() :: pid() | integer() | float() | binary()

Link to this section Functions

Link to this function

to_float(pid)

to_float(pid() | binary()) :: float()

Convert an Elixir PID to a number

Examples:

iex> Runlet.PID.to_float(:erlang.list_to_pid('<0.1234.0>'))
1234.0
iex> Runlet.PID.to_float(:erlang.list_to_pid('<0.1234.56>'))
1234.56
Link to this function

to_pid(x)

to_pid(Runlet.PID.t()) :: pid()

Convert a representation of an Elixir PID.

Examples:

iex> Runlet.PID.to_pid(String.to_integer(Runlet.PID.to_string(:erlang.list_to_pid('<0.1234.0>')))) #PID<0.1234.0>

Link to this function

to_string(pid)

to_string(pid()) :: binary()

Convert a Elixir PID to a string

Examples:

iex> Runlet.PID.to_string(:erlang.list_to_pid('<0.1234.0>'))
"1234"
iex> Runlet.PID.to_string(:erlang.list_to_pid('<0.1234.56>'))
"1234.56"