Skip to content

Force pack as binaryΒ #86

@adrianroe

Description

@adrianroe

I'm trying to pack the following data structure.

#{<<"Coalesce">> => true,
  <<"Name">> => <<"streamAvailable">>,
  <<"Payload">> =>
      term_to_binary({streamAvailable,{streamId,<<"stream1">>},<<"172.16.169.1">>})
}.

In a perfect world I would use '{pack_str, from_binary}' but it then tries to pack Payload as a string and fails on the 'unicode:characters_to_binary' check. Is there a way to force Payload to be encoded as a binary while allowing the others to remain strings?

Thanks for the efforts on a great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions