pub struct ReferenceTypeBuilder { /* 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 ReferenceTypeBuilder
impl ReferenceTypeBuilder
Sourcepub fn new<T, S>(
node_id: &NodeId,
browse_name: T,
display_name: S,
) -> ReferenceTypeBuilder
pub fn new<T, S>( node_id: &NodeId, browse_name: T, display_name: S, ) -> ReferenceTypeBuilder
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) -> ReferenceTypeBuilderwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> ReferenceTypeBuilderwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> ReferenceTypeBuilder
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> ReferenceTypeBuilder
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> ReferenceTypeBuilder
pub fn organizes<T>(self, organizes_id: T) -> ReferenceTypeBuilder
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> ReferenceTypeBuilder
pub fn organized_by<T>(self, organized_by_id: T) -> ReferenceTypeBuilder
Indicates this node is organised by another node by its id
Sourcepub fn build(self) -> ReferenceType
pub fn build(self) -> ReferenceType
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 ReferenceTypeBuilder
impl ReferenceTypeBuilder
Sourcepub fn subtype_of<T>(self, type_id: T) -> ReferenceTypeBuilder
pub fn subtype_of<T>(self, type_id: T) -> ReferenceTypeBuilder
Add an inverse HasSubtype reference to the given
type.
Sourcepub fn has_subtype<T>(self, subtype_id: T) -> ReferenceTypeBuilder
pub fn has_subtype<T>(self, subtype_id: T) -> ReferenceTypeBuilder
Add a HasSubtype reference to the given type.
Source§impl ReferenceTypeBuilder
impl ReferenceTypeBuilder
Sourcepub fn is_abstract(self, is_abstract: bool) -> ReferenceTypeBuilder
pub fn is_abstract(self, is_abstract: bool) -> ReferenceTypeBuilder
Set the IsAbstract attribute of this reference type,
indicating whether references in the instance hierarchy
are allowed to use this reference type.
Sourcepub fn write_mask(self, write_mask: WriteMask) -> ReferenceTypeBuilder
pub fn write_mask(self, write_mask: WriteMask) -> ReferenceTypeBuilder
Set the write mask of this type.
Sourcepub fn symmetric(self, symmetric: bool) -> ReferenceTypeBuilder
pub fn symmetric(self, symmetric: bool) -> ReferenceTypeBuilder
Set whether references of this type are symmetric, meaning they have the same name in both directions.
Sourcepub fn inverse_name(
self,
inverse_name: impl Into<LocalizedText>,
) -> ReferenceTypeBuilder
pub fn inverse_name( self, inverse_name: impl Into<LocalizedText>, ) -> ReferenceTypeBuilder
Set the inverse name of this reference type.