Gcode.Result (gcode v1.0.1)
A helper which represents a result type.
This is really just a wrapper around Erlang's ok/error tuples.
Summary
Functions
Initialise or match an error value
Is the result an error?
Convert a successful result another result.
Initialise or match an ok value
Is the result ok?
Attempt to unwrap a result and return the inner value. Raises an exception if the result contains an error.
Types
Link to this type
error(error)
@type error(error) :: {:error, error}
Link to this type
ok(result)
@type ok(result) :: {:ok, result}
Link to this type
t(result)
Link to this type
t(result, error)
Functions
Initialise or match an error value
Link to this function
error?(arg)
Is the result an error?
Link to this function
map(arg, mapper)
Convert a successful result another result.
Initialise or match an ok value
Link to this function
ok?(arg)
Is the result ok?
Link to this function
unwrap!(arg)
Attempt to unwrap a result and return the inner value. Raises an exception if the result contains an error.