View Source Cyanide (cyanide v2.0.0)

Link to this section Summary

Link to this section Types

@type bson_map() :: %{optional(String.t()) => bson_type()}
@type bson_type() ::
  float()
  | String.t()
  | bson_map()
  | [bson_type()]
  | Cyanide.Binary.t()
  | {integer(), binary()}
  | boolean()
  | nil
  | integer()
  | DateTime.t()
@type encodable_map() :: %{required(encodable_map_key()) => bson_type()}
@type encodable_map_key() :: atom() | String.t()

Link to this section Functions

@spec decode(binary()) :: {:ok, bson_map()} | {:error, :invalid_bson}
@spec decode!(binary()) :: bson_map()
@spec encode(encodable_map()) :: {:ok, binary()} | {:error, :cannot_bson_encode}
@spec encode!(encodable_map()) :: binary()