pub enum LuaString {
    Heap(Vec<u8>),
    Static(&'static [u8]),
    Stack([u8; 23], u8),
}Expand description
A Lua string, which can be stored on the heap, stack, or as a static reference, based on its length.
Variants§
Implementations§
Source§impl LuaString
 
impl LuaString
pub fn from_static_str(s: &'static str) -> Self
pub fn from_static(s: &'static [u8]) -> Self
pub fn from_vec(v: Vec<u8>) -> Self
pub fn from_string(s: String) -> Self
pub fn from_slice(s: &[u8]) -> Self
pub fn from_str(s: &str) -> Self
pub fn len(&self) -> usize
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_vec(self) -> Vec<u8> ⓘ
pub fn into_mapped(self, f: impl Fn(u8) -> u8) -> Self
pub fn try_to_number(&self) -> Result<LuaNumber, RuntimeError>
Trait Implementations§
Source§impl Ord for LuaString
 
impl Ord for LuaString
Source§impl PartialOrd for LuaString
 
impl PartialOrd for LuaString
impl Eq for LuaString
Auto Trait Implementations§
impl Freeze for LuaString
impl RefUnwindSafe for LuaString
impl Send for LuaString
impl Sync for LuaString
impl Unpin for LuaString
impl UnwindSafe for LuaString
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.