com.phasmidsoftware.xmldoc.core.TryUsing
The TryUsing object provides utility methods to manage resources safely and effectively using Scala's Using and Try. It encapsulates resource management in a functional way, ensuring proper release of resources. The methods in this object extend the functionality of Using.apply by offering flattening operations over nested Try.
Attributes
Graph
Reset zoom Hide graph Show graph
Supertypes
class Object
trait Matchable
class Any
Self type
Members list
This method is to Using.apply as flatMap is to map.
This method is to Using.apply as flatMap is to map.
Type parameters
A
the underlying type of the result.
R
the resource type.
Value parameters
f
a function of R => Try[A].
resource
a resource which is used by f and will be managed via Using.apply
Attributes
Returns
a Try[A]
This method is similar to apply(r) but it takes a Try[R] as its parameter. The definition of f is the same as in the other apply, however.
This method is similar to apply(r) but it takes a Try[R] as its parameter. The definition of f is the same as in the other apply, however.
TESTME
Type parameters
A
the underlying type of the result.
R
the resource type.
Value parameters
f
a function of R => Try[A].
ry
a Try[R] which is passed into f and will be managed via Using.apply
Attributes
Returns
a Try[A]