ExStorageServiceSdk.ByteSource protocol (ex_storage_service_sdk v0.7.1)

Copy Markdown View Source

A replayable, bounded byte source that can be folded more than once.

Request checksums pass checksum_source: values through this protocol so a body can be hashed before it is streamed, without materializing it in memory.

Summary

Types

t()

All the types that implement this protocol.

Functions

Folds the source's chunks in order. opts may carry :coordinator, the request's ExStorageServiceSdk.Transfer.Coordinator, for cancellation.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

reduce(source, acc, reducer, opts)

@spec reduce(t(), acc, (binary(), acc -> acc), keyword()) ::
  {:ok, acc} | {:error, ExStorageServiceSdk.Error.t()}
when acc: term()

Folds the source's chunks in order. opts may carry :coordinator, the request's ExStorageServiceSdk.Transfer.Coordinator, for cancellation.