bento v0.2.0 Bento.Encoder protocol

Protocol and implementations to encode Elixir data structures into their Bencoded forms.

Examples

iex> Bento.Encoder.encode("foo")
"3:foo"

iex> Bento.Encoder.encode([1, "mixed", "types", 4])
"li1e5:mixed5:typesi4ee"

Summary

Functions

Encode an Elixir value into its Bencoded form

Types

bencodable ::
  atom |
  String.t |
  integer |
  map |
  list |
  Range.t |
  Stream.t
t :: String.t

Functions

encode(value)

Specs

encode(bencodable) :: t

Encode an Elixir value into its Bencoded form.