luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[allow(non_snake_case)]
pub unsafe fn fnVisitR<Visitor, Result, T>(
    vis: &mut Visitor,
    dst: &mut Result,
    src: *mut core::ffi::c_void,
) where
    Visitor: FnMut(&T) -> Result,
{
    // In C++, this function is used by the Variant implementation to invoke a visitor
    // on a specific type T stored within the variant's storage.
    // The src pointer is cast to T* and dereferenced.
    *dst = vis(&*(src as *const T));
}