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.caps/Capability

Capability

scala.caps.Capability

Base trait for classes that represent capabilities in theobject-capability model.

A capability is a value representing a permission, access right, resource or effect. Capabilities are typically passed to code as parameters; they should not be global objects. Often, they come with access restrictions such as scoped lifetimes or limited sharing.

An example is theLabel class inscala.util.boundary. It represents a capability in the sense that it gives permission tobreak to the enclosing boundary represented by theLabel. It has a scoped lifetime, since breaking to aLabel after the associatedboundary was exited gives a runtime exception.

Capability has a formal meaning whenCapture Checking is turned on. But even without capture checking, extending this trait can be useful for documenting the intended purpose of a class.

Attributes

Experimental
true
Source
package.scala
Graph
Supertypes
classAny
Known subtypes
traitExists
traitMutable
traitSharable
traitControl
classCanThrow[E]
objectcap
Show all
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp