roles.inspect

The roles a value holds with their counts, and one page of points or primitives with their roles.

GeometricSince 0.15.0

Usage

TypeScript
Roles.inspect(geometry: VerbInput, options?: RolesInspectOptions): Result<RolesInspectPage>

Parameters

  • geometryGeometry | VerbValue

    The value to read; a VerbValue keeps its roles, a Geometry copy has none.

    Required

  • options.domain'point' | 'primitive'

    Which elements the page lists. Default 'primitive'.

  • options.rolestring

    Only the elements holding this role.

    Required

  • options.offsetnumber

    The first element shown, a whole number ≥ 0. Default 0. In count.

  • options.limitnumber

    At 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

TypeScript
Roles.inspect(Mesh.box().value, { limit: 3 }) // → a page with no roles once loadGeometryKernel() has run

See also