Skip to main content

str_len

Function str_len 

Source
pub fn str_len(state: &mut LuaState) -> Result<usize, LuaError>
Expand description

string.len(s) — return byte-length of s.

C: static int str_len(lua_State *L)

Reads only the byte-length, never the bytes themselves, so go through to_lua_string_len (which never copies) rather than check_arg_string (which to_vecs the entire payload only for .len() to throw it away).