scala.scalanative.util

Type members

Classlikes

object And
@implicitNotFound(msg = "Resource acquisition requires a scope.")
trait Scope

Scoped implicit lifetime.

Scoped implicit lifetime.

The main idea behind the Scope is to encode resource lifetimes through a concept of an implicit scope. Scopes are necessary to acquire resources. They are responsible for disposal of the resources once the evaluation exits the demarkated block in the source code.

See https://www.youtube.com/watch?v=MV2eJkwarT4 for details.

Companion:
object
object Scope
Companion:
class
class ScopedVar[A]
Companion:
object
object ScopedVar
Companion:
class
sealed trait ShowBuilder
Companion:
object
Companion:
class
object Stats
case object UnreachableException extends Exception
final case class UnsupportedException(msg: String) extends Exception

Types

Scope-managed resource.

Scope-managed resource.

Value members

Concrete methods

def acquire[R <: Resource](res: R)(implicit in: Scope): R

Acquire given resource in implicit scope.

Acquire given resource in implicit scope.

def defer(f: => Unit)(implicit in: Scope): Unit

Defer cleanup until the scope closes.

Defer cleanup until the scope closes.

def partitionBy[T](elems: Seq[T])(f: T => Any): Map[Int, Seq[T]]
def partitionBy[T](elems: Seq[T], batches: Int)(f: T => Any): Map[Int, Seq[T]]
def procs: Int
def time[T](msg: String)(f: => T): T

Print running time of closure to stdout.

Print running time of closure to stdout.

def unreachable: Nothing

Marker methods, called whenever a specific control-flow branch should never happen.

Marker methods, called whenever a specific control-flow branch should never happen.

def unsupported(v: Any): Nothing

Marker method, called whenever a specific control-flow branch is not supported.

Marker method, called whenever a specific control-flow branch is not supported.

def unsupported(s: String): Nothing