What ASDF.info/1 can say without reading a block payload.
blocks_scanned is true after open/2 finishes the header scan.
block_count is the number of block headers found. Payloads are not read.
warnings holds permissive-mode recoveries. Strict mode leaves it empty.
Examples
iex> bytes = ASDF.write!(:binary, %{"n" => 1})
...> handle = ASDF.open!({:binary, bytes})
...> info = ASDF.info!(handle)
...> ASDF.close(handle)
...> {info.format_version, info.standard_version, info.block_count, info.source,
...> info.mode, info.blocks_scanned, info.warnings}
{{1, 0, 0}, {1, 5, 0}, 0, :binary, :strict, true, []}
Summary
Types
@type t() :: %ASDF.Info{ block_count: non_neg_integer() | nil, blocks_scanned: boolean(), format_version: version(), mode: :strict | :permissive, source: String.t() | :binary, standard_version: version() | nil, tree_bytes: non_neg_integer(), warnings: [ASDF.Warning.t()] }
Summary of one open file.
:format_version— the#ASDFversion, aversion/0triple:standard_version— the#ASDF_STANDARDcomment, ornil:tree_bytes— bytes in the YAML document, including its newline:block_count— number of block headers, ornilbefore a scan:source— filesystem path, or:binary:mode—:strictor:permissive:blocks_scanned—trueafterASDF.open/2finishes the scan:warnings— permissive-mode recoveries
@type version() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}
A major.minor.patch triple parsed from #ASDF or #ASDF_STANDARD.