pub struct TileProgram {
pub spec: TileSpec,
pub children: Vec<Arc<PolydatProgram>>,
/* private fields */
}Expand description
The runtime form: the spec, compiled body programs, and parsed streams.
Fields§
§spec: TileSpecThe serialized skeleton.
children: Vec<Arc<PolydatProgram>>The body programs, compiled once at setup, for the interpreter.
Implementations§
Source§impl TileProgram
impl TileProgram
Sourcepub fn from_json(json: &str) -> Self
pub fn from_json(json: &str) -> Self
Parse a skeleton and compile its projection bodies. Panics with the compiler’s diagnostic on a malformed payload, which only the compiler produces.
Sourcepub fn interned(spec: &str) -> &'static TileProgram
pub fn interned(spec: &str) -> &'static TileProgram
The program for a skeleton payload, interned for the process
(SRD 115 §6): the compiled lowering of tile_render bakes its
address, so it must outlive every kernel compiled from it, and
the same payload is parsed and its bodies compiled once.
Sourcepub fn has_projections(&self) -> bool
pub fn has_projections(&self) -> bool
True when any op re-runs a projection body.
Sourcepub fn render(&self, inputs: &[Value], bodies: &mut BodyKernels) -> String
pub fn render(&self, inputs: &[Value], bodies: &mut BodyKernels) -> String
Render with the node’s wire inputs, the hole values, on the
interpreter, over bodies, the rendering state’s own kernels
for the projection bodies.
Sourcepub fn render_into<W: Write>(
&self,
inputs: &[ValueRef<'_>],
engine: Engine,
bodies: &mut BodyKernels,
out: &mut W,
)
pub fn render_into<W: Write>( &self, inputs: &[ValueRef<'_>], engine: Engine, bodies: &mut BodyKernels, out: &mut W, )
Render into any text sink from borrowed views of the hole
values: a String at P1, a step’s own scratch in a compiled
closure. Every hole is encoded here, from the view straight into
the sink, and a projection’s body runs on engine, the engine
of the kernel rendering, in a kernel the rendering state owns
(bodies) and reuses across renders.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TileProgram
impl !UnwindSafe for TileProgram
impl Freeze for TileProgram
impl Send for TileProgram
impl Sync for TileProgram
impl Unpin for TileProgram
impl UnsafeUnpin for TileProgram
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more