Skip to main content

StringRuntime

Trait StringRuntime 

Source
pub trait StringRuntime: Sealed {
    // Required methods
    unsafe fn resize(&self, new_size: i32) -> VmErrorResult;
    unsafe fn intern_string(&self, bytes: &BStr) -> VmErrorResult<TString>;
    unsafe fn free_string(&self, string: TString, page: LuaPage);
    unsafe fn update_atom(&self, string: TString);
    unsafe fn buffer_start(&self, size: usize) -> VmErrorResult<TString>;
    unsafe fn buffer_finish(&self, string: TString) -> VmErrorResult<TString>;
}
Expand description

Unstable interned-string allocation capability.

§Safety

The thread and all string/page handles must be live and belong to the same VM. Sizes and pages must match their allocations, and callers must preserve interning-table, atom, rooting, and GC invariants.

Required Methods§

Source

unsafe fn resize(&self, new_size: i32) -> VmErrorResult

luaS_resize

Source

unsafe fn intern_string(&self, bytes: &BStr) -> VmErrorResult<TString>

luaS_newlstr

Source

unsafe fn free_string(&self, string: TString, page: LuaPage)

luaS_free

Source

unsafe fn update_atom(&self, string: TString)

luaS_updateatom

Source

unsafe fn buffer_start(&self, size: usize) -> VmErrorResult<TString>

luaS_bufstart

Source

unsafe fn buffer_finish(&self, string: TString) -> VmErrorResult<TString>

luaS_buffinish

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§