[−][src]Struct samp::prelude::AmxString
Methods
impl<'amx> AmxString<'amx>[src]
pub unsafe fn new(buffer: Buffer<'amx>, bytes: &[u8]) -> AmxString<'amx>[src]
Create a new AmxString from an allocated buffer and fill it with a string
pub fn to_bytes(&self) -> Vec<u8>[src]
Convert an AMX string to a Vec<u8>.
pub fn to_string(&self) -> String[src]
Convert an AMX string to a String.
Only ASCII chars by default. Pass cp1251 to crate features to enable Windows 1251 encoding (TODO).
Example
use samp_sdk::cell::AmxString; fn log_error(&self, amx: &Amx, text: AmxString) -> AmxResult<bool> { if !self.logger_enabled { return Ok(false); } let string = text.to_string(); println!("[{}] PluginName error: {}", current_date(), string); Ok(true) }
pub fn len(&self) -> usize[src]
Return a length of a string.
pub fn is_empty(&self) -> bool[src]
pub fn bytes_len(&self) -> usize[src]
Return a length of a buffer of a string
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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>,