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

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

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.

Gets the raw result string.

Converts the result to a string.

Types

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

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.

Link to this function

raw(result)

View Source (since 2.1.0)
@spec raw(t()) :: binary()

Gets the raw result string.

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

Converts the result to a string.