pub struct ObjectTypeBuilder { /* 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 ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn new<T, S>(
node_id: &NodeId,
browse_name: T,
display_name: S,
) -> ObjectTypeBuilder
pub fn new<T, S>( node_id: &NodeId, browse_name: T, display_name: S, ) -> ObjectTypeBuilder
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) -> ObjectTypeBuilderwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> ObjectTypeBuilderwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> ObjectTypeBuilder
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> ObjectTypeBuilder
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> ObjectTypeBuilder
pub fn organizes<T>(self, organizes_id: T) -> ObjectTypeBuilder
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> ObjectTypeBuilder
pub fn organized_by<T>(self, organized_by_id: T) -> ObjectTypeBuilder
Indicates this node is organised by another node by its id
Sourcepub fn build(self) -> ObjectType
pub fn build(self) -> ObjectType
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 ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn generates_event<T>(self, event_type: T) -> ObjectTypeBuilder
pub fn generates_event<T>(self, event_type: T) -> ObjectTypeBuilder
Add a GeneratesEvent reference to the given event type.
Source§impl ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn subtype_of<T>(self, type_id: T) -> ObjectTypeBuilder
pub fn subtype_of<T>(self, type_id: T) -> ObjectTypeBuilder
Add an inverse HasSubtype reference to the given
type.
Sourcepub fn has_subtype<T>(self, subtype_id: T) -> ObjectTypeBuilder
pub fn has_subtype<T>(self, subtype_id: T) -> ObjectTypeBuilder
Add a HasSubtype reference to the given type.
Source§impl ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn component_of<T>(self, component_of_id: T) -> ObjectTypeBuilder
pub fn component_of<T>(self, component_of_id: T) -> ObjectTypeBuilder
Add an inverse HasComponent reference to the
given node.
Sourcepub fn has_component<T>(self, has_component_id: T) -> ObjectTypeBuilder
pub fn has_component<T>(self, has_component_id: T) -> ObjectTypeBuilder
Add a HasComponent reference to the
given node.
Source§impl ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn has_property<T>(self, has_component_id: T) -> ObjectTypeBuilder
pub fn has_property<T>(self, has_component_id: T) -> ObjectTypeBuilder
Add a HasProperty reference to the given node.
Sourcepub fn property_of<T>(self, component_of_id: T) -> ObjectTypeBuilder
pub fn property_of<T>(self, component_of_id: T) -> ObjectTypeBuilder
Add an inverse HasProperty reference to the given node.
Source§impl ObjectTypeBuilder
impl ObjectTypeBuilder
Sourcepub fn is_abstract(self, is_abstract: bool) -> ObjectTypeBuilder
pub fn is_abstract(self, is_abstract: bool) -> ObjectTypeBuilder
Set whether the object type is abstract, meaning it cannot be used by types in the instance hierarchy.
Sourcepub fn write_mask(self, write_mask: WriteMask) -> ObjectTypeBuilder
pub fn write_mask(self, write_mask: WriteMask) -> ObjectTypeBuilder
Set the object type write mask.