Result
Object Hierarchy:
Gpseq.Result
Gpseq.Result
Gpseq.Result
Gee.Hashable
Gee.Hashable
Gee.Hashable->Gpseq.Result
Description:
[ GenericAccessors ] [ Version ( since = "0.3.0-alpha" ) ]public interface Result <G > : Hashable <Result <G >>
A result object that holds a value or an error.
See also:
Future , Optional
All known implementing classes:
Content:
Properties:
public Error ? exception { owned get ; }
The error of this result, or null if the result is a succeeded result.
public bool is_err { get ; }
Whether or not this result holds an error.
public G value { get ; }
The value of this result.
public Type value_type { get ; }
Delegates:
public delegate Result <A > FlatMapFunc <A ,G > (G value)
public delegate unowned A LightMapFunc <A ,G > (G value) throws Error
public delegate Error MapErrorFunc (owned Error err)
public delegate A MapFunc <A ,G > (G value) throws Error
public delegate Result <A > TransformFunc <A ,G > (Result <G > result)
public delegate C ZipFunc <A ,B ,C > (A a, B b) throws Error
Static methods:
Methods:
public abstract unowned G @get () throws Error
Gets the value or throws the exception.
public virtual Result <G > and_then (owned Func <G > func)
Runs the function with the value if this result holds a value.
public virtual Result <A > flat_map <A > (owned FlatMapFunc <A ,G > func)
Maps the value to another result by applying the given function to the
value.
public virtual Future <G > future ()
Returns a Future
version of this result.
public virtual Result <A > map <A > (owned MapFunc <A ,G > func)
Maps the value to another value by applying the given function to the
value.
public virtual Result <G > map_err (owned MapErrorFunc func)
If this result holds an exception, maps the exception to another
exception by applying the given function to the exception, otherwise the returned result holds the value of this result.
public Result <G > ok ()
Ensures this result holds a value, not an error.
public Result <G > ok_with (G expected, owned EqualDataFunc ? equal = null )
Ensures this result holds the expected value.
public virtual Result <G > then (owned Func <Result <G >> func)
Runs the function with this result.
public abstract Result <A > transform <A > (owned TransformFunc <A ,G > func)
Creates a new result by applying the given function to this result.
public virtual Result <B > zip <A ,B > (owned ZipFunc <G ,A ,B > zip_func, Result <A > second)
Combines the values of two results using the given function.
Inherited Members:
All known members inherited from interface Gee.Hashable