Hello, I am a beginner at rust, and recently I tried using NiTE 2.2 in my rust project, but an issue I noticed is that the compiler is unable to find the Sized trait of NiteUserData, I tried implementing it manually but the compiler returns "explicit impls for the Sized
trait are not permitted impl of 'Sized' not allowed". How should I fix this issue?
fn main
fn main() {
let mut userTracker:NiteUserTracker = unsafe {std::mem::zeroed()};
let mut userTrackerHandle:NiteUserTrackerHandle = &mut userTracker;
let mut niteRc:NiteStatus;
unsafe {
niteInitialize();
niteRc = niteInitializeUserTracker(&mut userTrackerHandle);
}
if niteRc != NiteStatus_NITE_STATUS_OK {
println!("Couldn't create user tracker");
dbg!(niteRc);
std::process::exit(3);
}
println!("Start moving around to get detected...");
println!("(PSI pose may be required for skeleton calibration, depending on the configuration)");
let mut userTrackerFrame:NiteUserTrackerFrame = unsafe {std::mem::zeroed()};
while(!wasKeyboardHit()){
niteRc = unsafe {niteReadUserTrackerFrame(userTrackerHandle, &mut userTrackerFrame as *mut NiteUserTrackerFrame as *mut *mut NiteUserTrackerFrame)};
if niteRc != NiteStatus_NITE_STATUS_OK {
println!("Get next frame failed");
continue;
}
let users = unsafe {std::slice::from_raw_parts_mut(userTrackerFrame.pUser, userTrackerFrame.userCount as usize)}; //error here
}
unsafe {NiTE::niteShutdown()};
}