pub struct ScopedExpr { /* private fields */ }Expand description
SRD-84 shape 2 — a polydat expression bound to a parent
kernel’s lexical scope. Compiled into a sub-context whose named
output is the expression, evaluable many times against injected
inputs. The return is whatever Wire type the bound stub was
qualified with (ExprStub::returning::<T>), or its natural
truthiness (is_true). A general-purpose, scope-bound, callable
expression holder.
Implementations§
Source§impl ScopedExpr
impl ScopedExpr
Sourcepub fn bind(
parent: &PolydatKernel,
output: impl Into<String>,
matter: GraphMatter,
) -> Result<Self, String>
pub fn bind( parent: &PolydatKernel, output: impl Into<String>, matter: GraphMatter, ) -> Result<Self, String>
Bind matter — which must define the named output (plus any
extern wires it reads) — into a sub-context of parent. The
expression is compiled once; call it repeatedly via eval /
is_true after set-ing its inputs.
Sourcepub fn set(&mut self, name: &str, value: Value) -> &mut Self
pub fn set(&mut self, name: &str, value: Value) -> &mut Self
Set a runtime input wire by name before evaluating. No-op for a name the expression doesn’t read.
Sourcepub fn dataflow(&mut self) -> &mut PolydatKernel
pub fn dataflow(&mut self) -> &mut PolydatKernel
The bound sub-context as a Dataflow, for callers that inject
a batch of inputs through a Dataflow-based injector (e.g. a
runtime-state snapshot) before evaluating.
Auto Trait Implementations§
impl !RefUnwindSafe for ScopedExpr
impl !UnwindSafe for ScopedExpr
impl Freeze for ScopedExpr
impl Send for ScopedExpr
impl Sync for ScopedExpr
impl Unpin for ScopedExpr
impl UnsafeUnpin for ScopedExpr
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