pub struct LuaString<'l>(_);Expand description
Represents a lua string on the stack
Implementations§
Methods from Deref<Target = ValRef<'l>>§
sourcepub fn deserialize<T: Deserialize<'a>>(&'a self) -> Result<T, DesErr>
pub fn deserialize<T: Deserialize<'a>>(&'a self) -> Result<T, DesErr>
deserialize a lua value
sourcepub fn transcode<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
pub fn transcode<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
transcode a lua value to another serialize format
pub fn state(&self) -> &'a State
pub fn type_of(&self) -> Type
pub fn is_nil(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_table(&self) -> bool
pub fn is_function(&self) -> bool
pub fn to_safe_bytes(&self) -> Option<&'a [u8]>
pub fn to_safe_str(&self) -> Option<&'a str>
pub fn to_bytes(&self) -> Option<&[u8]>
pub fn to_str(&self) -> Option<&str>
pub fn to_string_lossy(&self) -> Option<Cow<'_, str>>
pub fn to_bool(&self) -> bool
pub fn to_integer(&self) -> lua_Integer
pub fn to_number(&self) -> lua_Number
pub fn index(&self) -> Index
pub fn check_type(&self, ty: Type) -> Result<()>
pub fn cast<'v, T: FromLua<'a> + 'v>(&'v self) -> Option<T>
pub fn check_cast<T: FromLua<'a>>(&self) -> Result<T>
pub fn geti(&self, i: impl Into<lua_Integer>) -> Result<ValRef<'a>>
pub fn seti<V: ToLua>(&self, i: impl Into<lua_Integer>, v: V) -> Result<()>
sourcepub fn set<K: ToLua, V: ToLua>(&self, k: K, v: V) -> Result<()>
pub fn set<K: ToLua, V: ToLua>(&self, k: K, v: V) -> Result<()>
Set value, equivalent to self[k] = v in lua
sourcepub fn get<K: ToLua>(&self, k: K) -> Result<ValRef<'a>>
pub fn get<K: ToLua>(&self, k: K) -> Result<ValRef<'a>>
Get value associated, equivalent to return self[k] in lua
pub fn getopt<K: ToLua, V: FromLua<'a>>(&self, k: K) -> Result<Option<V>>
sourcepub fn pcall<T: ToLuaMulti, R: FromLuaMulti<'a>>(&self, args: T) -> Result<R>
pub fn pcall<T: ToLuaMulti, R: FromLuaMulti<'a>>(&self, args: T) -> Result<R>
Call this value as a function
sourcepub fn pcall_void<T: ToLuaMulti>(&self, args: T) -> Result<()>
pub fn pcall_void<T: ToLuaMulti>(&self, args: T) -> Result<()>
Invoke pcall() without return value
pub fn has_metatable(&self) -> bool
sourcepub fn set_metatable(&self, t: Table<'_>) -> Result<()>
pub fn set_metatable(&self, t: Table<'_>) -> Result<()>
Set metatable for lua table or userdata
sourcepub fn remove_metatable(&self)
pub fn remove_metatable(&self)
Remove metatable for lua table or userdata
sourcepub fn call_metamethod<T: ToLuaMulti, R: FromLuaMulti<'a>>(
&self,
m: &str,
args: T
) -> Result<R>
pub fn call_metamethod<T: ToLuaMulti, R: FromLuaMulti<'a>>( &self, m: &str, args: T ) -> Result<R>
Call a metamethod
pub fn as_table(&self) -> Option<&Table<'a>>
pub fn as_function(&self) -> Option<&Function<'a>>
pub fn as_string(&self) -> Option<&LuaString<'a>>
pub fn as_thread(&self) -> Option<&LuaThread<'a>>
pub fn as_userdata(&self) -> Option<&LuaUserData<'a>>
Trait Implementations§
Auto Trait Implementations§
impl<'l> !RefUnwindSafe for LuaString<'l>
impl<'l> !Send for LuaString<'l>
impl<'l> !Sync for LuaString<'l>
impl<'l> Unpin for LuaString<'l>
impl<'l> !UnwindSafe for LuaString<'l>
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