pub struct Ref<'amx, T: Sized + AmxPrimitive> { /* private fields */ }Expand description
Implementations§
Source§impl<'amx, T: Sized + AmxPrimitive> Ref<'amx, T>
impl<'amx, T: Sized + AmxPrimitive> Ref<'amx, T>
Sourcepub unsafe fn new(amx_addr: i32, phys_addr: *mut T) -> Ref<'amx, T>
pub unsafe fn new(amx_addr: i32, phys_addr: *mut T) -> Ref<'amx, T>
Creates a Ref from the (AMX address, physical address) pair, already resolved.
Prefer obtaining Ref via Amx::get_ref or via automatic parsing of
native arguments — this direct API is the low-level path used
internally by the SDK.
§Safety
phys_addr must point to a live T cell for as long as this
Ref exists and must be aligned for T (debug asserts validate both
conditions in builds with debug_assertions).
Sourcepub fn address(&self) -> i32
pub fn address(&self) -> i32
Address of the cell in the AMX address space (not the physical pointer).
This is the value the VM sees — useful when passing the cell back into calls to other AMX functions.
Sourcepub fn as_mut_ptr(&mut self) -> *mut T
pub fn as_mut_ptr(&mut self) -> *mut T
Mutable physical pointer to the cell.
Trait Implementations§
Auto Trait Implementations§
impl<'amx, T> !Send for Ref<'amx, T>
impl<'amx, T> !Sync for Ref<'amx, T>
impl<'amx, T> Freeze for Ref<'amx, T>
impl<'amx, T> RefUnwindSafe for Ref<'amx, T>where
T: RefUnwindSafe,
impl<'amx, T> Unpin for Ref<'amx, T>
impl<'amx, T> UnsafeUnpin for Ref<'amx, T>
impl<'amx, T> UnwindSafe for Ref<'amx, T>where
T: RefUnwindSafe,
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