Skip to main content

Class: Runtime

worker.Runtime

Core singleton representing an instance of the Rust Core SDK

Use install in order to customize the server connection options or other global process options.

Properties

logger

Readonly logger: Logger


native

Readonly native: Runtime


options

Readonly options: CompiledRuntimeOptions


_instance

Static Optional _instance: Runtime


defaultOptions

Static defaultOptions: RuntimeOptions

Default options get overridden when Core is installed and are remembered in case Core is re-instantiated after being shut down


instantiator

Static Optional instantiator: "install" | "instance"

Methods

flushLogs

flushLogs(): void

Flush any buffered logs.

This is a noop in case the instance is configured with logForwardingLevel=OFF.

Returns

void


install

install(options): Runtime

Instantiate a new Core object and set it as the singleton instance

If Core has already been instantiated with instance or this method, will throw a IllegalStateError.

Parameters

NameType
optionsRuntimeOptions

Returns

Runtime


instance

instance(): Runtime

Get or instantiate the singleton Core object

If Core has not been instantiated with install or this method, a new Core instance will be installed and configured to connect to a local server.

Returns

Runtime