Skip to content

How to pass a callback function from Rust to Python with pyo3 #3659

Answered by mejrs
vrrashkov asked this question in Questions
Discussion options

You must be logged in to vote

you can make a closure with https://docs.rs/pyo3/latest/pyo3/types/struct.PyCFunction.html#method.new_closure or create a pyclass that implements __call__.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vrrashkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants