Struct OwnedByteResource

Move-only ownership token for one retained physical byte resource.

struct OwnedByteResource;

An armed token owns exactly one release obligation.

Destroying an armed token releases that resource exactly once.

Moving the token transfers the obligation. A moved-from or relinquished token owns nothing.

Properties

NameTypeDescription
byteLength[get] ulongByte length of the currently owned resource.
ownsResource[get] boolWhether this token currently owns a physical resource.

Example

Example using the move-only ownership token in its empty state.

import raster;

OwnedByteResource resource;
assert(!resource.ownsResource);
assert(resource.byteLength == 0);