Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.util/Using/Releasable

Releasable

scala.util.Using.Releasable
See theReleasable companion object
traitReleasable[-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 ofjava.io.OutputStream would be considered a resource, because it is important to close the stream after it is finished being used.

An instance ofReleasable is needed in order to automatically manage a resource withUsing. An implicit instance is provided for all types extendingjava.lang.AutoCloseable.

Type parameters

R

the type of the resource

Attributes

Companion
object
Source
Using.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Known subtypes

Members list

Value members

Abstract methods

defrelease(resource:R):Unit

Releases the specified resource.

Releases the specified resource.

Attributes

Source
Using.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp