“I was experimenting with a library of hashing functions that are imported from OpenSSL. These are then wrapped up by some Rust code to make them seamless for use elsewhere in Rust. That wrapper code takes the form of a struct that has an impl with one class method and two instance methods.
The struct itself defines two pieces of information we need to know about the call into the C code and stores a pointer to an extern “C” unsafe function. At instantiation time we have to pass the engine value in from outside…”
http://relistan.com/a-pattern-for-wrapping-c-function-calls-in-rust/
Image may be NSFW.
Clik here to view.

Clik here to view.
