pub struct ISourceMod(/* private fields */);
Implementations§
Source§impl ISourceMod
impl ISourceMod
pub fn log_message(&self, myself: &IExtension, msg: String)
pub fn log_error(&self, myself: &IExtension, msg: String)
Sourcepub fn add_game_frame_hook(&self, hook: GameFrameHookFunc) -> GameFrameHookId
pub fn add_game_frame_hook(&self, hook: GameFrameHookFunc) -> GameFrameHookId
Add a function that will be called every game frame until the GameFrameHookId
return value
is dropped. This is a fairly low-level building block as the callback must be extern "C"
.
Sourcepub fn add_frame_action<F>(&self, func: F)where
F: FnMut() + 'static,
pub fn add_frame_action<F>(&self, func: F)where
F: FnMut() + 'static,
Add a function that will be called on the next game frame. This has a runtime cost as this API
is thread-safe on the SM side, but it supports a Rust closure so is more flexible than ISourceMod::add_game_frame_hook
.
Trait Implementations§
Source§impl Debug for ISourceMod
impl Debug for ISourceMod
Source§impl RequestableInterface for ISourceMod
impl RequestableInterface for ISourceMod
fn get_interface_name() -> &'static str
fn get_interface_version() -> u32
Source§unsafe fn from_raw_interface(iface: SMInterface) -> ISourceMod
unsafe fn from_raw_interface(iface: SMInterface) -> ISourceMod
Safety Read more
Source§impl SMInterfaceApi for ISourceMod
impl SMInterfaceApi for ISourceMod
fn get_interface_version(&self) -> u32
fn get_interface_name(&self) -> &str
fn is_version_compatible(&self, version: u32) -> bool
Auto Trait Implementations§
impl Freeze for ISourceMod
impl RefUnwindSafe for ISourceMod
impl !Send for ISourceMod
impl !Sync for ISourceMod
impl Unpin for ISourceMod
impl UnwindSafe for ISourceMod
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