diff --git a/doc/404.html b/doc/404.html index da2ec83..b4e8f2c 100644 --- a/doc/404.html +++ b/doc/404.html @@ -5,7 +5,7 @@ -
Protocol and implementations to encode Elixir data structures into their Bencoded forms.
iex> Bento.Encoder.encode("foo")
+iex> Bento.Encoder.encode("foo") |> IO.iodata_to_binary()
"3:foo"
-iex> Bento.Encoder.encode([1, "mixed", "types", 4])
-"li1e5:mixed5:typesi4ee"
+iex> Bento.Encoder.encode([1, "two", [3]]) |> IO.iodata_to_binary()
+"li1e3:twoli4eee"
Bencode a value, raises an exception on error
Bencode a value as iodata
+encode_to_iodata(Bento.Encoder.t, Keyword.t) ::
+ {:ok, iodata} |
+ {:error, {:invalid, any}}
+
+ Bencode a value as iodata.
+iex> Bento.encode_to_iodata([1, "two", [3]])
+{:ok, [108, [[105, "1", 101], ["3", 58, "two"], [108, [[105, "3", 101]], 101]], 101]}
+
+