pub struct PawnComponent { /* private fields */ }Expand description
Typed wrapper for the Open Multiplayer server’s IPawnComponent.
Obtained via samp::plugin::omp_query::<PawnComponent>(). Exposes the
Pawn-specific methods (event dispatcher, AMX functions) in addition to the
generic IComponent ones (name(), version() via component_api).
Implementations§
Source§impl PawnComponent
impl PawnComponent
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
Returns the component name — equivalent to component_name(&self).
Sourcepub fn version(&self) -> Option<SemanticVersion>
pub fn version(&self) -> Option<SemanticVersion>
Returns the component version — equivalent to component_version(&self).
Sourcepub fn event_dispatcher(&self) -> *mut IEventDispatcherPawn
pub fn event_dispatcher(&self) -> *mut IEventDispatcherPawn
Returns the component’s IEventDispatcher<PawnEventHandler>.
Use it to register AMX event handlers (load/unload).
Sourcepub fn amx_functions(&self) -> usize
pub fn amx_functions(&self) -> usize
Returns the AMX function table as usize (raw pointer).
Available only after on_omp_ready — before that callback,
getAmxFunctions() returns 0 (server behavior).
Trait Implementations§
Source§impl Clone for PawnComponent
impl Clone for PawnComponent
Source§fn clone(&self) -> PawnComponent
fn clone(&self) -> PawnComponent
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 PawnComponent
Source§impl Debug for PawnComponent
impl Debug for PawnComponent
Source§impl OmpComponentHandle for PawnComponent
impl OmpComponentHandle for PawnComponent
Source§unsafe fn from_raw(ptr: NonNull<ServerComponent>) -> PawnComponent
unsafe fn from_raw(ptr: NonNull<ServerComponent>) -> PawnComponent
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 PawnComponent
impl !Sync for PawnComponent
impl Freeze for PawnComponent
impl RefUnwindSafe for PawnComponent
impl Unpin for PawnComponent
impl UnsafeUnpin for PawnComponent
impl UnwindSafe for PawnComponent
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