sreepathi-ravikumar's picture
Upload 4 files
54229f6 verified
raw
history blame contribute delete
287 Bytes
use pyo3::prelude::*;
#[pyfunction]
fn hello(name: &str) -> PyResult<String> {
Ok(format!("Hello, {}! Welcome from Rust 🦀", name))
}
#[pymodule]
fn sample_rust(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(hello, m)?)?;
Ok(())
}