Skip to main content

InputPluginContext

Struct InputPluginContext 

Source
pub struct InputPluginContext<'scope> { /* private fields */ }
Expand description

Safe capabilities available during one input-plugin hook.

Implementations§

Source§

impl<'scope> InputPluginContext<'scope>

Source

pub const fn game(&self) -> &InputGameInfo

Loading-game identity copied from the Input API initialization call.

Source

pub const fn input_api_version(&self) -> InputApiVersion

Input API version selected by the SCS loader.

Source

pub fn register_device( &mut self, spec: InputDeviceSpec, ) -> PluginResult<InputDeviceId>

Declares one input device and returns its callback identity.

Registration remains explicit: the runtime does not infer a device from hook implementations or automatically install activity callbacks.

§Errors

Returns SdkError::NotNow outside InputPlugin::initialize. Invalid names, empty or oversized input arrays, duplicate device/input names, and an unrepresentable device ordinal return SdkError::InvalidParameter or SdkError::AlreadyRegistered.

Source

pub fn log(&self, level: LogLevel, arguments: Arguments<'_>)

Formats and writes one message to the game log.

Source

pub fn message(&self, arguments: Arguments<'_>)

Logs an informational message.

Source

pub fn warning(&self, arguments: Arguments<'_>)

Logs a warning message.

Source

pub fn error(&self, arguments: Arguments<'_>)

Logs an error message.

Auto Trait Implementations§

§

impl<'scope> !Send for InputPluginContext<'scope>

§

impl<'scope> !Sync for InputPluginContext<'scope>

§

impl<'scope> !UnwindSafe for InputPluginContext<'scope>

§

impl<'scope> Freeze for InputPluginContext<'scope>

§

impl<'scope> RefUnwindSafe for InputPluginContext<'scope>

§

impl<'scope> Unpin for InputPluginContext<'scope>

§

impl<'scope> UnsafeUnpin for InputPluginContext<'scope>

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.