Link
class Link
ClosureChain
sequentially executes try-blocks, also known as Link
s. Links must receive exactly one of either a .success()
or a .throw()
to signfiy the completion of the Link.
-
Signify a successful completion of a
Link
.Declaration
Swift
public func success(_ param: Any? = nil)
Parameters
param
An optional parameter may be specified, to be passed to the next
Link
(try-block) -
Any
Link
may throw by calling.throw(Error)
orthrow Error
Declaration
Swift
public func `throw`(_ error: Error)
-
Convenience method to call
success()
orthrow
as appropriate for the givenResult
Declaration
Swift
public func `return`<RequiredType>(_ result: Result<RequiredType, Error>)
Parameters
result
Result
to evaluate