summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUENISHI Kota <kuenishi+github@gmail.com>2010-07-18 23:55:07 +0900
committerUENISHI Kota <kuenishi+github@gmail.com>2010-07-18 23:55:07 +0900
commitdcbcf5842f58b7ead3f524ac027576ce0c55e9ab (patch)
tree23737815ec2e003cd92e74b6e1a43061952d3ded
parent8a3ac6d9bd374acc6b134d330bf7aeb906fa1a80 (diff)
downloadmsgpack-python-dcbcf5842f58b7ead3f524ac027576ce0c55e9ab.tar.gz
erlang: msgpack:unpack_all/1 doc.
-rw-r--r--erlang/msgpack.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/erlang/msgpack.erl b/erlang/msgpack.erl
index d4a0bc8..b54874d 100644
--- a/erlang/msgpack.erl
+++ b/erlang/msgpack.erl
@@ -80,6 +80,11 @@ unpack(Bin) when is_binary(Bin) ->
unpack(Other) ->
{error, {badarg, Other}}.
+% @doc Decode an msgpack binary into an erlang terms.
+% It only decodes ALL msgpack packets contained in the binary. No packets should not remain.
+% Returns {error, {badarg, term()}} if the input is corrupted.
+% Returns {error, incomplete} if the input is not a full msgpack packet (caller should gather more data and try again).
+% @spec unpack_all(binary()) -> [msgpack_term()] | {error, incomplete} | {error, {badarg, term()}}
-spec unpack_all(binary()) -> [msgpack_term()] | {error, incomplete} | {error, {badarg, term()}}.
unpack_all(Data)->
try