Crates.io | libpvcam-sys |
lib.rs | libpvcam-sys |
version | 0.1.0 |
source | src |
created_at | 2020-09-29 20:42:40.410948 |
updated_at | 2020-09-29 20:42:40.410948 |
description | bindgen generated FFI bindings for Photometrics' C SDK |
homepage | |
repository | https://github.com/erisyon/libpvcam-sys |
max_upload_size | |
id | 294317 |
size | 30,936 |
Rust bindings for Photometrics' PVCam C SDK. Highly experimental.
This has only been tested on Ubuntu so far.
rustup @ 1.22.1
libclang1-9
pvcam
from Photometrics
3.8.4.3
and 3.9.4.0
It is assumed that pvcam is installed as per the installation instructions for Ubuntu.
This library uses the bindgen which tries its best to navigate header files and produce appropriate structs and FFI interfaces. You'll notice a lot of casting too/from types in this binding. It may be likely that bindgen settings could reduce that.
The PVCam SDK has a lot of deprecations in it, as such the bindgen invocation in
build.rs aggressively does not import a range of functions. However,
it may be better to use the whitelist
option instead and build the list from
a script similar to how Photometrics' python binding does this.
o -- lib.rs
`-- pvcam (public)
`-- internal (private)
The public pvcam
module re-exports internal concepts generated by bindgen and
makes them minimally rusty. It's likely that some of these rust patterns are:
On the first case: I (Mike Ossareh) am not clear enough on the semantics of when to use various ptr types in a binding. The Primitive Pointer Docs cover this. Also, I'm new to Rust ^_^.
On the second case: Rust Enum's mapping over PVCam SDK Enums probably demonstrates this most clearly. These may be good candidates for lifting into a higher level library which implements other niceties like a PVCamContext which frees resources when it leaves scope. With the aim being to leave this layer just as C-like as possible.
[] verify dependencies documented in this readme
[] verify installation steps documented in this readme