Crate koto_runtime

Source
Expand description

Contains the runtime and core library for the Koto language

Re-exports§

pub use koto_derive as derive;

Modules§

core_lib
The core library for the Koto language
prelude
A collection of useful items to make it easier to work with koto_runtime

Macros§

make_ptr
Makes a Ptr, with support for casting to trait objects
make_ptr_mut
Makes a PtrMut, with support for casting to trait objects
runtime_error
Creates a crate::Error from a message (with format-like behaviour), wrapped in Err

Structs§

Borrow
An immutably borrowed reference to a value borrowed from a PtrMut
BorrowMut
A mutably borrowed reference to a value borrowed from a PtrMut
BufferedFile
A combination of BufReader and BufWriter
CallContext
The context provided when a call to a KNativeFunction is made
DefaultStderr
The default stderr used in Koto
DefaultStdin
The default stdin used in Koto
DefaultStdout
The default stdout used in Koto
DisplayContext
A helper for converting Koto values to strings
Error
An error thrown by the Koto runtime
InstructionFrame
A chunk and instruction pointer in a call stack where an error was thrown
KCell
A mutable value with borrowing checked at runtime
KFunction
A Koto function
KIterator
The iterator value type used in Koto
KList
The List type used by the Koto runtime
KMap
The core hash map value type used in Koto, containing a ValueMap and a MetaMap
KNativeFunction
An function that’s defined outside of the Koto runtime
KObject
A KotoObject wrapper used in the Koto runtime
KRange
The integer range type used by the Koto runtime
KString
The String type used by the Koto runtime
KTuple
The Tuple type used by the Koto runtime
KotoVm
The Koto runtime’s virtual machine
KotoVmSettings
The configurable settings that should be used by the Koto runtime
MetaMap
The meta map used by KMap
MethodContext
Context provided to a function that implements an object method
Ptr
An immutable pointer to a value in allocated memory
ValueKey
The key type used by ValueMap
ValueMap
The (ValueKey -> Value) ‘data’ hash map used by the Koto runtime

Enums§

BinaryOp
The binary operations that can be implemented in a MetaMap
CallArgs
Function call arguments
ErrorKind
The different error types that can be thrown by the Koto runtime
IsIterable
An enum that indicates to the runtime if a KotoObject is iterable
KIteratorOutput
The output type for iterators in Koto
KNumber
The Number type used by the Koto runtime
KValue
The core Value type for Koto
MetaKey
The key type used by MetaMaps
ReturnOrYield
An output value from KotoVm::continue_running, either from a return or yield expression
UnaryOp
The unary operations that can be implemented in a MetaMap

Traits§

KotoCopy
A trait for defining how objects should behave when copied in the Koto runtime
KotoEntries
A trait that allows objects to support ‘.’ accesses
KotoField
A trait that represents the basic requirements of fields in a type that implements KotoObject
KotoFile
A trait used for file-like-things in Koto
KotoFunction
A trait for native functions used by the Koto runtime
KotoIterator
The trait used to implement iterators in Koto
KotoObject
A trait for implementing objects that can be added to the Koto runtime
KotoRead
A trait that defines the read operations of a KotoFile
KotoSend
An empty trait for single-threaded contexts, implemented for all types
KotoSync
An empty trait for single-threaded contexts, implemented for all types
KotoType
A trait for specifying a Koto object’s type
KotoWrite
A trait that defines the write operations of a KotoFile
ModuleImportedCallback
The trait used by the ‘module imported’ callback mechanism

Functions§

unexpected_args
Creates an unexpected arguments error containing the provided arguments
unexpected_args_after_instance
Creates an unexpected arguments error containing the provided instance and arguments
unexpected_type
Creates an error that describes a type mismatch

Type Aliases§

KotoHasher
The hasher used throughout the Koto runtime
PtrMut
A mutable pointer to a value in allocated memory
Result
The Result type used by the Koto Runtime
ValueVec
The underlying Vec type used by KList