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§
Sourceunsafe fn resize(&self, new_size: i32) -> VmErrorResult
unsafe fn resize(&self, new_size: i32) -> VmErrorResult
luaS_resize
Sourceunsafe fn intern_string(&self, bytes: &BStr) -> VmErrorResult<TString>
unsafe fn intern_string(&self, bytes: &BStr) -> VmErrorResult<TString>
luaS_newlstr
Sourceunsafe fn free_string(&self, string: TString, page: LuaPage)
unsafe fn free_string(&self, string: TString, page: LuaPage)
luaS_free
Sourceunsafe fn update_atom(&self, string: TString)
unsafe fn update_atom(&self, string: TString)
luaS_updateatom
Sourceunsafe fn buffer_start(&self, size: usize) -> VmErrorResult<TString>
unsafe fn buffer_start(&self, size: usize) -> VmErrorResult<TString>
luaS_bufstart
Sourceunsafe fn buffer_finish(&self, string: TString) -> VmErrorResult<TString>
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".