[−][src]Struct samp::prelude::Ref
A reference to a cell in the Amx.
Notes
This type implements Deref trait that allows you read or write to inner value (like smart pointers Box<T>, Rc<T>).
Methods
impl<'amx, T> Ref<'amx, T> where
T: AmxPrimitive, [src]
T: AmxPrimitive,
pub unsafe fn new(amx_addr: i32, phys_addr: *mut T) -> Ref<'amx, T>[src]
Create a new wrapper over an AMX cell.
Safety
Ref<T> should be alive as long as phys_addr or it will dangling pointer.
It's not recomended to use directly, instead get a reference from Args or Amx::get_ref.
pub fn address(&self) -> i32[src]
Get an inner AMX address to cell (not physical).
Example
use samp_sdk::cell::Ref; fn native_fn(amx: &Amx, arg: Ref<usize>) { let cell_addr = arg.address(); println!("The argument stored in the {} cell.", cell_addr); }
pub fn as_ptr(&self) -> *const T[src]
Get a pointer to a memory cell.
pub fn as_mut_ptr(&mut self) -> *mut T[src]
Get a mutable pointer to a memory cell.
Trait Implementations
impl<'_, T> DerefMut for Ref<'_, T> where
T: AmxPrimitive, [src]
T: AmxPrimitive,
impl<'amx, T> AmxCell<'amx> for Ref<'amx, T> where
T: AmxPrimitive, [src]
T: AmxPrimitive,
fn from_raw(amx: &'amx Amx, cell: i32) -> Result<Ref<'amx, T>, AmxError>[src]
fn as_cell(&self) -> i32[src]
impl<'_, T> Deref for Ref<'_, T> where
T: AmxPrimitive, [src]
T: AmxPrimitive,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
T: From<U>, [src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId[src]
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,