rust-spice

![logo image]

![crate badge] ![doc badge] ![license badge] ![pre-commit badge]

WOW! The complete NASA/NAIF Spice toolkit is actually usable on Rust


Rational | Installation | License


Rational

Another crate already exists for wrapping C spice: spice-sys. The motivation behind the creation of rust-spice was 1) the need to access the complete spice API from Rust and 2) the need to have a nice Rust layer to code naturally.

Complete API

spice-sys does not use bindgen to wrap which is error-prone and does not provide a complete API. The description of spice-sys says:

Currently, it provides only the most common API calls as outlined here.

This boosted me to build a complete C spice wrapper.

Rust interface

spice-sys does not provide a Rust user-friendly interface, which constrains the user to use unsafe and FFI types conversion which is simply a pain to use.

I wanted to use spice from Rust without feeling it being a C wrapper, for quicker and simplier development and usage in my crates.

S/O

Many thanks to the author of the crate spice-sys for the idea of the wget script to avoid crate upload, I included your script copyrighted under your MIT license and added some modifications that I listed carefully.

Disclaimer

This crate is my first exercice to write a wrapper, all kind advices are warmly welcomed.

The Rust layer is being built in real time as I face the need of it. Raise an issue with the need of a function/struct and we will work on it immediately. Any time a function is not wrapped inside safe code, you can still use the unsafe code to call it.

Apparently the documentation is not building online, though I spent a lot of time writting it. On my pc it is building just nice. By reading docs.rs output, the header cspice/include/SpiceUser.h is not in the include PATH obviously. Locally it works because in my build.rs I use .clang_arg() on the the bindgen:Builder to tell Rust where to find the damn header. And it should work online also, I guess. Any help is appreciated to solve this issue!! I can send you the offline documentation in the meantime if you want.

Installation

Add the dependency rust-spice to your Cargo.toml:

toml ... [dependencies] rust-spice = "0.3.4"

License

Licensed under the Apache License, Version 2.0.