Behaviour for file implementations that are compatible with Ash.Type.File.
Summary
Types
Errors returned by the implementation.
The source of the file the implementation operates on.
Any module() implementing the Ash.Type.File.Implementation behaviour.
Callbacks
Return the MIME content type of the file.
Return the filename of the file.
Open IO.device() for the file.
Return path of the file on disk.
Types
@type error() :: term()
Errors returned by the implementation.
@type source() :: term()
The source of the file the implementation operates on.
@type t() :: module()
Any module() implementing the Ash.Type.File.Implementation behaviour.
Callbacks
Return the MIME content type of the file.
See: Ash.Type.File.content_type/1
This callback is optional. If the implementation cannot determine the content type, this callback can be omitted.
Return the filename of the file.
This callback is optional. If the implementation cannot determine the filename, this callback can be omitted.
Open IO.device() for the file.
The return pid must point to a process following the
Erlang I/O Protocol
like StringIO or File.
Return path of the file on disk.
See: Ash.Type.File.path/1
This callback is optional. If the file is not stored on disk, this callback can be omitted.