roles.inspect
The roles a value holds with their counts, and one page of points or primitives with their roles.
Usage
Roles.inspect(geometry: VerbInput, options?: RolesInspectOptions): Result<RolesInspectPage>Parameters
geometryGeometry | VerbValueThe value to read; a VerbValue keeps its roles, a Geometry copy has none.
options.domain'point' | 'primitive'Which elements the page lists. Default
'primitive'.options.rolestringOnly the elements holding this role.
options.offsetnumberThe first element shown, a whole number ≥ 0. Default
0. In count.options.limitnumberAt most this many elements, 1–1000. Default
100. In count.
Returns
Ok with { contentHash, roles, elements }: each role with its policy and how many points and primitives hold it; elements is a page { domain, total, offset, nextOffset?, items } of { index, id or primId and its minter when present, roles }.
Errors
Guarantees
- roles lists every role the value holds, sorted by its bytes
- paging with nextOffset visits every element of the domain (or every holder of role) once
- The same result on every machine.
Example
Roles.inspect(Mesh.box().value, { limit: 3 }) // → a page with no roles once loadGeometryKernel() has run