View Source FLHook.Result (FLHook Client v2.0.0)

A struct that contains result data and provides helpers to decode the contained data.

Link to this section Summary

Functions

Converts a multiline result to a list of dictionaries.

Converts the result to a file string. Raises when the result is no file.

Converts the result to a file stream. Raises when the result is no file.

Converts a result to dictionary. When the result has multiple lines only the first one is being returned. When first line is no valid dictionary, an empty dictionary is returned.

Converts the result to a string.

Link to this section Types

@type t() :: %FLHook.Result{lines: [String.t()]}

Link to this section Functions

@spec all(t()) :: [FLHook.Dict.t()]

Converts a multiline result to a list of dictionaries.

@spec file!(t()) :: String.t() | no_return()

Converts the result to a file string. Raises when the result is no file.

@spec file_stream!(t()) :: Enum.t() | no_return()

Converts the result to a file stream. Raises when the result is no file.

@spec one(t()) :: FLHook.Dict.t()

Converts a result to dictionary. When the result has multiple lines only the first one is being returned. When first line is no valid dictionary, an empty dictionary is returned.

@spec to_string(t()) :: String.t()

Converts the result to a string.