Skip to main content

Crate aranya_policy_vm

Crate aranya_policy_vm 

Source
Expand description

The Aranya Policy Virtual Machine

See the policy book for more information on the policy language.

Re-exports§

pub use aranya_policy_ast as ast;

Modules§

ast
The Aranya Policy Language’s AST.
ffi
The VM’s foreign function interface.
named
NamedMap and associated traits and types.

Macros§

arg
Shorthand for creating Args.
ident
Creates an Identifier from a string literal.
text
Creates a Text from a string literal.

Structs§

ActionContext
Context for actions
ActionDef
An action definition.
ActionDefResolver
The resolver for an archived ActionDef
ArchivedActionDef
An archived ActionDef
ArchivedAttribute
An archived Attribute
ArchivedCodeMap
An archived CodeMap
ArchivedCommandDef
An archived CommandDef
ArchivedFact
An archived Fact
ArchivedFactKey
An archived FactKey
ArchivedFactValue
An archived FactValue
ArchivedField
An archived Field
ArchivedLabel
An archived Label
ArchivedModule
An archived Module
ArchivedModuleV0
An archived ModuleV0
ArchivedStruct
An archived Struct
Attribute
A command attribute.
AttributeResolver
The resolver for an archived Attribute
BenchMeasurementsbench
Holds durations
BenchStatbench
Benchmarking statistics
CodeMap
The code map contains the original source and can map VM instructions to text ranges inside that source.
CodeMapResolver
The resolver for an archived CodeMap
CommandDef
A command definition.
CommandDefResolver
The resolver for an archived CommandDef
Fact
A Fact
FactKey
One labeled value in a fact key. A sequence of FactKeys mapped to a sequence of FactValues comprises a Fact.
FactKeyResolver
The resolver for an archived FactKey
FactResolver
The resolver for an archived Fact
FactValue
One labeled value in a fact value.
FactValueResolver
The resolver for an archived FactValue
Field
A struct or command field.
FieldResolver
The resolver for an archived Field
Identifier
A textual identifier which matches [a-zA-Z][a-zA-Z0-9_]*.
KVPair
A generic key/value pair. Used for Effects and Command fields. Technically identical to a FactValue but separate to distinguish usage.
Label
Labels are branch targets and execution entry points.
LabelResolver
The resolver for an archived Label
Machine
The core policy VM type.
MachineError
An error returned by Machine.
MachineStack
An implementation of Stack.
Module
The serializable state of a Machine.
ModuleResolver
The resolver for an archived Module
ModuleV0
The Version 0 module format
ModuleV0Resolver
The resolver for an archived ModuleV0
OpenContext
Context for open blocks
PolicyContext
Context for Policy and Recall blocks
RangeError
An error for a range that doesn’t exist. Used in CodeMap.
RunState
The “run state” of the machine.
SealContext
Context for seal blocks
SpannedText
This is a simplified version of Pest’s Span. We can’t use Pest’s version because we need to work in no_std environments.
Stopwatchbench
Measures and records times for named tasks.
Struct
A Struct value
StructResolver
The resolver for an archived Struct
Text
A string-like value which is utf8 without nul bytes.
UnsupportedVersion
Unsupported Module version.

Enums§

ArchivedExitReason
An archived ExitReason
ArchivedHashableValue
An archived HashableValue
ArchivedInstruction
An archived Instruction
ArchivedLabelType
An archived LabelType
ArchivedMeta
An archived Meta
ArchivedModuleData
An archived ModuleData
ArchivedTarget
An archived Target
ArchivedValue
An archived Value
CommandContext
Properties of policy execution available through FFI.
ExitReason
Reason for ending execution.
ExitReasonResolver
The resolver for an archived ExitReason
HashableValue
The subset of Values that can be hashed. Only these types of values can be used in the key portion of a Fact.
HashableValueResolver
The resolver for an archived HashableValue
Instruction
The machine instruction types
InstructionResolver
The resolver for an archived Instruction
LabelType
Types of Labels
LabelTypeResolver
The resolver for an archived LabelType
MachineErrorType
Possible machine errors.
MachineIOError
An I/O error.
MachineStatus
Status of machine execution after stepping through each instruction.
Meta
Compiler Tracer metadata
MetaResolver
The resolver for an archived Meta
ModuleData
Versioned Module data.
ModuleDataResolver
The resolver for an archived ModuleData
Target
The target of a branch
TargetResolver
The resolver for an archived Target
Value
All of the value types allowed in the VM
ValueConversionError
Indicates that the Value conversion has failed
ValueResolver
The resolver for an archived Value
Version
Identifies a Module.

Traits§

MachineIO
The part of a Machine that performs I/O.
Stack
A stack data structure.
TryAsMut
Like AsMut, but fallible.
TryFromValue
Trait for converting from a Value, similar to TryFrom<Value>.
Typed
Allows a type to be used by FFI derive.

Functions§

bench_aggregatebench
Adds the given measurements to the global measurements.
bench_measurementsbench
Returns the accumulated benchmarking measurements.

Type Aliases§

BaseId
The base ID type.
FactKeyList
A list of fact keys.
FactValueList
A list of fact values.