VCF.Stream (VCF v1.0.0)

View Source

A header-aware lazy record stream.

Summary

Functions

Returns a stream with the same header and lazily filtered successful records.

Opens a source, parses its header eagerly, and returns tagged records lazily.

Opens a stream or raises VCF.ParseError for a structural source/header error.

Types

mode()

@type mode() :: :strict | :permissive

t()

@type t() :: %VCF.Stream{
  bang?: boolean(),
  header: VCF.Header.t(),
  mode: mode(),
  records: Enumerable.t()
}

Functions

filter(stream, predicate)

@spec filter(t(), (VCF.Record.t() -> as_boolean(term()))) :: t()

Returns a stream with the same header and lazily filtered successful records.

open(input, options \\ [])

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

Opens a source, parses its header eagerly, and returns tagged records lazily.

open!(input, options \\ [])

@spec open!(
  term(),
  keyword()
) :: t()

Opens a stream or raises VCF.ParseError for a structural source/header error.