pub struct ExprStub { /* private fields */ }Expand description
A caller-native expression stub: a named binding over a polydat
expression, optionally type-coerced (via the SRD-84 Part 1b as
cast) and volatile.
Implementations§
Source§impl ExprStub
impl ExprStub
Sourcepub fn new(name: impl Into<String>, expr: Expr) -> Self
pub fn new(name: impl Into<String>, expr: Expr) -> Self
Build a stub from an already-constructed expression.
Sourcepub fn parse(name: impl Into<String>, source: &str) -> Result<Self, String>
pub fn parse(name: impl Into<String>, source: &str) -> Result<Self, String>
Build a stub by parsing a single expression from source — the boundary parse for user-authored predicate text. Thereafter the stub is grammar-safe (it flows as AST, never re-rendered to a string).
Sourcepub fn returning<T: Wire>(self) -> Self
pub fn returning<T: Wire>(self) -> Self
Coerce the stub’s value to T’s polydat type via the SRD-84
Part 1b as <type> cast — alignment-only, a no-op when the
expression is already T::PORT. The Rust generic is the
polydat target type.
Sourcepub fn volatile(self) -> Self
pub fn volatile(self) -> Self
Mark the binding volatile — re-evaluated on every pull (e.g. a
stop-condition predicate evaluated per trigger).
Sourcepub fn into_statement(self) -> Statement
pub fn into_statement(self) -> Statement
The binding statement this stub becomes — drop it into a
BodyFragment::Statements and the kernel builder consumes it
directly, no re-parse.
Auto Trait Implementations§
impl Freeze for ExprStub
impl RefUnwindSafe for ExprStub
impl Send for ExprStub
impl Sync for ExprStub
impl Unpin for ExprStub
impl UnsafeUnpin for ExprStub
impl UnwindSafe for ExprStub
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