pub struct TimersComponent { /* private fields */ }Expand description
Typed wrapper for the Open Multiplayer server’s ITimersComponent.
Obtained via samp::plugin::omp_query::<TimersComponent>(). Exposes
create_repeating for timer creation and the generic IComponent methods
(name, version).
Implementations§
Source§impl TimersComponent
impl TimersComponent
Sourcepub fn version(&self) -> Option<SemanticVersion>
pub fn version(&self) -> Option<SemanticVersion>
Returns the component version.
Sourcepub unsafe fn create_repeating(
&self,
handler: *mut TimerTimeOutHandler,
interval_ms: i64,
) -> *mut ITimer
pub unsafe fn create_repeating( &self, handler: *mut TimerTimeOutHandler, interval_ms: i64, ) -> *mut ITimer
Creates a repeating timer on the server.
handler must be heap-allocated (e.g. Box::into_raw) and must be
dropped inside the TimerHandlerVTable::free callback.
§Safety
handler must point to a live TimerTimeOutHandler while the timer
is active.
Trait Implementations§
Source§impl Clone for TimersComponent
impl Clone for TimersComponent
Source§fn clone(&self) -> TimersComponent
fn clone(&self) -> TimersComponent
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 TimersComponent
Source§impl Debug for TimersComponent
impl Debug for TimersComponent
Source§impl OmpComponentHandle for TimersComponent
impl OmpComponentHandle for TimersComponent
Source§unsafe fn from_raw(ptr: NonNull<ServerComponent>) -> TimersComponent
unsafe fn from_raw(ptr: NonNull<ServerComponent>) -> TimersComponent
Builds the wrapper from the pointer returned by
query_component. Read moreSource§fn as_raw(&self) -> NonNull<ServerComponent>
fn as_raw(&self) -> NonNull<ServerComponent>
Returns the raw component pointer.
Auto Trait Implementations§
impl !Send for TimersComponent
impl !Sync for TimersComponent
impl Freeze for TimersComponent
impl RefUnwindSafe for TimersComponent
impl Unpin for TimersComponent
impl UnsafeUnpin for TimersComponent
impl UnwindSafe for TimersComponent
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