VCF.Source (VCF v1.0.0)

View Source

A VCF input source with explicit ownership and repeatability semantics.

Summary

Functions

Returns tagged physical lines, claiming one-shot sources on first use.

Opens a path, caller-owned I/O device, or generic binary enumerable.

Types

kind()

@type kind() :: :path | :device | :enumerable

t()

@type t() :: %VCF.Source{
  claim: :atomics.atomics_ref(),
  kind: kind(),
  options: keyword(),
  reusable?: boolean(),
  value: term()
}

Functions

lines(source)

@spec lines(t()) :: Enumerable.t()

Returns tagged physical lines, claiming one-shot sources on first use.

open(source, options \\ [])

@spec open(
  term(),
  keyword()
) :: {:ok, t()} | {:error, VCF.Error.t()}

Opens a path, caller-owned I/O device, or generic binary enumerable.