stixex v0.1.3 StixEx.Serialiser behaviour View Source

Ways to dump stix to a file - only JSON has to be implemented

Defined as a behaviour so that extra serialisation methods can be implemented whenever needed.

Link to this section Summary

Callbacks

Convert a STIX bundle object into a string

Link to this section Functions

Link to this function

dump(serialiser, bundle) View Source

Link to this section Callbacks

Link to this callback

to_string(term) View Source
to_string(term()) :: {atom(), String.t()}

Convert a STIX bundle object into a string

iex> StixEx.Serialiser.to_string(%StixEx.Bundle{})
{:ok, "{...}"}