Hello, I'm glad to publish a very first version of LeapRS to be able to use Leap hand trackers from the Rust programming language. Rust is a language focusing on performance and memory safety. Think of it like modern C with a very very strict compiler.
I intend LeapRS to stay very close to the LeapC library, so a verbose low-level one. It should however be very easy to make nicer rust libraries based on LeapRS.
Here is a "hello world" of LeapRS:
use leaprs::*;
let mut connection = Connection::create(ConnectionConfig::default()).expect("Failed to connect");
connection.open().expect("Failed to open the connection");
connection.poll(1000).expect("First poll failed");
loop {
match connection
.poll(1000)
.expect("Failed to poll for events.")
.event()
{
Event::Tracking(e) => println!("There are {} hand(s) in view", e.hands().len()),
_ => {}
}
}
A note of warning: It is very fresh, not yet complete and likely has bugs!