Skip to content

Methods_T_RailwaySharp_ErrorHandling_Trial

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

Trial Methods

The Trial type exposes the following members.

Methods

 

Name Description
Public methodStatic member Apply(TValue, TSuccess, TMessage) If the wrapped function is a success and the given result is a success the function is applied on the value. Otherwise the exisiting error messages are propagated.
Public methodStatic member Bind(TValue, TSuccess, TMessage) If the result is a Success it executes the given function on the value. Otherwise the exisiting failure is propagated.
Public methodStatic member Collect(TSuccess, TMessage) Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.
Public methodStatic member Either(TSuccess, TMessage, TResult) Takes a Result and maps it with successFunc if it is a Success otherwise it maps it with failureFunc.
Public methodStatic member Fail(TSuccess, TMessage) Wraps a message in a Failure.
Public methodStatic member Failed(TSuccess, TMessage) Returns true if the result was not successful.
Public methodStatic member Flatten(TSuccess, TMessage) Flattens a nested result given the Failure types are equal.
Public methodStatic member Lift(TValue, TSuccess, TMessage) Lifts a function into a Result container and applies it on the given result.
Public methodStatic member Lift2(TSuccess, TMessage, TSuccess1, TMessage1) Promote a function to a monad/applicative, scanning the monadic/applicative arguments from left to right.
Public methodStatic member MergeMessages(TSuccess, TMessage) Appends the given messages with the messages in the given result.
Public methodStatic member Ok(TSuccess, TMessage) Wraps a value in a Success.
Public methodStatic member Pass(TSuccess, TMessage) Wraps a value in a Success.
Public methodStatic member ReturnOrFail(TSuccess, TMessage) If the given result is a Success the wrapped value will be returned. Otherwise the function throws an exception with Failure message of the result.
Public methodStatic member Warn(TSuccess, TMessage) Wraps a value in a Success and adds a message.
  Back to Top

See Also

Reference

Trial Class
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally