Loading RustViz Engine...
Expose a C-compatible repr(C) struct and extern "C" function with zero wrapper overhead.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
#[repr(C)]
pub struct NativePoint {
pub x: f64,
pub y: f64,
}
#[no_mangle]
pub extern "C" fn point_distance_squared(p: *const NativePoint) -> f64 {
if p.is_null() { return 0.0; }
unsafe { (*p).x * (*p).x + (*p).y * (*p).y }
}