pub struct LuaStringLib;Expand description
Lua string library (includes Factorio’s pack / packsize / unpack).
Implementations§
Source§impl LuaStringLib
impl LuaStringLib
pub const fn new() -> Self
pub fn byte( &self, s: &'static str, i: Option<i64>, j: Option<i64>, ) -> Option<u8>
pub fn char(&self, bytes: impl Into<LuaAny>) -> &'static str
pub fn find( &self, s: &'static str, pattern: &'static str, init: Option<i64>, plain: Option<bool>, ) -> Option<(i64, i64)>
Sourcepub fn format_1(&self, fmt: &'static str, a: impl Into<LuaAny>) -> &'static str
pub fn format_1(&self, fmt: &'static str, a: impl Into<LuaAny>) -> &'static str
string.format(fmt, a). Lowers as string.format.
Sourcepub fn format_2(
&self,
fmt: &'static str,
a: impl Into<LuaAny>,
b: impl Into<LuaAny>,
) -> &'static str
pub fn format_2( &self, fmt: &'static str, a: impl Into<LuaAny>, b: impl Into<LuaAny>, ) -> &'static str
string.format(fmt, a, b). Lowers as string.format.
Sourcepub fn format_3(
&self,
fmt: &'static str,
a: impl Into<LuaAny>,
b: impl Into<LuaAny>,
c: impl Into<LuaAny>,
) -> &'static str
pub fn format_3( &self, fmt: &'static str, a: impl Into<LuaAny>, b: impl Into<LuaAny>, c: impl Into<LuaAny>, ) -> &'static str
string.format(fmt, a, b, c). Lowers as string.format.
Sourcepub fn format_4(
&self,
fmt: &'static str,
a: impl Into<LuaAny>,
b: impl Into<LuaAny>,
c: impl Into<LuaAny>,
d: impl Into<LuaAny>,
) -> &'static str
pub fn format_4( &self, fmt: &'static str, a: impl Into<LuaAny>, b: impl Into<LuaAny>, c: impl Into<LuaAny>, d: impl Into<LuaAny>, ) -> &'static str
string.format(fmt, a, b, c, d). Lowers as string.format.
pub fn gmatch(&self, s: &'static str, pattern: &'static str) -> LuaAny
pub fn gsub( &self, s: &'static str, pattern: &'static str, repl: impl Into<LuaAny>, n: Option<i64>, ) -> (&'static str, i64)
pub fn len(&self, s: &'static str) -> i64
pub fn lower(&self, s: &'static str) -> &'static str
pub fn match( &self, s: &'static str, pattern: &'static str, init: Option<i64>, ) -> Option<&'static str>
Sourcepub fn pack(&self, fmt: &'static str, values: impl Into<LuaAny>) -> &'static str
pub fn pack(&self, fmt: &'static str, values: impl Into<LuaAny>) -> &'static str
Binary pack (Lua 5.4 backport in Factorio).
pub fn packsize(&self, fmt: &'static str) -> i64
pub fn rep( &self, s: &'static str, n: i64, sep: Option<&'static str>, ) -> &'static str
pub fn reverse(&self, s: &'static str) -> &'static str
pub fn sub(&self, s: &'static str, i: i64, j: Option<i64>) -> &'static str
Sourcepub fn unpack(
&self,
fmt: &'static str,
s: &'static str,
pos: Option<i64>,
) -> LuaAny
pub fn unpack( &self, fmt: &'static str, s: &'static str, pos: Option<i64>, ) -> LuaAny
Binary unpack (Lua 5.4 backport in Factorio).
pub fn upper(&self, s: &'static str) -> &'static str
Trait Implementations§
Source§impl Clone for LuaStringLib
impl Clone for LuaStringLib
Source§fn clone(&self) -> LuaStringLib
fn clone(&self) -> LuaStringLib
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LuaStringLib
Source§impl Debug for LuaStringLib
impl Debug for LuaStringLib
Source§impl Default for LuaStringLib
impl Default for LuaStringLib
Source§fn default() -> LuaStringLib
fn default() -> LuaStringLib
Returns the “default value” for a type. Read more
impl Eq for LuaStringLib
Source§impl PartialEq for LuaStringLib
impl PartialEq for LuaStringLib
impl StructuralPartialEq for LuaStringLib
Auto Trait Implementations§
impl Freeze for LuaStringLib
impl RefUnwindSafe for LuaStringLib
impl Send for LuaStringLib
impl Sync for LuaStringLib
impl Unpin for LuaStringLib
impl UnsafeUnpin for LuaStringLib
impl UnwindSafe for LuaStringLib
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