Struct RasterLease

Lifetime capability for a retained raster representation.

struct RasterLease(T);

Copying a RasterLease retains the same backing representation. The retained-owner reference count is non-atomic; the lease does not provide implicit synchronization for concurrent copies, assignment or destruction.

A RasterView obtained from view() borrows from this lease and therefore must not outlive it. A writable borrow from tryWritableView() is bound to the same retained lifetime and does not imply exclusive storage.

Methods

NameDescription
tryWritableView (success) Attempts to return a non-owning writable semantic view borrowing from this lease.
view () Returns a non-owning read-only RasterView borrowing from this lease.

Example

Example inspecting the default retained-lifetime capability.

import raster;

RasterLease!ubyte lease;
bool success;
scope auto writable = lease.tryWritableView(success);

assert(!success);
assert(writable.empty);