pub struct NodeTypeBuilder<T: PortType> { /* private fields */ }Implementations§
Source§impl<T: PortType> NodeTypeBuilder<T>
impl<T: PortType> NodeTypeBuilder<T>
pub fn new(def: TypedNodeDef<T>) -> Self
Sourcepub fn body(self, f: impl Fn(String) -> AnyView + Send + Sync + 'static) -> Self
pub fn body(self, f: impl Fn(String) -> AnyView + Send + Sync + 'static) -> Self
Set the body content. Receives node_id for per-instance customization.
Sourcepub fn dynamic_inputs(
self,
f: impl Fn(String) -> Signal<Vec<TypedPort<T>>> + Send + Sync + 'static,
) -> Self
pub fn dynamic_inputs( self, f: impl Fn(String) -> Signal<Vec<TypedPort<T>>> + Send + Sync + 'static, ) -> Self
Set dynamic input ports — a function called per node instance that returns a reactive signal of ports. Ports are re-rendered when the signal changes. Static ports from the TypedNodeDef are rendered first, dynamic ones after.
Sourcepub fn dynamic_outputs(
self,
f: impl Fn(String) -> Signal<Vec<TypedPort<T>>> + Send + Sync + 'static,
) -> Self
pub fn dynamic_outputs( self, f: impl Fn(String) -> Signal<Vec<TypedPort<T>>> + Send + Sync + 'static, ) -> Self
Set dynamic output ports — same as dynamic_inputs but for outputs.
Sourcepub fn port_slot(
self,
port_id: &str,
f: impl Fn(String) -> AnyView + Send + Sync + 'static,
) -> Self
pub fn port_slot( self, port_id: &str, f: impl Fn(String) -> AnyView + Send + Sync + 'static, ) -> Self
Override a specific port’s content. The function receives the port label.
Sourcepub fn custom_renderer(
self,
f: impl Fn(String, RwSignal<Position>) -> AnyView + Send + Sync + 'static,
) -> Self
pub fn custom_renderer( self, f: impl Fn(String, RwSignal<Position>) -> AnyView + Send + Sync + 'static, ) -> Self
Use a fully custom renderer instead of auto-generated ports. Use this for nodes with dynamic port counts.
Sourcepub fn build(self) -> NodeTypeDef
pub fn build(self) -> NodeTypeDef
Build the node type definition.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for NodeTypeBuilder<T>
impl<T> !UnwindSafe for NodeTypeBuilder<T>
impl<T> Freeze for NodeTypeBuilder<T>
impl<T> Send for NodeTypeBuilder<T>
impl<T> Sync for NodeTypeBuilder<T>
impl<T> Unpin for NodeTypeBuilder<T>
impl<T> UnsafeUnpin for NodeTypeBuilder<T>where
TypedNodeDef<T>: UnsafeUnpin,
Option<Arc<dyn Fn(String) -> Signal<Vec<TypedPort<T>>> + Sync + Send>>: UnsafeUnpin,
PhantomData<T>: UnsafeUnpin,
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
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.