##// END OF EJS Templates
rust-pyo3: conversions to GraphError Python exception...
rust-pyo3: conversions to GraphError Python exception The nice thing is that with PyO3, exceptions can be instantiated without holding the GIL. Hence the only thing that prevents us to implement `Into<PyErr>` for `hg::GraphError` is that neither is defined by the current crate. We could use a wrapping "newtype", but the compiler is not so clever yet that it could chain automatically to two needed `into()`, so we'll end up with some type conversion anyway, involving something like `GraphErrorWrapper`. At this point, explicitly named methods are just simpler.

File last commit:

r53304:c5128c54 default
r53309:6e8ba528 default
Show More
dagops.rs
22 lines | 597 B | application/rls-services+xml | RustLexer
// dagops.rs
//
// Copyright 2024 Georges Racinet <georges.racinet@cloudcrane.io>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
//! Bindings for the `hg::dagops` module provided by the
//! `hg-core` package.
//!
//! From Python, this will be seen as `mercurial.pyo3-rustext.dagop`
use pyo3::prelude::*;
use crate::util::new_submodule;
pub fn init_module<'py>(
py: Python<'py>,
package: &str,
) -> PyResult<Bound<'py, PyModule>> {
let m = new_submodule(py, package, "dagop")?;
Ok(m)
}