pub struct PyBlockRegistry { /* private fields */ }Expand description
Caches each .py file’s own source text by path – a fresh PyBlockInstance execs it
into its own new namespace, so multiple instances of the same file never share module-level
state (see the module doc comment, “State, cloning, and per-instance isolation”).
Implementations§
Source§impl PyBlockRegistry
impl PyBlockRegistry
pub fn new() -> Self
Sourcepub fn instantiate(
&mut self,
path: &Path,
) -> Result<PyBlockInstance, PyBlockError>
pub fn instantiate( &mut self, path: &Path, ) -> Result<PyBlockInstance, PyBlockError>
The plain contract: requires start/output, for a block with xc_count == 0.
Sourcepub fn instantiate_xc(
&mut self,
path: &Path,
) -> Result<PyBlockInstance, PyBlockError>
pub fn instantiate_xc( &mut self, path: &Path, ) -> Result<PyBlockInstance, PyBlockError>
The continuous-state (xc) contract: requires start/derivative/output_xc, for a
block with xc_count > 0.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PyBlockRegistry
impl Freeze for PyBlockRegistry
impl Move for PyBlockRegistry
impl RefUnwindSafe for PyBlockRegistry
impl Send for PyBlockRegistry
impl Sync for PyBlockRegistry
impl Unpin for PyBlockRegistry
impl UnsafeUnpin for PyBlockRegistry
impl UnwindSafe for PyBlockRegistry
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