View Source Runlet.PID (runlet v1.2.0)

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 section Functions

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

Convert an Elixir PID to a number

examples

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
@spec to_pid(t() | pid() | String.t() | charlist()) :: pid()

Convert a representation of an Elixir PID.

examples

Examples:

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

Convert a Elixir PID to a string

examples

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"