ScopedResourceOps

zio.blocks.scope.Scope.ScopedResourceOps
implicit class ScopedResourceOps[A](sr: Scope.this.$[Resource[A]])

Enrichment for $[Resource[A]] scoped values.

Provides allocate for acquiring a resource that is itself scoped. The Resource never leaves the scope wrapper; only its result becomes scoped.

Type parameters

A

the underlying resource value type

Attributes

Source
Scope.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def allocate: Scope.this.$[A]

Allocates the scoped Resource within this scope, returning the acquired value as $[A].

Allocates the scoped Resource within this scope, returning the acquired value as $[A].

The Resource is never extracted from $; only its acquired result becomes a new scoped value. Equivalent to self.allocate($unwrap(sr)).

Attributes

Returns

the acquired value wrapped as $[A]

Throws
java.lang.IllegalStateException

if this scope is already closed

Source
Scope.scala