mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-24 17:49:45 +01:00
erlang: improved spec.
This commit is contained in:
parent
ff5d5d7cbc
commit
584462f9b9
@ -64,8 +64,9 @@ pack(_Other) ->
|
|||||||
% if failed in decoding and not end, get more data
|
% if failed in decoding and not end, get more data
|
||||||
% and feed more Bin into this function.
|
% and feed more Bin into this function.
|
||||||
% TODO: error case for imcomplete format when short for any type formats.
|
% TODO: error case for imcomplete format when short for any type formats.
|
||||||
-spec unpack( binary() )->
|
-spec unpack( Bin::binary() )-> {msgpack_term(), binary()} |
|
||||||
{msgpack_term(), binary()} | {more, non_neg_integer()} | {error, reason()}.
|
{more, non_neg_integer()} | {more, undefined} |
|
||||||
|
{error, reason()}.
|
||||||
unpack(Bin) when not is_binary(Bin)->
|
unpack(Bin) when not is_binary(Bin)->
|
||||||
{error, badarg};
|
{error, badarg};
|
||||||
unpack(Bin) when bit_size(Bin) >= 8 ->
|
unpack(Bin) when bit_size(Bin) >= 8 ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user