pub struct FuncSig {Show 13 fields
pub name: &'static str,
pub category: FuncCategory,
pub outputs: usize,
pub description: &'static str,
pub help: &'static str,
pub identity: Option<u64>,
pub variadic_ctor: Option<fn(usize) -> Box<dyn PolydatNode>>,
pub params: &'static [ParamSpec],
pub arity: Arity,
pub commutativity: Commutativity,
pub default_resolver: Option<DefaultResolver>,
pub output_type: OutputType,
pub output_port: Option<PortType>,
}Expand description
Description of a registered function’s signature.
Fields§
§name: &'static strFunction name as used in the DSL.
category: FuncCategoryFunctional category.
outputs: usizeNumber of output ports (0 = dynamic, determined at compile time).
description: &'static strShort description for help/error messages.
help: &'static strDetailed help text: theory, usage examples, parameter meanings. Displayed in the graph editor help panel.
identity: Option<u64>For variadic functions: the identity element for zero inputs.
variadic_ctor: Option<fn(usize) -> Box<dyn PolydatNode>>Factory for variadic nodes: takes wire count, returns node.
params: &'static [ParamSpec]Positional parameter list: wires and constants in call order.
arity: ArityArity specification.
commutativity: CommutativityInput commutativity for this function.
default_resolver: Option<DefaultResolver>Optional resolver hint for Handle-typed input ports. When
the binding compiler emits this function and a Handle
input is wired to a Str-producing source, it splices in
the named resolver to convert the string into a handle. This
is the “string-conversion node insertion” mechanism from
SRD 53 §“Source-string call-site sugar”. None means no
auto-promotion — the caller must pass a Handle directly.
output_type: OutputTypeOutput-type contract — Fixed for the vast majority of
nodes; SameAsInput(idx) for type-polymorphic pass-throughs
(e.g. log_info whose output type tracks its sole input).
output_port: Option<PortType>Concrete port type of the single output, when statically
known (#[polydat_node] emits it from the return type’s
Wire::PORT). None for tuple/dynamic/polymorphic outputs
and for hand registrations that don’t declare one. The DSL
type inference (binding::infer_expr_type) reads this
FIRST — the name-prefix heuristic is only the fallback —
so call-expression operand typing flows from the symbol
registry, not from a hand-maintained list.
Implementations§
Source§impl FuncSig
impl FuncSig
Sourcepub fn wire_input_count(&self) -> usize
pub fn wire_input_count(&self) -> usize
Number of wire inputs in the fixed parameter list.
Sourcepub fn is_variadic(&self) -> bool
pub fn is_variadic(&self) -> bool
Whether this function accepts variadic arguments.
Sourcepub fn const_param_info(&self) -> Vec<(&'static str, bool)>
pub fn const_param_info(&self) -> Vec<(&'static str, bool)>
Constant parameter names and whether they’re required.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FuncSig
impl RefUnwindSafe for FuncSig
impl Send for FuncSig
impl Sync for FuncSig
impl Unpin for FuncSig
impl UnsafeUnpin for FuncSig
impl UnwindSafe for FuncSig
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