Scope

scalacv.Managed.Scope
final class Scope

The own handed to a Managed.scope body: registers a native object with the scope and hands it straight back, so val m = own(Mat()) reads as an ordinary binding.

Attributes

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

Members list

Value members

Concrete methods

def adopt[A](handle: Managed[A]): A

apply for a value that arrives already wrapped — the Managed[Mat] every mid-level Ops call hands back. The scope takes over that handle rather than making a second one, so the Mat is still released exactly once.

apply for a value that arrives already wrapped — the Managed[Mat] every mid-level Ops call hands back. The scope takes over that handle rather than making a second one, so the Mat is still released exactly once.

A separate name rather than an overload of apply: Managed[A] is itself an A as far as overload resolution is concerned, and the two candidates would be picked between before the Releasable search that distinguishes them.

Attributes

Source
Managed.scala
def apply[A](a: A)(using Releasable[A]): A

Takes ownership of a for the rest of the enclosing Managed.scope and returns it for use.

Takes ownership of a for the rest of the enclosing Managed.scope and returns it for use.

Attributes

Source
Managed.scala