Skip to main content

TelemetryPlugin

Trait TelemetryPlugin 

Source
pub trait TelemetryPlugin: Send + 'static {
    // Required methods
    fn metadata(&self) -> PluginMetadata;
    fn compatibility(&self) -> PluginCompatibility;
    fn initialize(&mut self, context: &mut PluginContext<'_>) -> PluginResult;

    // Provided methods
    fn channel(
        &mut self,
        _context: &mut PluginContext<'_>,
        _update: ChannelUpdate<'_>,
    ) { ... }
    fn event(
        &mut self,
        _context: &mut PluginContext<'_>,
        _event: TelemetryEvent<'_>,
    ) { ... }
    fn shutdown(&mut self, _context: &mut PluginContext<'_>) { ... }
}
Expand description

Application-facing telemetry plugin lifecycle.

Every method is called synchronously on the SDK thread. The framework catches unwinding panics at every ABI entry point; release builds in this workspace additionally use panic = "abort", matching a native game plugin’s usual failure policy.

Required Methods§

Source

fn metadata(&self) -> PluginMetadata

Declares the stable product name and build version used in runtime logs.

This method is required so framework diagnostics never silently fall back to an implementation type name or an unrelated workspace package.

Source

fn compatibility(&self) -> PluginCompatibility

Declares the Telemetry API and per-game schema requirements of this product.

This method is required rather than defaulting to the widest possible range. The runtime validates the declaration before invoking initialize, so an incompatible game never reaches product state setup or SDK registration.

Source

fn initialize(&mut self, context: &mut PluginContext<'_>) -> PluginResult

Declares subscriptions and initializes plugin-owned state.

Returning an error aborts initialization before a successful result is reported to the game. If later SDK registration fails, the framework unregisters the completed prefix and calls TelemetryPlugin::shutdown.

§Errors

Implementations may return PluginError to reject the loading game, report invalid configuration, or propagate a subscription failure.

Provided Methods§

Source

fn channel( &mut self, _context: &mut PluginContext<'_>, _update: ChannelUpdate<'_>, )

Receives one subscribed telemetry channel update.

Source

fn event( &mut self, _context: &mut PluginContext<'_>, _event: TelemetryEvent<'_>, )

Receives one SDK lifecycle, configuration, gameplay, or frame event.

Source

fn shutdown(&mut self, _context: &mut PluginContext<'_>)

Releases plugin-owned resources while the SDK logging function is valid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§