Jason.Encode (jason v1.4.5)

Copy Markdown View Source

Utilities for encoding elixir values to JSON.

Summary

Types

opts()

@opaque opts()

Functions

atom(atom, arg)

@spec atom(atom(), opts()) :: iodata()

float(float)

@spec float(float()) :: iodata()

integer(integer)

@spec integer(integer()) :: iodata()

keyword(list, arg2)

@spec keyword(
  keyword(),
  opts()
) :: iodata()

list(list, arg)

@spec list(list(), opts()) :: iodata()

map(value, arg)

@spec map(map(), opts()) :: iodata()

string(string, arg)

@spec string(String.t(), opts()) :: iodata()

struct(value, arg)

@spec struct(
  struct(),
  opts()
) :: iodata()

value(value, arg)

@spec value(term(), opts()) :: iodata()

Equivalent to calling the Jason.Encoder.encode/2 protocol function.

Slightly more efficient for built-in types because of the internal dispatching.