View Source Cyanide.Binary (cyanide v2.0.0)

Represents a binary with a subtype.

fields

Fields

  • subtype is any of :generic, :function, :old_binary, :old_uuid, :uuid, :md5, :encrypted_bson, or any user defined value (any integer >= 0x80 and <= 0xFF).
  • data is a binary (such as <<0, 1, 2>> or "test").

Link to this section Summary

Link to this section Types

@type subtype() ::
  :generic
  | :function
  | :old_binary
  | :old_uuid
  | :uuid
  | :md5
  | :encrypted_bson
  | pos_integer()
@type t() :: %Cyanide.Binary{data: binary(), subtype: subtype()}

Link to this section Functions

@spec cast_subtype(byte()) :: {:ok, subtype()} | :error