pub struct BodySource { /* private fields */ }Expand description
A traversal body as its parent compiled it: the child file and the compiler settings the parent used, so the same body compiles on any engine, once, keyed by the engine as the interpreter’s program is keyed by the body’s position (SRD 113 §5.1).
Implementations§
Source§impl BodySource
impl BodySource
Sourcepub fn source_text(&self) -> &str
pub fn source_text(&self) -> &str
The body’s source as the parent lowered it: the implicit cycle
input, one extern per element and per cascaded wire, then the
body’s statements.
Sourcepub fn program_on(
&self,
engine: Engine,
) -> Result<Arc<dyn KernelProgram>, KernelError>
pub fn program_on( &self, engine: Engine, ) -> Result<Arc<dyn KernelProgram>, KernelError>
The body’s program on engine, compiled on the first call for
that engine and shared by every use after it.
One body, one carrier. A for body and a tile’s projection
body are the same thing — a statement list compiled once per
engine against the settings the parent compiled under — and
they reach it through here. The tile path used to compile each
body twice at node construction, once for the interpreter and
once on Engine::default(), and then render on the default
engine whatever engine the kernel was running.
Sourcepub fn from_source(source: &str, context_label: &str) -> Result<Self, String>
pub fn from_source(source: &str, context_label: &str) -> Result<Self, String>
A body from its source text, under the default settings.
The route for a body that reaches the runtime as text rather
than from the compiler that lowered it — a tile skeleton’s
projection body, which travels in the tile_render node’s
serialized spec. context_label names it in a diagnostic.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BodySource
impl RefUnwindSafe for BodySource
impl Send for BodySource
impl Sync for BodySource
impl Unpin for BodySource
impl UnsafeUnpin for BodySource
impl UnwindSafe for BodySource
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