rust-samp-sdk 3.6.0

Low-level FFI bindings for the SA-MP AMX virtual machine and open.mp native component ABI. Used internally by `rust-samp`; depend on it directly only if you need raw access without the higher-level macros and lifecycle.
Documentation
//! `IConsoleComponent` — generated by `cargo xtask gen-omp` from `Server/Components/Console/console.hpp`.
//! Implemented by `ConsoleComponent` in the server's `Console`.
//!
//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
//! regenerate. Slots are clang's layout of the header for each ABI, checked
//! against the official binaries by `cargo xtask check-abi --generated`.

#![allow(unused_imports)]

use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
use crate::omp::types::{
    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
    UID, Vector2, Vector3, Vector4, WorldTimePoint,
};
use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
use crate::omp::*;

opaque! {
    /// Opaque handle for `IConsoleComponent*`.
    pub IConsoleComponent;
}

/// `ConsoleComponent_UID` in `Server/Components/Console/console.hpp`.
pub const CONSOLE_COMPONENT_UID: UID = 0xbfa24e49d0c95ee4;

impl ComponentInterface for IConsoleComponent {
    const UID: UID = CONSOLE_COMPONENT_UID;
}

slots! {
    /// `IEventDispatcher<ConsoleEventHandler> & IConsoleComponent::getEventDispatcher()`
    SLOT_GET_EVENT_DISPATCHER: usize = 18, 16;
    /// `void IConsoleComponent::send(StringView, const ConsoleCommandSenderData &)`
    SLOT_SEND: usize = 19, 17;
    /// `void IConsoleComponent::sendMessage(const ConsoleCommandSenderData &, StringView)`
    SLOT_SEND_MESSAGE: usize = 20, 18;
}

virtual_fns! {
    /// `IEventDispatcher<ConsoleEventHandler> & IConsoleComponent::getEventDispatcher()`.
    ///
    /// # Safety
    /// `component` must be a live `IConsoleComponent`.
    #[must_use]
    pub fn console_event_dispatcher(
        component: IConsoleComponent,
    ) -> *mut EventDispatcher<ConsoleHandler> = [0, SLOT_GET_EVENT_DISPATCHER] or std::ptr::null_mut();

    /// `void IConsoleComponent::send(StringView, const ConsoleCommandSenderData &)`.
    ///
    /// # Safety
    /// `component` must be a live `IConsoleComponent`.
    pub fn console_send(
        component: IConsoleComponent,
        command: StringView,
        sender: &ConsoleCommandSenderData,
    ) = [0, SLOT_SEND];

    /// `void IConsoleComponent::sendMessage(const ConsoleCommandSenderData &, StringView)`.
    ///
    /// # Safety
    /// `component` must be a live `IConsoleComponent`.
    pub fn console_send_message(
        component: IConsoleComponent,
        recipient: &ConsoleCommandSenderData,
        message: StringView,
    ) = [0, SLOT_SEND_MESSAGE];
}