Rover.Result (Rover v0.1.0)

Copy Markdown View Source

Result of a Rover.fetch/2 call.

Every field is a plain value — results are safe to pattern match, serialize, and pass across processes.

Fields

  • :status:ok when the fetch completed, :error otherwise. Mirrors the tuple returned by Rover.fetch/2, so pipelines that do not pattern match the tuple can still branch on result.status.
  • :url — final URL after redirects.
  • :body — rendered HTML (document.documentElement.outerHTML), or nil if the fetch failed before page load.
  • :titledocument.title (may be empty string).
  • :evaluated — JS evaluation result if :evaluate was requested.
  • :extracted — map of selector results if :extract was requested.
  • :screenshot — raw image bytes if :screenshot was requested.
  • :error — the Rover.Error if :status == :error; otherwise nil.

Summary

Types

t()

@type t() :: %Rover.Result{
  body: String.t() | nil,
  error: Rover.Error.t() | nil,
  evaluated: term() | nil,
  extracted: map() | nil,
  screenshot: binary() | nil,
  status: :ok | :error,
  title: String.t() | nil,
  url: String.t() | nil
}