harald v0.2.0 Harald.Serializable behaviour View Source

Serializable behaviour.

Link to this section Summary

Functions

Asserts that bin will serialize symmetrically.

Link to this section Functions

Link to this macro

assert_symmetry(mod, bin) View Source (macro)

Asserts that bin will serialize symmetrically.

If bin deserializes into {:ok, data}, data should serialize perfectly back into bin.

Link to this section Callbacks

Link to this callback

deserialize(binary) View Source
deserialize(binary()) :: {:ok, term()} | {:error, term()}

Link to this callback

serialize(term) View Source
serialize(term()) :: {:ok, binary()} | {:error, term()}