pub struct PortDecl {
pub key: PortKey,
pub dir: PortDirection,
pub kind: PortKind,
pub capacity: PortCapacity,
pub ty: Option<TypeDesc>,
pub label: Option<String>,
pub view: PortViewDescriptor,
}Expand description
Declares a port for a node kind.
Fields§
§key: PortKeyStable schema key for this port.
dir: PortDirectionDirection.
kind: PortKindKind.
capacity: PortCapacityCapacity.
ty: Option<TypeDesc>Optional type descriptor.
label: Option<String>UI-facing label.
view: PortViewDescriptorAdapter-facing handle and label presentation metadata.
Implementations§
Source§impl PortDecl
impl PortDecl
Sourcepub fn new(
key: impl Into<PortKey>,
dir: PortDirection,
kind: PortKind,
capacity: PortCapacity,
) -> Self
pub fn new( key: impl Into<PortKey>, dir: PortDirection, kind: PortKind, capacity: PortCapacity, ) -> Self
Creates a port declaration.
Sourcepub fn data_input(key: impl Into<PortKey>) -> Self
pub fn data_input(key: impl Into<PortKey>) -> Self
Creates a single-capacity data input port.
Sourcepub fn data_output(key: impl Into<PortKey>) -> Self
pub fn data_output(key: impl Into<PortKey>) -> Self
Creates a multi-capacity data output port.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Sets the adapter-facing label.
Sourcepub fn with_view(self, view: PortViewDescriptor) -> Self
pub fn with_view(self, view: PortViewDescriptor) -> Self
Sets the adapter-facing port view descriptor.
Sourcepub fn with_view_order(self, order: i32) -> Self
pub fn with_view_order(self, order: i32) -> Self
Sets deterministic ordering within the selected side/group.
Sourcepub fn with_view_group(self, group: impl Into<String>) -> Self
pub fn with_view_group(self, group: impl Into<String>) -> Self
Groups this port with related handles for adapter presentation.
Sourcepub fn with_view_anchor(self, anchor: impl Into<String>) -> Self
pub fn with_view_anchor(self, anchor: impl Into<String>) -> Self
Anchors this port to an adapter-owned region such as a field row.
Hides this handle from adapter hit testing without removing the semantic port.
Sourcepub fn with_capacity(self, capacity: PortCapacity) -> Self
pub fn with_capacity(self, capacity: PortCapacity) -> Self
Sets the capacity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PortDecl
impl<'de> Deserialize<'de> for PortDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PortDecl
Auto Trait Implementations§
impl Freeze for PortDecl
impl RefUnwindSafe for PortDecl
impl Send for PortDecl
impl Sync for PortDecl
impl Unpin for PortDecl
impl UnsafeUnpin for PortDecl
impl UnwindSafe for PortDecl
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