pub struct MethodBuilder { /* private fields */ }Expand description
A builder for constructing a node of same name. This can be used as an easy way to create a node and the references it has to another node in a simple fashion.
Implementations§
Source§impl MethodBuilder
impl MethodBuilder
Sourcepub fn new<T, S>(node_id: &NodeId, browse_name: T, display_name: S) -> Self
pub fn new<T, S>(node_id: &NodeId, browse_name: T, display_name: S) -> Self
Creates a builder for a node. All nodes are required to su
Sourcepub fn get_node_id(&self) -> &NodeId
pub fn get_node_id(&self) -> &NodeId
Get the node ID of the node being built.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Tests that the builder is in a valid state to build or insert the node.
Sourcepub fn description<V>(self, description: V) -> Selfwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> Selfwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> Self
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> Self
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> Self
pub fn organizes<T>(self, organizes_id: T) -> Self
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> Self
pub fn organized_by<T>(self, organized_by_id: T) -> Self
Indicates this node is organised by another node by its id
Sourcepub fn build(self) -> Method
pub fn build(self) -> Method
Yields a built node. This function will panic if the node is invalid. Note that calling this function discards any references for the node, so there is no purpose in adding references if you intend to call this method.
Sourcepub fn insert(self, address_space: &mut impl NodeInsertTarget) -> bool
pub fn insert(self, address_space: &mut impl NodeInsertTarget) -> bool
Inserts the node into the address space, including references. This function will panic if the node is in an invalid state.
Source§impl MethodBuilder
impl MethodBuilder
Sourcepub fn component_of<T>(self, component_of_id: T) -> Self
pub fn component_of<T>(self, component_of_id: T) -> Self
Add an inverse HasComponent reference to the
given node.
Sourcepub fn has_component<T>(self, has_component_id: T) -> Self
pub fn has_component<T>(self, has_component_id: T) -> Self
Add a HasComponent reference to the
given node.
Source§impl MethodBuilder
impl MethodBuilder
Sourcepub fn generates_event<T>(self, event_type: T) -> Self
pub fn generates_event<T>(self, event_type: T) -> Self
Add a GeneratesEvent reference to the given event type.
Source§impl MethodBuilder
impl MethodBuilder
Sourcepub fn output_args(
self,
address_space: &mut impl NodeInsertTarget,
node_id: &NodeId,
arguments: &[Argument],
) -> Self
pub fn output_args( self, address_space: &mut impl NodeInsertTarget, node_id: &NodeId, arguments: &[Argument], ) -> Self
Specify output arguments from the method. This will create an OutputArguments variable child of the method which describes the out parameters.
Sourcepub fn input_args(
self,
address_space: &mut impl NodeInsertTarget,
node_id: &NodeId,
arguments: &[Argument],
) -> Self
pub fn input_args( self, address_space: &mut impl NodeInsertTarget, node_id: &NodeId, arguments: &[Argument], ) -> Self
Specify input arguments to the method. This will create an InputArguments variable child of the method which describes the in parameters.
Sourcepub fn executable(self, executable: bool) -> Self
pub fn executable(self, executable: bool) -> Self
Set whether this method is executable, meaning it can be called by users at all.
Sourcepub fn user_executable(self, executable: bool) -> Self
pub fn user_executable(self, executable: bool) -> Self
Set whether this method is executable by the current user. This value is usually modified by the server depending on the user asking for it.
Sourcepub fn write_mask(self, write_mask: WriteMask) -> Self
pub fn write_mask(self, write_mask: WriteMask) -> Self
Set the write mask for this method.