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
//! `IPlayerRecordingData` — generated by `cargo xtask gen-omp` from `Server/Components/Recordings/recordings.hpp`.
//! Implemented by `PlayerRecordingData` in the server's `Recordings`.
//!
//! 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 `IPlayerRecordingData*`.
    pub IPlayerRecordingData;
}

/// `RecordingData_UID` in `Server/Components/Recordings/recordings.hpp`.
pub const PLAYER_RECORDINGS_UID: UID = 0x34db532857286482;

/// The player's `IPlayerRecordingData`, or null when the component providing it is not loaded.
///
/// Found by walking the player's extension map for `PLAYER_RECORDINGS_UID` — the
/// virtual `getExtension` does not consult that map. `IExtension`
/// is `IPlayerRecordingData`'s first base, so the extension pointer is the interface pointer.
///
/// # Safety
/// `player` must be a live `IPlayer`.
#[must_use]
pub unsafe fn player_recordings(player: *mut IPlayer) -> *mut IPlayerRecordingData {
    unsafe { extension(player.cast::<u8>(), PLAYER_RECORDINGS_UID) }.cast::<IPlayerRecordingData>()
}

slots! {
    /// `void IPlayerRecordingData::start(PlayerRecordingType, StringView)`
    SLOT_START: usize = 3, 3;
    /// `void IPlayerRecordingData::stop()`
    SLOT_STOP: usize = 4, 4;
}

virtual_fns! {
    /// `void IPlayerRecordingData::start(PlayerRecordingType, StringView)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerRecordingData`.
    pub fn player_recordings_start(
        data: IPlayerRecordingData,
        type_value: i32,
        file: StringView,
    ) = [0, SLOT_START];

    /// `void IPlayerRecordingData::stop()`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerRecordingData`.
    pub fn player_recordings_stop(data: IPlayerRecordingData) = [0, SLOT_STOP];
}