pub struct InputSession { /* private fields */ }Expand description
Inert handle retained for direct input callbacks and shutdown logging.
Implementations§
Source§impl InputSession
impl InputSession
Sourcepub unsafe fn with_call<R>(
self,
operation: impl for<'scope> FnOnce(&InputCall<'scope>) -> R,
) -> R
pub unsafe fn with_call<R>( self, operation: impl for<'scope> FnOnce(&InputCall<'scope>) -> R, ) -> R
Creates a callback-scoped capability during a direct call from SCS.
The higher-ranked callback keeps the created InputCall inside the
direct SDK callback scope:
ⓘ
use scs_sdk::input::{InputCall, InputSession};
fn leak(session: InputSession) -> &'static InputCall<'static> {
unsafe { session.with_call(|call| call) }
}§Safety
The caller must be executing synchronously in an input callback or shutdown entry point on the game main thread while this session is live.
Trait Implementations§
Source§impl Clone for InputSession
impl Clone for InputSession
Source§fn clone(&self) -> InputSession
fn clone(&self) -> InputSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InputSession
Auto Trait Implementations§
impl Freeze for InputSession
impl RefUnwindSafe for InputSession
impl Send for InputSession
impl Sync for InputSession
impl Unpin for InputSession
impl UnsafeUnpin for InputSession
impl UnwindSafe for InputSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more