rdk_sys/bindings/
ro_mol.rs

1#[cxx::bridge(namespace = "RDKit")]
2pub mod ffi {
3    unsafe extern "C++" {
4        include!("cpp/include/ro_mol.h");
5
6        pub type ROMol;
7        pub type ExplicitBitVect = crate::fingerprint_ffi::ExplicitBitVect;
8        pub type SmilesParserParams;
9        pub type Atom = crate::atom_ffi::Atom;
10
11        pub fn copy_mol(mol: SharedPtr<ROMol>) -> SharedPtr<ROMol>;
12
13        pub fn smiles_to_mol(smi: &CxxString) -> Result<SharedPtr<ROMol>>;
14
15        pub fn smiles_to_mol_with_params(
16            smi: &CxxString,
17            params: SharedPtr<SmilesParserParams>,
18        ) -> Result<SharedPtr<ROMol>>;
19        pub fn new_smiles_parser_params() -> SharedPtr<SmilesParserParams>;
20        pub fn smiles_parser_params_set_sanitize(
21            ptr: SharedPtr<SmilesParserParams>,
22            sanitize: bool,
23        );
24
25        pub fn mol_to_smiles(mol: SharedPtr<ROMol>) -> String;
26
27        // 0b11111111
28        pub type MolSanitizeException;
29        pub fn detect_chemistry_problems(mol: SharedPtr<ROMol>) -> UniquePtr<CxxVector<CxxString>>;
30        // pub fn mol_sanitize_exception_type() -> String;
31
32        pub fn get_num_atoms(mol: SharedPtr<ROMol>) -> u32;
33        pub fn get_atom_with_idx(mol: SharedPtr<ROMol>, idx: usize) -> SharedPtr<Atom>;
34    }
35}