FeedReader.FormatDetector (FeedReader v0.1.0)

Copy Markdown

Internal bounded detection and replay for FeedReader.

Summary

Functions

Returns the detected format id, or :unknown, from a bounded prefix.

Returns the detected id, inspected prefix, and replayable input stream.

Checks whether the bounded prefix matches the explicitly selected format.

Functions

detect(content, opts)

@spec detect(binary(), keyword()) :: FeedReader.format_id()

Returns the detected format id, or :unknown, from a bounded prefix.

detect_and_replay(content, opts)

@spec detect_and_replay(binary() | Enumerable.t(), keyword()) ::
  {FeedReader.format_id(), binary(), Enumerable.t()}

Returns the detected id, inspected prefix, and replayable input stream.

validate(content, format, opts)

@spec validate(binary(), atom() | module(), keyword()) :: boolean()

Checks whether the bounded prefix matches the explicitly selected format.