pub struct KernelLookup<'a>(/* private fields */);Expand description
A kernel of any engine, as a scope names resolve in.
A host holding a Box<dyn Kernel> interpolates {k} > 5 against
the kernel it has through this wrapper, without compiling the
program a second time on the interpreter. It is a wrapper rather
than an impl Lookup for dyn Kernel because one trait object
cannot become another.
Distinct from
comprehension::surfaces::KernelScope,
the algebra layer’s trait for the parent a comprehension scopes
under; this is a Lookup over a kernel that already exists.
Implementations§
Trait Implementations§
Source§impl Lookup for KernelLookup<'_>
impl Lookup for KernelLookup<'_>
Source§fn lookup(&self, name: &str) -> Option<Value>
fn lookup(&self, name: &str) -> Option<Value>
A name resolves to what the kernel holds for it now — an input the host wrote, a coordinate it was positioned at — and otherwise to what the build folded for it. The live answer comes first because it is the later one: a coordinate has a folded value on some engines, and it is the value the program was built with, not the value the kernel is at.
A const binding is the exception. Its value is the scope’s for
the name, and an input slot of the same name, which a const that
reads a parameter it shadows is given (none_semantics.md,
“Conditional-shadow semantics for const”), holds only the
value from the scope above. So the const’s own value comes
first, and the slot answers only while that value is None: the
two-tier read of a conditional shadow.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for KernelLookup<'a>
impl<'a> !UnwindSafe for KernelLookup<'a>
impl<'a> Freeze for KernelLookup<'a>
impl<'a> Send for KernelLookup<'a>
impl<'a> Sync for KernelLookup<'a>
impl<'a> Unpin for KernelLookup<'a>
impl<'a> UnsafeUnpin for KernelLookup<'a>
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