pub struct TelemetryApi<'a> { /* private fields */ }Expand description
A typed view over the initialization parameters supplied by SCS.
Implementations§
Source§impl<'a> TelemetryApi<'a>
impl<'a> TelemetryApi<'a>
Sourcepub const SUPPORTED_VERSIONS: &'static [TelemetryApiVersion]
pub const SUPPORTED_VERSIONS: &'static [TelemetryApiVersion]
Telemetry API versions with initialization layouts audited by this crate.
This list describes wrapper capability, not a product plugin’s minimum requirements. A framework may understand API 1.00 while a particular plugin still requires API 1.01 for gameplay events or signed 64-bit values.
Sourcepub const fn supports_version(version: TelemetryApiVersion) -> bool
pub const fn supports_version(version: TelemetryApiVersion) -> bool
Returns whether this wrapper has an audited initialization adapter for the supplied version.
The check is an exact whitelist. It deliberately does not accept an unknown minor version merely because SCS normally uses minor increments for additive changes: the initialization structure still needs to be compared with the new official header first.
Sourcepub unsafe fn from_raw(
version: TelemetryApiVersion,
params: *const ScsTelemetryInitParams,
) -> SdkResult<Self>
pub unsafe fn from_raw( version: TelemetryApiVersion, params: *const ScsTelemetryInitParams, ) -> SdkResult<Self>
Creates a typed view over the initialization parameters supplied by SCS.
§Safety
For a supported version, params must point to the live matching
telemetry initialization structure supplied by the game. An unsupported
version is rejected before params is inspected. The returned view may
only be used synchronously during the direct initialization call from
SCS, on the game’s main thread. The pointed-to function table and strings
must remain valid for that use.
§Errors
Returns SdkError::Unsupported before reading params when version
has no audited adapter. Returns SdkError::InvalidParameter when the
version is supported but params is null.
Sourcepub const fn version(&self) -> TelemetryApiVersion
pub const fn version(&self) -> TelemetryApiVersion
Telemetry API version represented by this initialized view.
pub const fn raw(&self) -> &ScsTelemetryInitParamsV101
pub fn game_name(&self) -> &'a CStr
pub fn game_id(&self) -> &'a CStr
pub const fn game_schema_version(&self) -> GameSchemaVersion
Sourcepub const fn session(&self) -> TelemetrySession
pub const fn session(&self) -> TelemetrySession
Returns an inert session handle for later callback entry points.