ImagePipe.Source.Response (image_pipe v0.5.0)

Copy Markdown View Source

Source bytes returned by an ImagePipe.Source adapter.

Exactly one of stream or path must be present. Streams are consumed lazily and must release their resources when enumeration halts. Adapters opening resources before enumeration also supply an idempotent close function. ImagePipe calls it once it is done with the response, even when no body is consumed.

Summary

Functions

Releases the response's resources by calling its close function.

Types

t()

@type t() :: %ImagePipe.Source.Response{
  close: (-> :ok) | nil,
  origin: ImagePipe.Source.Origin.t() | nil,
  path: Path.t() | nil,
  stream: Enumerable.t() | nil
}

Functions

close(response)

Releases the response's resources by calling its close function.