[−][src]Struct samp::cell::buffer::UnsizedBuffer
It's more like a temorary buffer that comes from AMX when a native is calling.
Example
use samp_sdk::cell::UnsizedBuffer; fn null_my_array(amx: &Amx, array: UnsizedBuffer, length: usize) -> AmxResult<u32> { let mut array = array.into_sized_buffer(length); unsafe { let slice = array.as_mut_slice(); std::ptr::write_bytes(slice.as_mut_ptr(), 0, length); } return Ok(1) }
Methods
impl<'amx> UnsizedBuffer<'amx>[src]
pub fn into_sized_buffer(self, len: usize) -> Buffer<'amx>[src]
Convert UnsizedBuffer into Buffer with given length.
Example
use samp_sdk::cell::UnsizedBuffer; fn push_ones(amx: &Amx, array: UnsizedBuffer, length: usize) { let mut buffer = array.into_sized_buffer(length); let slice = buffer.as_mut_slice(); for item in slice.iter_mut() { *item = 1; } }
pub fn as_ptr(&self) -> *const i32[src]
Return a raw pointer to an inner value.
pub fn as_mut_ptr(&mut self) -> *mut i32[src]
Return a mutable raw pointer to an inner value.
Trait Implementations
impl<'amx> AmxCell<'amx> for UnsizedBuffer<'amx>[src]
Auto Trait Implementations
impl<'amx> !Send for UnsizedBuffer<'amx>
impl<'amx> !Sync for UnsizedBuffer<'amx>
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>,