Very good article.
However it seems to me a little bit odd using the platform specific RawSymbol in the VTableV0 implementation to get around the lifetime checks.
Maybe a better cross platform approach could be dereferencing the Symbol and storing the function pointer as std::boxed::Box.
struct VTableV0 {
free_object: Box<FreeObject>,
get_info: Box<GetInfo>,
set_info: Box<SetInfo>,
}
// ...
let free_object: Symbol<FreeObject> = library.get(b"free_object\0").unwrap();
let free_object = Box::new(*free_object);
Apart from that i like your article very much, thanks.
Very good article.
However it seems to me a little bit odd using the platform specific
RawSymbolin theVTableV0implementation to get around the lifetime checks.Maybe a better cross platform approach could be dereferencing the
Symboland storing the function pointer as std::boxed::Box.Apart from that i like your article very much, thanks.