We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0984311 commit 25753a5Copy full SHA for 25753a5
src/lib.rs
@@ -134,17 +134,17 @@ static CREATE_FUTURE: OnceCell<PyObject> = OnceCell::new();
134
/// })
135
/// }
136
/// ```
137
-pub fn with_runtime<F>(py: Python, f: F) -> PyResult<()>
+pub fn with_runtime<F, R>(py: Python, f: F) -> PyResult<R>
138
where
139
- F: FnOnce() -> PyResult<()>,
+ F: FnOnce() -> PyResult<R>,
140
{
141
try_init(py)?;
142
143
- (f)()?;
+ let result = (f)()?;
144
145
try_close(py)?;
146
147
- Ok(())
+ Ok(result)
148
}
149
150
/// Attempt to initialize the Python and Rust event loops
0 commit comments