View Source FLHook.Result (FLHook Client v1.0.0)
A struct that contains result data and provides helpers to decode the contained data.
Link to this section Summary
Functions
Converts the result to a file string. May raise when the result is no file.
Converts the result to a file stream. May raise when the result is no file.
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to.
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to. Raises when the param is missing or could not be coerced to the given type.
Converts a result to params. When the result has multiple lines only the first one is being processed.
Converts a multiline result to a params list.
Converts the result to a string.
Link to this section Types
Specs
t() :: %FLHook.Result{lines: [String.t()]}
Link to this section Functions
Specs
Converts the result to a file string. May raise when the result is no file.
Specs
Converts the result to a file stream. May raise when the result is no file.
Specs
param(t(), FLHook.Params.key(), FLHook.Params.param_type()) :: {:ok, any()} | {:error, FLHook.ParamError.t()}
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to.
Specs
param!(t(), FLHook.Params.key(), FLHook.Params.param_type()) :: any() | no_return()
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to. Raises when the param is missing or could not be coerced to the given type.
Specs
params(t()) :: FLHook.Params.t()
Converts a result to params. When the result has multiple lines only the first one is being processed.
Specs
params_list(t()) :: [FLHook.Params.t()]
Converts a multiline result to a params list.
Specs
Converts the result to a string.