pub trait KernelProgram: Send + Sync {
// Required methods
fn engine(&self) -> Engine;
fn create_kernel(self: Arc<Self>) -> Box<dyn Kernel>;
// Provided method
fn as_interpreter(self: Arc<Self>) -> Option<Arc<PolydatProgram>> { ... }
}Expand description
A program on some engine, shared across threads through an Arc;
every kernel created from it computes the same values and owns its
own inputs, buffers, and outputs.
Required Methods§
Sourcefn create_kernel(self: Arc<Self>) -> Box<dyn Kernel>
fn create_kernel(self: Arc<Self>) -> Box<dyn Kernel>
A kernel of this program for the calling thread. It starts from
the program on every engine: every input at its declared
default, whatever the kernel that became the program had been
set to; every shared binding with a cell of its own.
Provided Methods§
Sourcefn as_interpreter(self: Arc<Self>) -> Option<Arc<PolydatProgram>>
fn as_interpreter(self: Arc<Self>) -> Option<Arc<PolydatProgram>>
The interpreter’s program, when this is one: the graph a
diagnostic describes node by node. None for a compiled
engine’s program.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".