Skip to main content

Module schema

Module schema 

Source
Expand description

The Didbot namespace a document is written against: the entity types, the four actions with their contexts, and the per-collection record shapes that give context.value and context.existing a type.

One Cedar schema cannot type context.value differently per collection, since a context type belongs to an action. So there is one schema per described collection, each the same namespace with record.write’s context carrying that collection’s record type, plus a base schema with no record type at all for statements that never touch record.write. crate::Document::load picks which to validate a statement against.

Structs§

Described 🔒
Field
One field of a record shape.
Shape
The fields a collection’s records carry, as a closed Cedar record type.
ShapeError
A shape that does not make a Cedar schema.
Shapes
The collections this engine knows the shape of, each with the schema that shape produces, plus the base schema for everything else.

Enums§

ActionName
The actions a document can forbid, one per gate.
FieldType
The Cedar type of one record field.

Constants§

NAMESPACE
The Cedar namespace every type and action lives in.

Functions§

schema_json
The schema schema_text writes, in Cedar’s JSON schema format: its entity types with their attributes, and its actions with what each applies to. For a tool that reads the schema’s parts, not its text.
schema_text
The schema text for the namespace, with record.write’s context typed for record when there is one.
uid 🔒
Build an entity reference in the Didbot namespace.