lib.rs
23 lines
| 657 B
| application/rls-services+xml
|
RustLexer
Raphaël Gomès
|
r53299 | use pyo3::prelude::*; | ||
Georges Racinet
|
r53308 | mod convert_cpython; | ||
Georges Racinet
|
r53304 | mod dagops; | ||
Georges Racinet
|
r53305 | mod exceptions; | ||
Georges Racinet
|
r53306 | mod revision; | ||
Georges Racinet
|
r53304 | mod util; | ||
Raphaël Gomès
|
r53299 | #[pymodule] | ||
Georges Racinet
|
r53304 | fn pyo3_rustext(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
m.add( | ||||
"__doc__", | ||||
"Mercurial core concepts - Rust implementation exposed via PyO3", | ||||
)?; | ||||
// the module's __name__ is pyo3_rustext, not mercurial.pyo3_rustext | ||||
// (at least at this point). | ||||
let name: String = m.getattr("__name__")?.extract()?; | ||||
let dotted_name = format!("mercurial.{}", name); | ||||
m.add_submodule(&dagops::init_module(py, &dotted_name)?)?; | ||||
Georges Racinet
|
r53305 | m.add("GraphError", py.get_type::<exceptions::GraphError>())?; | ||
Raphaël Gomès
|
r53299 | Ok(()) | ||
} | ||||