pub struct Port {
pub broadcast_name: PortId,
pub impl_name: String,
pub display_name: String,
pub description: Option<String>,
pub required: bool,
}Expand description
Port configuration for a node
Fields§
§broadcast_name: PortIdBroadcast name (external name for connections between nodes)
impl_name: StringImplementation name (internal name used within the node function)
display_name: StringHuman-readable display name
description: Option<String>Port description
required: boolWhether this port is required
Implementations§
Source§impl Port
impl Port
Sourcepub fn new(
broadcast_name: impl Into<String>,
impl_name: impl Into<String>,
) -> Self
pub fn new( broadcast_name: impl Into<String>, impl_name: impl Into<String>, ) -> Self
Create a new required port with separate broadcast and implementation names
Sourcepub fn simple(name: impl Into<String>) -> Self
pub fn simple(name: impl Into<String>) -> Self
Create a port where broadcast and implementation names are the same
Sourcepub fn optional(
broadcast_name: impl Into<String>,
impl_name: impl Into<String>,
) -> Self
pub fn optional( broadcast_name: impl Into<String>, impl_name: impl Into<String>, ) -> Self
Create a new optional port
Sourcepub fn with_display_name(self, display_name: impl Into<String>) -> Self
pub fn with_display_name(self, display_name: impl Into<String>) -> Self
Set the display name for this port
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description for this port
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Port
impl<'de> Deserialize<'de> for Port
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
Auto Trait Implementations§
impl Freeze for Port
impl RefUnwindSafe for Port
impl Send for Port
impl Sync for Port
impl Unpin for Port
impl UnwindSafe for Port
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