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§
Sourcefn metadata(&self) -> PluginMetadata
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.
Sourcefn compatibility(&self) -> PluginCompatibility
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.
Sourcefn initialize(&mut self, context: &mut PluginContext<'_>) -> PluginResult
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§
Sourcefn channel(
&mut self,
_context: &mut PluginContext<'_>,
_update: ChannelUpdate<'_>,
)
fn channel( &mut self, _context: &mut PluginContext<'_>, _update: ChannelUpdate<'_>, )
Receives one subscribed telemetry channel update.
Sourcefn event(
&mut self,
_context: &mut PluginContext<'_>,
_event: TelemetryEvent<'_>,
)
fn event( &mut self, _context: &mut PluginContext<'_>, _event: TelemetryEvent<'_>, )
Receives one SDK lifecycle, configuration, gameplay, or frame event.
Sourcefn shutdown(&mut self, _context: &mut PluginContext<'_>)
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".