You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pstjohn unfortunately I did not get autocxx working. I would love to get away from manually setting up bindings for every little thing -- it's terribly error prone and for the most part I'm just smart enough to be dangerous on C++ vs Rust.
I did start this issue: google/autocxx#1334 . I'd gladly accept help on using autocxx, manually setting up bindings isn't a great use of anyone's time.
To your original point, yes, it sounds like you'll want to expose something like bonds(ptr: SharedPtr<ROMol> -> CxxVector<Bond> and introduce a type Bond in ro_mol.rs. Unfortunately I never figured out how to expose a CXX iter in Rust, so I instead just drain the iterator in to a vector and return the vector -- but passing around vectors with complex interior types is a bit of a game in cxx.
#57 adds molecule-borrowed bond views, bond iteration/endpoints/type/stereo/direction getters, and checked basic graph editing. The ownership design also covers immutable atom views and exclusive mutation. Keeping this request open while that draft is reviewed; additional mutable bond/stereo controls from #51 remain useful follow-up work.
Activity
xrl commentedon Nov 24, 2023
@pstjohn unfortunately I did not get autocxx working. I would love to get away from manually setting up bindings for every little thing -- it's terribly error prone and for the most part I'm just smart enough to be dangerous on C++ vs Rust.
I did start this issue: google/autocxx#1334 . I'd gladly accept help on using autocxx, manually setting up bindings isn't a great use of anyone's time.
xrl commentedon Nov 24, 2023
To your original point, yes, it sounds like you'll want to expose something like
bonds(ptr: SharedPtr<ROMol> -> CxxVector<Bond>and introduce atype Bondinro_mol.rs. Unfortunately I never figured out how to expose a CXX iter in Rust, so I instead just drain the iterator in to a vector and return the vector -- but passing around vectors with complex interior types is a bit of a game in cxx.Getting autocxx working might be more efficient.
xrl commentedon Oct 9, 2026
#57 adds molecule-borrowed bond views, bond iteration/endpoints/type/stereo/direction getters, and checked basic graph editing. The ownership design also covers immutable atom views and exclusive mutation. Keeping this request open while that draft is reviewed; additional mutable bond/stereo controls from #51 remain useful follow-up work.