Releasable

scala.util.Using$.Releasable
See theReleasable companion object
trait Releasable[-R]

A type class describing how to release a particular type of resource.

A resource is anything which needs to be released, closed, or otherwise cleaned up in some way after it is finished being used, and for which waiting for the object's garbage collection to be cleaned up would be unacceptable. For example, an instance of java.io.OutputStream would be considered a resource, because it is important to close the stream after it is finished being used.

An instance of Releasable is needed in order to automatically manage a resource with Using. An implicit instance is provided for all types extending java.lang.AutoCloseable.

Type parameters

R

the type of the resource

Attributes

Companion
object
Source
Using.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def release(resource: R): Unit

Releases the specified resource.

Releases the specified resource.

Attributes

Source
Using.scala