Capsule v1.0.0 Capsule.Upload protocol View Source

Protocol for reading upload contents and name from any data structure.

Link to this section Summary

Types

t()

All the types that implement this protocol.

Functions

Returns the contents of the upload as an iodata binary.

Returns the name of the upload. Falls back to the locator ID if no name is set in metadata.

Link to this section Types

Specs

t() :: term()

All the types that implement this protocol.

Link to this section Functions

Specs

contents(struct()) :: {:ok, iodata()} | {:error, String.t()}

Returns the contents of the upload as an iodata binary.

Specs

name(struct()) :: String.t()

Returns the name of the upload. Falls back to the locator ID if no name is set in metadata.