Magika.Result (Magika v0.1.0-rc.0)

Copy Markdown View Source

The top-level result of an identification call.

:status is :ok when identification succeeded, in which case :prediction holds a Magika.Prediction. On failure (e.g. a missing or unreadable file) :status carries the error reason and :prediction is nil.

Summary

Functions

Returns true when the result holds a successful prediction.

Types

status()

@type status() :: :ok | :file_not_found | :permission_error

t()

@type t() :: %Magika.Result{
  path: Path.t() | nil,
  prediction: Magika.Prediction.t() | nil,
  status: status()
}

Functions

ok?(result)

@spec ok?(t()) :: boolean()

Returns true when the result holds a successful prediction.