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
| Name | Type | Description |
|---|---|---|
byteLength[get]
|
ulong | Byte length of the currently owned resource. |
ownsResource[get]
|
bool | Whether 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);