Skip to main content

Crate garnish_lang_traits

Crate garnish_lang_traits 

Source
Expand description

This crate contains interfaces and helper functions used by the Garnish Core libraries.

Modules§

helpers

Structs§

EmptyContext
Concrete object for when a runtime requires no context functionality. Can use constants EMPTY_CONTEXT and NO_CONTEXT if needed as type parameters.
RuntimeError
Error implementation for crate::GarnishRuntime instruction methods.

Enums§

ErrorType
List of possible error types a RuntimeError can be categorized as.
GarnishDataType
List of Garnish data types.
Instruction
List of possible instructions a Garnish runtime can process.

Constants§

EMPTY_CONTEXT
Constant instantiation of EmptyContext.
NO_CONTEXT
An Option set to None. Typed as a mutable reference to an EmptyContext for use in crate::GarnishRuntime instruction methods that require a context be passed.

Traits§

GarnishContext
Functionality required by Garnish contexts.
GarnishData
Trait defining what a data access operations are required by a runtime.
GarnishNumber
Arithmetic operations required so a runtime can resolve associated instruction.
GarnishRuntime
Trait containing instruction operations Garnish needs to execute. All instruction methods (e.g. all except GarnishRuntime::get_data, GarnishRuntime::get_data_mut should a Result. With the Ok value being the next instruction address to be executed if not sequential, otherwise return None
TypeConstants
Trait to provide constant values that a runtime will need access to.