pub struct ObjectBuilder { /* 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 ObjectBuilder
impl ObjectBuilder
Sourcepub fn new<T, S>(
node_id: &NodeId,
browse_name: T,
display_name: S,
) -> ObjectBuilder
pub fn new<T, S>( node_id: &NodeId, browse_name: T, display_name: S, ) -> ObjectBuilder
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) -> ObjectBuilderwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> ObjectBuilderwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> ObjectBuilder
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> ObjectBuilder
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> ObjectBuilder
pub fn organizes<T>(self, organizes_id: T) -> ObjectBuilder
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> ObjectBuilder
pub fn organized_by<T>(self, organized_by_id: T) -> ObjectBuilder
Indicates this node is organised by another node by its id
Sourcepub fn build(self) -> Object
pub fn build(self) -> Object
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 ObjectBuilder
impl ObjectBuilder
Sourcepub fn component_of<T>(self, component_of_id: T) -> ObjectBuilder
pub fn component_of<T>(self, component_of_id: T) -> ObjectBuilder
Add an inverse HasComponent reference to the
given node.
Sourcepub fn has_component<T>(self, has_component_id: T) -> ObjectBuilder
pub fn has_component<T>(self, has_component_id: T) -> ObjectBuilder
Add a HasComponent reference to the
given node.
Source§impl ObjectBuilder
impl ObjectBuilder
Sourcepub fn has_property<T>(self, has_component_id: T) -> ObjectBuilder
pub fn has_property<T>(self, has_component_id: T) -> ObjectBuilder
Add a HasProperty reference to the given node.
Sourcepub fn property_of<T>(self, component_of_id: T) -> ObjectBuilder
pub fn property_of<T>(self, component_of_id: T) -> ObjectBuilder
Add an inverse HasProperty reference to the given node.
Source§impl ObjectBuilder
impl ObjectBuilder
Sourcepub fn is_folder(self) -> ObjectBuilder
pub fn is_folder(self) -> ObjectBuilder
Get whether this is building an object with FolderType as the
type definition.
Sourcepub fn event_notifier(self, event_notifier: EventNotifier) -> ObjectBuilder
pub fn event_notifier(self, event_notifier: EventNotifier) -> ObjectBuilder
Set the event notifier of the object.
Sourcepub fn write_mask(self, write_mask: WriteMask) -> ObjectBuilder
pub fn write_mask(self, write_mask: WriteMask) -> ObjectBuilder
Set the write mask of the object.
Sourcepub fn has_type_definition(self, type_id: impl Into<NodeId>) -> ObjectBuilder
pub fn has_type_definition(self, type_id: impl Into<NodeId>) -> ObjectBuilder
Add a HasTypeDefinition reference to the given object type.
Sourcepub fn has_event_source(self, source_id: impl Into<NodeId>) -> ObjectBuilder
pub fn has_event_source(self, source_id: impl Into<NodeId>) -> ObjectBuilder
Add a HasEventSource reference to the given node.