pub struct PyFunctionRegistry { /* private fields */ }Expand description
Caches each .py file’s own source text by path, same convention as
super::PyBlockRegistry — a fresh PyFunctionInstance execs it into its own new
namespace per instance.
Implementations§
Source§impl PyFunctionRegistry
impl PyFunctionRegistry
pub fn new() -> Self
Sourcepub fn instantiate(
&mut self,
path: &Path,
function_name: &str,
) -> Result<PyFunctionInstance, PyBlockError>
pub fn instantiate( &mut self, path: &Path, function_name: &str, ) -> Result<PyFunctionInstance, PyBlockError>
Loads path if not already cached, resolves function_name as a callable, and
returns a fresh PyFunctionInstance — no start() call, no state at all.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PyFunctionRegistry
impl Freeze for PyFunctionRegistry
impl Move for PyFunctionRegistry
impl RefUnwindSafe for PyFunctionRegistry
impl Send for PyFunctionRegistry
impl Sync for PyFunctionRegistry
impl Unpin for PyFunctionRegistry
impl UnsafeUnpin for PyFunctionRegistry
impl UnwindSafe for PyFunctionRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more