Get basic incomplete Python queue API working
This commit is contained in:
parent
661e1d220a
commit
0995e6db90
8 changed files with 69 additions and 45 deletions
12
src/lib.rs
12
src/lib.rs
|
@ -1,16 +1,12 @@
|
|||
pub mod backing;
|
||||
pub mod queue;
|
||||
|
||||
use pyo3::prelude::*;
|
||||
use queue::pure::PureQueue;
|
||||
|
||||
/// Formats the sum of two numbers as string.
|
||||
#[pyfunction]
|
||||
fn sum_as_string(a: usize, b: usize) -> PyResult<String> {
|
||||
Ok((a + b).to_string())
|
||||
}
|
||||
|
||||
/// A Python module implemented in Rust.
|
||||
/// Bindings for the Rust queue implementations
|
||||
#[pymodule]
|
||||
fn pyority_queue(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
||||
m.add_function(wrap_pyfunction!(sum_as_string, m)?)?;
|
||||
m.add_class::<PureQueue>()?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue