A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scala-lang.org/api/3.x/scala/util/Using$$Manager$.html below:

Manager

scala.util.Using.Manager

See theManager companion class Members list

Performs an operation using a Manager, then closes the Manager, releasing its resources (in reverse order of acquisition).

Performs an operation using a Manager, then closes the Manager, releasing its resources (in reverse order of acquisition).

Example:

val lines = Using.Manager { use =>
 use(new BufferedReader(new FileReader("file.txt"))).lines()
}

If using resources which require an implicit Manager as a parameter, this method should be invoked with an implicit modifier before the function parameter:

Example:

val lines = Using.Manager { implicit use =>
 new SafeFileReader("file.txt").lines()
}

See the main doc for Using for full details of suppression behavior.

Type parameters
A

the return type of the operation

Value parameters
op

the operation to perform using the manager

Attributes
Returns

a Try containing an exception if one or more were thrown, or the result of the operation if no exceptions were thrown

Source
Using.scala

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4