renfe_cli/
lib.rs

1pub mod cli;
2pub mod renfe;
3
4use pyo3::prelude::*;
5
6use cli::main;
7use renfe::{Renfe, Schedule, Station};
8
9/// A Python module implemented in Rust. The name of this function must match
10/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
11/// import the module.
12#[pymodule]
13fn renfe_cli(m: &Bound<'_, PyModule>) -> PyResult<()> {
14    m.add_class::<Renfe>()?;
15    m.add_class::<Station>()?;
16    m.add_class::<Schedule>()?;
17    m.add_function(wrap_pyfunction!(main, m)?)?;
18
19    Ok(())
20}