GitSnapshot.Snapshot protocol (git_snapshot v0.1.8)

View Source

Protocol for data into their snapshot representations.

Snapshots can only be printable string content or it won't be great for getting compared by humans / in git.

Example

defmodule TestStruct do
  defstruct value: <<1, 2, 3>>

  defimpl GitSnapshot.Snapshot do
    def to_string(struct) do
      Base.encode16(struct.value)
    end
  end
end

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_string(t)