Skip to main content

Crate scs_sdk_plugin

Crate scs_sdk_plugin 

Source
Expand description

Safe application framework for SCS Telemetry SDK plugins.

This crate owns the parts of an SCS plugin which inherently require unsafe Rust: exported ABI symbols, raw callback trampolines, stable opaque context addresses, tagged-union borrowing, lifecycle sequencing, registration rollback, and panic containment. Application crates implement TelemetryPlugin and export it with export_plugin! using ordinary safe Rust only.

§Layering

  • scs-sdk-sys mirrors the C ABI and header constants;
  • scs-sdk supplies typed descriptors and callback-time borrowed views;
  • this crate turns those pieces into a safe plugin lifecycle;
  • scs-sdk-plugin-macros emits the two symbols discovered by the game.

§Threading model

The official SDK invokes initialization, telemetry callbacks, and shutdown on the game main thread. The runtime nevertheless serializes its global state with a mutex so Rust’s process-wide statics remain sound and poisoned locks can be recovered deterministically. Plugin implementations are required to be Send because they are stored behind that synchronized boundary; the framework does not itself move callbacks onto worker threads.

Re-exports§

pub use scs_sdk as sdk;

Macros§

export_input_plugin
Generates the two loader-visible symbols for one SCS input plugin.
export_plugin
Generates the two symbols loaded by ETS2 or ATS for one plugin instance.

Structs§

ChannelUpdate
One safely borrowed channel callback.
ConfigurationEvent
High-level view over one SDK configuration event.
GameCompatibility
Minimum telemetry schema required for one supported SCS game.
GameInfo
Owned identity of the game which loaded the plugin.
GameplayEvent
High-level view over one SDK gameplay event.
InputAxisValue
A finite normalized value for one float input axis.
InputDeviceId
Stable identity assigned to one device declared during plugin initialization.
InputDeviceSpec
Explicit declaration of one SCS input device.
InputEvent
One safe input event to write into the buffer supplied by SCS.
InputEventFlags
Flags supplied when SCS requests the next event from a device.
InputEventRequest
Data supplied each time SCS asks one device for its next event.
InputGameCompatibility
Minimum Input API game version required for one recognized game.
InputGameInfo
Owned identity and input-specific version of the loading game.
InputIndex
Strong zero-based input index limited by the official per-device maximum.
InputPluginCompatibility
Explicit API and game requirements of one input plugin.
InputPluginContext
Safe capabilities available during one input-plugin hook.
InputSpec
One bool or normalized float-axis input exposed by an input device.
PluginCompatibility
Explicit runtime requirements declared by one product plugin.
PluginContext
Safe capabilities available while the framework calls plugin code.
PluginError
An initialization failure with both an SDK result code and human-readable context suitable for the game log.
PluginMetadata
Static identity reported by the framework during plugin lifecycle logging.

Enums§

Game
Recognized games which implement the SCS Telemetry SDK.
InputAxisValueError
Why a raw float could not become a normalized InputAxisValue.
InputDeviceType
Input-device class declared by the official SDK.
InputValue
Safe event value returned by an application input provider.
InputValueType
Value representation accepted for an input-device entry.
TelemetryEvent
Safe event payload delivered to TelemetryPlugin::event.
TelemetryEventKind
Application-facing name for the canonical sdk::Event descriptor.

Traits§

InputPlugin
Application-facing lifecycle for one SCS input plugin.
TelemetryPlugin
Application-facing telemetry plugin lifecycle.

Type Aliases§

PluginResult
Result type returned by plugin initialization and subscription helpers.