Skip to main content

AmxPrimitive

Trait AmxPrimitive 

Source
pub unsafe trait AmxPrimitive: Sized { }
Expand description

Marker: the value fits in a single AMX cell (32 bits) and can be stored directly in the VM stack/heap without indirection.

Implemented for i8, u8, i16, u16, i32, u32, usize, isize, f32 and bool.

§Safety

Only implement for types that fit in 32 bits — the SDK assumes this when copying bytes from the cell. Larger types corrupt the VM memory.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AmxPrimitive for bool

Source§

impl AmxPrimitive for f32

Source§

impl AmxPrimitive for i8

Source§

impl AmxPrimitive for i16

Source§

impl AmxPrimitive for i32

Source§

impl AmxPrimitive for isize

Source§

impl AmxPrimitive for u8

Source§

impl AmxPrimitive for u16

Source§

impl AmxPrimitive for u32

Source§

impl AmxPrimitive for usize

Implementors§