pub enum In<T> {
Const(T),
Param {
name: String,
fallback: T,
min: Option<f64>,
max: Option<f64>,
},
Port {
ix: usize,
name: &'static str,
},
}Expand description
A node field whose value is an inline literal, a $param reference,
or a scalar input port. Resolve with In::get inside Node::eval.
Variants§
Const(T)
Inline literal, baked at build time.
Param
$param reference: read EvalCtx::params at eval time, fall
back to the declaration default, clamp numbers to the
declaration’s min / max.
Port
@node connection on a scalar input port.
Implementations§
Source§impl<T: ScalarType> In<T>
impl<T: ScalarType> In<T>
Sourcepub fn get(
&self,
ctx: &EvalCtx<'_>,
inputs: &[Option<PortValue>],
) -> Result<T, EvalError>
pub fn get( &self, ctx: &EvalCtx<'_>, inputs: &[Option<PortValue>], ) -> Result<T, EvalError>
Resolve the field’s value for one eval.
Sourcepub fn param_hash(&self, h: &mut Xxh3)
pub fn param_hash(&self, h: &mut Xxh3)
Feed the field’s static identity into Node::param_hash.
Runtime $param values are keyed via Node::param_refs; a
port-fed value is keyed via the upstream node’s hash.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for In<T>where
T: Freeze,
impl<T> RefUnwindSafe for In<T>where
T: RefUnwindSafe,
impl<T> Send for In<T>where
T: Send,
impl<T> Sync for In<T>where
T: Sync,
impl<T> Unpin for In<T>where
T: Unpin,
impl<T> UnsafeUnpin for In<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for In<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more