Skip to main content

TelemetryApi

Struct TelemetryApi 

Source
pub struct TelemetryApi<'a> { /* private fields */ }
Expand description

A typed view over the initialization parameters supplied by SCS.

Implementations§

Source§

impl<'a> TelemetryApi<'a>

Source

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.

Source

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.

Source

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.

Source

pub const fn version(&self) -> TelemetryApiVersion

Telemetry API version represented by this initialized view.

Source

pub const fn raw(&self) -> &ScsTelemetryInitParamsV101

Source

pub fn game_name(&self) -> &'a CStr

Source

pub fn game_id(&self) -> &'a CStr

Source

pub const fn game_schema_version(&self) -> GameSchemaVersion

Source

pub const fn session(&self) -> TelemetrySession

Returns an inert session handle for later callback entry points.

Source

pub fn with_call<R>( &self, operation: impl for<'scope> FnOnce(&SdkCall<'scope>) -> R, ) -> R

Executes an operation with the capabilities valid during initialization.

The higher-ranked lifetime prevents the operation from returning or storing the scoped capability.

Auto Trait Implementations§

§

impl<'a> !Send for TelemetryApi<'a>

§

impl<'a> !Sync for TelemetryApi<'a>

§

impl<'a> Freeze for TelemetryApi<'a>

§

impl<'a> RefUnwindSafe for TelemetryApi<'a>

§

impl<'a> Unpin for TelemetryApi<'a>

§

impl<'a> UnsafeUnpin for TelemetryApi<'a>

§

impl<'a> UnwindSafe for TelemetryApi<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.