pub enum ConstConstraint {
RangeU64 {
min: u64,
max: u64,
},
RangeF64 {
min: f64,
max: f64,
},
AllowedU64(&'static [u64]),
NonZeroU64,
NonEmptyStr,
StrParser(fn(&str) -> Result<(), String>),
PositiveFiniteF64,
FiniteF64,
}Expand description
A declarative constraint on one constant argument of a node call.
Attached to a ParamSpec via the optional constraint field;
the factory walks FuncSig.params and enforces every declared
constraint before build_node constructs the node. All variants
are Copy so ParamSpec (and the static FuncSig arrays that
embed it) stay Copy.
Variants§
RangeU64
Integer must satisfy min ≤ v ≤ max.
RangeF64
Float must satisfy min ≤ v ≤ max.
AllowedU64(&'static [u64])
Integer must appear in a closed set (e.g. radix ∈ {2, 8, 10, 16}).
NonZeroU64
Integer must be non-zero (divisors, moduli, ranges).
NonEmptyStr
String must have non-empty length after trim.
StrParser(fn(&str) -> Result<(), String>)
Arbitrary string format predicate. Return Err(msg) to
reject the constant; the caller prepends parameter context.
Use for structured specs like "v1:w1;v2:w2" where a fixed
enum variant can’t express the format.
PositiveFiniteF64
Float must be finite and strictly positive. Distinct from
RangeF64 because the natural upper bound is +∞ and
RangeF64 requires a finite max.
FiniteF64
Float must be finite (!is_nan() && !is_infinite()).
Endpoint and offset constants where ±∞/NaN would silently
produce nonsense outputs downstream.
Implementations§
Trait Implementations§
Source§impl Clone for ConstConstraint
impl Clone for ConstConstraint
Source§fn clone(&self) -> ConstConstraint
fn clone(&self) -> ConstConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConstConstraint
Auto Trait Implementations§
impl Freeze for ConstConstraint
impl RefUnwindSafe for ConstConstraint
impl Send for ConstConstraint
impl Sync for ConstConstraint
impl Unpin for ConstConstraint
impl UnsafeUnpin for ConstConstraint
impl UnwindSafe for ConstConstraint
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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