Fetcher

interface Fetcher<T : Any>

A Fetcher translates data into either a BufferedSource or a Drawable.

To accomplish this, fetchers fit into one of two types:

  • Uses the data as a key to fetch bytes from a remote source (e.g. network or disk) and exposes it as a BufferedSource. e.g. HttpFetcher

  • Reads the data directly and translates it into a Drawable. e.g. BitmapFetcher

Functions

fetch
Link copied to clipboard
abstract suspend fun fetch(pool: BitmapPool, data: T, size: Size, options: Options): FetchResult

Load the data into memory. Perform any necessary fetching operations.

handles
Link copied to clipboard
open fun handles(data: T): Boolean

Return true if this can load data.

key
Link copied to clipboard
abstract fun key(data: T): String?

Compute the memory cache key for data.